@rolder/kit 3.0.0-alpha.8 → 3.0.0-alpha.80

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 (297) hide show
  1. package/dist/ai/index.d.ts +2 -0
  2. package/dist/ai/index.js +2 -0
  3. package/dist/ai/ui/chat/Empty.d.ts +1 -0
  4. package/dist/ai/ui/chat/Empty.js +21 -0
  5. package/dist/ai/ui/chat/File.d.ts +3 -0
  6. package/dist/ai/ui/chat/File.js +43 -0
  7. package/dist/ai/ui/chat/FileIcon.d.ts +3 -0
  8. package/dist/ai/ui/chat/FileIcon.js +43 -0
  9. package/dist/ai/ui/chat/Loader.d.ts +2 -0
  10. package/dist/ai/ui/chat/Loader.js +13 -0
  11. package/dist/ai/ui/chat/Message.d.ts +3 -0
  12. package/dist/ai/ui/chat/Message.js +23 -0
  13. package/dist/ai/ui/chat/Messages.d.ts +2 -0
  14. package/dist/ai/ui/chat/Messages.js +27 -0
  15. package/dist/ai/ui/chat/Root.d.ts +49 -0
  16. package/dist/ai/ui/chat/Root.js +18 -0
  17. package/dist/ai/ui/chat/chatInput/File.d.ts +2 -0
  18. package/dist/ai/ui/chat/chatInput/File.js +71 -0
  19. package/dist/ai/ui/chat/chatInput/FileIcon.d.ts +3 -0
  20. package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
  21. package/dist/ai/ui/chat/chatInput/Footer.d.ts +2 -0
  22. package/dist/ai/ui/chat/chatInput/Footer.js +8 -0
  23. package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
  24. package/dist/ai/ui/chat/chatInput/Root.js +24 -0
  25. package/dist/ai/ui/chat/chatInput/Submit.d.ts +2 -0
  26. package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
  27. package/dist/ai/ui/chat/chatInput/Textarea.d.ts +2 -0
  28. package/dist/ai/ui/chat/chatInput/Textarea.js +34 -0
  29. package/dist/ai/ui/chat/chatInput/index.d.ts +7 -0
  30. package/dist/ai/ui/chat/chatInput/index.js +13 -0
  31. package/dist/ai/ui/chat/chatInput/store/file.d.ts +8 -0
  32. package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
  33. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
  34. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
  35. package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
  36. package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
  37. package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
  38. package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
  39. package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
  40. package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
  41. package/dist/ai/ui/chat/index.d.ts +13 -0
  42. package/dist/ai/ui/chat/index.js +15 -0
  43. package/dist/ai/ui/chat/store/index.d.ts +5 -0
  44. package/dist/ai/ui/chat/store/index.js +5 -0
  45. package/dist/ai/ui/chat/store/messageIds.d.ts +8 -0
  46. package/dist/ai/ui/chat/store/messageIds.js +41 -0
  47. package/dist/ai/ui/chat/store/messagesMap.d.ts +5 -0
  48. package/dist/ai/ui/chat/store/messagesMap.js +15 -0
  49. package/dist/ai/ui/chat/store/send.d.ts +14 -0
  50. package/dist/ai/ui/chat/store/send.js +16 -0
  51. package/dist/ai/ui/chat/store/states.d.ts +11 -0
  52. package/dist/ai/ui/chat/store/states.js +17 -0
  53. package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
  54. package/dist/ai/ui/chat/store/useInitChat.js +40 -0
  55. package/dist/ai/ui/index.d.ts +1 -0
  56. package/dist/ai/ui/index.js +1 -0
  57. package/dist/ai/utils/convertFileUIPartBlobToDataURL.d.ts +5 -0
  58. package/dist/ai/utils/convertFileUIPartBlobToDataURL.js +21 -0
  59. package/dist/ai/utils/index.d.ts +2 -0
  60. package/dist/ai/utils/index.js +2 -0
  61. package/dist/ai/utils/parseAiMessagePart.d.ts +2 -0
  62. package/dist/ai/utils/parseAiMessagePart.js +12 -0
  63. package/dist/app/AppDefaults.d.ts +3 -0
  64. package/dist/app/AppDefaults.js +27 -0
  65. package/dist/app/DefaultApp.d.ts +6 -0
  66. package/dist/app/DefaultApp.js +43 -0
  67. package/dist/app/cookieColorSchemeManager.d.ts +6 -0
  68. package/dist/app/cookieColorSchemeManager.js +46 -0
  69. package/dist/app/defaultRequestMiddlewares.d.ts +4 -0
  70. package/dist/app/defaultRequestMiddlewares.js +24 -0
  71. package/dist/app/defaultTheme.d.ts +141 -0
  72. package/dist/app/defaultTheme.js +24 -0
  73. package/dist/app/index.d.ts +4 -0
  74. package/dist/app/index.js +4 -0
  75. package/dist/hooks/index.d.ts +2 -0
  76. package/dist/hooks/index.js +2 -0
  77. package/dist/hooks/useMutation.d.ts +4 -0
  78. package/dist/hooks/useMutation.js +8 -0
  79. package/dist/hooks/useMutationWithInvalidate.d.ts +4 -0
  80. package/dist/hooks/useMutationWithInvalidate.js +16 -0
  81. package/dist/index.d.ts +5 -0
  82. package/dist/index.js +5 -0
  83. package/{src → dist}/styles.css +14 -29
  84. package/dist/tanstackFunctions/cookie/getCookie.d.ts +3 -0
  85. package/dist/tanstackFunctions/cookie/getCookie.js +8 -0
  86. package/dist/tanstackFunctions/cookie/index.d.ts +3 -0
  87. package/dist/tanstackFunctions/cookie/index.js +4 -0
  88. package/dist/tanstackFunctions/cookie/setCookie.d.ts +10 -0
  89. package/dist/tanstackFunctions/cookie/setCookie.js +19 -0
  90. package/dist/tanstackFunctions/cookie/setCookies.d.ts +14 -0
  91. package/dist/tanstackFunctions/cookie/setCookies.js +13 -0
  92. package/dist/tanstackFunctions/index.d.ts +3 -0
  93. package/dist/tanstackFunctions/index.js +3 -0
  94. package/dist/tanstackFunctions/s3/getS3Client.d.ts +2 -0
  95. package/dist/tanstackFunctions/s3/getS3Client.js +18 -0
  96. package/dist/tanstackFunctions/s3/getSignedFileUrlFn.d.ts +4 -0
  97. package/dist/tanstackFunctions/s3/getSignedFileUrlFn.js +21 -0
  98. package/dist/tanstackFunctions/s3/index.d.ts +2 -0
  99. package/dist/tanstackFunctions/s3/index.js +2 -0
  100. package/dist/tanstackFunctions/s3/uploadRequest.d.ts +3 -0
  101. package/dist/tanstackFunctions/s3/uploadRequest.js +21 -0
  102. package/dist/tanstackFunctions/surreal/connection.d.ts +9 -0
  103. package/dist/tanstackFunctions/surreal/connection.js +49 -0
  104. package/dist/tanstackFunctions/surreal/deafaultCrud.d.ts +2 -0
  105. package/dist/tanstackFunctions/surreal/deafaultCrud.js +18 -0
  106. package/dist/tanstackFunctions/surreal/deserialize.d.ts +17 -0
  107. package/dist/tanstackFunctions/surreal/deserialize.js +46 -0
  108. package/dist/tanstackFunctions/surreal/encryption.d.ts +6 -0
  109. package/dist/tanstackFunctions/surreal/encryption.js +30 -0
  110. package/dist/tanstackFunctions/surreal/index.d.ts +4 -0
  111. package/dist/tanstackFunctions/surreal/index.js +4 -0
  112. package/dist/ui/AnimatedChevron.d.ts +6 -0
  113. package/dist/ui/AnimatedChevron.js +13 -0
  114. package/dist/ui/JsonInput.d.ts +2 -0
  115. package/dist/ui/JsonInput.js +45 -0
  116. package/dist/ui/RouterLink.d.ts +16 -0
  117. package/dist/ui/RouterLink.js +36 -0
  118. package/dist/ui/editor/Content.d.ts +3 -0
  119. package/dist/ui/editor/Content.js +13 -0
  120. package/dist/ui/editor/Root.d.ts +8 -0
  121. package/dist/ui/editor/Root.js +55 -0
  122. package/dist/ui/editor/Toolbar.d.ts +5 -0
  123. package/dist/ui/editor/Toolbar.js +138 -0
  124. package/dist/ui/editor/index.d.ts +11 -0
  125. package/dist/ui/editor/index.js +10 -0
  126. package/dist/ui/editor/store.d.ts +6 -0
  127. package/dist/ui/editor/store.js +10 -0
  128. package/dist/ui/error/DefaultError.d.ts +2 -0
  129. package/dist/ui/error/DefaultError.js +62 -0
  130. package/dist/ui/error/DefaultNotFound.d.ts +1 -0
  131. package/dist/ui/error/DefaultNotFound.js +37 -0
  132. package/dist/ui/error/Forbidden.d.ts +1 -0
  133. package/dist/ui/error/Forbidden.js +32 -0
  134. package/dist/ui/error/defaultErrorNotification.d.ts +1 -0
  135. package/dist/ui/error/defaultErrorNotification.js +8 -0
  136. package/dist/ui/error/index.js +5 -0
  137. package/dist/ui/form/blurOnError.d.ts +4 -0
  138. package/dist/ui/form/blurOnError.js +11 -0
  139. package/dist/ui/form/buttons/CancelButton.d.ts +5 -0
  140. package/dist/ui/form/buttons/CancelButton.js +22 -0
  141. package/dist/ui/form/buttons/SubmitButton.d.ts +5 -0
  142. package/dist/ui/form/buttons/SubmitButton.js +22 -0
  143. package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +4 -0
  144. package/dist/ui/form/buttons/SubscribeActionIcon.js +15 -0
  145. package/dist/ui/form/buttons/SubscribeButton.d.ts +5 -0
  146. package/dist/ui/form/buttons/SubscribeButton.js +16 -0
  147. package/dist/ui/form/buttons/index.js +4 -0
  148. package/dist/ui/form/context.d.ts +83 -0
  149. package/dist/ui/form/context.js +26 -0
  150. package/dist/ui/form/fields/JsonField.d.ts +2 -0
  151. package/dist/ui/form/fields/JsonField.js +13 -0
  152. package/dist/ui/form/fields/MultiSelectField.d.ts +2 -0
  153. package/dist/ui/form/fields/MultiSelectField.js +15 -0
  154. package/dist/ui/form/fields/NumberField.d.ts +2 -0
  155. package/dist/ui/form/fields/NumberField.js +15 -0
  156. package/dist/ui/form/fields/PassowrdField.d.ts +2 -0
  157. package/dist/ui/form/fields/PassowrdField.js +18 -0
  158. package/dist/ui/form/fields/SelectField.d.ts +2 -0
  159. package/dist/ui/form/fields/SelectField.js +15 -0
  160. package/dist/ui/form/fields/SwitchField.d.ts +2 -0
  161. package/dist/ui/form/fields/SwitchField.js +15 -0
  162. package/dist/ui/form/fields/TextField.d.ts +2 -0
  163. package/dist/ui/form/fields/TextField.js +15 -0
  164. package/dist/ui/form/fields/TextPassowrdField.d.ts +2 -0
  165. package/dist/ui/form/fields/TextPassowrdField.js +29 -0
  166. package/dist/ui/form/fields/TextareaField.d.ts +2 -0
  167. package/dist/ui/form/fields/TextareaField.js +15 -0
  168. package/dist/ui/form/fields/index.js +9 -0
  169. package/dist/ui/form/fieldsSchema.d.ts +12 -0
  170. package/dist/ui/form/fieldsSchema.js +13 -0
  171. package/dist/ui/form/index.js +4 -0
  172. package/dist/ui/hoverPaper/HoverPaper.d.ts +6 -0
  173. package/dist/ui/hoverPaper/HoverPaper.js +15 -0
  174. package/dist/ui/hoverPaper/index.js +3 -0
  175. package/dist/ui/hoverPaper/usePaperHover.d.ts +4 -0
  176. package/dist/ui/hoverPaper/usePaperHover.js +9 -0
  177. package/dist/ui/index.d.ts +9 -0
  178. package/dist/ui/index.js +9 -0
  179. package/dist/ui/saveInput/JsonInput.d.ts +6 -0
  180. package/dist/ui/saveInput/JsonInput.js +34 -0
  181. package/dist/ui/saveInput/NumberInput.d.ts +6 -0
  182. package/dist/ui/saveInput/NumberInput.js +27 -0
  183. package/dist/ui/saveInput/SaveInput.d.ts +36 -0
  184. package/dist/ui/saveInput/SaveInput.js +15 -0
  185. package/dist/ui/saveInput/Select.d.ts +6 -0
  186. package/dist/ui/saveInput/Select.js +27 -0
  187. package/dist/ui/saveInput/Switch.d.ts +6 -0
  188. package/dist/ui/saveInput/Switch.js +30 -0
  189. package/dist/ui/saveInput/TextInput.d.ts +6 -0
  190. package/dist/ui/saveInput/TextInput.js +26 -0
  191. package/dist/ui/saveInput/Textarea.d.ts +6 -0
  192. package/dist/ui/saveInput/Textarea.js +26 -0
  193. package/dist/ui/saveInput/index.js +2 -0
  194. package/dist/ui/scrollArea/Root.d.ts +7 -0
  195. package/dist/ui/scrollArea/Root.js +42 -0
  196. package/dist/ui/scrollArea/ScrollButton.d.ts +10 -0
  197. package/dist/ui/scrollArea/ScrollButton.js +30 -0
  198. package/dist/ui/scrollArea/index.d.ts +6 -0
  199. package/dist/ui/scrollArea/index.js +7 -0
  200. package/dist/ui/scrollArea/methods.d.ts +4 -0
  201. package/dist/ui/scrollArea/methods.js +32 -0
  202. package/dist/ui/scrollArea/store.d.ts +12 -0
  203. package/dist/ui/scrollArea/store.js +25 -0
  204. package/package.json +40 -28
  205. package/rslib.config.ts +0 -21
  206. package/src/ai/ui/conversation/ConversationContext.ts +0 -21
  207. package/src/ai/ui/conversation/ConversationProvider.tsx +0 -21
  208. package/src/ai/ui/conversation/Empty.tsx +0 -15
  209. package/src/ai/ui/conversation/File.tsx +0 -40
  210. package/src/ai/ui/conversation/FileIcon.tsx +0 -143
  211. package/src/ai/ui/conversation/Loader.tsx +0 -8
  212. package/src/ai/ui/conversation/Message.tsx +0 -34
  213. package/src/ai/ui/conversation/Root.tsx +0 -24
  214. package/src/ai/ui/conversation/index.ts +0 -16
  215. package/src/ai/ui/conversation/types.ts +0 -8
  216. package/src/ai/ui/conversation/useChatMessage.ts +0 -13
  217. package/src/ai/ui/promptInput/File.tsx +0 -98
  218. package/src/ai/ui/promptInput/FileIcon.tsx +0 -149
  219. package/src/ai/ui/promptInput/Footer.tsx +0 -5
  220. package/src/ai/ui/promptInput/PromptInputContext.ts +0 -24
  221. package/src/ai/ui/promptInput/PromptInputProvider.tsx +0 -54
  222. package/src/ai/ui/promptInput/Root.tsx +0 -29
  223. package/src/ai/ui/promptInput/Submit.tsx +0 -39
  224. package/src/ai/ui/promptInput/Textarea.tsx +0 -39
  225. package/src/ai/ui/promptInput/index.ts +0 -15
  226. package/src/ai/ui/promptInput/types.ts +0 -9
  227. package/src/ai/utils/convertFileUIPartBlobToDataURL.ts +0 -29
  228. package/src/ai/utils/parseAiMessagePart.ts +0 -19
  229. package/src/app/AppDefaults.tsx +0 -21
  230. package/src/app/DefaultApp.tsx +0 -50
  231. package/src/app/cookieColorSchemeManager.ts +0 -70
  232. package/src/app/defaultRequestMiddlewares.ts +0 -22
  233. package/src/app/defaultTheme.ts +0 -22
  234. package/src/functions/getCookie.ts +0 -36
  235. package/src/functions/setCookie.ts +0 -29
  236. package/src/functions/setCookies.ts +0 -24
  237. package/src/hooks/useMutation.ts +0 -14
  238. package/src/hooks/useMutationWithInvalidate.ts +0 -23
  239. package/src/index.ts +0 -66
  240. package/src/surreal/connection.ts +0 -72
  241. package/src/surreal/deafaultCrud.ts +0 -25
  242. package/src/surreal/deserialize.ts +0 -144
  243. package/src/surreal/encryption.ts +0 -51
  244. package/src/ui/AnimatedChevron.tsx +0 -32
  245. package/src/ui/JsonInput.tsx +0 -52
  246. package/src/ui/RouterLink.tsx +0 -78
  247. package/src/ui/editor/Content.tsx +0 -11
  248. package/src/ui/editor/Provider.tsx +0 -96
  249. package/src/ui/editor/Root.tsx +0 -25
  250. package/src/ui/editor/Toolbar.tsx +0 -92
  251. package/src/ui/editor/index.ts +0 -13
  252. package/src/ui/editor/types.ts +0 -7
  253. package/src/ui/error/DefaultError.tsx +0 -60
  254. package/src/ui/error/DefaultNotFound.tsx +0 -19
  255. package/src/ui/error/Forbidden.tsx +0 -18
  256. package/src/ui/error/defaultErrorNotification.ts +0 -9
  257. package/src/ui/form/blurOnError.ts +0 -21
  258. package/src/ui/form/buttons/CancelButton.tsx +0 -42
  259. package/src/ui/form/buttons/SubmitButton.tsx +0 -43
  260. package/src/ui/form/buttons/SubscribeActionIcon.tsx +0 -18
  261. package/src/ui/form/buttons/SubscribeButton.tsx +0 -17
  262. package/src/ui/form/context.ts +0 -45
  263. package/src/ui/form/fields/JsonField.tsx +0 -16
  264. package/src/ui/form/fields/MultiSelectField.tsx +0 -17
  265. package/src/ui/form/fields/NumberField.tsx +0 -17
  266. package/src/ui/form/fields/PassowrdField.tsx +0 -20
  267. package/src/ui/form/fields/SelectField.tsx +0 -17
  268. package/src/ui/form/fields/SwitchField.tsx +0 -17
  269. package/src/ui/form/fields/TextField.tsx +0 -17
  270. package/src/ui/form/fields/TextPassowrdField.tsx +0 -51
  271. package/src/ui/form/fields/TextareaField.tsx +0 -17
  272. package/src/ui/form/fieldsSchema.ts +0 -24
  273. package/src/ui/hoverPaper/HoverPaper.tsx +0 -17
  274. package/src/ui/hoverPaper/usePaperHover.ts +0 -9
  275. package/src/ui/saveInput/JsonInput.tsx +0 -40
  276. package/src/ui/saveInput/NumberInput.tsx +0 -40
  277. package/src/ui/saveInput/SaveInput.tsx +0 -15
  278. package/src/ui/saveInput/Select.tsx +0 -41
  279. package/src/ui/saveInput/Switch.tsx +0 -46
  280. package/src/ui/saveInput/TextInput.tsx +0 -40
  281. package/src/ui/saveInput/Textarea.tsx +0 -40
  282. package/src/ui/scrollArea/ARCH.md +0 -204
  283. package/src/ui/scrollArea/README.md +0 -369
  284. package/src/ui/scrollArea/ScrollArea.tsx +0 -93
  285. package/src/ui/scrollArea/ScrollAreaButton.tsx +0 -56
  286. package/src/ui/scrollArea/ScrollAreaContent.tsx +0 -36
  287. package/src/ui/scrollArea/context.tsx +0 -43
  288. package/src/ui/scrollArea/index.ts +0 -10
  289. package/src/ui/scrollArea/types.ts +0 -77
  290. package/src/ui/scrollArea/useScrollArea.ts +0 -227
  291. package/tsconfig.json +0 -14
  292. /package/{src/ui/error/index.ts → dist/ui/error/index.d.ts} +0 -0
  293. /package/{src/ui/form/buttons/index.ts → dist/ui/form/buttons/index.d.ts} +0 -0
  294. /package/{src/ui/form/fields/index.ts → dist/ui/form/fields/index.d.ts} +0 -0
  295. /package/{src/ui/form/index.ts → dist/ui/form/index.d.ts} +0 -0
  296. /package/{src/ui/hoverPaper/index.ts → dist/ui/hoverPaper/index.d.ts} +0 -0
  297. /package/{src/ui/saveInput/index.ts → dist/ui/saveInput/index.d.ts} +0 -0
@@ -0,0 +1,5 @@
1
+ import { DefaultError } from "./DefaultError.js";
2
+ import { DefaultNotFound } from "./DefaultNotFound.js";
3
+ import { defaultErrorNotification } from "./defaultErrorNotification.js";
4
+ import { Forbidden } from "./Forbidden.js";
5
+ export { DefaultError, DefaultNotFound, Forbidden, defaultErrorNotification };
@@ -0,0 +1,4 @@
1
+ import type { AnyFormApi } from '@tanstack/react-form';
2
+ export declare const blurOnError: ({ formApi }: {
3
+ formApi: AnyFormApi;
4
+ }) => void;
@@ -0,0 +1,11 @@
1
+ const blurOnError = ({ formApi })=>{
2
+ const inputNames = Array.from(new Set(Object.keys(formApi.state.fieldMeta).filter((i)=>formApi.state.fieldMeta[i]?.errors.length)));
3
+ for (const inputName of inputNames){
4
+ const input = document.querySelector(`#form input[name="${inputName}"]`);
5
+ if (input) {
6
+ input.focus();
7
+ break;
8
+ }
9
+ }
10
+ };
11
+ export { blurOnError };
@@ -0,0 +1,5 @@
1
+ import { type ButtonProps } from '@mantine/core';
2
+ export declare const CancelButton: (props: ButtonProps & {
3
+ label?: string;
4
+ onClick?: () => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mantine/core";
3
+ import { IconCancel } from "@tabler/icons-react";
4
+ import { useFormContext } from "../context.js";
5
+ const CancelButton = (props)=>{
6
+ const form = useFormContext();
7
+ return /*#__PURE__*/ jsx(form.Subscribe, {
8
+ selector: (state)=>state.isSubmitting,
9
+ children: (isSubmitting)=>/*#__PURE__*/ jsx(Button, {
10
+ type: "reset",
11
+ size: "xs",
12
+ variant: "light",
13
+ leftSection: /*#__PURE__*/ jsx(IconCancel, {
14
+ size: 16
15
+ }),
16
+ disabled: isSubmitting,
17
+ ...props,
18
+ children: props.label || 'Отмена'
19
+ })
20
+ });
21
+ };
22
+ export { CancelButton };
@@ -0,0 +1,5 @@
1
+ import { type ButtonProps } from '@mantine/core';
2
+ export declare const SubmitButton: (props: ButtonProps & {
3
+ label?: string;
4
+ onClick?: () => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mantine/core";
3
+ import { IconDeviceFloppy } from "@tabler/icons-react";
4
+ import { useFormContext } from "../context.js";
5
+ const SubmitButton = (props)=>{
6
+ const form = useFormContext();
7
+ return /*#__PURE__*/ jsx(form.Subscribe, {
8
+ selector: (state)=>state,
9
+ children: (state)=>/*#__PURE__*/ jsx(Button, {
10
+ type: "submit",
11
+ size: "xs",
12
+ leftSection: /*#__PURE__*/ jsx(IconDeviceFloppy, {
13
+ size: 20
14
+ }),
15
+ loading: state.isSubmitting,
16
+ disabled: !state.isDirty,
17
+ ...props,
18
+ children: props.label || 'Сохранить'
19
+ })
20
+ });
21
+ };
22
+ export { SubmitButton };
@@ -0,0 +1,4 @@
1
+ import { type ActionIconProps } from '@mantine/core';
2
+ export declare const SubscribeActionIcon: (props: ActionIconProps & {
3
+ onClick?: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ActionIcon } from "@mantine/core";
3
+ import { useFormContext } from "../context.js";
4
+ const SubscribeActionIcon = (props)=>{
5
+ const form = useFormContext();
6
+ return /*#__PURE__*/ jsx(form.Subscribe, {
7
+ selector: (state)=>state.isSubmitting,
8
+ children: (isSubmitting)=>/*#__PURE__*/ jsx(ActionIcon, {
9
+ disabled: isSubmitting,
10
+ ...props,
11
+ children: props.children
12
+ })
13
+ });
14
+ };
15
+ export { SubscribeActionIcon };
@@ -0,0 +1,5 @@
1
+ import { type ButtonProps } from '@mantine/core';
2
+ export declare const SubscribeButton: (props: ButtonProps & {
3
+ label: string;
4
+ onClick?: () => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mantine/core";
3
+ import { useFormContext } from "../context.js";
4
+ const SubscribeButton = (props)=>{
5
+ const form = useFormContext();
6
+ return /*#__PURE__*/ jsx(form.Subscribe, {
7
+ selector: (state)=>state.isSubmitting,
8
+ children: (isSubmitting)=>/*#__PURE__*/ jsx(Button, {
9
+ type: "button",
10
+ disabled: isSubmitting,
11
+ ...props,
12
+ children: props.label
13
+ })
14
+ });
15
+ };
16
+ export { SubscribeButton };
@@ -0,0 +1,4 @@
1
+ export * from "./CancelButton.js";
2
+ export * from "./SubmitButton.js";
3
+ export * from "./SubscribeActionIcon.js";
4
+ export * from "./SubscribeButton.js";
@@ -0,0 +1,83 @@
1
+ declare const useFieldContext: <TData>() => import("@tanstack/form-core").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
2
+ declare const useAppForm: <TFormData, TOnMount extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import("@tanstack/form-core").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
3
+ readonly TextField: (props: import("@mantine/core").TextInputProps) => import("react/jsx-runtime").JSX.Element;
4
+ readonly NumberField: (props: import("@mantine/core").NumberInputProps) => import("react/jsx-runtime").JSX.Element;
5
+ readonly TextareaField: (props: import("@mantine/core").TextareaProps) => import("react/jsx-runtime").JSX.Element;
6
+ readonly TextPassowrdField: (props: import("@mantine/core").TextInputProps) => import("react/jsx-runtime").JSX.Element;
7
+ readonly PassowrdField: (props: import("@mantine/core").PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
8
+ readonly SelectField: (props: import("@mantine/core").SelectProps) => import("react/jsx-runtime").JSX.Element;
9
+ readonly MultiSelectField: (props: import("@mantine/core").MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
10
+ readonly SwitchField: (props: import("@mantine/core").SwitchProps) => import("react/jsx-runtime").JSX.Element;
11
+ readonly JsonField: (props: import("@uiw/react-codemirror").ReactCodeMirrorProps) => import("react/jsx-runtime").JSX.Element;
12
+ }, {
13
+ readonly SubmitButton: (props: import("@mantine/core").ButtonProps & {
14
+ label?: string;
15
+ onClick?: () => void;
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ readonly CancelButton: (props: import("@mantine/core").ButtonProps & {
18
+ label?: string;
19
+ onClick?: () => void;
20
+ }) => import("react/jsx-runtime").JSX.Element;
21
+ readonly SubscribeButton: (props: import("@mantine/core").ButtonProps & {
22
+ label: string;
23
+ onClick?: () => void;
24
+ }) => import("react/jsx-runtime").JSX.Element;
25
+ readonly SubscribeActionIcon: (props: import("@mantine/core").ActionIconProps & {
26
+ onClick?: () => void;
27
+ }) => import("react/jsx-runtime").JSX.Element;
28
+ }>, withForm: <TFormData, TOnMount extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: import("@tanstack/react-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
29
+ readonly TextField: (props: import("@mantine/core").TextInputProps) => import("react/jsx-runtime").JSX.Element;
30
+ readonly NumberField: (props: import("@mantine/core").NumberInputProps) => import("react/jsx-runtime").JSX.Element;
31
+ readonly TextareaField: (props: import("@mantine/core").TextareaProps) => import("react/jsx-runtime").JSX.Element;
32
+ readonly TextPassowrdField: (props: import("@mantine/core").TextInputProps) => import("react/jsx-runtime").JSX.Element;
33
+ readonly PassowrdField: (props: import("@mantine/core").PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
34
+ readonly SelectField: (props: import("@mantine/core").SelectProps) => import("react/jsx-runtime").JSX.Element;
35
+ readonly MultiSelectField: (props: import("@mantine/core").MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
36
+ readonly SwitchField: (props: import("@mantine/core").SwitchProps) => import("react/jsx-runtime").JSX.Element;
37
+ readonly JsonField: (props: import("@uiw/react-codemirror").ReactCodeMirrorProps) => import("react/jsx-runtime").JSX.Element;
38
+ }, {
39
+ readonly SubmitButton: (props: import("@mantine/core").ButtonProps & {
40
+ label?: string;
41
+ onClick?: () => void;
42
+ }) => import("react/jsx-runtime").JSX.Element;
43
+ readonly CancelButton: (props: import("@mantine/core").ButtonProps & {
44
+ label?: string;
45
+ onClick?: () => void;
46
+ }) => import("react/jsx-runtime").JSX.Element;
47
+ readonly SubscribeButton: (props: import("@mantine/core").ButtonProps & {
48
+ label: string;
49
+ onClick?: () => void;
50
+ }) => import("react/jsx-runtime").JSX.Element;
51
+ readonly SubscribeActionIcon: (props: import("@mantine/core").ActionIconProps & {
52
+ onClick?: () => void;
53
+ }) => import("react/jsx-runtime").JSX.Element;
54
+ }, TRenderProps>) => import("react").FunctionComponent<import("react").PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
55
+ form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
56
+ readonly TextField: (props: import("@mantine/core").TextInputProps) => import("react/jsx-runtime").JSX.Element;
57
+ readonly NumberField: (props: import("@mantine/core").NumberInputProps) => import("react/jsx-runtime").JSX.Element;
58
+ readonly TextareaField: (props: import("@mantine/core").TextareaProps) => import("react/jsx-runtime").JSX.Element;
59
+ readonly TextPassowrdField: (props: import("@mantine/core").TextInputProps) => import("react/jsx-runtime").JSX.Element;
60
+ readonly PassowrdField: (props: import("@mantine/core").PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
61
+ readonly SelectField: (props: import("@mantine/core").SelectProps) => import("react/jsx-runtime").JSX.Element;
62
+ readonly MultiSelectField: (props: import("@mantine/core").MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
63
+ readonly SwitchField: (props: import("@mantine/core").SwitchProps) => import("react/jsx-runtime").JSX.Element;
64
+ readonly JsonField: (props: import("@uiw/react-codemirror").ReactCodeMirrorProps) => import("react/jsx-runtime").JSX.Element;
65
+ }, {
66
+ readonly SubmitButton: (props: import("@mantine/core").ButtonProps & {
67
+ label?: string;
68
+ onClick?: () => void;
69
+ }) => import("react/jsx-runtime").JSX.Element;
70
+ readonly CancelButton: (props: import("@mantine/core").ButtonProps & {
71
+ label?: string;
72
+ onClick?: () => void;
73
+ }) => import("react/jsx-runtime").JSX.Element;
74
+ readonly SubscribeButton: (props: import("@mantine/core").ButtonProps & {
75
+ label: string;
76
+ onClick?: () => void;
77
+ }) => import("react/jsx-runtime").JSX.Element;
78
+ readonly SubscribeActionIcon: (props: import("@mantine/core").ActionIconProps & {
79
+ onClick?: () => void;
80
+ }) => import("react/jsx-runtime").JSX.Element;
81
+ }>;
82
+ }>>;
83
+ export { useAppForm, useFieldContext, useFormContext, withForm };
@@ -0,0 +1,26 @@
1
+ import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
2
+ import { CancelButton, SubmitButton, SubscribeActionIcon, SubscribeButton } from "./buttons/index.js";
3
+ import { JsonField, MultiSelectField, NumberField, PassowrdField, SelectField, SwitchField, TextField, TextPassowrdField, TextareaField } from "./fields/index.js";
4
+ const { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts();
5
+ const { useAppForm, withForm } = createFormHook({
6
+ fieldComponents: {
7
+ TextField: TextField,
8
+ NumberField: NumberField,
9
+ TextareaField: TextareaField,
10
+ TextPassowrdField: TextPassowrdField,
11
+ PassowrdField: PassowrdField,
12
+ SelectField: SelectField,
13
+ MultiSelectField: MultiSelectField,
14
+ SwitchField: SwitchField,
15
+ JsonField: JsonField
16
+ },
17
+ formComponents: {
18
+ SubmitButton: SubmitButton,
19
+ CancelButton: CancelButton,
20
+ SubscribeButton: SubscribeButton,
21
+ SubscribeActionIcon: SubscribeActionIcon
22
+ },
23
+ fieldContext,
24
+ formContext
25
+ });
26
+ export { useAppForm, useFieldContext, useFormContext, withForm };
@@ -0,0 +1,2 @@
1
+ import type { ReactCodeMirrorProps } from '@uiw/react-codemirror';
2
+ export declare const JsonField: (props: ReactCodeMirrorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { JsonInput } from "../../JsonInput.js";
3
+ import { useFieldContext } from "../context.js";
4
+ const JsonField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(JsonInput, {
7
+ value: field.state.value || '',
8
+ onChange: field.handleChange,
9
+ onBlur: field.handleBlur,
10
+ ...props
11
+ });
12
+ };
13
+ export { JsonField };
@@ -0,0 +1,2 @@
1
+ import { type MultiSelectProps } from '@mantine/core';
2
+ export declare const MultiSelectField: (props: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { MultiSelect } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const MultiSelectField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(MultiSelect, {
7
+ name: field.name,
8
+ value: field.state.value || [],
9
+ onChange: field.handleChange,
10
+ onBlur: field.handleBlur,
11
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
12
+ ...props
13
+ });
14
+ };
15
+ export { MultiSelectField };
@@ -0,0 +1,2 @@
1
+ import { type NumberInputProps } from '@mantine/core';
2
+ export declare const NumberField: (props: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { NumberInput } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const NumberField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(NumberInput, {
7
+ name: field.name,
8
+ value: field.state.value || '',
9
+ onChange: (v)=>field.handleChange(v),
10
+ onBlur: field.handleBlur,
11
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
12
+ ...props
13
+ });
14
+ };
15
+ export { NumberField };
@@ -0,0 +1,2 @@
1
+ import { type PasswordInputProps } from '@mantine/core';
2
+ export declare const PassowrdField: (props: PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { PasswordInput } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const PassowrdField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(PasswordInput, {
7
+ size: "lg",
8
+ label: "Пароль",
9
+ placeholder: "Введите пароль",
10
+ name: field.name,
11
+ value: field.state.value || '',
12
+ onChange: (e)=>field.handleChange(e.target.value),
13
+ onBlur: field.handleBlur,
14
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
15
+ ...props
16
+ });
17
+ };
18
+ export { PassowrdField };
@@ -0,0 +1,2 @@
1
+ import { type SelectProps } from '@mantine/core';
2
+ export declare const SelectField: (props: SelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Select } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const SelectField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(Select, {
7
+ name: field.name,
8
+ value: field.state.value,
9
+ onChange: field.handleChange,
10
+ onBlur: field.handleBlur,
11
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
12
+ ...props
13
+ });
14
+ };
15
+ export { SelectField };
@@ -0,0 +1,2 @@
1
+ import { type SwitchProps } from '@mantine/core';
2
+ export declare const SwitchField: (props: SwitchProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Switch } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const SwitchField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(Switch, {
7
+ name: field.name,
8
+ checked: field.state.value,
9
+ onChange: (e)=>field.handleChange(e.currentTarget.checked),
10
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
11
+ w: "fit-content",
12
+ ...props
13
+ });
14
+ };
15
+ export { SwitchField };
@@ -0,0 +1,2 @@
1
+ import { type TextInputProps } from '@mantine/core';
2
+ export declare const TextField: (props: TextInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TextInput } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const TextField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(TextInput, {
7
+ name: field.name,
8
+ value: field.state.value || '',
9
+ onChange: (e)=>field.handleChange(e.target.value),
10
+ onBlur: field.handleBlur,
11
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
12
+ ...props
13
+ });
14
+ };
15
+ export { TextField };
@@ -0,0 +1,2 @@
1
+ import { type TextInputProps } from '@mantine/core';
2
+ export declare const TextPassowrdField: (props: TextInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ActionIcon, TextInput } from "@mantine/core";
3
+ import { IconRefresh } from "@tabler/icons-react";
4
+ import omgopass from "omgopass";
5
+ import { useFieldContext } from "../context.js";
6
+ const TextPassowrdField = (props)=>{
7
+ const field = useFieldContext();
8
+ return /*#__PURE__*/ jsx(TextInput, {
9
+ label: "Пароль",
10
+ placeholder: "Введите пароль",
11
+ rightSection: /*#__PURE__*/ jsx(ActionIcon, {
12
+ variant: "light",
13
+ onClick: ()=>field.setValue(omgopass({
14
+ minSyllableLength: 2,
15
+ maxSyllableLength: 2
16
+ })),
17
+ children: /*#__PURE__*/ jsx(IconRefresh, {
18
+ size: 16
19
+ })
20
+ }),
21
+ name: field.name,
22
+ value: field.state.value || '',
23
+ onChange: (e)=>field.handleChange(e.target.value),
24
+ onBlur: field.handleBlur,
25
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
26
+ ...props
27
+ });
28
+ };
29
+ export { TextPassowrdField };
@@ -0,0 +1,2 @@
1
+ import { type TextareaProps } from '@mantine/core';
2
+ export declare const TextareaField: (props: TextareaProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Textarea } from "@mantine/core";
3
+ import { useFieldContext } from "../context.js";
4
+ const TextareaField = (props)=>{
5
+ const field = useFieldContext();
6
+ return /*#__PURE__*/ jsx(Textarea, {
7
+ name: field.name,
8
+ value: field.state.value || '',
9
+ onChange: (e)=>field.handleChange(e.target.value),
10
+ onBlur: field.handleBlur,
11
+ error: field.state.meta.errors.map((error)=>error.message).join(', '),
12
+ ...props
13
+ });
14
+ };
15
+ export { TextareaField };
@@ -0,0 +1,9 @@
1
+ export * from "./JsonField.js";
2
+ export * from "./MultiSelectField.js";
3
+ export * from "./NumberField.js";
4
+ export * from "./PassowrdField.js";
5
+ export * from "./SelectField.js";
6
+ export * from "./SwitchField.js";
7
+ export * from "./TextareaField.js";
8
+ export * from "./TextField.js";
9
+ export * from "./TextPassowrdField.js";
@@ -0,0 +1,12 @@
1
+ import z from 'zod/v4';
2
+ export declare const fieldsSchema: {
3
+ id: z.ZodString;
4
+ str: z.ZodString;
5
+ strArr: z.ZodArray<z.ZodString>;
6
+ strMin3: z.ZodString;
7
+ select: z.ZodString;
8
+ email: z.ZodEmail;
9
+ username: z.ZodString;
10
+ password: z.ZodString;
11
+ kebab: z.ZodString;
12
+ };
@@ -0,0 +1,13 @@
1
+ import v4 from "zod/v4";
2
+ const fieldsSchema = {
3
+ id: v4.string().min(1, 'ID не может быть пустым'),
4
+ str: v4.string().min(1, 'Значение не может быть пустым'),
5
+ strArr: v4.array(v4.string().min(1, 'Значение не может быть пустым')),
6
+ strMin3: v4.string().min(3, 'Должно содержать не менее 3 символов'),
7
+ select: v4.string().min(1, 'Выберите значение'),
8
+ email: v4.email('Неверный формат email'),
9
+ username: v4.string().min(3, 'Должен быть не менее 3 символов').max(24, 'Должен быть не более 24 символов'),
10
+ password: v4.string('Пароль не может быть пустым').min(8, 'Пароль должен содержать не менее 8 символов'),
11
+ kebab: v4.string().min(3, 'Минимум 3 символа').regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Должен быть в формате kebab-case (только строчные буквы, цифры и дефисы)')
12
+ };
13
+ export { fieldsSchema };
@@ -0,0 +1,4 @@
1
+ import { blurOnError } from "./blurOnError.js";
2
+ import { useAppForm, useFieldContext, withForm } from "./context.js";
3
+ import { fieldsSchema } from "./fieldsSchema.js";
4
+ export { blurOnError, fieldsSchema, useAppForm, useFieldContext, withForm };
@@ -0,0 +1,6 @@
1
+ import { type ElementProps, type PaperProps } from '@mantine/core';
2
+ interface Props extends PaperProps, ElementProps<'div', keyof PaperProps> {
3
+ disabled?: boolean;
4
+ }
5
+ export declare const HoverPaper: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Paper } from "@mantine/core";
3
+ import { forwardRef } from "react";
4
+ const HoverPaper = /*#__PURE__*/ forwardRef(({ disabled, classNames, ...props }, ref)=>/*#__PURE__*/ jsx(Paper, {
5
+ ref: ref,
6
+ classNames: {
7
+ root: 'rolder-hover-paper-root',
8
+ ...classNames
9
+ },
10
+ mod: {
11
+ disabled
12
+ },
13
+ ...props
14
+ }));
15
+ export { HoverPaper };
@@ -0,0 +1,3 @@
1
+ import { HoverPaper } from "./HoverPaper.js";
2
+ import { usePaperHover } from "./usePaperHover.js";
3
+ export { HoverPaper, usePaperHover };
@@ -0,0 +1,4 @@
1
+ export declare const usePaperHover: () => {
2
+ paperHovered: boolean;
3
+ paperRef: (node: HTMLDivElement | null) => void;
4
+ };
@@ -0,0 +1,9 @@
1
+ import { useHover } from "@mantine/hooks";
2
+ const usePaperHover = ()=>{
3
+ const { hovered: paperHovered, ref: paperRef } = useHover();
4
+ return {
5
+ paperHovered,
6
+ paperRef
7
+ };
8
+ };
9
+ export { usePaperHover };
@@ -0,0 +1,9 @@
1
+ export * from './AnimatedChevron';
2
+ export * from './editor';
3
+ export * from './error';
4
+ export * from './form';
5
+ export * from './hoverPaper';
6
+ export * from './JsonInput';
7
+ export * from './RouterLink';
8
+ export * from './saveInput';
9
+ export * from './scrollArea';
@@ -0,0 +1,9 @@
1
+ export * from "./AnimatedChevron.js";
2
+ export * from "./editor/index.js";
3
+ export * from "./error/index.js";
4
+ export * from "./form/index.js";
5
+ export * from "./hoverPaper/index.js";
6
+ export * from "./JsonInput.js";
7
+ export * from "./RouterLink.js";
8
+ export * from "./saveInput/index.js";
9
+ export * from "./scrollArea/index.js";
@@ -0,0 +1,6 @@
1
+ import type { ReactCodeMirrorProps } from '@uiw/react-codemirror';
2
+ export declare const JsonInput: ({ initialValue, onChange, debounce, ...props }: {
3
+ initialValue: string;
4
+ onChange: (value: string) => Promise<void>;
5
+ debounce?: number;
6
+ } & Omit<ReactCodeMirrorProps, "value" | "onChange">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Box, Loader } from "@mantine/core";
3
+ import { useDebouncedCallback } from "@mantine/hooks";
4
+ import { useState } from "react";
5
+ import { JsonInput } from "../JsonInput.js";
6
+ const JsonInput_JsonInput = ({ initialValue, onChange, debounce = 300, ...props })=>{
7
+ const [value, setValue] = useState(initialValue);
8
+ const [loading, setLoading] = useState(false);
9
+ const handleSave = useDebouncedCallback(async (content)=>{
10
+ setLoading(true);
11
+ await onChange(content);
12
+ setLoading(false);
13
+ }, debounce);
14
+ return /*#__PURE__*/ jsxs(Box, {
15
+ pos: "relative",
16
+ children: [
17
+ /*#__PURE__*/ jsx(JsonInput, {
18
+ value: value,
19
+ onChange: (e)=>{
20
+ setValue(e);
21
+ handleSave(e);
22
+ },
23
+ ...props
24
+ }),
25
+ loading && /*#__PURE__*/ jsx(Loader, {
26
+ size: "sm",
27
+ pos: "absolute",
28
+ top: 8,
29
+ left: 8
30
+ })
31
+ ]
32
+ });
33
+ };
34
+ export { JsonInput_JsonInput as JsonInput };
@@ -0,0 +1,6 @@
1
+ import { type NumberInputProps } from '@mantine/core';
2
+ export declare const NumberInput: ({ initialValue, onChange, debounce, ...props }: {
3
+ initialValue: string | number;
4
+ onChange: (value: string | number) => Promise<void>;
5
+ debounce?: number;
6
+ } & Omit<NumberInputProps, "value" | "onChange">) => import("react/jsx-runtime").JSX.Element;