lkd-web-kit 0.8.4 → 0.9.0

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 (193) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +30 -30
  3. package/dist/components/EmptyState/index.cjs +1 -1
  4. package/dist/components/EmptyState/index.d.ts +16 -0
  5. package/dist/components/EmptyState/index.d.ts.map +1 -0
  6. package/dist/components/EmptyState/index.js +1 -1
  7. package/dist/components/Icon.d.ts +43 -0
  8. package/dist/components/Icon.d.ts.map +1 -0
  9. package/dist/components/InfinityLoadMoreButton/index.cjs +1 -1
  10. package/dist/components/InfinityLoadMoreButton/index.d.ts +17 -0
  11. package/dist/components/InfinityLoadMoreButton/index.d.ts.map +1 -0
  12. package/dist/components/InfinityLoadMoreButton/index.js +1 -1
  13. package/dist/components/InfinitySelect/index.cjs +1 -1
  14. package/dist/components/InfinitySelect/index.d.ts +35 -0
  15. package/dist/components/InfinitySelect/index.d.ts.map +1 -0
  16. package/dist/components/InfinitySelect/index.js +1 -1
  17. package/dist/components/MyCheckboxGroup/index.cjs +1 -1
  18. package/dist/components/MyCheckboxGroup/index.d.ts +9 -0
  19. package/dist/components/MyCheckboxGroup/index.d.ts.map +1 -0
  20. package/dist/components/MyCheckboxGroup/index.js +1 -1
  21. package/dist/components/MyDateInput/index.d.ts +6 -0
  22. package/dist/components/MyDateInput/index.d.ts.map +1 -0
  23. package/dist/components/MyDatePickerInput/CalendarIcon.d.ts +7 -0
  24. package/dist/components/MyDatePickerInput/CalendarIcon.d.ts.map +1 -0
  25. package/dist/components/MyDatePickerInput/index.d.ts +6 -0
  26. package/dist/components/MyDatePickerInput/index.d.ts.map +1 -0
  27. package/dist/components/MyDateTimePicker/index.d.ts +6 -0
  28. package/dist/components/MyDateTimePicker/index.d.ts.map +1 -0
  29. package/dist/components/MyMonthPickerInput/index.d.ts +6 -0
  30. package/dist/components/MyMonthPickerInput/index.d.ts.map +1 -0
  31. package/dist/components/MyMultiSelect/index.cjs +1 -1
  32. package/dist/components/MyMultiSelect/index.d.ts +6 -0
  33. package/dist/components/MyMultiSelect/index.d.ts.map +1 -0
  34. package/dist/components/MyMultiSelect/index.js +1 -1
  35. package/dist/components/MyNotifications/index.d.ts +5 -0
  36. package/dist/components/MyNotifications/index.d.ts.map +1 -0
  37. package/dist/components/MyNumberInput/index.cjs +1 -1
  38. package/dist/components/MyNumberInput/index.d.ts +6 -0
  39. package/dist/components/MyNumberInput/index.d.ts.map +1 -0
  40. package/dist/components/MyNumberInput/index.js +1 -1
  41. package/dist/components/MyRadioGroup/index.cjs +1 -1
  42. package/dist/components/MyRadioGroup/index.d.ts +9 -0
  43. package/dist/components/MyRadioGroup/index.d.ts.map +1 -0
  44. package/dist/components/MyRadioGroup/index.js +1 -1
  45. package/dist/components/MySelect/index.cjs +1 -1
  46. package/dist/components/MySelect/index.d.ts +6 -0
  47. package/dist/components/MySelect/index.d.ts.map +1 -0
  48. package/dist/components/MySelect/index.js +1 -1
  49. package/dist/components/MyTextInput/index.cjs +1 -1
  50. package/dist/components/MyTextInput/index.d.ts +6 -0
  51. package/dist/components/MyTextInput/index.d.ts.map +1 -0
  52. package/dist/components/MyTextInput/index.js +1 -1
  53. package/dist/components/MyTextarea/index.cjs +1 -1
  54. package/dist/components/MyTextarea/index.d.ts +6 -0
  55. package/dist/components/MyTextarea/index.d.ts.map +1 -0
  56. package/dist/components/MyTextarea/index.js +1 -1
  57. package/dist/components/MyTimeInput/index.cjs +1 -1
  58. package/dist/components/MyTimeInput/index.d.ts +6 -0
  59. package/dist/components/MyTimeInput/index.d.ts.map +1 -0
  60. package/dist/components/MyTimeInput/index.js +1 -1
  61. package/dist/components/NavItems.cjs +1 -1
  62. package/dist/components/NavItems.d.ts +17 -0
  63. package/dist/components/NavItems.d.ts.map +1 -0
  64. package/dist/components/NavItems.js +1 -1
  65. package/dist/components/index.d.ts +19 -0
  66. package/dist/components/index.d.ts.map +1 -0
  67. package/dist/consts/http-status.d.ts +64 -0
  68. package/dist/consts/http-status.d.ts.map +1 -0
  69. package/dist/consts/index.d.ts +3 -0
  70. package/dist/consts/index.d.ts.map +1 -0
  71. package/dist/consts/revalidate.d.ts +8 -0
  72. package/dist/consts/revalidate.d.ts.map +1 -0
  73. package/dist/contexts/NavigationHistoryContext/hook.d.ts +11 -0
  74. package/dist/contexts/NavigationHistoryContext/hook.d.ts.map +1 -0
  75. package/dist/contexts/NavigationHistoryContext/index.d.ts +11 -0
  76. package/dist/contexts/NavigationHistoryContext/index.d.ts.map +1 -0
  77. package/dist/contexts/PageDataContext/index.d.ts +8 -0
  78. package/dist/contexts/PageDataContext/index.d.ts.map +1 -0
  79. package/dist/contexts/index.d.ts +4 -0
  80. package/dist/contexts/index.d.ts.map +1 -0
  81. package/dist/form/Form.cjs +1 -1
  82. package/dist/form/Form.d.ts +10 -0
  83. package/dist/form/Form.d.ts.map +1 -0
  84. package/dist/form/Form.js +1 -1
  85. package/dist/form/FormSubmitButton.cjs +1 -1
  86. package/dist/form/FormSubmitButton.d.ts +6 -0
  87. package/dist/form/FormSubmitButton.d.ts.map +1 -0
  88. package/dist/form/FormSubmitButton.js +1 -1
  89. package/dist/form/base/FormCheckbox.cjs +1 -1
  90. package/dist/form/base/FormCheckbox.d.ts +8 -0
  91. package/dist/form/base/FormCheckbox.d.ts.map +1 -0
  92. package/dist/form/base/FormCheckbox.js +1 -1
  93. package/dist/form/base/FormCheckboxGroup.d.ts +8 -0
  94. package/dist/form/base/FormCheckboxGroup.d.ts.map +1 -0
  95. package/dist/form/base/FormDateInput.d.ts +9 -0
  96. package/dist/form/base/FormDateInput.d.ts.map +1 -0
  97. package/dist/form/base/FormDatePickerInput.d.ts +9 -0
  98. package/dist/form/base/FormDatePickerInput.d.ts.map +1 -0
  99. package/dist/form/base/FormDateTimePicker.d.ts +9 -0
  100. package/dist/form/base/FormDateTimePicker.d.ts.map +1 -0
  101. package/dist/form/base/FormMonthPickerInput.d.ts +9 -0
  102. package/dist/form/base/FormMonthPickerInput.d.ts.map +1 -0
  103. package/dist/form/base/FormMultiSelect.d.ts +8 -0
  104. package/dist/form/base/FormMultiSelect.d.ts.map +1 -0
  105. package/dist/form/base/FormNumberInput.d.ts +6 -0
  106. package/dist/form/base/FormNumberInput.d.ts.map +1 -0
  107. package/dist/form/base/FormRadioGroup.d.ts +8 -0
  108. package/dist/form/base/FormRadioGroup.d.ts.map +1 -0
  109. package/dist/form/base/FormSelect.d.ts +9 -0
  110. package/dist/form/base/FormSelect.d.ts.map +1 -0
  111. package/dist/form/base/FormSelectInfinity.d.ts +6 -0
  112. package/dist/form/base/FormSelectInfinity.d.ts.map +1 -0
  113. package/dist/form/base/FormTextInput.d.ts +8 -0
  114. package/dist/form/base/FormTextInput.d.ts.map +1 -0
  115. package/dist/form/base/FormTextarea.d.ts +9 -0
  116. package/dist/form/base/FormTextarea.d.ts.map +1 -0
  117. package/dist/form/base/FormTimeInput.d.ts +11 -0
  118. package/dist/form/base/FormTimeInput.d.ts.map +1 -0
  119. package/dist/form/index.d.ts +21 -0
  120. package/dist/form/index.d.ts.map +1 -0
  121. package/dist/form/utils/nullable-but-required.d.ts +3 -0
  122. package/dist/form/utils/nullable-but-required.d.ts.map +1 -0
  123. package/dist/form/utils/optional-but-required.d.ts +3 -0
  124. package/dist/form/utils/optional-but-required.d.ts.map +1 -0
  125. package/dist/form/utils/zodValidator.d.ts +3 -0
  126. package/dist/form/utils/zodValidator.d.ts.map +1 -0
  127. package/dist/hocs/index.d.ts +3 -0
  128. package/dist/hocs/index.d.ts.map +1 -0
  129. package/dist/hocs/withController.d.ts +26 -0
  130. package/dist/hocs/withController.d.ts.map +1 -0
  131. package/dist/hocs/withModalManager.d.ts +11 -0
  132. package/dist/hocs/withModalManager.d.ts.map +1 -0
  133. package/dist/hooks/index.d.ts +6 -0
  134. package/dist/hooks/index.d.ts.map +1 -0
  135. package/dist/hooks/useBreakpoint.d.ts +3 -0
  136. package/dist/hooks/useBreakpoint.d.ts.map +1 -0
  137. package/dist/hooks/useFetchNextPageOnScroll.d.ts +12 -0
  138. package/dist/hooks/useFetchNextPageOnScroll.d.ts.map +1 -0
  139. package/dist/hooks/useOnScrollProgress.d.ts +9 -0
  140. package/dist/hooks/useOnScrollProgress.d.ts.map +1 -0
  141. package/dist/hooks/useUpdateSearchParams.d.ts +6 -0
  142. package/dist/hooks/useUpdateSearchParams.d.ts.map +1 -0
  143. package/dist/hooks/useZodConfig.d.ts +2 -0
  144. package/dist/hooks/useZodConfig.d.ts.map +1 -0
  145. package/dist/index.cjs +33 -33
  146. package/dist/index.d.ts +10 -646
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +12 -12
  149. package/dist/mantine/breakpoints-with-px.d.ts +9 -0
  150. package/dist/mantine/breakpoints-with-px.d.ts.map +1 -0
  151. package/dist/mantine/index.d.ts +4 -0
  152. package/dist/mantine/index.d.ts.map +1 -0
  153. package/dist/mantine/my-default-theme.d.ts +3 -0
  154. package/dist/mantine/my-default-theme.d.ts.map +1 -0
  155. package/dist/mantine/to-tailwind-colors.d.ts +3 -0
  156. package/dist/mantine/to-tailwind-colors.d.ts.map +1 -0
  157. package/dist/test/setup.d.ts +1 -0
  158. package/dist/test/setup.d.ts.map +1 -0
  159. package/dist/types/api-list.d.ts +4 -0
  160. package/dist/types/api-list.d.ts.map +1 -0
  161. package/dist/types/api-pagination.d.ts +4 -0
  162. package/dist/types/api-pagination.d.ts.map +1 -0
  163. package/dist/types/index.d.ts +6 -0
  164. package/dist/types/index.d.ts.map +1 -0
  165. package/dist/types/page-props.d.ts +14 -0
  166. package/dist/types/page-props.d.ts.map +1 -0
  167. package/dist/types/setter.d.ts +3 -0
  168. package/dist/types/setter.d.ts.map +1 -0
  169. package/dist/types/utils/deep-partial.d.ts +4 -0
  170. package/dist/types/utils/deep-partial.d.ts.map +1 -0
  171. package/dist/utils/array/groupBy.d.ts +6 -0
  172. package/dist/utils/array/groupBy.d.ts.map +1 -0
  173. package/dist/utils/array/shuffleArray.d.ts +2 -0
  174. package/dist/utils/array/shuffleArray.d.ts.map +1 -0
  175. package/dist/utils/formatBytes.d.ts +2 -0
  176. package/dist/utils/formatBytes.d.ts.map +1 -0
  177. package/dist/utils/get-path-value.d.ts +2 -0
  178. package/dist/utils/get-path-value.d.ts.map +1 -0
  179. package/dist/utils/index.d.ts +10 -0
  180. package/dist/utils/index.d.ts.map +1 -0
  181. package/dist/utils/isInfinityEmpty.d.ts +5 -0
  182. package/dist/utils/isInfinityEmpty.d.ts.map +1 -0
  183. package/dist/utils/ky/addBodyJsonHook.d.ts +8 -0
  184. package/dist/utils/ky/addBodyJsonHook.d.ts.map +1 -0
  185. package/dist/utils/ky/parseJson.d.ts +3 -0
  186. package/dist/utils/ky/parseJson.d.ts.map +1 -0
  187. package/dist/utils/new-route.d.ts +28 -0
  188. package/dist/utils/new-route.d.ts.map +1 -0
  189. package/dist/utils/query-stringify.d.ts +2 -0
  190. package/dist/utils/query-stringify.d.ts.map +1 -0
  191. package/dist/utils/virtual-styles.d.ts +14 -0
  192. package/dist/utils/virtual-styles.d.ts.map +1 -0
  193. package/package.json +17 -13
package/dist/index.d.ts CHANGED
@@ -1,646 +1,10 @@
1
- import { BeforeErrorHook } from 'ky';
2
- import { BoxProps } from '@mantine/core';
3
- import { ButtonProps } from '@mantine/core';
4
- import { ChangeEventHandler } from 'react';
5
- import { CheckboxGroupProps } from '@mantine/core';
6
- import { CheckboxProps } from '@mantine/core';
7
- import { ComboboxItem } from '@mantine/core';
8
- import { ComboboxProps } from '@mantine/core';
9
- import { ComboboxStore } from '@mantine/core';
10
- import { ComponentProps } from 'react';
11
- import { ComponentPropsWithoutRef } from 'react';
12
- import { ControllerProps } from 'react-hook-form';
13
- import { DateInputProps } from '@mantine/dates';
14
- import { DatePickerInputProps } from '@mantine/dates';
15
- import { DatesRangeValue } from '@mantine/dates';
16
- import { DateStringValue } from '@mantine/dates';
17
- import { DateTimePickerProps } from '@mantine/dates';
18
- import { default as default_2 } from 'react';
19
- import { DefaultMantineColor } from '@mantine/core';
20
- import { Dispatch } from 'react';
21
- import { ElementProps } from '@mantine/core';
22
- import { FC } from 'react';
23
- import { FieldValues } from 'react-hook-form';
24
- import { HTTPError } from 'ky';
25
- import { InfiniteData } from '@tanstack/react-query';
26
- import { InfiniteQueryHookResult } from 'react-query-kit';
27
- import { InputBaseProps } from '@mantine/core';
28
- import { JSX } from 'react/jsx-runtime';
29
- import { KyResponse } from 'ky';
30
- import { MantineColorShade } from '@mantine/core';
31
- import { MantineSpacing } from '@mantine/core';
32
- import { MantineThemeColors } from '@mantine/core';
33
- import { MantineThemeOverride } from '@mantine/core';
34
- import { ModalProps } from '@mantine/core';
35
- import { MonthPickerInputProps } from '@mantine/dates';
36
- import { MouseEvent as MouseEvent_2 } from 'react';
37
- import { MultiSelectProps } from '@mantine/core';
38
- import { NotificationsProps } from '@mantine/notifications';
39
- import { NumberInputProps } from '@mantine/core';
40
- import { RadioGroupProps } from '@mantine/core';
41
- import { RadioProps } from '@mantine/core';
42
- import { ReactNode } from 'react';
43
- import { ReadonlyURLSearchParams } from 'next/navigation';
44
- import { RefObject } from 'react';
45
- import { SelectProps } from '@mantine/core';
46
- import { SetStateAction } from 'react';
47
- import { SubmitErrorHandler } from 'react-hook-form';
48
- import { SubmitHandler } from 'react-hook-form';
49
- import { TextareaProps } from '@mantine/core';
50
- import { TextInputProps } from '@mantine/core';
51
- import { TimeInputProps } from '@mantine/dates';
52
- import { UseFormReturn } from 'react-hook-form';
53
- import { VirtualItem } from '@tanstack/react-virtual';
54
- import { z } from 'zod';
55
- import { ZodType } from 'zod';
56
-
57
- export declare const addBodyJsonHook: BeforeErrorHook;
58
-
59
- export declare interface ApiList<T = unknown> {
60
- data: T[];
61
- }
62
-
63
- export declare interface ApiPagination<T> {
64
- data: T[];
65
- }
66
-
67
- export declare const breakpointsWithPx: {
68
- xs: string;
69
- sm: string;
70
- md: string;
71
- lg: string;
72
- xl: string;
73
- "2xl": string;
74
- };
75
-
76
- export declare function createNewRoute<GlobalQuery extends object = {}>(config?: {
77
- queryBuilder?: (query: GlobalQuery) => string;
78
- }): {
79
- <LocalQuery extends object = {}, Path extends string = string>(path: Path, options?: RouteOptions<LocalQuery, ExtractPathParams<Path>>): (params?: RouteInput<ExtractPathParams<Path>, GlobalQuery & LocalQuery>) => string;
80
- <LocalQuery extends object = {}, PathParams extends Params = {}>(path: string, options?: RouteOptions<LocalQuery, PathParams>): (params?: RouteInput<PathParams, GlobalQuery & LocalQuery>) => string;
81
- <LocalQuery extends object = {}, PathParams extends Params = {}>(pathBuilder: (params: PathParams) => string, options?: RouteOptions<LocalQuery, PathParams>): (params?: RouteInput<PathParams, GlobalQuery & LocalQuery>) => string;
82
- };
83
-
84
- export declare type DeepPartial<T> = {
85
- [P in keyof T]?: DeepPartial<T[P]>;
86
- };
87
-
88
- export declare interface EmptyProps extends ComponentProps<'div'> {
89
- label: ReactNode;
90
- action?: ReactNode;
91
- icon?: IconFC;
92
- size?: keyof typeof pxBySize;
93
- }
94
-
95
- export declare const EmptyState: ({ label, action, icon, size, ...props }: EmptyProps) => JSX.Element;
96
-
97
- declare type ExtractPathParams<T extends string> = T extends `${string}:${infer Param}/${infer Rest}` ? {
98
- [K in Param | keyof ExtractPathParams<`/${Rest}`>]: string | number;
99
- } : T extends `${string}:${infer Param}` ? {
100
- [K in Param]: string | number;
101
- } : {};
102
-
103
- export declare type FetchNextPageOnScrollOptions = {
104
- infinity: InfiniteQueryHookResult<InfiniteData<{
105
- data: unknown[];
106
- }, number>, Error>;
107
- scrollRef?: RefObject<HTMLElement | null>;
108
- disabled?: boolean;
109
- };
110
-
111
- export declare const Form: <T extends FieldValues, TContext = any, TT extends T = T>({ methods, onSubmit, onSubmitError, ...rest }: FormProps<T, TContext, TT>) => JSX.Element;
112
-
113
- export declare function formatBytes(bytes: number, decimals?: number): string;
114
-
115
- export declare const FormCheckbox: FC<CheckboxProps & WithControllerProps & {
116
- onValueChange?: ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined;
117
- }>;
118
-
119
- export declare const FormCheckboxGroup: FC<MyCheckboxGroupProps & WithControllerProps & {
120
- onValueChange?: ((value: string[]) => void) | undefined;
121
- }>;
122
-
123
- export declare type FormCheckboxGroupProps = MyCheckboxGroupProps & WithControllerProps;
124
-
125
- export declare type FormCheckboxProps = CheckboxProps & WithControllerProps;
126
-
127
- export declare const FormDateInput: FC<WithControllerProps & MyDateInputProps & {
128
- onValueChange?: ((value: DateStringValue | null) => void) | undefined;
129
- }>;
130
-
131
- export declare type FormDateInputProps = WithControllerProps & MyDateInputProps;
132
-
133
- export declare const FormDatePickerInput: FC<WithControllerProps & MyDatePickerInputProps & {
134
- onValueChange?: ((value: string | string[] | DatesRangeValue<string> | null) => void) | undefined;
135
- }>;
136
-
137
- export declare type FormDatePickerInputProps = WithControllerProps & MyDatePickerInputProps;
138
-
139
- export declare const FormDateTimePicker: FC<DateTimePickerProps & WithControllerProps & {
140
- onValueChange?: ((value: DateStringValue | null) => void) | undefined;
141
- }>;
142
-
143
- export declare type FormDateTimePickerProps = WithControllerProps & MyDateTimePickerProps;
144
-
145
- export declare type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {
146
- props: T;
147
- field: {
148
- label?: ReactNode;
149
- placeholder?: string;
150
- description?: React.ReactNode;
151
- error?: string;
152
- };
153
- };
154
-
155
- export declare const FormInfinitySelect: <T>(props: FormInfinitySelectProps<T>) => ReactNode;
156
-
157
- export declare type FormInfinitySelectProps<T = unknown> = InfinitySelectProps<T> & WithControllerProps;
158
-
159
- export declare const FormMonthPickerInput: FC<MyMonthPickerInputProps & WithControllerProps & {
160
- onValueChange?: ((value: string | string[] | DatesRangeValue<string> | null) => void) | undefined;
161
- }>;
162
-
163
- export declare type FormMonthPickerInputProps = WithControllerProps & MyMonthPickerInputProps;
164
-
165
- export declare const FormMultiSelect: FC<MyMultiSelectProps & WithControllerProps & {
166
- onValueChange?: ((value: string[]) => void) | undefined;
167
- }>;
168
-
169
- export declare type FormMultiSelectProps = MyMultiSelectProps & WithControllerProps;
170
-
171
- export declare const FormNumberInput: default_2.FC<FormNumberInputProps>;
172
-
173
- export declare type FormNumberInputProps = MyNumberInputProps & WithControllerProps;
174
-
175
- declare interface FormProps<T extends FieldValues, TContext = any, TT extends T = T> extends BoxProps, ElementProps<'form', 'onSubmit'> {
176
- methods: UseFormReturn<T, TContext, TT>;
177
- onSubmit?: SubmitHandler<TT>;
178
- onSubmitError?: SubmitErrorHandler<T>;
179
- }
180
-
181
- export declare const FormRadioGroup: FC<MyRadioGroupProps & WithControllerProps & {
182
- onValueChange?: ((value: string) => void) | undefined;
183
- }>;
184
-
185
- export declare type FormRadioGroupProps = MyRadioGroupProps & WithControllerProps;
186
-
187
- export declare const FormSelect: FC<MySelectProps & WithControllerProps & {
188
- onValueChange?: ((value: string | null, option: ComboboxItem<string>) => void) | undefined;
189
- }>;
190
-
191
- export declare type FormSelectProps = MySelectProps & WithControllerProps;
192
-
193
- export declare const FormSubmitButton: ({ disabled, disabledWhenSuccess, ...props }: FormSubmitButtonProps) => JSX.Element;
194
-
195
- export declare interface FormSubmitButtonProps extends ButtonProps, ElementProps<'button', keyof ButtonProps> {
196
- disabledWhenSuccess?: boolean;
197
- }
198
-
199
- export declare const FormTextarea: FC<TextareaProps & WithControllerProps & {
200
- onValueChange?: ChangeEventHandler<HTMLTextAreaElement, HTMLTextAreaElement> | undefined;
201
- }>;
202
-
203
- export declare type FormTextareaProps = MyTextareaProps & WithControllerProps;
204
-
205
- export declare const FormTextInput: FC<WithControllerProps & MyTextInputProps & {
206
- onValueChange?: ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined;
207
- }>;
208
-
209
- export declare type FormTextInputProps = WithControllerProps & MyTextInputProps;
210
-
211
- export declare type FormTimeInput = MyTimeInputProps & WithControllerProps;
212
-
213
- export declare const FormTimeInput: FC<TimeInputProps & WithControllerProps & {
214
- onValueChange?: ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined;
215
- }>;
216
-
217
- export declare const getVirtualContainerProps: (virtualizer: {
218
- getTotalSize: () => number;
219
- }) => ComponentProps<"div">;
220
-
221
- export declare const getVirtualItemProps: (item: VirtualItem, virtualizer: {
222
- options: {
223
- scrollMargin: number;
224
- };
225
- measureElement: (element: Element | null) => void;
226
- }) => ComponentProps<"div"> & {
227
- ["data-index"]: number;
228
- };
229
-
230
- export declare const groupBy: <T extends any>(arr: T[], getKey: (item: T) => string | string[] | null) => Record<string, T[] | undefined>;
231
-
232
- export declare type GroupByResult<T> = Record<string, T[] | undefined>;
233
-
234
- export declare enum HttpStatus {
235
- Continue = 100,
236
- SwitchingProtocols = 101,
237
- Processing = 102,
238
- EarlyHints = 103,
239
- Ok = 200,
240
- Created = 201,
241
- Accepted = 202,
242
- NonAuthoritativeInformation = 203,
243
- NoContent = 204,
244
- ResetContent = 205,
245
- PartialContent = 206,
246
- MultiStatus = 207,
247
- AlreadyReported = 208,
248
- ImUsed = 226,
249
- MultipleChoices = 300,
250
- MovedPermanently = 301,
251
- Found = 302,
252
- SeeOther = 303,
253
- NotModified = 304,
254
- UseProxy = 305,
255
- TemporaryRedirect = 307,
256
- PermanentRedirect = 308,
257
- BadRequest = 400,
258
- Unauthorized = 401,
259
- PaymentRequired = 402,
260
- Forbidden = 403,
261
- NotFound = 404,
262
- MethodNotAllowed = 405,
263
- NotAcceptable = 406,
264
- ProxyAuthenticationRequired = 407,
265
- RequestTimeout = 408,
266
- Conflict = 409,
267
- Gone = 410,
268
- LengthRequired = 411,
269
- PreconditionFailed = 412,
270
- PayloadTooLarge = 413,
271
- UriTooLong = 414,
272
- UnsupportedMediaType = 415,
273
- RangeNotSatisfiable = 416,
274
- ExpectationFailed = 417,
275
- MisdirectedRequest = 421,
276
- UnprocessableEntity = 422,
277
- Locked = 423,
278
- FailedDependency = 424,
279
- TooEarly = 425,
280
- UpgradeRequired = 426,
281
- PreconditionRequired = 428,
282
- TooManyRequests = 429,
283
- RequestHeaderFieldsTooLarge = 431,
284
- UnavailableForLegalReasons = 451,
285
- InternalServerError = 500,
286
- NotImplemented = 501,
287
- BadGateway = 502,
288
- ServiceUnavailable = 503,
289
- GatewayTimeout = 504,
290
- HttpVersionNotSupported = 505,
291
- VariantAlsoNegotiates = 506,
292
- InsufficientStorage = 507,
293
- LoopDetected = 508,
294
- NotExtended = 510,
295
- NetworkAuthenticationRequired = 511
296
- }
297
-
298
- export declare const Icon: ({ i: I, size, style, rotate, ...rest }: IconProps) => JSX.Element;
299
-
300
- export declare type IconFC = default_2.FC<ComponentPropsWithoutRef<'svg'>>;
301
-
302
- export declare interface IconProps extends ComponentPropsWithoutRef<'svg'> {
303
- i: IconFC;
304
- /**
305
- * @property xs: 16px
306
- * @property sm: 20px
307
- * @property md: 24px
308
- * @property lg: 28px
309
- * @property xl: 32px
310
- * @property 2xl: 40px
311
- */
312
- size?: keyof typeof stylesBySize | number;
313
- }
314
-
315
- export declare function indexBy<T, K, C extends string>(arr: T[], getKey: (item: T) => C | undefined): Record<C, T | undefined>;
316
-
317
- export declare function indexBy<T, K, C extends string>(arr: T[], getKey: (item: T) => C | undefined, getValue: (item: T) => K): Record<C, K | undefined>;
318
-
319
- export declare type IndexByResult<T> = Record<string, T | undefined>;
320
-
321
- export declare const InfinityLoadMoreButton: <T>({ infinity, labels, parentRef, loader, ...props }: InfinityLoadMoreButtonProps<T>) => JSX.Element;
322
-
323
- export declare interface InfinityLoadMoreButtonProps<T> extends ButtonProps {
324
- infinity: InfiniteQueryHookResult<InfiniteData<{
325
- data?: T[];
326
- }, number>, Error>;
327
- parentRef?: RefObject<HTMLElement | null>;
328
- loader?: React.ReactNode;
329
- labels?: {
330
- loadMore?: string;
331
- end?: string;
332
- };
333
- }
334
-
335
- export declare function InfinitySelect<T = unknown>({ value, searchValue, defaultSearchValue, nothingFoundMessage, infinity, defaultValue, onChange, onSearchChange, renderOption, onOptionSubmit, getOptionLabel, getOptionValue, onSelectedOptionChange, selectedOption, comboboxProps, searchable, defaultSelectedOption, loadMoreButtonProps, ...props }: InfinitySelectProps<T>): JSX.Element;
336
-
337
- export declare interface InfinitySelectProps<T = unknown> extends InputBaseProps, ElementProps<'input', keyof InputBaseProps | 'value' | 'onChange'> {
338
- value?: string | null;
339
- defaultValue?: string;
340
- searchValue?: string;
341
- defaultSearchValue?: string;
342
- nothingFoundMessage?: ReactNode | ((data: {
343
- combobox: ComboboxStore;
344
- }) => ReactNode);
345
- infinity: InfiniteQueryHookResult<InfiniteData<{
346
- data?: T[];
347
- }, number>, Error>;
348
- defaultSelectedOption?: T | null;
349
- selectedOption?: T | null;
350
- onSelectedOptionChange?: (option: T | null) => void;
351
- onSearchChange?: (value: string) => void;
352
- onChange?: (value: string | null) => void;
353
- renderOption?: (args: {
354
- option: T;
355
- }) => React.ReactNode;
356
- onOptionSubmit?: (value: string, option: T) => void;
357
- getOptionLabel: (option: T) => string;
358
- getOptionValue: (option: T) => string;
359
- resetPageParam?: () => Promise<void>;
360
- comboboxProps?: ComboboxProps;
361
- searchable?: boolean;
362
- ref?: React.Ref<HTMLInputElement>;
363
- loadMoreButtonProps?: Partial<InfinityLoadMoreButtonProps<T>>;
364
- }
365
-
366
- export declare const isInfinityEmpty: (data: InfiniteData<{
367
- data: unknown[];
368
- }> | undefined) => boolean;
369
-
370
- export declare type KyError<T> = HTTPError<T> & {
371
- response: {
372
- bodyJson?: T;
373
- };
374
- };
375
-
376
- export declare interface LayoutProps {
377
- children: React.ReactNode;
378
- params: Promise<PageParams>;
379
- }
380
-
381
- export declare type ModalManagerWrappedComponentProps<T extends object = object> = T & {
382
- modalProps: ModalProps;
383
- };
384
-
385
- export declare type ModalManagerWrapperProps<T extends object = object> = T & {
386
- modalProps: Partial<ModalProps>;
387
- removeModal: () => void;
388
- };
389
-
390
- export declare const MyCheckboxGroup: ({ options, orientation, gap, ...checkboxGroupProps }: MyCheckboxGroupProps) => JSX.Element;
391
-
392
- export declare interface MyCheckboxGroupProps extends Omit<CheckboxGroupProps, 'children'> {
393
- options: CheckboxProps[];
394
- orientation?: 'horizontal' | 'vertical';
395
- gap?: MantineSpacing;
396
- disabled?: boolean;
397
- }
398
-
399
- export declare const MyDateInput: (props: MyDateInputProps) => JSX.Element;
400
-
401
- export declare interface MyDateInputProps extends DateInputProps {
402
- ref?: React.Ref<HTMLInputElement>;
403
- }
404
-
405
- export declare const MyDatePickerInput: (props: MyDatePickerInputProps) => JSX.Element;
406
-
407
- export declare interface MyDatePickerInputProps extends DatePickerInputProps<any> {
408
- ref?: React.Ref<HTMLButtonElement>;
409
- }
410
-
411
- export declare const MyDateTimePicker: (props: MyDateTimePickerProps) => JSX.Element;
412
-
413
- export declare interface MyDateTimePickerProps extends DateTimePickerProps {
414
- ref?: React.Ref<HTMLButtonElement>;
415
- }
416
-
417
- export declare const myDefaultTheme: MantineThemeOverride;
418
-
419
- export declare const MyMonthPickerInput: (props: MyMonthPickerInputProps) => JSX.Element;
420
-
421
- export declare interface MyMonthPickerInputProps extends MonthPickerInputProps<any> {
422
- ref?: React.Ref<HTMLButtonElement>;
423
- }
424
-
425
- export declare const MyMultiSelect: (props: MyMultiSelectProps) => JSX.Element;
426
-
427
- export declare interface MyMultiSelectProps extends MultiSelectProps {
428
- ref?: React.Ref<HTMLInputElement>;
429
- }
430
-
431
- export declare interface MyNotificationPrpos extends NotificationsProps {
432
- }
433
-
434
- export declare const MyNotifications: (props: MyNotificationPrpos) => JSX.Element;
435
-
436
- export declare const MyNumberInput: (props: MyNumberInputProps) => JSX.Element;
437
-
438
- export declare interface MyNumberInputProps extends Omit<NumberInputProps, "onValueChange"> {
439
- ref?: React.Ref<HTMLInputElement>;
440
- }
441
-
442
- export declare const MyRadioGroup: ({ options, orientation, gap, ...radioGroupProps }: MyRadioGroupProps) => JSX.Element;
443
-
444
- export declare interface MyRadioGroupProps extends Omit<RadioGroupProps, 'children'> {
445
- options: RadioProps[];
446
- orientation?: 'horizontal' | 'vertical';
447
- gap?: MantineSpacing;
448
- disabled?: boolean;
449
- }
450
-
451
- export declare const MySelect: (props: MySelectProps) => JSX.Element;
452
-
453
- export declare interface MySelectProps extends SelectProps {
454
- ref?: React.Ref<HTMLInputElement>;
455
- }
456
-
457
- export declare const MyTextarea: (props: MyTextareaProps) => JSX.Element;
458
-
459
- export declare interface MyTextareaProps extends TextareaProps {
460
- ref?: React.Ref<HTMLTextAreaElement>;
461
- }
462
-
463
- export declare const MyTextInput: (props: MyTextInputProps) => JSX.Element;
464
-
465
- export declare interface MyTextInputProps extends TextInputProps {
466
- ref?: React.Ref<HTMLInputElement>;
467
- }
468
-
469
- export declare const MyTimeInput: (props: MyTimeInputProps) => JSX.Element;
470
-
471
- export declare interface MyTimeInputProps extends TimeInputProps {
472
- ref?: React.Ref<HTMLInputElement>;
473
- }
474
-
475
- declare interface NavigationHistoryHook {
476
- history: string[];
477
- goBack: (fallback?: string) => void;
478
- currentRoute: string | null;
479
- hasPreviousRoute: boolean;
480
- getPreviousRoute: () => string | null;
481
- }
482
-
483
- export declare function NavigationHistoryProvider({ children }: NavigationHistoryProviderProps): JSX.Element;
484
-
485
- declare interface NavigationHistoryProviderProps {
486
- children: ReactNode;
487
- }
488
-
489
- export declare const NavItems: ({ items, activeStrategy }: NavItemsProps) => JSX.Element;
490
-
491
- export declare interface NavItemsProps {
492
- items: {
493
- leftSection?: ReactNode;
494
- rightSection?: ReactNode;
495
- onClick?: (e: MouseEvent_2<Element>) => void;
496
- disabled?: boolean;
497
- className?: string;
498
- children?: ReactNode;
499
- label: string;
500
- href?: string;
501
- isActive?: boolean;
502
- }[];
503
- activeStrategy?: 'equals' | 'includes';
504
- }
505
-
506
- export declare const newRoute: {
507
- <LocalQuery extends object = {}, Path extends string = string>(path: Path, options?: RouteOptions<LocalQuery, ExtractPathParams<Path>> | undefined): (params?: RouteInput<ExtractPathParams<Path>, LocalQuery> | undefined) => string;
508
- <LocalQuery extends object = {}, PathParams extends Params = {}>(path: string, options?: RouteOptions<LocalQuery, PathParams> | undefined): (params?: RouteInput<PathParams, LocalQuery> | undefined) => string;
509
- <LocalQuery extends object = {}, PathParams extends Params = {}>(pathBuilder: (params: PathParams) => string, options?: RouteOptions<LocalQuery, PathParams> | undefined): (params?: RouteInput<PathParams, LocalQuery> | undefined) => string;
510
- };
511
-
512
- export declare const nullableButRequired: <T extends ZodType>(schema: T, message?: string) => z.ZodPipe<z.ZodNullable<T>, z.ZodTransform<Awaited<z.core.output<T> & undefined> | Awaited<z.core.output<T> & {}>, z.core.output<T> | null>>;
513
-
514
- export declare const numberToTimeInput: (number: number) => string;
515
-
516
- export declare type OnScrollProgressOptions = {
517
- triggerPercentage: number;
518
- callback: () => void;
519
- scrollRef?: RefObject<HTMLElement | null>;
520
- disabled?: boolean;
521
- };
522
-
523
- export declare const optionalButRequired: <T extends ZodType>(schema: T, message?: string) => z.ZodPipe<z.ZodOptional<T>, z.ZodTransform<Awaited<z.core.output<T> & null> | Awaited<z.core.output<T> & {}>, z.core.output<T> | undefined>>;
524
-
525
- export declare const PageDataProvider: ({ value, children }: PageDataProviderProps) => JSX.Element;
526
-
527
- declare interface PageDataProviderProps {
528
- children: React.ReactNode;
529
- value: any;
530
- }
531
-
532
- declare interface PageParams extends Record<string, string | string[] | undefined> {
533
- }
534
-
535
- export declare interface PageProps {
536
- params: Promise<PageParams>;
537
- searchParams: Promise<{
538
- [key: string]: string | string[] | undefined;
539
- }>;
540
- }
541
-
542
- declare type Params = Record<string, Primitive>;
543
-
544
- export declare const parseJSON: (response: KyResponse) => Promise<any>;
545
-
546
- declare type Primitive = string | number | boolean | undefined;
547
-
548
- declare const pxBySize: {
549
- sm: number;
550
- md: number;
551
- lg: number;
552
- };
553
-
554
- export declare const QP_BACK_URL_NAME = "backUrl";
555
-
556
- export declare const queryStringify: (query?: Record<string, any>) => string;
557
-
558
- export declare enum Revalidate {
559
- OneHour = 3600,
560
- OneDay = 86400,
561
- OneWeek = 604800,
562
- OneMonth = 2592000,
563
- OneYear = 31536000
564
- }
565
-
566
- declare type RouteInput<PathParams extends Params, Query> = PathParams & {
567
- query?: Query;
568
- };
569
-
570
- declare type RouteOptions<Query, PathParams> = {
571
- queryBuilder?: (query: Query) => string;
572
- pathBuilder?: (params: PathParams) => string;
573
- };
574
-
575
- export declare type Setter<T> = Dispatch<SetStateAction<T>>;
576
-
577
- export declare const shuffleArray: <T>(array: T[]) => T[];
578
-
579
- declare const stylesBySize: {
580
- xs: {
581
- height: number;
582
- width: number;
583
- };
584
- sm: {
585
- height: number;
586
- width: number;
587
- };
588
- md: {
589
- height: number;
590
- width: number;
591
- };
592
- lg: {
593
- height: number;
594
- width: number;
595
- };
596
- xl: {
597
- height: number;
598
- width: number;
599
- };
600
- "2xl": {
601
- height: number;
602
- width: number;
603
- };
604
- };
605
-
606
- export declare const timeInputToNumber: (timeInput: string) => number;
607
-
608
- export declare const toTailwindColors: (colors: MantineThemeColors) => Record<DefaultMantineColor, Record<MantineColorShade, string>>;
609
-
610
- export declare const useBreakpoint: (breakpoint: keyof typeof breakpointsWithPx) => boolean;
611
-
612
- export declare const useFetchNextPageOnScroll: ({ infinity, scrollRef, disabled, }: FetchNextPageOnScrollOptions) => void;
613
-
614
- export declare function useNavigationHistory(): NavigationHistoryHook;
615
-
616
- export declare const useOnScrollProgress: ({ triggerPercentage, callback, scrollRef, disabled, }: OnScrollProgressOptions) => void;
617
-
618
- export declare const usePageData: <T>() => T;
619
-
620
- export declare const useUpdateSearchParams: () => {
621
- updateSearchParams: (newSearchparams: Record<string, string | number | null>) => void;
622
- searchParams: ReadonlyURLSearchParams;
623
- };
624
-
625
- export declare const useZodConfig: () => void;
626
-
627
- export declare const withController: <P extends {
628
- onChange?: any;
629
- }>(WrappedComponent: React.ComponentType<FormFieldProps<P>>, getControllerProps?: (fieldProps: P) => Omit<Partial<ControllerProps>, "render">) => FC<P & WithControllerProps & {
630
- onValueChange?: P["onChange"];
631
- }>;
632
-
633
- export declare interface WithControllerProps {
634
- name?: string;
635
- label?: ReactNode;
636
- placeholder?: string;
637
- description?: ReactNode;
638
- validate?: ZodType;
639
- disabled?: boolean;
640
- }
641
-
642
- export declare const withModalManager: <CustomProps extends object>(WrappedComponent: React.ComponentType<ModalManagerWrappedComponentProps<CustomProps>>) => FC<ModalManagerWrapperProps<CustomProps>>;
643
-
644
- export declare const zodValidator: (schema: ZodType) => (values: any) => string | undefined;
645
-
646
- export { }
1
+ export * from './components';
2
+ export * from './consts';
3
+ export * from './contexts';
4
+ export * from './form';
5
+ export * from './hocs';
6
+ export * from './hooks';
7
+ export * from './mantine';
8
+ export * from './types';
9
+ export * from './utils';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}