@rolder-kit/ui 0.1.0-alpha.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 (97) hide show
  1. package/dist/AnimatedChevron.d.ts +5 -0
  2. package/dist/AnimatedChevron.js +12 -0
  3. package/dist/JsonInput.d.ts +2 -0
  4. package/dist/JsonInput.js +45 -0
  5. package/dist/RouterLink.d.ts +16 -0
  6. package/dist/RouterLink.js +36 -0
  7. package/dist/editor/Content.d.ts +3 -0
  8. package/dist/editor/Content.js +13 -0
  9. package/dist/editor/Root.d.ts +8 -0
  10. package/dist/editor/Root.js +55 -0
  11. package/dist/editor/Toolbar.d.ts +6 -0
  12. package/dist/editor/Toolbar.js +138 -0
  13. package/dist/editor/index.d.ts +8 -0
  14. package/dist/editor/index.js +10 -0
  15. package/dist/editor/store.d.ts +6 -0
  16. package/dist/editor/store.js +10 -0
  17. package/dist/error/DefaultError.d.ts +2 -0
  18. package/dist/error/DefaultError.js +62 -0
  19. package/dist/error/DefaultNotFound.d.ts +1 -0
  20. package/dist/error/DefaultNotFound.js +37 -0
  21. package/dist/error/Forbidden.d.ts +1 -0
  22. package/dist/error/Forbidden.js +32 -0
  23. package/dist/error/defaultErrorNotification.d.ts +1 -0
  24. package/dist/error/defaultErrorNotification.js +8 -0
  25. package/dist/error/index.d.ts +4 -0
  26. package/dist/error/index.js +5 -0
  27. package/dist/form/blurOnError.d.ts +4 -0
  28. package/dist/form/blurOnError.js +11 -0
  29. package/dist/form/buttons/CancelButton.d.ts +5 -0
  30. package/dist/form/buttons/CancelButton.js +22 -0
  31. package/dist/form/buttons/SubmitButton.d.ts +5 -0
  32. package/dist/form/buttons/SubmitButton.js +22 -0
  33. package/dist/form/buttons/SubscribeActionIcon.d.ts +4 -0
  34. package/dist/form/buttons/SubscribeActionIcon.js +15 -0
  35. package/dist/form/buttons/SubscribeButton.d.ts +5 -0
  36. package/dist/form/buttons/SubscribeButton.js +16 -0
  37. package/dist/form/buttons/index.d.ts +4 -0
  38. package/dist/form/buttons/index.js +4 -0
  39. package/dist/form/context.d.ts +83 -0
  40. package/dist/form/context.js +26 -0
  41. package/dist/form/fields/JsonField.d.ts +2 -0
  42. package/dist/form/fields/JsonField.js +13 -0
  43. package/dist/form/fields/MultiSelectField.d.ts +2 -0
  44. package/dist/form/fields/MultiSelectField.js +15 -0
  45. package/dist/form/fields/NumberField.d.ts +2 -0
  46. package/dist/form/fields/NumberField.js +15 -0
  47. package/dist/form/fields/PasswordField.d.ts +2 -0
  48. package/dist/form/fields/PasswordField.js +18 -0
  49. package/dist/form/fields/SelectField.d.ts +2 -0
  50. package/dist/form/fields/SelectField.js +15 -0
  51. package/dist/form/fields/SwitchField.d.ts +2 -0
  52. package/dist/form/fields/SwitchField.js +15 -0
  53. package/dist/form/fields/TextField.d.ts +2 -0
  54. package/dist/form/fields/TextField.js +15 -0
  55. package/dist/form/fields/TextPasswordField.d.ts +2 -0
  56. package/dist/form/fields/TextPasswordField.js +29 -0
  57. package/dist/form/fields/TextareaField.d.ts +2 -0
  58. package/dist/form/fields/TextareaField.js +15 -0
  59. package/dist/form/fields/index.d.ts +9 -0
  60. package/dist/form/fields/index.js +9 -0
  61. package/dist/form/index.d.ts +3 -0
  62. package/dist/form/index.js +4 -0
  63. package/dist/hoverPaper/HoverPaper.d.ts +6 -0
  64. package/dist/hoverPaper/HoverPaper.js +15 -0
  65. package/dist/hoverPaper/index.d.ts +2 -0
  66. package/dist/hoverPaper/index.js +3 -0
  67. package/dist/hoverPaper/usePaperHover.d.ts +4 -0
  68. package/dist/hoverPaper/usePaperHover.js +9 -0
  69. package/dist/index.d.ts +4 -0
  70. package/dist/index.js +4 -0
  71. package/dist/saveInput/JsonInput.d.ts +6 -0
  72. package/dist/saveInput/JsonInput.js +33 -0
  73. package/dist/saveInput/NumberInput.d.ts +6 -0
  74. package/dist/saveInput/NumberInput.js +26 -0
  75. package/dist/saveInput/SaveInput.d.ts +36 -0
  76. package/dist/saveInput/SaveInput.js +15 -0
  77. package/dist/saveInput/Select.d.ts +6 -0
  78. package/dist/saveInput/Select.js +26 -0
  79. package/dist/saveInput/Switch.d.ts +6 -0
  80. package/dist/saveInput/Switch.js +29 -0
  81. package/dist/saveInput/TextInput.d.ts +6 -0
  82. package/dist/saveInput/TextInput.js +25 -0
  83. package/dist/saveInput/Textarea.d.ts +6 -0
  84. package/dist/saveInput/Textarea.js +25 -0
  85. package/dist/saveInput/index.d.ts +1 -0
  86. package/dist/saveInput/index.js +2 -0
  87. package/dist/scrollArea/Root.d.ts +7 -0
  88. package/dist/scrollArea/Root.js +41 -0
  89. package/dist/scrollArea/ScrollButton.d.ts +7 -0
  90. package/dist/scrollArea/ScrollButton.js +30 -0
  91. package/dist/scrollArea/index.d.ts +6 -0
  92. package/dist/scrollArea/index.js +7 -0
  93. package/dist/scrollArea/methods.d.ts +4 -0
  94. package/dist/scrollArea/methods.js +32 -0
  95. package/dist/scrollArea/store.d.ts +12 -0
  96. package/dist/scrollArea/store.js +25 -0
  97. package/package.json +53 -0
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ActionIcon } from "@rolder-kit/mantine";
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 '@rolder-kit/mantine';
2
+ export declare const SubscribeButton: React.FC<ButtonProps & {
3
+ label: string;
4
+ onClick?: () => void;
5
+ }>;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@rolder-kit/mantine";
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';
2
+ export * from './SubmitButton';
3
+ export * from './SubscribeActionIcon';
4
+ export * from './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/react-form").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/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import("@tanstack/react-form").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: import("react").FC<import("@mantine/core").TextInputProps>;
4
+ readonly NumberField: import("react").FC<import("@mantine/core").NumberInputProps>;
5
+ readonly TextareaField: import("react").FC<import("@mantine/core").TextareaProps>;
6
+ readonly TextPasswordField: import("react").FC<import("@mantine/core").TextInputProps>;
7
+ readonly PasswordField: import("react").FC<import("@mantine/core").PasswordInputProps>;
8
+ readonly SelectField: import("react").FC<import("@mantine/core").SelectProps>;
9
+ readonly MultiSelectField: import("react").FC<import("@mantine/core").MultiSelectProps>;
10
+ readonly SwitchField: import("react").FC<import("@mantine/core").SwitchProps>;
11
+ readonly JsonField: import("react").FC<import("@uiw/react-codemirror").ReactCodeMirrorProps>;
12
+ }, {
13
+ readonly SubmitButton: import("react").FC<import("@mantine/core").ButtonProps & {
14
+ label?: string;
15
+ onClick?: () => void;
16
+ }>;
17
+ readonly CancelButton: import("react").FC<import("@mantine/core").ButtonProps & {
18
+ label?: string;
19
+ onClick?: () => void;
20
+ }>;
21
+ readonly SubscribeButton: import("react").FC<import("@mantine/core").ButtonProps & {
22
+ label: string;
23
+ onClick?: () => void;
24
+ }>;
25
+ readonly SubscribeActionIcon: import("react").FC<import("@mantine/core").ActionIconProps & {
26
+ onClick?: () => void;
27
+ }>;
28
+ }>, withForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").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: import("react").FC<import("@mantine/core").TextInputProps>;
30
+ readonly NumberField: import("react").FC<import("@mantine/core").NumberInputProps>;
31
+ readonly TextareaField: import("react").FC<import("@mantine/core").TextareaProps>;
32
+ readonly TextPasswordField: import("react").FC<import("@mantine/core").TextInputProps>;
33
+ readonly PasswordField: import("react").FC<import("@mantine/core").PasswordInputProps>;
34
+ readonly SelectField: import("react").FC<import("@mantine/core").SelectProps>;
35
+ readonly MultiSelectField: import("react").FC<import("@mantine/core").MultiSelectProps>;
36
+ readonly SwitchField: import("react").FC<import("@mantine/core").SwitchProps>;
37
+ readonly JsonField: import("react").FC<import("@uiw/react-codemirror").ReactCodeMirrorProps>;
38
+ }, {
39
+ readonly SubmitButton: import("react").FC<import("@mantine/core").ButtonProps & {
40
+ label?: string;
41
+ onClick?: () => void;
42
+ }>;
43
+ readonly CancelButton: import("react").FC<import("@mantine/core").ButtonProps & {
44
+ label?: string;
45
+ onClick?: () => void;
46
+ }>;
47
+ readonly SubscribeButton: import("react").FC<import("@mantine/core").ButtonProps & {
48
+ label: string;
49
+ onClick?: () => void;
50
+ }>;
51
+ readonly SubscribeActionIcon: import("react").FC<import("@mantine/core").ActionIconProps & {
52
+ onClick?: () => void;
53
+ }>;
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/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
56
+ readonly TextField: import("react").FC<import("@mantine/core").TextInputProps>;
57
+ readonly NumberField: import("react").FC<import("@mantine/core").NumberInputProps>;
58
+ readonly TextareaField: import("react").FC<import("@mantine/core").TextareaProps>;
59
+ readonly TextPasswordField: import("react").FC<import("@mantine/core").TextInputProps>;
60
+ readonly PasswordField: import("react").FC<import("@mantine/core").PasswordInputProps>;
61
+ readonly SelectField: import("react").FC<import("@mantine/core").SelectProps>;
62
+ readonly MultiSelectField: import("react").FC<import("@mantine/core").MultiSelectProps>;
63
+ readonly SwitchField: import("react").FC<import("@mantine/core").SwitchProps>;
64
+ readonly JsonField: import("react").FC<import("@uiw/react-codemirror").ReactCodeMirrorProps>;
65
+ }, {
66
+ readonly SubmitButton: import("react").FC<import("@mantine/core").ButtonProps & {
67
+ label?: string;
68
+ onClick?: () => void;
69
+ }>;
70
+ readonly CancelButton: import("react").FC<import("@mantine/core").ButtonProps & {
71
+ label?: string;
72
+ onClick?: () => void;
73
+ }>;
74
+ readonly SubscribeButton: import("react").FC<import("@mantine/core").ButtonProps & {
75
+ label: string;
76
+ onClick?: () => void;
77
+ }>;
78
+ readonly SubscribeActionIcon: import("react").FC<import("@mantine/core").ActionIconProps & {
79
+ onClick?: () => void;
80
+ }>;
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, PasswordField, SelectField, SwitchField, TextField, TextPasswordField, 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
+ TextPasswordField: TextPasswordField,
11
+ PasswordField: PasswordField,
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: React.FC<ReactCodeMirrorProps>;
@@ -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 '@rolder-kit/mantine';
2
+ export declare const MultiSelectField: React.FC<MultiSelectProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { MultiSelect } from "@rolder-kit/mantine";
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 '@rolder-kit/mantine';
2
+ export declare const NumberField: React.FC<NumberInputProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { NumberInput } from "@rolder-kit/mantine";
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 '@rolder-kit/mantine';
2
+ export declare const PasswordField: React.FC<PasswordInputProps>;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { PasswordInput } from "@rolder-kit/mantine";
3
+ import { useFieldContext } from "../context.js";
4
+ const PasswordField = (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 { PasswordField };
@@ -0,0 +1,2 @@
1
+ import { type SelectProps } from '@rolder-kit/mantine';
2
+ export declare const SelectField: React.FC<SelectProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Select } from "@rolder-kit/mantine";
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 '@rolder-kit/mantine';
2
+ export declare const SwitchField: React.FC<SwitchProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Switch } from "@rolder-kit/mantine";
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 '@rolder-kit/mantine';
2
+ export declare const TextField: React.FC<TextInputProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TextInput } from "@rolder-kit/mantine";
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 '@rolder-kit/mantine';
2
+ export declare const TextPasswordField: React.FC<TextInputProps>;
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ActionIcon, TextInput } from "@rolder-kit/mantine";
3
+ import { IconRefresh } from "@tabler/icons-react";
4
+ import omgopass from "omgopass";
5
+ import { useFieldContext } from "../context.js";
6
+ const TextPasswordField = (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 { TextPasswordField };
@@ -0,0 +1,2 @@
1
+ import { type TextareaProps } from '@rolder-kit/mantine';
2
+ export declare const TextareaField: React.FC<TextareaProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Textarea } from "@rolder-kit/mantine";
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';
2
+ export * from './MultiSelectField';
3
+ export * from './NumberField';
4
+ export * from './PasswordField';
5
+ export * from './SelectField';
6
+ export * from './SwitchField';
7
+ export * from './TextareaField';
8
+ export * from './TextField';
9
+ export * from './TextPasswordField';
@@ -0,0 +1,9 @@
1
+ export * from "./JsonField.js";
2
+ export * from "./MultiSelectField.js";
3
+ export * from "./NumberField.js";
4
+ export * from "./PasswordField.js";
5
+ export * from "./SelectField.js";
6
+ export * from "./SwitchField.js";
7
+ export * from "./TextareaField.js";
8
+ export * from "./TextField.js";
9
+ export * from "./TextPasswordField.js";
@@ -0,0 +1,3 @@
1
+ export * from '@tanstack/react-form';
2
+ export { blurOnError } from './blurOnError';
3
+ export { useAppForm, useFieldContext, withForm } from './context';
@@ -0,0 +1,4 @@
1
+ import { blurOnError } from "./blurOnError.js";
2
+ import { useAppForm, useFieldContext, withForm } from "./context.js";
3
+ export * from "@tanstack/react-form";
4
+ export { blurOnError, useAppForm, useFieldContext, withForm };
@@ -0,0 +1,6 @@
1
+ import { type ElementProps, type PaperProps } from '@rolder-kit/mantine';
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 "@rolder-kit/mantine";
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,2 @@
1
+ export { HoverPaper } from './HoverPaper';
2
+ export { usePaperHover } from './usePaperHover';
@@ -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 "@rolder-kit/mantine";
2
+ const usePaperHover = ()=>{
3
+ const { hovered: paperHovered, ref: paperRef } = useHover();
4
+ return {
5
+ paperHovered,
6
+ paperRef
7
+ };
8
+ };
9
+ export { usePaperHover };
@@ -0,0 +1,4 @@
1
+ export * from './AnimatedChevron';
2
+ export * from './JsonInput';
3
+ export * from './RouterLink';
4
+ export * from './scrollArea';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./AnimatedChevron.js";
2
+ export * from "./JsonInput.js";
3
+ export * from "./RouterLink.js";
4
+ export * from "./scrollArea/index.js";
@@ -0,0 +1,6 @@
1
+ import type { ReactCodeMirrorProps } from '@uiw/react-codemirror';
2
+ export declare const JsonInput: React.FC<{
3
+ initialValue: string;
4
+ onChange: (value: string) => Promise<void>;
5
+ debounce?: number;
6
+ } & Omit<ReactCodeMirrorProps, 'value' | 'onChange'>>;
@@ -0,0 +1,33 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Box, Loader, useDebouncedCallback } from "@rolder-kit/mantine";
3
+ import { useState } from "react";
4
+ import { JsonInput } from "../JsonInput.js";
5
+ const JsonInput_JsonInput = ({ initialValue, onChange, debounce = 300, ...props })=>{
6
+ const [value, setValue] = useState(initialValue);
7
+ const [loading, setLoading] = useState(false);
8
+ const handleSave = useDebouncedCallback(async (content)=>{
9
+ setLoading(true);
10
+ await onChange(content);
11
+ setLoading(false);
12
+ }, debounce);
13
+ return /*#__PURE__*/ jsxs(Box, {
14
+ pos: "relative",
15
+ children: [
16
+ /*#__PURE__*/ jsx(JsonInput, {
17
+ value: value,
18
+ onChange: (e)=>{
19
+ setValue(e);
20
+ handleSave(e);
21
+ },
22
+ ...props
23
+ }),
24
+ loading && /*#__PURE__*/ jsx(Loader, {
25
+ size: "sm",
26
+ pos: "absolute",
27
+ top: 8,
28
+ left: 8
29
+ })
30
+ ]
31
+ });
32
+ };
33
+ export { JsonInput_JsonInput as JsonInput };
@@ -0,0 +1,6 @@
1
+ import { type NumberInputProps } from '@rolder-kit/mantine';
2
+ export declare const NumberInput: React.FC<{
3
+ initialValue: string | number;
4
+ onChange: (value: string | number) => Promise<void>;
5
+ debounce?: number;
6
+ } & Omit<NumberInputProps, 'value' | 'onChange'>>;
@@ -0,0 +1,26 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Loader, NumberInput, useDebouncedCallback } from "@rolder-kit/mantine";
3
+ import { useState } from "react";
4
+ const NumberInput_NumberInput = ({ initialValue, onChange, debounce = 300, ...props })=>{
5
+ const [value, setValue] = useState(initialValue);
6
+ const [loading, setLoading] = useState(false);
7
+ const handleSave = useDebouncedCallback(async (content)=>{
8
+ setLoading(true);
9
+ await onChange(content);
10
+ setLoading(false);
11
+ }, debounce);
12
+ return /*#__PURE__*/ jsx(NumberInput, {
13
+ value: value,
14
+ onChange: (v)=>{
15
+ setValue(v);
16
+ handleSave(v);
17
+ },
18
+ flex: props.w ? void 0 : 1,
19
+ rightSection: loading ? /*#__PURE__*/ jsx(Loader, {
20
+ size: "sm",
21
+ mr: 8
22
+ }) : void 0,
23
+ ...props
24
+ });
25
+ };
26
+ export { NumberInput_NumberInput as NumberInput };
@@ -0,0 +1,36 @@
1
+ export declare const SaveInput: import("react").FC<{
2
+ initialValue?: string;
3
+ onChange: (value: string) => Promise<void>;
4
+ debounce?: number;
5
+ } & Omit<import("@mantine/core").TextInputProps, "onChange" | "value">> & {
6
+ TextInput: import("react").FC<{
7
+ initialValue?: string;
8
+ onChange: (value: string) => Promise<void>;
9
+ debounce?: number;
10
+ } & Omit<import("@mantine/core").TextInputProps, "onChange" | "value">>;
11
+ NumberInput: import("react").FC<{
12
+ initialValue: string | number;
13
+ onChange: (value: string | number) => Promise<void>;
14
+ debounce?: number;
15
+ } & Omit<import("@mantine/core").NumberInputProps, "onChange" | "value">>;
16
+ Textarea: import("react").FC<{
17
+ initialValue: string;
18
+ onChange: (value: string) => Promise<void>;
19
+ debounce?: number;
20
+ } & Omit<import("@mantine/core").TextareaProps, "onChange" | "value">>;
21
+ Switch: import("react").FC<{
22
+ initialValue: boolean;
23
+ onChange: (value: boolean) => Promise<void>;
24
+ debounce?: number;
25
+ } & Omit<import("@mantine/core").SwitchProps, "onChange" | "checked">>;
26
+ JsonInput: import("react").FC<{
27
+ initialValue: string;
28
+ onChange: (value: string) => Promise<void>;
29
+ debounce?: number;
30
+ } & Omit<import("@uiw/react-codemirror").ReactCodeMirrorProps, "onChange" | "value">>;
31
+ Select: import("react").FC<{
32
+ initialValue: string | null;
33
+ onChange: (value: string | null) => Promise<void>;
34
+ debounce?: number;
35
+ } & Omit<import("@mantine/core").SelectProps, "onChange" | "value">>;
36
+ };
@@ -0,0 +1,15 @@
1
+ import { JsonInput } from "./JsonInput.js";
2
+ import { NumberInput } from "./NumberInput.js";
3
+ import { Select } from "./Select.js";
4
+ import { Switch } from "./Switch.js";
5
+ import { Textarea } from "./Textarea.js";
6
+ import { TextInput } from "./TextInput.js";
7
+ const SaveInput = Object.assign(TextInput, {
8
+ TextInput: TextInput,
9
+ NumberInput: NumberInput,
10
+ Textarea: Textarea,
11
+ Switch: Switch,
12
+ JsonInput: JsonInput,
13
+ Select: Select
14
+ });
15
+ export { SaveInput };
@@ -0,0 +1,6 @@
1
+ import { type SelectProps } from '@rolder-kit/mantine';
2
+ export declare const Select: React.FC<{
3
+ initialValue: string | null;
4
+ onChange: (value: string | null) => Promise<void>;
5
+ debounce?: number;
6
+ } & Omit<SelectProps, 'value' | 'onChange'>>;