react-luna-form 0.0.4 → 0.0.6

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 (89) hide show
  1. package/dist/client/cjs/index.js +1 -1
  2. package/dist/client/esm/index.js +1 -1
  3. package/dist/config/cjs/index.js +1 -1
  4. package/dist/config/esm/index.js +1 -1
  5. package/dist/server/cjs/index.js +1 -1
  6. package/dist/server/esm/index.js +1 -1
  7. package/dist/types/{config → luna-core/src}/fetcher.d.ts +1 -1
  8. package/dist/types/luna-core/src/handle/proxy-event.d.ts +5 -0
  9. package/dist/types/luna-core/src/handle/source-event.d.ts +2 -0
  10. package/dist/types/luna-core/src/handle/value-event.d.ts +2 -0
  11. package/dist/types/luna-core/src/helper/input.d.ts +41 -0
  12. package/dist/types/luna-core/src/index.d.ts +19 -0
  13. package/dist/types/{type.d.ts → luna-core/src/type.d.ts} +61 -25
  14. package/dist/types/luna-core/src/util/build.d.ts +5 -0
  15. package/dist/types/{util → luna-core/src/util}/constant.d.ts +19 -4
  16. package/dist/types/{util → luna-core/src/util}/extract.d.ts +9 -1
  17. package/dist/types/luna-core/src/util/is-input.d.ts +17 -0
  18. package/dist/types/luna-core/src/util/is-type.d.ts +6 -0
  19. package/dist/types/luna-core/src/util/prepare.d.ts +4 -0
  20. package/dist/types/luna-core/src/util/schema.d.ts +14 -0
  21. package/dist/types/luna-core/src/util/source.d.ts +2 -0
  22. package/dist/types/luna-core/src/util/string.d.ts +7 -0
  23. package/dist/types/luna-core/src/util/stringify.d.ts +1 -0
  24. package/dist/types/luna-core/src/util/url.d.ts +10 -0
  25. package/dist/types/luna-react/src/client/component/form.d.ts +14 -0
  26. package/dist/types/{client → luna-react/src/client}/component/input.d.ts +4 -5
  27. package/dist/types/{component/slot → luna-react/src/client/component}/slot.d.ts +2 -1
  28. package/dist/types/{client/component/wrapper/field.d.ts → luna-react/src/client/component/wrapper/index.d.ts} +1 -2
  29. package/dist/types/luna-react/src/client/hook/use-data-source.d.ts +3 -0
  30. package/dist/types/luna-react/src/client/hook/use-fetch.d.ts +3 -0
  31. package/dist/types/luna-react/src/client/hook/use-form-action.d.ts +14 -0
  32. package/dist/types/{client/hook/useInput.d.ts → luna-react/src/client/hook/use-input.d.ts} +1 -1
  33. package/dist/types/{client/hook/useSchema.d.ts → luna-react/src/client/hook/use-schema.d.ts} +1 -1
  34. package/dist/types/luna-react/src/client/hook/use-store.d.ts +1 -0
  35. package/dist/types/luna-react/src/client/hook/use-timeout.d.ts +1 -0
  36. package/dist/types/{client → luna-react/src/client}/index.d.ts +1 -1
  37. package/dist/types/luna-react/src/client/lib/error-store.d.ts +10 -0
  38. package/dist/types/luna-react/src/client/lib/source-store.d.ts +8 -0
  39. package/dist/types/luna-react/src/client/lib/store-helper.d.ts +21 -0
  40. package/dist/types/luna-react/src/client/lib/value-store.d.ts +13 -0
  41. package/dist/types/{component → luna-react/src/component}/column.d.ts +1 -2
  42. package/dist/types/{component → luna-react/src/component}/description.d.ts +1 -1
  43. package/dist/types/luna-react/src/component/field/field-base.d.ts +10 -0
  44. package/dist/types/{component → luna-react/src/component/field}/field-error.d.ts +1 -1
  45. package/dist/types/luna-react/src/component/field/field-group.d.ts +8 -0
  46. package/dist/types/luna-react/src/component/field/field-horizontal.d.ts +6 -0
  47. package/dist/types/{component → luna-react/src/component/field}/field-set.d.ts +2 -2
  48. package/dist/types/luna-react/src/component/field/field-vertical.d.ts +6 -0
  49. package/dist/types/{component → luna-react/src/component/field}/field.d.ts +2 -2
  50. package/dist/types/{component → luna-react/src/component}/form.d.ts +4 -1
  51. package/dist/types/luna-react/src/component/formatted-description.d.ts +3 -0
  52. package/dist/types/{component → luna-react/src/component}/group.d.ts +1 -0
  53. package/dist/types/{component → luna-react/src/component}/input/input-attributes.d.ts +1 -1
  54. package/dist/types/{component → luna-react/src/component}/input/input-base.d.ts +2 -2
  55. package/dist/types/{component → luna-react/src/component}/input/input-common.d.ts +1 -1
  56. package/dist/types/{component → luna-react/src/component}/input/input-option-select.d.ts +1 -1
  57. package/dist/types/luna-react/src/component/input-group.d.ts +5 -0
  58. package/dist/types/luna-react/src/component/input-label.d.ts +5 -0
  59. package/dist/types/{component → luna-react/src/component}/label.d.ts +2 -2
  60. package/dist/types/{component → luna-react/src/component}/slot/slot-base.d.ts +3 -3
  61. package/dist/types/{client/component → luna-react/src/component/slot}/slot.d.ts +2 -2
  62. package/dist/types/luna-react/src/config/index.d.ts +28 -0
  63. package/dist/types/luna-react/src/lib/render-If-exists.d.ts +1 -0
  64. package/dist/types/luna-react/src/lib/string.d.ts +1 -0
  65. package/dist/types/{server → luna-react/src/server}/component/fallback.d.ts +2 -1
  66. package/dist/types/{client → luna-react/src/server}/component/form.d.ts +3 -2
  67. package/dist/types/{server → luna-react/src/server}/component/input.d.ts +3 -2
  68. package/dist/types/{server → luna-react/src/server}/index.d.ts +1 -1
  69. package/dist/types/luna-react/src/type.d.ts +16 -0
  70. package/package.json +6 -4
  71. package/dist/types/client/component/wrapper/column.d.ts +0 -5
  72. package/dist/types/client/hook/useDataSource.d.ts +0 -2
  73. package/dist/types/client/hook/useFormAction.d.ts +0 -2
  74. package/dist/types/client/lib/error-store.d.ts +0 -7
  75. package/dist/types/config/index.d.ts +0 -9
  76. package/dist/types/server/component/form.d.ts +0 -9
  77. package/dist/types/util/build.d.ts +0 -4
  78. package/dist/types/util/helper/input.d.ts +0 -11
  79. package/dist/types/util/is-input.d.ts +0 -13
  80. package/dist/types/util/is-type.d.ts +0 -3
  81. package/dist/types/util/prepare.d.ts +0 -3
  82. package/dist/types/util/schema.d.ts +0 -12
  83. /package/dist/types/{util → luna-core/src/util}/attributes.d.ts +0 -0
  84. /package/dist/types/{util → luna-core/src/util}/column.d.ts +0 -0
  85. /package/dist/types/{util → luna-core/src/util}/date.d.ts +0 -0
  86. /package/dist/types/{client → luna-react/src/client}/component/wrapper/with-error.d.ts +0 -0
  87. /package/dist/types/{component → luna-react/src/component}/control.d.ts +0 -0
  88. /package/dist/types/{component → luna-react/src/component}/legend.d.ts +0 -0
  89. /package/dist/types/{component → luna-react/src/component}/separator.d.ts +0 -0
@@ -1,14 +1,22 @@
1
1
  export declare const INPUT = "input";
2
2
  export declare const INPUT_EMAIL = "input/email";
3
3
  export declare const INPUT_NUMBER = "input/number";
4
- export declare const INPUT_TEXTAREA = "textarea";
5
- export declare const COLUMN = "column";
6
- export declare const FIELDS = "fields";
4
+ export declare const INPUT_PASSWORD = "input/password";
5
+ export declare const INPUT_TEL = "input/tel";
6
+ export declare const INPUT_TEXT = "input/text";
7
+ export declare const INPUTS: string[];
8
+ export declare const TEXTAREA = "textarea";
7
9
  export declare const RADIO = "radio";
8
- export declare const VALUE = "value";
10
+ export declare const CHECKBOX = "checkbox";
9
11
  export declare const SELECT = "select";
10
12
  export declare const SELECT_MONTH = "select/month";
11
13
  export declare const SELECT_YEAR = "select/year";
14
+ export declare const SELECTS: string[];
15
+ export declare const COLUMN = "column";
16
+ export declare const FIELDS = "fields";
17
+ export declare const LABEL = "label";
18
+ export declare const VALUE = "value";
19
+ export declare const OPTIONS = "options";
12
20
  export declare const TYPE_EMAIL = "email";
13
21
  export declare const TYPE_NUMBER = "number";
14
22
  export declare const TYPE_PASSWORD = "password";
@@ -17,9 +25,16 @@ export declare const TYPE_TEXT = "text";
17
25
  export declare const ARIA_ERROR_MESSAGE = "aria-errormessage";
18
26
  export declare const ARIA_INVALID = "aria-invalid";
19
27
  export declare const DATA_INVALID = "data-invalid";
28
+ export declare const DATA_READONLY = "data-readonly";
20
29
  export declare const PREFIX_ARIA = "aria";
21
30
  export declare const PREFIX_DATA = "data";
22
31
  export declare const MIN = "min";
23
32
  export declare const MAX = "max";
24
33
  export declare const MIN_LENGTH = "minLength";
25
34
  export declare const MAX_LENGTH = "maxLength";
35
+ export declare const $REF = "$ref";
36
+ export declare const SOURCE = "source";
37
+ export declare const SET = "set";
38
+ export declare const COMMON_URL = "http://luna.internal";
39
+ export declare const VERTICAL = "vertical";
40
+ export declare const HORIZONTAL = "horizontal";
@@ -1,6 +1,14 @@
1
- import type { Nullable, Value } from '../type';
1
+ import type { Nullable, Option, Value } from '../type';
2
+ export declare function getEntity<T>(selected: string, collection?: Nullable<T[]>, entity?: string): NonNullable<T> | {
3
+ value: string;
4
+ } | undefined;
2
5
  export declare function getCurrentValue<T>(value: T, entity?: string): Value | undefined;
3
6
  export declare function getValue<T>(value: Record<string, T>, namespace?: string): T | undefined;
4
7
  export declare function getArray<T>(value: Record<string, T> | T[], namespace?: string): Nullable<T[]>;
5
8
  export declare function extract<T>(value: Record<string, T>, namespace?: string): T | null;
9
+ export declare function toOptions<T>(data: T[], options?: Option): (T | {
10
+ label: string;
11
+ value: string;
12
+ })[];
6
13
  export declare function getType(value?: string): string;
14
+ export declare function getFormData(formData: FormData): Record<string, unknown>;
@@ -0,0 +1,17 @@
1
+ import type { Column, Field, Input, Nullable, Select } from '../type';
2
+ export declare const isSelectMonth: (field: Field) => boolean;
3
+ export declare const isSelectYear: (field: Field) => boolean;
4
+ export declare const isCheckbox: (field: Field) => field is Input;
5
+ export declare const isInput: (field: Field) => field is Input;
6
+ export declare const isRadio: (field: Field) => field is Select;
7
+ export declare const isSelect: (field: Field) => field is Select;
8
+ export declare const isTextArea: (field: Field) => field is Input;
9
+ export declare const isText: (field: Field) => field is Input;
10
+ export declare const isEmail: (field: Field) => field is Input;
11
+ export declare const isNumber: (field: Field) => field is Input;
12
+ export declare function isClickable(field: Field): boolean;
13
+ export declare function isColumn(slot: Field | Column): slot is Column;
14
+ export declare function isField(slot: Field | Column): slot is Field;
15
+ export declare function isOptions(field: Field): field is Input;
16
+ export declare function isTextable(field: Field): boolean;
17
+ export declare function isValidValue<T>(value?: Nullable<T>): boolean;
@@ -0,0 +1,6 @@
1
+ import type { DataSource, Value } from '../type';
2
+ export declare function isObject<T>(value: unknown): value is Record<string, T>;
3
+ export declare function isEmpty(value: unknown): boolean;
4
+ export declare function isValue(value: unknown): value is Value;
5
+ export declare function isString(value: unknown): value is string;
6
+ export declare function isDataSource(value: unknown): value is DataSource;
@@ -0,0 +1,4 @@
1
+ import type { Base, Definition, Nullable } from '../type';
2
+ export declare function prepare<T extends Base>(base?: readonly T[], definition?: Definition): any[];
3
+ export declare function resolveRefs(base: unknown, definition?: Definition, cache?: Map<object, unknown>, visited?: WeakSet<object>): unknown;
4
+ export declare function entries<T>(values?: Nullable<Record<string, T>>): [key: string, value: T][];
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import type { Input, Schemas } from '../type';
3
+ export declare function buildSchema(schemas: Schemas): z.ZodObject<{
4
+ [x: string]: import("..").Schema;
5
+ }, z.core.$strip>;
6
+ export declare function flatten(error: z.ZodError<Record<string, unknown>>): Record<string, string[]>;
7
+ export declare function getSchema(input: Input): z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
8
+ export declare function getEmail(input: Input): z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodEmail>> | z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodEmail>, z.ZodLiteral<"">]>>;
9
+ export declare function getBoolean(input: Input): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodCoercedBoolean<unknown>> | z.ZodNullable<z.ZodCoercedBoolean<unknown>>;
10
+ export declare function getRadio(input: Input): z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedString<unknown>> | z.ZodNullable<z.ZodUnion<[z.ZodCoercedString<unknown>, z.ZodLiteral<"">]>>;
11
+ export declare function getText(input: Input): z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedString<unknown>> | z.ZodNullable<z.ZodCoercedString<unknown>>;
12
+ export declare function getNumber(input: Input): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodCoercedNumber<unknown>> | z.ZodNullable<z.ZodCoercedNumber<unknown>>;
13
+ export declare function getYearSchema(input: Input): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodCoercedNumber<unknown>> | z.ZodNullable<z.ZodCoercedNumber<unknown>>;
14
+ export declare function getMonthSchema(input: Input): z.ZodCoercedNumber<unknown> | z.ZodNullable<z.ZodCoercedNumber<unknown>>;
@@ -0,0 +1,2 @@
1
+ import type { DataSource, Nullable } from '../type';
2
+ export declare function mergeSource(sources: DataSource[]): Nullable<DataSource>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Replaces placeholders in the format {key} with values from the provided object.
3
+ * Supports nested objects using dot notation (e.g., {user.id}).
4
+ */
5
+ export declare function interpolate<T>(template: T, values?: Record<string, unknown>): T;
6
+ export declare function isInterpolated(template: unknown): boolean;
7
+ export declare function formatMarkdown<K>(text?: string, callback?: (index: number, url: string, text?: string) => K): (string | K)[] | string | null;
@@ -0,0 +1 @@
1
+ export declare function stringify<T>(body: T): string | null;
@@ -0,0 +1,10 @@
1
+ import type { RemotePattern } from '../type';
2
+ /**
3
+ * Validates a URL against a list of allowed remote patterns.
4
+ * Internal URLs are allowed by default.
5
+ * If patterns is undefined, all URLs are allowed.
6
+ * If patterns is an empty array, all external URLs are blocked.
7
+ */
8
+ export declare function matchRemotePattern(urlStr: string, patterns?: RemotePattern[]): boolean;
9
+ export declare function isExternalUrl(url: string): boolean;
10
+ export declare function mergeUrl(baseUrl: string, targetUrl: string): string;
@@ -0,0 +1,14 @@
1
+ import { type FormState } from '../hook/use-form-action';
2
+ import type { Definition, FormStateError, Nullable, Sections, ZodSchema } from '@luna-form/core';
3
+ import type { Config } from '../../type';
4
+ export declare function Form<T extends Record<string, unknown> = Record<string, unknown>>(props: Readonly<{
5
+ action?: (formData: unknown, schema?: ZodSchema) => Promise<FormState<T>>;
6
+ children?: React.ReactNode;
7
+ config: Config;
8
+ definition?: Definition;
9
+ onError?: (error: Nullable<FormStateError>) => void;
10
+ onSuccess?: (data: T) => void;
11
+ readOnly?: boolean;
12
+ sections: Sections;
13
+ value?: Nullable<T>;
14
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
- import type { AriaAttributes, CommonProps, Config, DataAttributes, Field, Schema, Source } from '../../type';
1
+ import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Nullable, type Schema } from '@luna-form/core';
2
+ import type { Config } from '../../type';
2
3
  export declare function Input(props: Readonly<{
3
4
  ariaAttributes?: AriaAttributes;
4
5
  commonProps: CommonProps;
@@ -7,7 +8,5 @@ export declare function Input(props: Readonly<{
7
8
  field: Field;
8
9
  onMount: (name: string, schema: Schema) => void;
9
10
  onUnmount: (name: string) => void;
10
- source?: Source;
11
- value?: Record<string, unknown>;
12
- withinColumn?: boolean;
13
- }>): import("react/jsx-runtime").JSX.Element | null;
11
+ value?: Nullable<Record<string, unknown>>;
12
+ }>): import("react").ReactNode;
@@ -1,4 +1,5 @@
1
- import type { Children, Fields } from '../../type';
1
+ import type { Children } from '../../type';
2
+ import type { Fields } from '@luna-form/core';
2
3
  export declare const Slot: (props: Readonly<{
3
4
  children: Children;
4
5
  disabled?: boolean;
@@ -2,6 +2,5 @@ export declare const Field: (props: Readonly<Omit<Readonly<{
2
2
  children: import("../../../type").Children;
3
3
  disabled?: boolean;
4
4
  errors?: Record<string, string[]>;
5
- field: import("../../../type").Field;
6
- withinColumn?: boolean;
5
+ field: import("@luna-form/core").Field;
7
6
  }>, "errors">>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type Field, type Nullable } from '@luna-form/core';
2
+ import type { Config } from '../../type';
3
+ export declare function useDataSource(field: Field, config: Config, value?: Nullable<Record<string, unknown>>): readonly [Nullable<unknown[]>, (target: string, value: import("@luna-form/core").DataSource | undefined) => void];
@@ -0,0 +1,3 @@
1
+ import { type DataSource, type Nullable } from '@luna-form/core';
2
+ import type { Config } from '../../type';
3
+ export declare function useFetch<T>(dataSource: Nullable<DataSource | T[]> | undefined, config: Config, disabled?: boolean): [Nullable<T[]>];
@@ -0,0 +1,14 @@
1
+ import { type FormStateError, type Nullable, type Schemas, type ZodSchema } from '@luna-form/core';
2
+ export type FormState<T> = {
3
+ data: Nullable<T>;
4
+ error: Nullable<FormStateError>;
5
+ success: boolean;
6
+ };
7
+ export type FormActionOptions<T> = {
8
+ onError?: (error: Nullable<FormStateError>) => void;
9
+ onSuccess?: (data: T) => void;
10
+ preserveValues?: boolean;
11
+ validation?: boolean;
12
+ value?: Nullable<T>;
13
+ };
14
+ export declare function useFormState<T>(getSchema: () => Schemas, action?: <K>(formData: K, schema?: ZodSchema) => Promise<FormState<T>>, options?: FormActionOptions<T>): readonly [(payload: FormData) => void, FormState<T>, boolean];
@@ -1,2 +1,2 @@
1
- import type { Field, Schema } from '../../type';
1
+ import type { Field, Schema } from '@luna-form/core';
2
2
  export declare function useInput(field: Field, onMount: (name: string, schema: Schema) => void, onUnmount: (name: string) => void): readonly [import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>];
@@ -1,2 +1,2 @@
1
- import type { Schema, Schemas } from '../../type';
1
+ import type { Schema, Schemas } from '@luna-form/core';
2
2
  export declare function useSchema(): readonly [() => Schemas, (name: string, schema: Schema) => void, (name: string) => void];
@@ -0,0 +1 @@
1
+ export declare function useStore(): (names: string | string[]) => void;
@@ -0,0 +1 @@
1
+ export declare function useTimeout(): readonly [(callback: () => void, delay: number) => void, () => void];
@@ -1,3 +1,3 @@
1
1
  import { Form } from './component/form';
2
2
  export { Form };
3
- export type { Sections, Source } from '../type';
3
+ export type { Sections, Source } from '@luna-form/core';
@@ -0,0 +1,10 @@
1
+ export declare const inputErrorAtom: import("jotai").PrimitiveAtom<Record<string, string[]>> & {
2
+ init: Record<string, string[]>;
3
+ };
4
+ export declare const clearInputErrorAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
5
+ init: null;
6
+ };
7
+ export declare const reportErrorAtom: import("jotai").WritableAtom<null, [newValue: Record<string, string[]>], void> & {
8
+ init: null;
9
+ };
10
+ export declare const reportInputErrorAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<string[] | undefined, [newValue: string[] | undefined], void>>;
@@ -0,0 +1,8 @@
1
+ import { type DataSource } from '@luna-form/core';
2
+ export declare const sourceAtom: import("jotai").PrimitiveAtom<Record<string, Record<string, DataSource>>> & {
3
+ init: Record<string, Record<string, DataSource>>;
4
+ };
5
+ export declare const reportSourceAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<DataSource | undefined, [target: string, value: DataSource | undefined], void>>;
6
+ export declare const clearInputSourceAtom: import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
7
+ init: null;
8
+ };
@@ -0,0 +1,21 @@
1
+ import { type PrimitiveAtom } from 'jotai';
2
+ type RecordValue<T> = T extends Record<string, infer V> ? V : never;
3
+ interface NestedAtomFamilyOptions<TInner> {
4
+ merge?: (values: TInner[]) => TInner | undefined;
5
+ validateTarget?: (target: string) => boolean;
6
+ }
7
+ export declare function createRecordAtomFamily<TRecord extends Record<string, unknown>, TValue = RecordValue<TRecord>>(baseAtom: PrimitiveAtom<TRecord>): import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<NonNullable<TValue> | undefined, [newValue: TValue | undefined], void>>;
8
+ export declare function createClearAllAtom<T>(baseAtom: PrimitiveAtom<Record<string, T>>): import("jotai").WritableAtom<null, [], void> & {
9
+ init: null;
10
+ };
11
+ export declare function createClearAtom<T>(baseAtom: PrimitiveAtom<Record<string, T>>): import("jotai").WritableAtom<null, [names: string[]], void> & {
12
+ init: null;
13
+ };
14
+ export declare function createBulkReportAtom<T>(baseAtom: PrimitiveAtom<Record<string, T>>): import("jotai").WritableAtom<null, [newValue: Record<string, T>], void> & {
15
+ init: null;
16
+ };
17
+ export declare function createNestedRecordAtomFamily<TInner, TRecord extends Record<string, Record<string, TInner>> = Record<string, Record<string, TInner>>>(baseAtom: PrimitiveAtom<TRecord>, options?: NestedAtomFamilyOptions<TInner>): import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<TInner | undefined, [target: string, value: TInner | undefined], void>>;
18
+ export declare function createNestedClearAtom<TInner>(baseAtom: PrimitiveAtom<Record<string, Record<string, TInner>>>): import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
19
+ init: null;
20
+ };
21
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare const valueAtom: import("jotai").PrimitiveAtom<Record<string, unknown>> & {
2
+ init: Record<string, unknown>;
3
+ };
4
+ export declare const clearAllValueAtom: import("jotai").WritableAtom<null, [], void> & {
5
+ init: null;
6
+ };
7
+ export declare const clearInputValueAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
8
+ init: null;
9
+ };
10
+ export declare const reportBulkValueAtom: import("jotai").WritableAtom<null, [newValue: Record<string, unknown>], void> & {
11
+ init: null;
12
+ };
13
+ export declare const reportValueAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<{} | undefined, [newValue: unknown], void>>;
@@ -1,7 +1,6 @@
1
- import type { Column } from '../type';
1
+ import { type Column } from '@luna-form/core';
2
2
  export type ColumnProps = Readonly<{
3
3
  children?: React.ReactNode;
4
4
  column?: Column;
5
- errors?: Record<string, string[]>;
6
5
  }>;
7
6
  export declare function Column(props: ColumnProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export declare function Description(props: Readonly<{
2
- children: string;
2
+ children: string | React.ReactNode;
3
3
  }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type Orientation } from '@luna-form/core';
2
+ export type FieldBaseProps = Readonly<{
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ cols?: number;
6
+ disabled?: boolean;
7
+ errors?: string[];
8
+ orientation: Orientation;
9
+ }>;
10
+ export declare function FieldBase(props: FieldBaseProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { Nullable } from '../type';
1
+ import type { Nullable } from '@luna-form/core';
2
2
  export declare function FieldError(props: Readonly<{
3
3
  errors?: Nullable<string[]>;
4
4
  name?: string;
@@ -0,0 +1,8 @@
1
+ import { type Orientation } from '@luna-form/core';
2
+ export declare function FieldGroup(props: Readonly<{
3
+ children: React.ReactNode;
4
+ cols?: number;
5
+ errors?: string[];
6
+ orientation?: Orientation;
7
+ disabled?: boolean;
8
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export declare function FieldHorizontal(props: Readonly<{
2
+ children: React.ReactNode;
3
+ cols?: number;
4
+ disabled?: boolean;
5
+ errors?: string[];
6
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
+ import type { Section } from '@luna-form/core';
1
2
  export declare function FieldSet(props: Readonly<{
2
3
  children?: React.ReactNode;
3
- description?: string;
4
- title?: string;
4
+ section: Section;
5
5
  }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export declare function FieldVertical(props: Readonly<{
2
+ children: React.ReactNode;
3
+ cols?: number;
4
+ disabled?: boolean;
5
+ errors?: string[];
6
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
- import type { Children, Field } from '../type';
1
+ import { type Field } from '@luna-form/core';
2
+ import type { Children } from '../../type';
2
3
  export type FieldProps = Readonly<{
3
4
  children: Children;
4
5
  disabled?: boolean;
5
6
  errors?: Record<string, string[]>;
6
7
  field: Field;
7
- withinColumn?: boolean;
8
8
  }>;
9
9
  export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,11 @@
1
- import type { Sections, Slot } from '../type';
1
+ import { type Definition, type Sections } from '@luna-form/core';
2
+ import type { Config, Slot } from '../type';
2
3
  export declare function Form(props: Readonly<{
3
4
  action?: (formData: FormData) => void;
4
5
  children: Slot;
6
+ config: Config;
5
7
  control?: React.ReactNode;
8
+ definition?: Definition;
6
9
  noValidate?: boolean;
7
10
  readOnly?: boolean;
8
11
  sections: Sections;
@@ -0,0 +1,3 @@
1
+ export declare function FormattedDescription(props: Readonly<{
2
+ text?: string;
3
+ }>): import("react/jsx-runtime").JSX.Element | null;
@@ -1,3 +1,4 @@
1
1
  export declare function Group(props: Readonly<{
2
2
  children?: React.ReactNode;
3
+ compact?: boolean;
3
4
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
- import type { Field } from '../../type';
1
+ import { type Field } from '@luna-form/core';
2
2
  export declare function buildAriaAttributes(field: Field, errors?: string[]): Record<string, string | number | boolean>;
3
3
  export declare function buildDataAttributes(field: Field): Record<string, string | number | boolean>;
@@ -1,8 +1,8 @@
1
- import type { Children, Field } from '../../type';
1
+ import type { Children } from '../../type';
2
+ import type { Field } from '@luna-form/core';
2
3
  export declare function InputBase(props: Readonly<{
3
4
  children: Children;
4
5
  disabled?: boolean;
5
6
  errors?: string[];
6
7
  field: Field;
7
- withinColumn?: boolean;
8
8
  }>): import("react").ReactNode;
@@ -1,2 +1,2 @@
1
- import type { CommonProps, Field } from '../../type';
1
+ import { type CommonProps, type Field } from '@luna-form/core';
2
2
  export declare function buildCommon(field: Field, disabled?: boolean): CommonProps;
@@ -1,4 +1,4 @@
1
- import type { Field } from '../../type';
1
+ import { type Field } from '@luna-form/core';
2
2
  export declare function buildOptionSelect(field: Field): {
3
3
  value: string;
4
4
  label: string;
@@ -0,0 +1,5 @@
1
+ import { type Field } from '@luna-form/core';
2
+ export declare function InputGroup(props: Readonly<{
3
+ children: React.ReactNode;
4
+ field: Field;
5
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { type Field, type Orientation } from '@luna-form/core';
2
+ export declare function InputLabel(props: Readonly<{
3
+ field: Field;
4
+ orientation: Orientation;
5
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
+ import { type Field } from '@luna-form/core';
1
2
  export declare function Label(props: Readonly<{
2
3
  children?: React.ReactNode;
3
- name: string;
4
- required?: boolean;
4
+ field: Field;
5
5
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
- import type { Children, Fields } from '../../type';
1
+ import { type Fields } from '@luna-form/core';
2
+ import type { Children } from '../../type';
2
3
  import type { ColumnProps } from '../column';
3
- import type { FieldProps } from '../field';
4
+ import type { FieldProps } from '../field/field';
4
5
  export declare function SlotBase<T extends {
5
6
  column: React.ComponentType<ColumnProps>;
6
7
  field: React.ComponentType<FieldProps>;
@@ -8,6 +9,5 @@ export declare function SlotBase<T extends {
8
9
  children: Children;
9
10
  disabled?: boolean;
10
11
  fields?: Fields;
11
- withinColumn?: boolean;
12
12
  components: T;
13
13
  }>): import("react/jsx-runtime").JSX.Element[];
@@ -1,7 +1,7 @@
1
- import type { Children, Fields } from '../../type';
1
+ import type { Children } from '../../type';
2
+ import type { Fields } from '@luna-form/core';
2
3
  export declare const Slot: (props: Readonly<{
3
4
  children: Children;
4
5
  disabled?: boolean;
5
6
  fields?: Fields;
6
- withinColumn?: boolean;
7
7
  }>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { type Environment, type Orientation, type Protocol } from '@luna-form/core';
2
+ import type { Config, InputConfig } from '../type';
3
+ export declare function defineConfig<T extends React.ElementType>(options: Readonly<{
4
+ env?: Environment;
5
+ fetcher?: {
6
+ remotePatterns?: Array<{
7
+ hostname?: string;
8
+ port?: number;
9
+ protocol?: Protocol;
10
+ }>;
11
+ };
12
+ inputs: Array<InputConfig<T>>;
13
+ style?: {
14
+ compact?: boolean;
15
+ orientation?: Orientation;
16
+ };
17
+ validation?: {
18
+ blur?: boolean;
19
+ change?: boolean;
20
+ submit?: boolean;
21
+ };
22
+ }>): Config;
23
+ export declare const defineCheckbox: (input: any) => InputConfig<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
24
+ export declare const defineInput: (input: any) => InputConfig<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
25
+ export declare const defineRadio: (input: any) => InputConfig<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
26
+ export declare const defineSelect: (input: any) => InputConfig<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
27
+ export declare const defineTextArea: (input: any) => InputConfig<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
28
+ export declare function defineCustomInput<T extends React.ElementType>(types: string | string[], input: React.ComponentProps<T>): InputConfig<T>;
@@ -0,0 +1 @@
1
+ export declare function renderIfExists<T>(value: T | undefined | null, render: (value: T) => React.ReactNode): React.ReactNode;
@@ -0,0 +1 @@
1
+ export declare function formatMarkdown(text?: string): React.ReactNode;
@@ -1,4 +1,5 @@
1
- import type { Config, Sections } from '../../type';
1
+ import type { Config } from '../../type';
2
+ import type { Sections } from '@luna-form/core';
2
3
  export declare function Fallback(props: Readonly<{
3
4
  children: React.ReactNode;
4
5
  config: Config;
@@ -1,8 +1,9 @@
1
- import type { Sections, Config, Source } from '../../type';
1
+ import type { Config } from '../../type';
2
+ import type { Definition, Sections, Source } from '@luna-form/core';
2
3
  export declare function Form(props: Readonly<{
3
- action?: (formData: FormData) => Promise<void> | void;
4
4
  children?: React.ReactNode;
5
5
  config: Config;
6
+ definition?: Definition;
6
7
  readOnly?: boolean;
7
8
  sections: Sections;
8
9
  source?: Source;
@@ -1,4 +1,5 @@
1
- import type { AriaAttributes, CommonProps, DataAttributes, Field, Config, Source } from '../../type';
1
+ import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Source } from '@luna-form/core';
2
+ import type { Config } from '../../type';
2
3
  export declare function Input(props: Readonly<{
3
4
  ariaAttributes?: AriaAttributes;
4
5
  commonProps: CommonProps;
@@ -7,4 +8,4 @@ export declare function Input(props: Readonly<{
7
8
  field: Field;
8
9
  source?: Source;
9
10
  value?: Record<string, unknown>;
10
- }>): import("react/jsx-runtime").JSX.Element | null;
11
+ }>): import("react").ReactNode;
@@ -1,4 +1,4 @@
1
1
  import { Form } from './component/form';
2
2
  import { Fallback } from './component/fallback';
3
3
  export { Form, Fallback };
4
- export type { Sections, Source } from '../type';
4
+ export type { Sections, Source } from '@luna-form/core';
@@ -0,0 +1,16 @@
1
+ import type { AriaAttributes, CommonProps, DataAttributes, Field, Fields, BaseConfig } from '@luna-form/core';
2
+ export type Slot = (props: {
3
+ disabled?: boolean;
4
+ fields?: Fields;
5
+ }) => React.ReactNode;
6
+ export type Children = (props: {
7
+ ariaAttributes?: AriaAttributes;
8
+ commonProps: CommonProps;
9
+ dataAttributes?: DataAttributes;
10
+ field: Field;
11
+ }) => React.ReactNode;
12
+ export type InputConfig<T extends React.ElementType> = {
13
+ types: string | string[];
14
+ input: React.ComponentProps<T>;
15
+ };
16
+ export type Config = BaseConfig<React.ComponentProps<React.ElementType>>;