react-luna-form 0.0.87 → 0.0.88

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 (62) 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/schema/cjs/index.js +1 -1
  6. package/dist/schema/esm/index.js +1 -1
  7. package/dist/server/cjs/index.js +1 -1
  8. package/dist/server/esm/index.js +1 -1
  9. package/dist/types/luna-core/handle/source-event.d.ts +2 -1
  10. package/dist/types/luna-core/handle/value-event.d.ts +2 -1
  11. package/dist/types/luna-core/helper/input.d.ts +16 -7
  12. package/dist/types/luna-core/type.d.ts +15 -4
  13. package/dist/types/luna-core/util/constant.d.ts +4 -0
  14. package/dist/types/luna-core/util/date.d.ts +132 -6
  15. package/dist/types/luna-core/util/format.d.ts +11 -0
  16. package/dist/types/luna-core/util/is-input.d.ts +3 -2
  17. package/dist/types/luna-core/util/pattern.d.ts +28 -0
  18. package/dist/types/luna-core/util/prepare.d.ts +3 -2
  19. package/dist/types/luna-core/util/schema.d.ts +2 -1
  20. package/dist/types/luna-core/util/string.d.ts +7 -0
  21. package/dist/types/luna-react/src/client/component/field/field-list-preview-item.d.ts +3 -3
  22. package/dist/types/luna-react/src/client/component/field/field-preview-item.d.ts +4 -2
  23. package/dist/types/luna-react/src/client/component/field/field-preview-value.d.ts +4 -1
  24. package/dist/types/luna-react/src/client/component/field/field-preview.d.ts +2 -2
  25. package/dist/types/luna-react/src/client/component/formatted-description.d.ts +2 -2
  26. package/dist/types/luna-react/src/client/component/guard/list-guard.d.ts +1 -1
  27. package/dist/types/luna-react/src/client/component/input-strategies.d.ts +9 -1
  28. package/dist/types/luna-react/src/client/component/slot/slot.d.ts +1 -2
  29. package/dist/types/luna-react/src/client/hook/use-input-core.d.ts +2 -2
  30. package/dist/types/luna-react/src/component/column.d.ts +2 -2
  31. package/dist/types/luna-react/src/component/description.d.ts +2 -2
  32. package/dist/types/luna-react/src/component/field/field-list.d.ts +2 -3
  33. package/dist/types/luna-react/src/component/field/field.d.ts +3 -3
  34. package/dist/types/luna-react/src/component/field-description.d.ts +2 -2
  35. package/dist/types/luna-react/src/component/form.d.ts +1 -0
  36. package/dist/types/luna-react/src/component/input/input-base.d.ts +3 -3
  37. package/dist/types/luna-react/src/component/input-group.d.ts +2 -2
  38. package/dist/types/luna-react/src/component/input-label.d.ts +2 -2
  39. package/dist/types/luna-react/src/component/slot/list-slot.d.ts +1 -1
  40. package/dist/types/luna-react/src/component/slot/slot-base.d.ts +2 -3
  41. package/dist/types/luna-react/src/component/slot/slot-create.d.ts +2 -3
  42. package/dist/types/luna-react/src/component/slot/slot-list.d.ts +2 -3
  43. package/dist/types/luna-react/src/component/slot/slot.d.ts +1 -2
  44. package/dist/types/luna-react/src/config/index.d.ts +1 -0
  45. package/dist/types/luna-react/src/server/component/input.d.ts +2 -2
  46. package/dist/types/luna-react/src/server/component/slot.d.ts +1 -2
  47. package/dist/types/luna-react/src/type.d.ts +2 -1
  48. package/docs/events/change.md +4 -1
  49. package/docs/fields/custom-inputs.md +153 -4
  50. package/docs/fields/data-source.md +5 -3
  51. package/docs/fields/input.md +175 -3
  52. package/docs/fields/list.md +1 -1
  53. package/docs/fields/specialized-selectors.md +51 -12
  54. package/docs/forms/submit.md +6 -8
  55. package/docs/index.md +2 -1
  56. package/docs/interpolation/format-filters.md +28 -29
  57. package/docs/interpolation/overview.md +44 -14
  58. package/docs/setup.md +17 -16
  59. package/docs/structure/definition.md +45 -6
  60. package/docs/validation/overview.md +14 -11
  61. package/package.json +2 -2
  62. package/dist/types/luna-react/src/client/hook/use-format.d.ts +0 -5
@@ -1,4 +1,4 @@
1
- import type { Chips, Column, Field, Input, List, Nullable, Select, Time } from '../type';
1
+ import type { Chips, Column, Date as DateField, Field, Input, List, Nullable, Select, Time } from '../type';
2
2
  export declare const isSelectActive: (field: Field) => boolean;
3
3
  export declare const isSelectDay: (field: Field) => boolean;
4
4
  export declare const isSelectMonth: (field: Field) => boolean;
@@ -6,8 +6,9 @@ export declare const isSelectYear: (field: Field) => boolean;
6
6
  export declare const isSelectTimezone: (field: Field) => boolean;
7
7
  export declare const isChipsDays: (field: Field) => boolean;
8
8
  export declare const isChipsMonths: (field: Field) => boolean;
9
- export declare const isDate: (field: Field) => field is Field;
9
+ export declare const isDate: (field: Field) => field is DateField;
10
10
  export declare const isTime: (field: Field) => field is Time;
11
+ export declare function isDateRange(field: Field): boolean;
11
12
  export declare const isCheckbox: (field: Field) => field is Input;
12
13
  export declare const isChips: (field: Field) => field is Chips;
13
14
  export declare const isRadio: (field: Field) => field is Select;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * What an authored pattern can do to the thread that runs it.
3
+ *
4
+ * A pattern that can split the same text between its repetitions in more than
5
+ * one way backtracks exponentially on a value that almost matches: `^(a+)+$`
6
+ * holds the thread for seconds on thirty characters, a tab's or a server's.
7
+ * Only the ambiguity is dangerous. `^[a-z]+(-[a-z]+)*$` repeats a group with a
8
+ * quantifier inside it as well, and runs in linear time, because every
9
+ * repetition opens with a `-` that the one before cannot close with.
10
+ *
11
+ * So the question asked of each repeated group is not whether it nests a
12
+ * quantifier but whether its repetitions can overlap: whether the group can
13
+ * open with a character it can also close with, and then either holds an
14
+ * unbounded quantifier or offers alternatives that open alike. That is
15
+ * `(a+)+`, `(\w+\s?)+` and `(a|a)+`, and not `(-[a-z]+)*`, `(,\d+)*` or
16
+ * `(ab+c)+`.
17
+ *
18
+ * It is a reading of the source, not a proof. Characters are reasoned about as
19
+ * ASCII, with everything beyond it counted as one more symbol, and what the
20
+ * reader cannot tell apart it reads as any character: it would rather refuse
21
+ * a safe pattern than run a catastrophic one. Quadratic patterns are not its
22
+ * concern; they need very long values to hurt.
23
+ *
24
+ * Every term works out what it can open and close with as it is read, once,
25
+ * so reading a pattern costs time in proportion to its length, however it
26
+ * nests.
27
+ */
28
+ export declare function backtracksCatastrophically(source: string, flags?: string): boolean;
@@ -1,4 +1,5 @@
1
1
  import type { Definition, Filterable, Nullable } from '../type';
2
- export declare function prepare<T extends Filterable>(base?: readonly T[], definition?: Definition): T[];
3
- export declare function resolveRefs(base: unknown, definition?: Definition, cache?: Map<object, unknown>, visited?: WeakSet<object>): unknown;
2
+ export declare function prepare<T extends Filterable>(base?: readonly T[], definition?: Definition, context?: Record<string, unknown>): T[];
3
+ export declare function resolveRefs(base: unknown, definition?: Definition, context?: Record<string, unknown>): unknown;
4
+ export declare function refOf(value: unknown): string | undefined;
4
5
  export declare function entries<T>(values?: Nullable<Record<string, T>>): [key: string, value: T][];
@@ -8,9 +8,10 @@ export declare function getText(input: Input, translations?: Record<string, stri
8
8
  export declare function getNumber(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>, unknown>;
9
9
  export declare function getYearSchema(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>, unknown>;
10
10
  export declare function getMonthSchema(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>, unknown>;
11
+ export declare function getDateSchema(field: Field, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<[string, string], unknown, z.core.$ZodTypeInternals<[string, string], unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<[string, string], unknown, z.core.$ZodTypeInternals<[string, string], unknown>>>, unknown> | z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>, unknown>;
11
12
  export declare function applyCustomValidation(schema: ZodSchema, fields?: Field[], translations?: Record<string, string>): ZodSchema;
12
13
  export declare function validateCustom(value: unknown, rules: CustomValidation | Array<CustomValidation>, getValue: (name: string) => unknown, translations?: Record<string, string>): string[];
13
- export declare function buildFormSchema(sections: Sections, translations?: Record<string, string>, definition?: Definition): z.ZodType;
14
+ export declare function buildFormSchema(sections: Sections, translations?: Record<string, string>, definition?: Definition, context?: Record<string, unknown>): z.ZodType;
14
15
  export declare function collectIssues(error: z.ZodError): Array<{
15
16
  path: string;
16
17
  message: string;
@@ -1,6 +1,13 @@
1
1
  export type InterpolateOptions = {
2
2
  locale?: string;
3
+ now?: string;
3
4
  };
5
+ /**
6
+ * What text the form renders is formatted with: the form's language, its
7
+ * `lang`, and the instant the host gave in `context`. A label and a
8
+ * description format the same value the same way because they ask here.
9
+ */
10
+ export declare function renderOptions(lang?: string, context?: Record<string, unknown>): InterpolateOptions;
4
11
  /**
5
12
  * Replaces placeholders in the format {key} with values from the provided object.
6
13
  * Supports nested objects using dot notation (e.g., {user.id}) and pipe filters
@@ -1,6 +1,7 @@
1
+ import { type Localization } from '../../../../../luna-core/index';
1
2
  import type { List, Nullable, PreviewItem } from '../../../../../luna-core/index';
2
3
  import type { ReactNode } from 'react';
3
- export declare function FieldListPreviewItem({ canRemove, children, field, index, isMultiField, itemKey, label, lang, onRemove, previewBadge, previewLabel, previewTags, translations, value, }: {
4
+ export declare function FieldListPreviewItem({ canRemove, children, field, index, isMultiField, itemKey, label, localization, onRemove, previewBadge, previewLabel, previewTags, value, }: {
4
5
  canRemove: boolean;
5
6
  children: ReactNode;
6
7
  field: List;
@@ -8,11 +9,10 @@ export declare function FieldListPreviewItem({ canRemove, children, field, index
8
9
  isMultiField: boolean;
9
10
  itemKey: string | number;
10
11
  label: string;
11
- lang?: string;
12
+ localization?: Localization;
12
13
  onRemove: (index: number) => void;
13
14
  previewBadge?: PreviewItem;
14
15
  previewLabel?: PreviewItem;
15
16
  previewTags?: PreviewItem[];
16
- translations?: Record<string, string>;
17
17
  value?: Nullable<Record<string, unknown> | unknown[]>;
18
18
  }): import("react").JSX.Element;
@@ -1,7 +1,9 @@
1
- import { type Option } from '../../../../../luna-core/index';
2
- export declare function FieldPreviewItem({ className, initialValue, name, options, separator, staticLabel, }: Readonly<{
1
+ import { type DateFormat, type Option } from '../../../../../luna-core/index';
2
+ export declare function FieldPreviewItem({ className, dateFormat, initialValue, lang, name, options, separator, staticLabel, }: Readonly<{
3
3
  className?: string;
4
+ dateFormat?: DateFormat;
4
5
  initialValue?: unknown;
6
+ lang?: string;
5
7
  name?: string;
6
8
  options?: Array<Option | string>;
7
9
  separator?: boolean;
@@ -1,5 +1,8 @@
1
- export declare function FieldPreviewValue({ children, initialValue, name, }: Readonly<{
1
+ import { type DateFormat } from '../../../../../luna-core/index';
2
+ export declare function FieldPreviewValue({ children, dateFormat, initialValue, lang, name, }: Readonly<{
2
3
  children: (value: string) => React.ReactNode;
4
+ dateFormat?: DateFormat;
3
5
  initialValue?: unknown;
6
+ lang?: string;
4
7
  name: string;
5
8
  }>): import("react").JSX.Element;
@@ -1,12 +1,12 @@
1
+ import { type Localization } from '../../../../../luna-core/index';
1
2
  import type { Fields, PreviewItem } from '../../../../../luna-core/index';
2
3
  type PreviewProps = Readonly<{
3
4
  className?: string;
4
5
  fields?: Fields;
5
6
  label?: string;
6
- lang?: string;
7
+ localization?: Localization;
7
8
  name: string;
8
9
  previews: PreviewItem | PreviewItem[];
9
- translations?: Record<string, string>;
10
10
  value?: Record<string, unknown> | unknown[] | null;
11
11
  }>;
12
12
  export declare function FieldPreview(props: PreviewProps): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { type Description as DescriptionType } from '../../../../luna-core/index';
1
+ import { type Description as DescriptionType, type Localization } from '../../../../luna-core/index';
2
2
  import type { Config } from '../../type';
3
3
  export declare function FormattedDescription(props: Readonly<{
4
4
  config?: Config;
5
5
  context?: Record<string, unknown>;
6
+ localization?: Localization;
6
7
  text?: DescriptionType;
7
- translations?: Record<string, string>;
8
8
  value?: unknown;
9
9
  }>): import("react").JSX.Element | null;
@@ -1,2 +1,2 @@
1
1
  import type { ListProps } from '../../../component/field/field-list';
2
- export declare function ListGuard({ children, field, lang, onValueChange, translations, value, }: ListProps): import("react").JSX.Element;
2
+ export declare function ListGuard({ children, field, onValueChange, localization, value, }: ListProps): import("react").JSX.Element;
@@ -1,5 +1,14 @@
1
1
  import type { Config } from '../../type';
2
2
  import type { DataSource, Field, Nullable, Value } from '../../../../luna-core/index';
3
+ /**
4
+ * What a held value is when the change events run at mount, which has to be
5
+ * what a change hands them later: a form reopened on saved data reveals what it
6
+ * revealed when it was filled in. An array travels as one -- a `chips` field's
7
+ * selections, the two days of a range -- since `String()` on it joins them into
8
+ * "a,b", which answers to no option, no `when` and no day. Anything else is the
9
+ * text it would have been typed as.
10
+ */
11
+ export declare function toChangeValue(value: unknown): Value;
3
12
  /**
4
13
  * What the input pipeline reads off a change, and all it reads: the new value.
5
14
  *
@@ -38,5 +47,4 @@ export type InputStrategies = Readonly<{
38
47
  }>) => void;
39
48
  buildInitialSelected: (defaultValue: unknown, data: Nullable<unknown[]>, entity: string | undefined) => unknown;
40
49
  isInitialReady: (field: Field, defaultValue: unknown, data: Nullable<unknown[]>) => boolean;
41
- useExtraProps?: (field: Field) => Record<string, unknown> | undefined;
42
50
  }>;
@@ -4,12 +4,11 @@ export declare const Slot: (props: Readonly<{
4
4
  context?: Record<string, unknown>;
5
5
  disabled?: boolean;
6
6
  fields?: import('../../../../../luna-core/index').Fields;
7
- lang?: string;
8
7
  onValueChange?: (input: {
9
8
  name: string;
10
9
  value: unknown;
11
10
  }) => void;
12
11
  style?: import('../../../../../luna-core/index').Style;
13
- translations?: Record<string, string>;
12
+ localization?: import('../../../../../luna-core/index').Localization;
14
13
  value?: import('../../../../../luna-core/index').Nullable<Record<string, unknown>>;
15
14
  }>) => import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type AriaAttributes, type CommonProps, type DataAttributes, type DataSource, type Field, type Schema, type Value } from '../../../../luna-core/index';
1
+ import { type AriaAttributes, type CommonProps, type DataAttributes, type DataSource, type Field, type Schema, type Value, type Localization } from '../../../../luna-core/index';
2
2
  import type { Config, InputChange } from '../../type';
3
3
  export type InputCoreProps = Readonly<{
4
4
  ariaAttributes?: AriaAttributes;
@@ -9,13 +9,13 @@ export type InputCoreProps = Readonly<{
9
9
  field: Field;
10
10
  getField: (name: string) => Field | undefined;
11
11
  horizontal?: boolean;
12
+ localization?: Localization;
12
13
  onRegister: (name: string, schema: Schema, field: Field) => void;
13
14
  onUnmount: (name: string, options?: {
14
15
  keepValue?: boolean;
15
16
  }) => void;
16
17
  onValueChange?: (input: InputChange) => void;
17
18
  readOnly?: boolean;
18
- translations?: Record<string, string>;
19
19
  }>;
20
20
  export declare function useInputCore(props: InputCoreProps, deps: Readonly<{
21
21
  setSource: (target: string, source?: DataSource) => void;
@@ -1,5 +1,5 @@
1
1
  import { type DescriptionTextProps } from './description';
2
- import { type Column } from '../../../luna-core/index';
2
+ import { type Column, type Localization } from '../../../luna-core/index';
3
3
  import type { Config } from '../type';
4
4
  export declare function Column(props: Readonly<{
5
5
  children?: React.ReactNode;
@@ -7,5 +7,5 @@ export declare function Column(props: Readonly<{
7
7
  config?: Config;
8
8
  context?: Record<string, unknown>;
9
9
  description?: React.ComponentType<DescriptionTextProps>;
10
- translations?: Record<string, string>;
10
+ localization?: Localization;
11
11
  }>): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type Description as DescriptionType } from '../../../luna-core/index';
1
+ import { type Description as DescriptionType, type Localization } from '../../../luna-core/index';
2
2
  import type { Config } from '../type';
3
3
  export declare function Description(props: Readonly<{
4
4
  children: string | React.ReactNode;
@@ -7,7 +7,7 @@ export declare function Description(props: Readonly<{
7
7
  export type DescriptionTextProps = Readonly<{
8
8
  config?: Config;
9
9
  context?: Record<string, unknown>;
10
+ localization?: Localization;
10
11
  text?: DescriptionType;
11
- translations?: Record<string, string>;
12
12
  }>;
13
13
  export declare function DescriptionText(props: DescriptionTextProps): import("react").JSX.Element | null;
@@ -1,13 +1,12 @@
1
- import { type List, type Nullable } from '../../../../luna-core/index';
1
+ import { type List, type Nullable, type Localization } from '../../../../luna-core/index';
2
2
  export type ListProps = Readonly<{
3
3
  children: (index: number) => React.ReactNode;
4
4
  field: List;
5
- lang?: string;
6
5
  onValueChange?: (input: {
7
6
  name: string;
8
7
  value: unknown;
9
8
  }) => void;
10
- translations?: Record<string, string>;
9
+ localization?: Localization;
11
10
  value?: Nullable<Record<string, unknown>>;
12
11
  }>;
13
12
  export declare function FieldList(props: ListProps): import("react").JSX.Element[];
@@ -1,12 +1,12 @@
1
- import { type Field, type Style } from '../../../../luna-core/index';
1
+ import { type Field, type Style, type Localization } from '../../../../luna-core/index';
2
2
  import type { Children } from '../../type';
3
3
  export type FieldProps = Readonly<{
4
4
  children: Children;
5
5
  disabled?: boolean;
6
6
  errors?: string[];
7
7
  field: Field;
8
- lang?: string;
8
+ now?: string;
9
9
  style?: Style;
10
- translations?: Record<string, string>;
10
+ localization?: Localization;
11
11
  }>;
12
12
  export declare function Field(props: FieldProps): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import type { Config } from '../type';
2
- import type { Field } from '../../../luna-core/index';
2
+ import type { Field, Localization } from '../../../luna-core/index';
3
3
  export type DescriptionProps = Readonly<{
4
4
  config?: Config;
5
5
  context?: Record<string, unknown>;
6
6
  field: Field;
7
- translations?: Record<string, string>;
7
+ localization?: Localization;
8
8
  }>;
9
9
  export declare function StaticDescription(props: DescriptionProps): import("react").JSX.Element;
@@ -15,6 +15,7 @@ export declare function Form(props: Readonly<{
15
15
  action?: (formData: FormData) => void;
16
16
  children: Slot;
17
17
  config: Config;
18
+ context?: Record<string, unknown>;
18
19
  control?: Control;
19
20
  definition?: Definition;
20
21
  fieldSet?: React.ComponentType<React.ComponentProps<typeof StaticFieldSet>>;
@@ -1,4 +1,4 @@
1
- import { type Field } from '../../../../luna-core/index';
1
+ import { type Field, type Localization } from '../../../../luna-core/index';
2
2
  import type { Children } from '../../type';
3
3
  export declare function InputBase(props: Readonly<{
4
4
  children: Children;
@@ -6,7 +6,7 @@ export declare function InputBase(props: Readonly<{
6
6
  errors?: string[];
7
7
  field: Field;
8
8
  horizontal?: boolean;
9
- lang?: string;
9
+ localization?: Localization;
10
+ now?: string;
10
11
  readOnly?: boolean;
11
- translations?: Record<string, string>;
12
12
  }>): import("react").ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { type DescriptionProps } from './field-description';
2
2
  import type { Config } from '../type';
3
- import type { Field } from '../../../luna-core/index';
3
+ import type { Field, Localization } from '../../../luna-core/index';
4
4
  export declare function InputGroup(props: Readonly<{
5
5
  children: React.ReactNode;
6
6
  config?: Config;
@@ -8,5 +8,5 @@ export declare function InputGroup(props: Readonly<{
8
8
  description?: React.ComponentType<DescriptionProps>;
9
9
  field: Field;
10
10
  horizontal?: boolean;
11
- translations?: Record<string, string>;
11
+ localization?: Localization;
12
12
  }>): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type DescriptionProps } from './field-description';
2
- import { type Field } from '../../../luna-core/index';
2
+ import { type Field, type Localization } from '../../../luna-core/index';
3
3
  import type { Config } from '../type';
4
4
  export declare function InputLabel(props: Readonly<{
5
5
  config?: Config;
@@ -7,5 +7,5 @@ export declare function InputLabel(props: Readonly<{
7
7
  description?: React.ComponentType<DescriptionProps>;
8
8
  field: Field;
9
9
  horizontal?: boolean;
10
- translations?: Record<string, string>;
10
+ localization?: Localization;
11
11
  }>): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import type { ListProps } from '../field/field-list';
2
- export declare function ListSlot({ children, field, lang, translations, value, }: ListProps): import("react").JSX.Element;
2
+ export declare function ListSlot({ children, field, localization, value }: ListProps): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type Fields, type Nullable, type Style } from '../../../../luna-core/index';
1
+ import { type Fields, type Nullable, type Style, type Localization } from '../../../../luna-core/index';
2
2
  import type { DescriptionTextProps } from '../description';
3
3
  import type { Children, Config } from '../../type';
4
4
  import type { FieldProps } from '../field/field';
@@ -15,12 +15,11 @@ export declare function SlotBase(props: Readonly<{
15
15
  context?: Record<string, unknown>;
16
16
  disabled?: boolean;
17
17
  fields?: Fields;
18
- lang?: string;
19
18
  onValueChange?: (input: {
20
19
  name: string;
21
20
  value: unknown;
22
21
  }) => void;
23
22
  style?: Style;
24
- translations?: Record<string, string>;
23
+ localization?: Localization;
25
24
  value?: Nullable<Record<string, unknown>>;
26
25
  }>): import("react").JSX.Element[];
@@ -1,5 +1,5 @@
1
1
  import type { Children, Config } from '../../type';
2
- import type { Fields, Nullable, Style } from '../../../../luna-core/index';
2
+ import type { Fields, Localization, Nullable, Style } from '../../../../luna-core/index';
3
3
  import type { SlotComponents } from './slot-base';
4
4
  export declare function createSlot(components: SlotComponents): (props: Readonly<{
5
5
  children: Children;
@@ -7,12 +7,11 @@ export declare function createSlot(components: SlotComponents): (props: Readonly
7
7
  context?: Record<string, unknown>;
8
8
  disabled?: boolean;
9
9
  fields?: Fields;
10
- lang?: string;
11
10
  onValueChange?: (input: {
12
11
  name: string;
13
12
  value: unknown;
14
13
  }) => void;
15
14
  style?: Style;
16
- translations?: Record<string, string>;
15
+ localization?: Localization;
17
16
  value?: Nullable<Record<string, unknown>>;
18
17
  }>) => import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type List, type Nullable, type Style } from '../../../../luna-core/index';
1
+ import { type List, type Nullable, type Style, type Localization } from '../../../../luna-core/index';
2
2
  import { type SlotComponents } from './slot-base';
3
3
  import type { Children, Config } from '../../type';
4
4
  export declare function SlotList(props: Readonly<{
@@ -9,12 +9,11 @@ export declare function SlotList(props: Readonly<{
9
9
  disabled?: boolean;
10
10
  field: List;
11
11
  index: number;
12
- lang?: string;
13
12
  onValueChange?: (input: {
14
13
  name: string;
15
14
  value: unknown;
16
15
  }) => void;
17
16
  style?: Style;
18
- translations?: Record<string, string>;
17
+ localization?: Localization;
19
18
  value?: Nullable<Record<string, unknown>>;
20
19
  }>): import("react").JSX.Element;
@@ -4,12 +4,11 @@ export declare const Slot: (props: Readonly<{
4
4
  context?: Record<string, unknown>;
5
5
  disabled?: boolean;
6
6
  fields?: import('../../../../luna-core/index').Fields;
7
- lang?: string;
8
7
  onValueChange?: (input: {
9
8
  name: string;
10
9
  value: unknown;
11
10
  }) => void;
12
11
  style?: import('../../../../luna-core/index').Style;
13
- translations?: Record<string, string>;
12
+ localization?: import('../../../../luna-core/index').Localization;
14
13
  value?: import('../../../../luna-core/index').Nullable<Record<string, unknown>>;
15
14
  }>) => import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { type Environment, type Protocol } from '../../../luna-core/index';
2
2
  import type { AlertProps, Config, InputConfig } from '../type';
3
+ export { readDateProps, type DateProps } from '../../../luna-core/index';
3
4
  export declare function defineConfig<T extends React.ElementType>(options: Readonly<{
4
5
  alert?: React.ComponentType<AlertProps>;
5
6
  env?: Environment;
@@ -1,4 +1,4 @@
1
- import { type AriaAttributes, type CommonProps, type DataAttributes, type Field } from '../../../../luna-core/index';
1
+ import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Localization } from '../../../../luna-core/index';
2
2
  import type { Config } from '../../type';
3
3
  export declare function Input(props: Readonly<{
4
4
  ariaAttributes?: AriaAttributes;
@@ -8,6 +8,6 @@ export declare function Input(props: Readonly<{
8
8
  dataAttributes?: DataAttributes;
9
9
  field: Field;
10
10
  horizontal?: boolean;
11
- translations?: Record<string, string>;
11
+ localization?: Localization;
12
12
  value?: Record<string, unknown>;
13
13
  }>): import("react").ReactNode;
@@ -4,12 +4,11 @@ export declare const Slot: (props: Readonly<{
4
4
  context?: Record<string, unknown>;
5
5
  disabled?: boolean;
6
6
  fields?: import('../../../../luna-core/index').Fields;
7
- lang?: string;
8
7
  onValueChange?: (input: {
9
8
  name: string;
10
9
  value: unknown;
11
10
  }) => void;
12
11
  style?: import('../../../../luna-core/index').Style;
13
- translations?: Record<string, string>;
12
+ localization?: import('../../../../luna-core/index').Localization;
14
13
  value?: import('../../../../luna-core/index').Nullable<Record<string, unknown>>;
15
14
  }>) => import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { AriaAttributes, BaseConfig, CommonProps, DataAttributes, Field, Fields, FormStateError } from '../../luna-core/index';
1
+ import type { AriaAttributes, BaseConfig, CommonProps, DataAttributes, Field, Fields, FormStateError, Localization } from '../../luna-core/index';
2
2
  export type Slot = (props: {
3
3
  disabled?: boolean;
4
4
  fields?: Fields;
@@ -12,6 +12,7 @@ export type Children = (props: {
12
12
  dataAttributes?: DataAttributes;
13
13
  field: Field;
14
14
  horizontal?: boolean;
15
+ localization?: Localization;
15
16
  readOnly?: boolean;
16
17
  }) => React.ReactNode;
17
18
  export type InputConfig<T extends React.ElementType> = {
@@ -189,7 +189,7 @@ The `state` action modifies the interactive state or visibility of other fields
189
189
  - `action` (string): Must be set to `"state"`.
190
190
  - `target` (string | array of strings): The field name, or an array of field names, that the state modifications should be applied to.
191
191
  - `state` (object): An object containing the new state to apply. Properties are independent of field names — the form may safely contain a field whose `name` is `"description"`, `"disabled"` or `"hidden"`; `target` identifies the field, the keys inside `state` configure it.
192
- - `disabled` (boolean, optional): Whether the field should be disabled.
192
+ - `disabled` (boolean, optional): Whether the field should be disabled. While the condition holds it takes the place of the field's own `disabled`, in either direction: `false` enables a field declared `"disabled": true`. Once the condition stops holding, the field's own `disabled` applies again.
193
193
  - `hidden` (boolean, optional): Whether the field should be hidden from view. **Note:** When a field becomes hidden (`hidden: true`), its current value is automatically cleared from the form state to ensure no non-applicable data is submitted. See [What clearing a hidden target means](#what-clearing-a-hidden-target-means).
194
194
  - `description` (string | object, optional): A new description to render for the target field. Supports interpolation, format filters, and **Markdown** (specifically links). e.g. `"Check our [terms](https://example.com) for details."`.
195
195
  - `when` (string | array of strings | [Condition object](#the-condition-object), optional): A condition that specifies when this state should be applied.
@@ -409,6 +409,9 @@ Two details:
409
409
  `source`, the initial run is held until the data has loaded, so an action
410
410
  keyed on the selected entity sees the entity rather than a bare value. Text
411
411
  and date fields run as soon as the value is valid.
412
+ - **A date range carries its pair.** A [range](../fields/input.md#a-range-of-days)
413
+ runs its events with `[from, to]`, at mount and on a click alike: `{value}` is
414
+ that pair.
412
415
  - **A `chips` field carries its array, not an entity.** No single option answers
413
416
  to a value that can hold several, so a `chips` change carries the array
414
417
  itself, at mount and on a click alike: `{value}` is that array, and there is