@rolder/kit 3.0.0-alpha-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/functions/cookies/getCookie.d.ts +3 -0
- package/dist/functions/cookies/getCookie.js +8 -0
- package/dist/functions/cookies/index.d.ts +3 -0
- package/dist/functions/cookies/index.js +3 -0
- package/dist/functions/cookies/setCookie.d.ts +10 -0
- package/dist/functions/cookies/setCookie.js +19 -0
- package/dist/functions/cookies/setCookies.d.ts +14 -0
- package/dist/functions/cookies/setCookies.js +13 -0
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/ui/AnimatedChevron.d.ts +6 -0
- package/dist/ui/AnimatedChevron.js +13 -0
- package/dist/ui/JsonInput.d.ts +2 -0
- package/dist/ui/JsonInput.js +45 -0
- package/dist/ui/editor/Content.d.ts +3 -0
- package/dist/ui/editor/Content.js +13 -0
- package/dist/ui/editor/Provider.d.ts +17 -0
- package/dist/ui/editor/Provider.js +80 -0
- package/dist/ui/editor/Root.d.ts +2 -0
- package/dist/ui/editor/Root.js +19 -0
- package/dist/ui/editor/Toolbar.d.ts +5 -0
- package/dist/ui/editor/Toolbar.js +138 -0
- package/dist/ui/editor/index.d.ts +12 -0
- package/dist/ui/editor/index.js +11 -0
- package/dist/ui/editor/types.d.ts +7 -0
- package/dist/ui/editor/types.js +0 -0
- package/dist/ui/form/blurOnError.d.ts +4 -0
- package/dist/ui/form/blurOnError.js +11 -0
- package/dist/ui/form/buttons/CancelButton.d.ts +5 -0
- package/dist/ui/form/buttons/CancelButton.js +22 -0
- package/dist/ui/form/buttons/SubmitButton.d.ts +5 -0
- package/dist/ui/form/buttons/SubmitButton.js +22 -0
- package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +4 -0
- package/dist/ui/form/buttons/SubscribeActionIcon.js +15 -0
- package/dist/ui/form/buttons/SubscribeButton.d.ts +5 -0
- package/dist/ui/form/buttons/SubscribeButton.js +16 -0
- package/dist/ui/form/buttons/index.d.ts +4 -0
- package/dist/ui/form/buttons/index.js +4 -0
- package/dist/ui/form/context.d.ts +83 -0
- package/dist/ui/form/context.js +26 -0
- package/dist/ui/form/fields/JsonField.d.ts +2 -0
- package/dist/ui/form/fields/JsonField.js +13 -0
- package/dist/ui/form/fields/MultiSelectField.d.ts +2 -0
- package/dist/ui/form/fields/MultiSelectField.js +15 -0
- package/dist/ui/form/fields/NumberField.d.ts +2 -0
- package/dist/ui/form/fields/NumberField.js +15 -0
- package/dist/ui/form/fields/PassowrdField.d.ts +2 -0
- package/dist/ui/form/fields/PassowrdField.js +18 -0
- package/dist/ui/form/fields/SelectField.d.ts +2 -0
- package/dist/ui/form/fields/SelectField.js +15 -0
- package/dist/ui/form/fields/SwitchField.d.ts +2 -0
- package/dist/ui/form/fields/SwitchField.js +15 -0
- package/dist/ui/form/fields/TextField.d.ts +2 -0
- package/dist/ui/form/fields/TextField.js +15 -0
- package/dist/ui/form/fields/TextPassowrdField.d.ts +2 -0
- package/dist/ui/form/fields/TextPassowrdField.js +29 -0
- package/dist/ui/form/fields/TextareaField.d.ts +2 -0
- package/dist/ui/form/fields/TextareaField.js +15 -0
- package/dist/ui/form/fields/index.d.ts +9 -0
- package/dist/ui/form/fields/index.js +9 -0
- package/dist/ui/form/fieldsSchema.d.ts +12 -0
- package/dist/ui/form/fieldsSchema.js +13 -0
- package/dist/ui/form/index.d.ts +3 -0
- package/dist/ui/form/index.js +4 -0
- package/dist/ui/hoverActionIcon/HoverActionIcon.d.ts +6 -0
- package/dist/ui/hoverActionIcon/HoverActionIcon.js +14 -0
- package/dist/ui/hoverActionIcon/index.d.ts +1 -0
- package/dist/ui/hoverActionIcon/index.js +1 -0
- package/dist/ui/hoverPaper/HoverPaper.d.ts +6 -0
- package/dist/ui/hoverPaper/HoverPaper.js +16 -0
- package/dist/ui/hoverPaper/index.d.ts +2 -0
- package/dist/ui/hoverPaper/index.js +2 -0
- package/dist/ui/hoverPaper/usePaperHover.d.ts +4 -0
- package/dist/ui/hoverPaper/usePaperHover.js +9 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/routerLink/RouterLink.d.ts +16 -0
- package/dist/ui/routerLink/RouterLink.js +37 -0
- package/dist/ui/routerLink/index.d.ts +1 -0
- package/dist/ui/routerLink/index.js +1 -0
- package/dist/ui/saveInput/JsonInput.d.ts +6 -0
- package/dist/ui/saveInput/JsonInput.js +34 -0
- package/dist/ui/saveInput/NumberInput.d.ts +6 -0
- package/dist/ui/saveInput/NumberInput.js +27 -0
- package/dist/ui/saveInput/SaveInput.d.ts +36 -0
- package/dist/ui/saveInput/SaveInput.js +15 -0
- package/dist/ui/saveInput/Select.d.ts +6 -0
- package/dist/ui/saveInput/Select.js +27 -0
- package/dist/ui/saveInput/Switch.d.ts +6 -0
- package/dist/ui/saveInput/Switch.js +30 -0
- package/dist/ui/saveInput/TextInput.d.ts +6 -0
- package/dist/ui/saveInput/TextInput.js +26 -0
- package/dist/ui/saveInput/Textarea.d.ts +6 -0
- package/dist/ui/saveInput/Textarea.js +26 -0
- package/dist/ui/saveInput/index.d.ts +1 -0
- package/dist/ui/saveInput/index.js +2 -0
- package/dist/ui/scrollArea/ScrollArea.d.ts +62 -0
- package/dist/ui/scrollArea/ScrollArea.js +30 -0
- package/dist/ui/scrollArea/ScrollAreaButton.d.ts +5 -0
- package/dist/ui/scrollArea/ScrollAreaButton.js +30 -0
- package/dist/ui/scrollArea/ScrollAreaContent.d.ts +6 -0
- package/dist/ui/scrollArea/ScrollAreaContent.js +30 -0
- package/dist/ui/scrollArea/context.d.ts +28 -0
- package/dist/ui/scrollArea/context.js +10 -0
- package/dist/ui/scrollArea/index.d.ts +3 -0
- package/dist/ui/scrollArea/index.js +3 -0
- package/dist/ui/scrollArea/types.d.ts +65 -0
- package/dist/ui/scrollArea/types.js +0 -0
- package/dist/ui/scrollArea/useScrollArea.d.ts +9 -0
- package/dist/ui/scrollArea/useScrollArea.js +146 -0
- package/package.json +59 -0
|
@@ -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,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,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,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,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,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,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,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,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,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';
|
|
2
|
+
export * from './MultiSelectField';
|
|
3
|
+
export * from './NumberField';
|
|
4
|
+
export * from './PassowrdField';
|
|
5
|
+
export * from './SelectField';
|
|
6
|
+
export * from './SwitchField';
|
|
7
|
+
export * from './TextareaField';
|
|
8
|
+
export * from './TextField';
|
|
9
|
+
export * from './TextPassowrdField';
|
|
@@ -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,6 @@
|
|
|
1
|
+
import { type ActionIconProps, type ElementProps } from '@mantine/core';
|
|
2
|
+
interface Props extends ActionIconProps, ElementProps<'button', keyof ActionIconProps> {
|
|
3
|
+
hovered?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const HoverActionIcon: ({ hovered, classNames, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionIcon } from "@mantine/core";
|
|
3
|
+
import styles_module from "./styles.module.js";
|
|
4
|
+
const HoverActionIcon = ({ hovered, classNames, ...props })=>/*#__PURE__*/ jsx(ActionIcon, {
|
|
5
|
+
classNames: {
|
|
6
|
+
root: styles_module.root,
|
|
7
|
+
...classNames
|
|
8
|
+
},
|
|
9
|
+
mod: {
|
|
10
|
+
hovered
|
|
11
|
+
},
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
export { HoverActionIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HoverActionIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./HoverActionIcon.js";
|
|
@@ -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,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Paper } from "@mantine/core";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import styles_module from "./styles.module.js";
|
|
5
|
+
const HoverPaper = /*#__PURE__*/ forwardRef(({ disabled, classNames, ...props }, ref)=>/*#__PURE__*/ jsx(Paper, {
|
|
6
|
+
ref: ref,
|
|
7
|
+
classNames: {
|
|
8
|
+
root: styles_module.root,
|
|
9
|
+
...classNames
|
|
10
|
+
},
|
|
11
|
+
mod: {
|
|
12
|
+
disabled
|
|
13
|
+
},
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
export { HoverPaper };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './AnimatedChevron';
|
|
2
|
+
export * from './editor';
|
|
3
|
+
export * from './form';
|
|
4
|
+
export * from './hoverActionIcon';
|
|
5
|
+
export * from './hoverPaper';
|
|
6
|
+
export * from './JsonInput';
|
|
7
|
+
export * from './routerLink';
|
|
8
|
+
export * from './saveInput';
|
|
9
|
+
export * from './scrollArea';
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./AnimatedChevron.js";
|
|
2
|
+
export * from "./editor/index.js";
|
|
3
|
+
export * from "./form/index.js";
|
|
4
|
+
export * from "./hoverActionIcon/index.js";
|
|
5
|
+
export * from "./hoverPaper/index.js";
|
|
6
|
+
export * from "./JsonInput.js";
|
|
7
|
+
export * from "./routerLink/index.js";
|
|
8
|
+
export * from "./saveInput/index.js";
|
|
9
|
+
export * from "./scrollArea/index.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ActionIconProps, type AnchorProps, type ButtonProps, type UnstyledButtonProps } from '@mantine/core';
|
|
2
|
+
import { type LinkComponent } from '@tanstack/react-router';
|
|
3
|
+
interface MantineAnchorProps extends Omit<AnchorProps, 'href'> {
|
|
4
|
+
}
|
|
5
|
+
interface MantineButtonProps extends Omit<ButtonProps, 'href'> {
|
|
6
|
+
}
|
|
7
|
+
interface MantineActionIconProps extends Omit<ActionIconProps, 'href'> {
|
|
8
|
+
}
|
|
9
|
+
interface MantineUnstyledButtonProps extends Omit<UnstyledButtonProps, 'href'> {
|
|
10
|
+
}
|
|
11
|
+
export declare const RouterLink: LinkComponent<import("react").ForwardRefExoticComponent<MantineAnchorProps & import("react").RefAttributes<HTMLAnchorElement>>> & {
|
|
12
|
+
Button: LinkComponent<import("react").ForwardRefExoticComponent<MantineButtonProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
13
|
+
ActionIcon: LinkComponent<import("react").ForwardRefExoticComponent<MantineActionIconProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
14
|
+
UnstyledButton: LinkComponent<import("react").ForwardRefExoticComponent<MantineUnstyledButtonProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionIcon, Anchor, Button, UnstyledButton } from "@mantine/core";
|
|
3
|
+
import { createLink } from "@tanstack/react-router";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import styles_module from "./styles.module.js";
|
|
6
|
+
const MantineLinkComponent = /*#__PURE__*/ forwardRef(({ classNames, ...props }, ref)=>/*#__PURE__*/ jsx(Anchor, {
|
|
7
|
+
ref: ref,
|
|
8
|
+
classNames: {
|
|
9
|
+
root: styles_module.root,
|
|
10
|
+
...classNames
|
|
11
|
+
},
|
|
12
|
+
c: "inherit",
|
|
13
|
+
underline: "never",
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
const MantineButtonComponent = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Button, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
...props
|
|
19
|
+
}));
|
|
20
|
+
const MantineActionIconComponent = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(ActionIcon, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
...props
|
|
23
|
+
}));
|
|
24
|
+
const MantineUnstyledButtonComponent = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(UnstyledButton, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
...props
|
|
27
|
+
}));
|
|
28
|
+
const RouterLinkBase = createLink(MantineLinkComponent);
|
|
29
|
+
const RouterLinkButton = createLink(MantineButtonComponent);
|
|
30
|
+
const RouterLinkActionIcon = createLink(MantineActionIconComponent);
|
|
31
|
+
const RouterLinkUnstyledButton = createLink(MantineUnstyledButtonComponent);
|
|
32
|
+
const RouterLink = Object.assign(RouterLinkBase, {
|
|
33
|
+
Button: RouterLinkButton,
|
|
34
|
+
ActionIcon: RouterLinkActionIcon,
|
|
35
|
+
UnstyledButton: RouterLinkUnstyledButton
|
|
36
|
+
});
|
|
37
|
+
export { RouterLink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RouterLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RouterLink.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;
|