@dxos/react-ui-form 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (234) hide show
  1. package/README.md +0 -1
  2. package/dist/lib/browser/index.mjs +2772 -2208
  3. package/dist/lib/browser/index.mjs.map +4 -4
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/translations.mjs +82 -0
  6. package/dist/lib/browser/translations.mjs.map +7 -0
  7. package/dist/lib/node-esm/index.mjs +2772 -2208
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/lib/node-esm/translations.mjs +84 -0
  11. package/dist/lib/node-esm/translations.mjs.map +7 -0
  12. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
  13. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  14. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +69 -60
  15. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  16. package/dist/types/src/components/Form/Form.d.ts +109 -26
  17. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  18. package/dist/types/src/components/Form/Form.stories.d.ts +116 -138
  19. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  20. package/dist/types/src/components/Form/FormField.d.ts +43 -0
  21. package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
  22. package/dist/types/src/components/Form/FormFieldComponent.d.ts +79 -0
  23. package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
  24. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
  25. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
  26. package/dist/types/src/components/Form/FormFieldSet.d.ts +15 -0
  27. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
  28. package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
  29. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
  30. package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
  31. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
  32. package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
  33. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
  34. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +11 -0
  35. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
  36. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +84 -0
  37. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
  38. package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
  39. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
  40. package/dist/types/src/components/Form/fields/RefField.d.ts +22 -0
  41. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
  42. package/dist/types/src/components/Form/fields/SelectField.d.ts +10 -0
  43. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
  44. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
  45. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
  46. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +84 -0
  47. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
  48. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
  49. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
  50. package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
  51. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
  52. package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
  53. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
  54. package/dist/types/src/components/Form/fields/index.d.ts +12 -0
  55. package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
  56. package/dist/types/src/components/Form/index.d.ts +2 -4
  57. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  58. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +9 -0
  59. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
  60. package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
  61. package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
  62. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +68 -0
  63. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -0
  64. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +87 -0
  65. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -0
  66. package/dist/types/src/components/ObjectPicker/index.d.ts +2 -0
  67. package/dist/types/src/components/ObjectPicker/index.d.ts.map +1 -0
  68. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
  69. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
  70. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +127 -0
  71. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
  72. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
  73. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
  74. package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
  75. package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
  76. package/dist/types/src/components/Settings/Settings.d.ts +51 -0
  77. package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
  78. package/dist/types/src/components/Settings/Settings.stories.d.ts +84 -0
  79. package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
  80. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
  81. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
  82. package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
  83. package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
  84. package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
  85. package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
  86. package/dist/types/src/components/Settings/index.d.ts +4 -0
  87. package/dist/types/src/components/Settings/index.d.ts.map +1 -0
  88. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +22 -11
  89. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  90. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +72 -65
  91. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  92. package/dist/types/src/components/index.d.ts +4 -1
  93. package/dist/types/src/components/index.d.ts.map +1 -1
  94. package/dist/types/src/components/testing.d.ts +4 -6
  95. package/dist/types/src/components/testing.d.ts.map +1 -1
  96. package/dist/types/src/hooks/index.d.ts +2 -3
  97. package/dist/types/src/hooks/index.d.ts.map +1 -1
  98. package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
  99. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
  100. package/dist/types/src/hooks/useKeyHandler.d.ts +7 -0
  101. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
  102. package/dist/types/src/index.d.ts +0 -2
  103. package/dist/types/src/index.d.ts.map +1 -1
  104. package/dist/types/src/translations.d.ts +65 -59
  105. package/dist/types/src/translations.d.ts.map +1 -1
  106. package/dist/types/src/util/field-type.d.ts +19 -0
  107. package/dist/types/src/util/field-type.d.ts.map +1 -0
  108. package/dist/types/src/util/field.d.ts +3 -3
  109. package/dist/types/src/util/field.d.ts.map +1 -1
  110. package/dist/types/src/util/formatting.d.ts +2 -2
  111. package/dist/types/src/util/formatting.d.ts.map +1 -1
  112. package/dist/types/src/util/index.d.ts +2 -1
  113. package/dist/types/src/util/index.d.ts.map +1 -1
  114. package/dist/types/src/util/properties.d.ts +7 -0
  115. package/dist/types/src/util/properties.d.ts.map +1 -0
  116. package/dist/types/src/util/refs.d.ts +3 -3
  117. package/dist/types/src/util/refs.d.ts.map +1 -1
  118. package/dist/types/tsconfig.tsbuildinfo +1 -1
  119. package/package.json +56 -50
  120. package/src/components/FieldEditor/FieldEditor.stories.tsx +46 -26
  121. package/src/components/FieldEditor/FieldEditor.test.tsx +0 -1
  122. package/src/components/FieldEditor/FieldEditor.tsx +80 -80
  123. package/src/components/Form/AUDIT.md +17 -0
  124. package/src/components/Form/Form.stories.tsx +142 -254
  125. package/src/components/Form/Form.tsx +375 -99
  126. package/src/components/Form/FormField.tsx +306 -0
  127. package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
  128. package/src/components/Form/FormFieldComponent.tsx +174 -0
  129. package/src/components/Form/FormFieldSet.tsx +144 -0
  130. package/src/components/Form/README.md +3 -0
  131. package/src/components/Form/fields/ArrayField.tsx +155 -0
  132. package/src/components/Form/fields/BooleanField.tsx +22 -0
  133. package/src/components/Form/fields/GeoPointField.tsx +121 -0
  134. package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
  135. package/src/components/Form/fields/MarkdownField.tsx +168 -0
  136. package/src/components/Form/fields/NumberField.tsx +39 -0
  137. package/src/components/Form/fields/RefField.tsx +229 -0
  138. package/src/components/Form/fields/SelectField.tsx +65 -0
  139. package/src/components/Form/fields/SelectOptionField.stories.tsx +66 -0
  140. package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +31 -25
  141. package/src/components/Form/fields/TextAreaField.tsx +38 -0
  142. package/src/components/Form/fields/TextField.tsx +38 -0
  143. package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +16 -9
  144. package/src/components/Form/fields/index.ts +15 -0
  145. package/src/components/Form/index.ts +3 -4
  146. package/src/components/ObjectForm/ObjectForm.tsx +114 -0
  147. package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
  148. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +212 -0
  149. package/src/components/ObjectPicker/ObjectPicker.tsx +202 -0
  150. package/src/components/ObjectPicker/index.ts +5 -0
  151. package/src/components/ObjectProperties/ObjectProperties.stories.tsx +362 -0
  152. package/src/components/ObjectProperties/ObjectProperties.test.tsx +101 -0
  153. package/src/components/ObjectProperties/ObjectProperties.tsx +141 -0
  154. package/src/components/ObjectProperties/index.ts +5 -0
  155. package/src/components/Settings/AUDIT.md +52 -0
  156. package/src/components/Settings/Settings.stories.tsx +104 -0
  157. package/src/components/Settings/Settings.tsx +80 -0
  158. package/src/components/Settings/SettingsFieldSet.tsx +257 -0
  159. package/src/components/Settings/SettingsItem.tsx +58 -0
  160. package/src/components/Settings/SettingsSelectField.tsx +59 -0
  161. package/src/components/Settings/index.ts +7 -0
  162. package/src/components/ViewEditor/ViewEditor.stories.tsx +126 -75
  163. package/src/components/ViewEditor/ViewEditor.test.tsx +10 -9
  164. package/src/components/ViewEditor/ViewEditor.tsx +326 -195
  165. package/src/components/index.ts +4 -1
  166. package/src/components/testing.tsx +24 -11
  167. package/src/hooks/index.ts +2 -3
  168. package/src/hooks/useFormHandler.ts +380 -0
  169. package/src/hooks/useKeyHandler.tsx +37 -0
  170. package/src/index.ts +0 -4
  171. package/src/translations.ts +70 -64
  172. package/src/util/field-type.ts +60 -0
  173. package/src/util/field.ts +25 -25
  174. package/src/util/formatting.ts +22 -22
  175. package/src/util/index.ts +2 -1
  176. package/src/util/properties.ts +18 -0
  177. package/src/util/refs.ts +17 -19
  178. package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
  179. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
  180. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -83
  181. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
  182. package/dist/types/src/components/ControlSection/index.d.ts +0 -2
  183. package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
  184. package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
  185. package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
  186. package/dist/types/src/components/Form/Defaults.d.ts +0 -14
  187. package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
  188. package/dist/types/src/components/Form/FormActions.d.ts +0 -9
  189. package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
  190. package/dist/types/src/components/Form/FormContent.d.ts +0 -63
  191. package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
  192. package/dist/types/src/components/Form/FormContext.d.ts +0 -23
  193. package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
  194. package/dist/types/src/components/Form/Input.d.ts +0 -29
  195. package/dist/types/src/components/Form/Input.d.ts.map +0 -1
  196. package/dist/types/src/components/Form/RefField.d.ts +0 -18
  197. package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
  198. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
  199. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
  200. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
  201. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
  202. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -78
  203. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
  204. package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
  205. package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
  206. package/dist/types/src/components/Form/custom/index.d.ts +0 -4
  207. package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
  208. package/dist/types/src/components/Form/factory.d.ts +0 -8
  209. package/dist/types/src/components/Form/factory.d.ts.map +0 -1
  210. package/dist/types/src/hooks/useForm.d.ts +0 -67
  211. package/dist/types/src/hooks/useForm.d.ts.map +0 -1
  212. package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -23
  213. package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
  214. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
  215. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
  216. package/dist/types/src/util/schema.d.ts +0 -3
  217. package/dist/types/src/util/schema.d.ts.map +0 -1
  218. package/src/components/ControlSection/ControlSection.stories.tsx +0 -39
  219. package/src/components/ControlSection/ControlSection.tsx +0 -153
  220. package/src/components/Form/ArrayField.tsx +0 -124
  221. package/src/components/Form/Defaults.tsx +0 -205
  222. package/src/components/Form/FormActions.tsx +0 -54
  223. package/src/components/Form/FormContent.tsx +0 -302
  224. package/src/components/Form/FormContext.tsx +0 -110
  225. package/src/components/Form/Input.tsx +0 -54
  226. package/src/components/Form/RefField.tsx +0 -299
  227. package/src/components/Form/custom/GeoPointInput.tsx +0 -80
  228. package/src/components/Form/custom/SelectOptionsInput.stories.tsx +0 -62
  229. package/src/components/Form/custom/index.ts +0 -7
  230. package/src/components/Form/factory.tsx +0 -31
  231. package/src/hooks/useForm.ts +0 -293
  232. package/src/hooks/useQueryRefOptions.ts +0 -53
  233. package/src/hooks/useRefQueryLookupHandler.ts +0 -39
  234. package/src/util/schema.ts +0 -14
@@ -1,28 +1,111 @@
1
- import { type Schema } from 'effect';
2
- import React, { type ReactElement } from 'react';
3
- import { type BaseObject, type PropertyKey } from '@dxos/echo-schema';
4
- import { type ThemedClassName } from '@dxos/react-ui';
5
- import { type ProjectionModel, type SchemaProperty } from '@dxos/schema';
6
- import { type FormOptions } from '../../hooks';
7
- import { type FormOuterSpacing } from './FormActions';
8
- import { type FormFieldsProps } from './FormContent';
9
- import { type InputComponent, type InputProps } from './Input';
10
- export type PropsFilter<T extends BaseObject> = (props: SchemaProperty<T>[]) => SchemaProperty<T>[];
11
- export type ComponentLookup = (args: {
12
- prop: string;
13
- schema: Schema.Schema<any>;
14
- inputProps: InputProps;
15
- }) => ReactElement | undefined;
16
- export type CustomInputMap = Partial<Record<string, InputComponent>>;
17
- export type FormProps<T extends BaseObject> = ThemedClassName<{
18
- values: Partial<T>;
19
- autoFocus?: boolean;
20
- filter?: PropsFilter<T>;
21
- sort?: PropertyKey<T>[];
22
- projection?: ProjectionModel;
23
- autoSave?: boolean;
24
- outerSpacing?: FormOuterSpacing;
1
+ import * as Schema from 'effect/Schema';
2
+ import React, { type PropsWithChildren } from 'react';
3
+ import { type AnyProperties } from '@dxos/echo/internal';
4
+ import { type IconButtonProps, type ThemedClassName } from '@dxos/react-ui';
5
+ import { type FormHandler, type FormHandlerProps, type FormUpdateMeta } from '../../hooks';
6
+ import { type FormFieldLabelProps, type FormFieldStateProps } from './FormFieldComponent';
7
+ import { type FormFieldSetProps as NaturalFormFieldSetProps } from './FormFieldSet';
8
+ export type ExcludeId<S extends Schema.Schema.AnyNoContext> = Omit<Schema.Schema.Type<S>, 'id'>;
9
+ export declare const omitId: <S extends Schema.Schema.AnyNoContext>(schema: S) => Schema.Schema<ExcludeId<S>, ExcludeId<S>>;
10
+ /**
11
+ * Drop fields annotated with `FormInputAnnotation.set(false)` from a schema so
12
+ * the form's validator doesn't trip on required-but-hidden fields. Used by
13
+ * the picker's inline create form, where a `FactoryAnnotation` typically
14
+ * supplies the hidden values (e.g. a backing-object Ref) outside the form.
15
+ */
16
+ export declare const omitHiddenFormFields: <S extends Schema.Schema.AnyNoContext>(schema: S) => S;
17
+ type FormContextValue<T extends AnyProperties = any> = {
18
+ /**
19
+ * Form handler.
20
+ */
21
+ form: FormHandler<T>;
22
+ /**
23
+ * Show debug info.
24
+ */
25
+ debug?: boolean;
26
+ /**
27
+ * Testing.
28
+ */
29
+ testId?: string;
30
+ } & Pick<NaturalFormFieldSetProps<T>, 'readonly' | 'layout' | 'fieldMap' | 'fieldProvider' | 'projection' | 'createTypename' | 'createFieldMap' | 'db'>;
31
+ declare const useFormContext: (consumerName: string) => FormContextValue<any>;
32
+ /**
33
+ * Get the current form values.
34
+ */
35
+ declare const useFormValues: {
36
+ <T extends AnyProperties>(componentName: string, path?: (string | number)[]): T;
37
+ <T extends AnyProperties>(componentName: string, path: (string | number)[] | undefined, defaultValue: () => T): T | undefined;
38
+ };
39
+ /**
40
+ * Get the state props for the given field.
41
+ */
42
+ declare const useFormFieldState: (componentName: string, path?: (string | number)[]) => FormFieldStateProps;
43
+ type FormRootProps<T extends AnyProperties = AnyProperties> = PropsWithChildren<{
44
+ /**
45
+ * Called when the form is submitted and passes validation.
46
+ */
47
+ onSave?: (values: T, meta: FormUpdateMeta<T>) => void;
48
+ /**
49
+ * Called when the form is canceled to abandon/undo any pending changes.
50
+ */
25
51
  onCancel?: () => void;
26
- }> & Pick<FormOptions<T>, 'schema' | 'onValuesChanged' | 'onValidate' | 'onSave'> & FormFieldsProps;
27
- export declare const Form: <T extends BaseObject>({ classNames, testId, values: initialValues, autoFocus, readonly, autoSave, outerSpacing, schema, onCancel, onValuesChanged, onValidate, onSave, ...props }: FormProps<T>) => React.JSX.Element;
52
+ } & Omit<FormContextValue<T>, 'form'> & Pick<FormHandlerProps<T>, 'schema' | 'autoSave' | 'values' | 'defaultValues' | 'onValidate' | 'onValuesChanged'> & Omit<NaturalFormFieldSetProps<T>, 'schema' | 'path'>>;
53
+ declare function FormRoot<T extends AnyProperties = AnyProperties>({ children, schema, values, onSave, onCancel, ...props }: FormRootProps<T>): React.JSX.Element;
54
+ declare namespace FormRoot {
55
+ var displayName: string;
56
+ }
57
+ type FormViewportProps = {};
58
+ type FormContentProps = ThemedClassName<PropsWithChildren<{}>>;
59
+ type FormFieldSetProps = ThemedClassName<NaturalFormFieldSetProps<any>>;
60
+ declare function FormFieldSet(props: FormFieldSetProps): React.JSX.Element;
61
+ declare namespace FormFieldSet {
62
+ var displayName: string;
63
+ }
64
+ type FormActionsProps = ThemedClassName<{}>;
65
+ declare function FormActions({ classNames }: FormActionsProps): React.JSX.Element | null;
66
+ declare namespace FormActions {
67
+ var displayName: string;
68
+ }
69
+ type FormSectionProps = ThemedClassName<{
70
+ label: string;
71
+ description?: string;
72
+ }>;
73
+ type FormSubmitProps = ThemedClassName<Partial<Pick<IconButtonProps, 'icon' | 'label' | 'disabled'>>>;
74
+ declare function FormSubmit({ classNames, label, icon, disabled }: FormSubmitProps): React.JSX.Element | null;
75
+ declare namespace FormSubmit {
76
+ var displayName: string;
77
+ }
78
+ export declare const Form: {
79
+ Root: {
80
+ <T extends AnyProperties = AnyProperties>({ children, schema, values, onSave, onCancel, ...props }: FormRootProps<T>): React.JSX.Element;
81
+ displayName: string;
82
+ };
83
+ Viewport: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
84
+ classNames?: import("@dxos/ui-types").ClassNameValue;
85
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
86
+ Content: React.ForwardRefExoticComponent<Omit<FormContentProps, "className"> & {
87
+ classNames?: import("@dxos/ui-types").ClassNameValue;
88
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
89
+ Section: React.ForwardRefExoticComponent<Omit<FormSectionProps, "className"> & {
90
+ classNames?: import("@dxos/ui-types").ClassNameValue;
91
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
92
+ FieldSet: {
93
+ (props: FormFieldSetProps): React.JSX.Element;
94
+ displayName: string;
95
+ };
96
+ Label: {
97
+ ({ label, error, readonly, asChild }: FormFieldLabelProps): React.JSX.Element;
98
+ displayName: string;
99
+ };
100
+ Actions: {
101
+ ({ classNames }: FormActionsProps): React.JSX.Element | null;
102
+ displayName: string;
103
+ };
104
+ Submit: {
105
+ ({ classNames, label, icon, disabled }: FormSubmitProps): React.JSX.Element | null;
106
+ displayName: string;
107
+ };
108
+ };
109
+ export { useFormContext, useFormValues, useFormFieldState };
110
+ export type { FormRootProps, FormViewportProps, FormContentProps, FormSectionProps, FormFieldSetProps, FormFieldLabelProps, FormActionsProps, FormSubmitProps, };
28
111
  //# sourceMappingURL=Form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.tsx"],"names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AE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe;;;;AAmC1E,eAAO,MAAM,IAAI;IACf,IAAI;SA9MY,CAAC,SAAS,aAAa,4EAOtC,aAAa,CAAC,CAAC,CAAC;;;IAwMjB,QAAQ;;;IACR,OAAO;;;IACP,OAAO;;;IACP,QAAQ;gBAvImB,iBAAiB;;;IAwI5C,KAAK;;;;IACL,OAAO;yBAzH4B,gBAAgB;;;IA0HnD,MAAM;gDA3CmD,eAAe;;;CA4CzE,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC;AAE5D,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,CAAC"}
@@ -1,154 +1,132 @@
1
- import '@dxos-theme';
2
1
  import { type StoryObj } from '@storybook/react-vite';
3
- import { Schema } from 'effect';
2
+ import * as Schema from 'effect/Schema';
4
3
  import React from 'react';
5
- import { type Type } from '@dxos/echo';
6
- import { type BaseObject, Expando, Ref } from '@dxos/echo-schema';
7
- import { type FormProps } from './Form';
8
- type StoryProps<T extends BaseObject> = {
4
+ import { Type } from '@dxos/echo';
5
+ import { type AnyProperties } from '@dxos/echo/internal';
6
+ import { type ExcludeId, type FormRootProps } from './Form';
7
+ declare const Organization: Type.Obj<{
8
+ readonly name: string;
9
+ }, Schema.Struct.Fields>;
10
+ export interface Organization extends Schema.Schema.Type<typeof Organization> {
11
+ }
12
+ declare const Person: Type.Obj<{
13
+ readonly name: string;
14
+ readonly ignore?: string | undefined;
15
+ readonly active?: boolean | undefined;
16
+ readonly address?: {
17
+ readonly street: string;
18
+ readonly city: string;
19
+ readonly state: string;
20
+ readonly zip: number;
21
+ } | undefined;
22
+ readonly employer?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
23
+ readonly name: string;
24
+ }> | undefined;
25
+ readonly tags?: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
26
+ readonly label: string;
27
+ readonly hue?: string | undefined;
28
+ }>[] | undefined;
29
+ readonly status?: "active" | "inactive" | undefined;
30
+ readonly notes?: string | undefined;
31
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
32
+ readonly tasks?: readonly string[] | undefined;
33
+ readonly locations?: readonly (readonly [number, number, (number | undefined)?])[] | undefined;
34
+ readonly identities?: readonly {
35
+ readonly type: string;
36
+ readonly value: string;
37
+ }[] | undefined;
38
+ }, Schema.Struct.Fields>;
39
+ export interface Person extends Schema.Schema.Type<typeof Person> {
40
+ }
41
+ type DefaultStoryProps<T extends AnyProperties> = {
42
+ schema?: Schema.Schema<T>;
9
43
  debug?: boolean;
10
- schema: Type.Obj.Any;
11
- } & FormProps<T>;
44
+ } & FormRootProps<T>;
12
45
  declare const meta: {
13
46
  title: string;
14
- component: any;
15
- render: <T extends BaseObject = any>({ debug, schema, values: initialValues, ...props }: StoryProps<T>) => React.JSX.Element;
47
+ component: {
48
+ <T extends AnyProperties = AnyProperties>({ children, schema, values, onSave, onCancel, ...props }: FormRootProps<T>): React.JSX.Element;
49
+ displayName: string;
50
+ };
51
+ render: <T extends AnyProperties = AnyProperties>({ debug, schema, values: valuesProp, ...props }: DefaultStoryProps<T>) => React.JSX.Element;
16
52
  decorators: import("@storybook/react").Decorator[];
17
53
  parameters: {
54
+ layout: string;
18
55
  translations: [{
19
56
  readonly 'en-US': {
20
- readonly "react-ui-form": {
21
- readonly 'fields label': "Fields";
22
- readonly 'hidden fields label': "Hidden Fields";
23
- readonly 'empty readonly ref field label': "(none)";
24
- readonly 'button add property': "Add property";
25
- readonly 'field property label': "Property";
26
- readonly 'field property placeholder': "Property name";
27
- readonly 'field format label': "Type";
28
- readonly 'field path label': "Field path";
29
- readonly 'add field': "Add field";
30
- readonly 'delete field': "Delete field";
31
- readonly 'field limit reached': "Maximum number of fields reached";
32
- readonly 'boolean input true value': "Yes";
33
- readonly 'boolean input false value': "No";
34
- readonly 'show field label': "Show field";
35
- readonly 'hide field label': "Hide field";
36
- readonly 'delete field label': "Delete field";
37
- readonly 'ref field placeholder_one': "Select…";
38
- readonly 'ref field placeholder_other': "Select items…";
39
- readonly 'button cancel': "Cancel";
40
- readonly 'button save': "Save";
41
- readonly 'format boolean': "Boolean";
42
- readonly 'format currency': "Currency";
43
- readonly 'format date': "Date";
44
- readonly 'format date-time': "DateTime";
45
- readonly 'format did': "DID";
46
- readonly 'format duration': "Duration";
47
- readonly 'format dxn': "DXN";
48
- readonly 'format email': "Email";
49
- readonly 'format formula': "Formula";
50
- readonly 'format hostname': "Hostname";
51
- readonly 'format integer': "Integer";
52
- readonly 'format json': "JSON";
53
- readonly 'format latlng': "Geopoint";
54
- readonly 'format markdown': "Markdown";
55
- readonly 'format percent': "Percent";
56
- readonly 'format ref': "Reference";
57
- readonly 'format regex': "RegExp";
58
- readonly 'format string': "String";
59
- readonly 'format single-select': "Select";
60
- readonly 'format multi-select': "Multi-select";
61
- readonly 'format text': "Long text";
62
- readonly 'format time': "Time";
63
- readonly 'format timestamp': "Timestamp";
64
- readonly 'format user': "User";
65
- readonly 'format number': "Number";
66
- readonly 'format uri': "URI";
67
- readonly 'format url': "URL";
68
- readonly 'format uuid': "UUID";
69
- readonly 'latitude label': "Latitude";
70
- readonly 'longitude label': "Longitude";
71
- readonly 'select option label': "Label";
72
- readonly 'select option label placeholder': "Option label";
73
- readonly 'select option color': "Color";
74
- readonly 'select option delete': "Delete";
75
- readonly 'select option add': "Add option";
76
- readonly 'system schema title': "System record type";
77
- readonly 'system schema description': "This is a system record type and cannot be modified, though the view can still be configured.";
57
+ readonly "@dxos/react-ui-form": {
58
+ readonly 'fields.label': 'Fields';
59
+ readonly 'hidden-fields.label': 'Hidden Fields';
60
+ readonly 'empty-readonly-ref-field.label': '(none)';
61
+ readonly 'field-property.label': 'Property';
62
+ readonly 'field-property.placeholder': 'Property name';
63
+ readonly 'field-format.label': 'Type';
64
+ readonly 'field-path.label': 'Field path';
65
+ readonly 'add-item.button': 'Add item';
66
+ readonly 'add-property-button.label': 'Add property';
67
+ readonly 'boolean-input-true.value': 'Yes';
68
+ readonly 'boolean-input-false.value': 'No';
69
+ readonly 'show-field.label': 'Show field';
70
+ readonly 'hide-field.label': 'Hide field';
71
+ readonly 'delete-field.label': 'Delete field';
72
+ readonly 'create-option.label': 'Create';
73
+ readonly 'add-tag.label': 'Add tag';
74
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
75
+ readonly 'ref-field.placeholder': 'Select\u2026';
76
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
77
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
78
+ readonly 'example.placeholder': 'Example';
79
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
80
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
81
+ readonly 'cancel-button.label': 'Cancel';
82
+ readonly 'save-button.label': 'Save';
83
+ readonly 'create-text.label': 'Create text';
84
+ readonly 'format.boolean.label': 'Boolean';
85
+ readonly 'format.currency.label': 'Currency';
86
+ readonly 'format.date.label': 'Date';
87
+ readonly 'format.date-time.label': 'DateTime';
88
+ readonly 'format.did.label': 'DID';
89
+ readonly 'format.duration.label': 'Duration';
90
+ readonly 'format.dxn.label': 'DXN';
91
+ readonly 'format.email.label': 'Email';
92
+ readonly 'format.formula.label': 'Formula';
93
+ readonly 'format.hostname.label': 'Hostname';
94
+ readonly 'format.integer.label': 'Integer';
95
+ readonly 'format.json.label': 'JSON';
96
+ readonly 'format.lnglat.label': 'Geopoint';
97
+ readonly 'format.markdown.label': 'Markdown';
98
+ readonly 'format.percent.label': 'Percent';
99
+ readonly 'format.ref.label': 'Reference';
100
+ readonly 'format.regex.label': 'RegExp';
101
+ readonly 'format.string.label': 'String';
102
+ readonly 'format.single-select.label': 'Select';
103
+ readonly 'format.multi-select.label': 'Multi-select';
104
+ readonly 'format.text.label': 'Long text';
105
+ readonly 'format.time.label': 'Time';
106
+ readonly 'format.timestamp.label': 'Timestamp';
107
+ readonly 'format.user.label': 'User';
108
+ readonly 'format.number.label': 'Number';
109
+ readonly 'format.uri.label': 'URI';
110
+ readonly 'format.url.label': 'URL';
111
+ readonly 'format.uuid.label': 'UUID';
112
+ readonly 'latitude.label': 'Latitude';
113
+ readonly 'longitude.label': 'Longitude';
114
+ readonly 'select-option.label': 'Label';
115
+ readonly 'select-option-label.placeholder': 'Option label';
116
+ readonly 'select-option-delete.button': 'Delete';
117
+ readonly 'select-option-add.button': 'Add option';
118
+ readonly 'system-schema.title': 'System type';
119
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
120
+ readonly 'remove.button': 'Remove';
78
121
  };
79
122
  };
80
123
  }];
81
124
  };
82
- argTypes: {
83
- readonly: {
84
- control: "boolean";
85
- description: string;
86
- };
87
- };
88
125
  };
89
126
  export default meta;
90
- type Story = StoryObj<StoryProps<any>>;
91
- export declare const Default: Story;
92
- export declare const Organization: Story;
93
- export declare const OrganizationAutoSave: Story;
94
- export declare const Contact: Story;
95
- declare const ShapeSchema: Schema.mutable<Schema.Struct<{
96
- shape: Schema.optional<Schema.Union<[Schema.Struct<{
97
- type: Schema.Literal<["circle"]>;
98
- radius: Schema.optional<Schema.SchemaClass<number, number, never>>;
99
- }>, Schema.Struct<{
100
- type: Schema.Literal<["square"]>;
101
- size: Schema.optional<Schema.refine<number, typeof Schema.Number>>;
102
- }>]>>;
103
- }>>;
104
- type ShapeSchema = Schema.Schema.Type<typeof ShapeSchema>;
105
- export declare const DiscriminatedShape: StoryObj<StoryProps<ShapeSchema>>;
106
- declare const ArraysSchema: Schema.mutable<Schema.Struct<{
107
- names: Schema.Array$<Schema.filter<typeof Schema.String>>;
108
- addresses: Schema.Array$<Schema.Struct<{
109
- street: Schema.optional<Schema.SchemaClass<string, string, never>>;
110
- city: Schema.optional<Schema.SchemaClass<string, string, never>>;
111
- zip: Schema.optional<Schema.refine<string, typeof Schema.String>>;
112
- location: Schema.optional<Schema.Tuple<[Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.Element<typeof Schema.Number, "?">]>>;
113
- }>>;
114
- }>>;
115
- type ArraysSchema = Schema.Schema.Type<typeof ArraysSchema>;
116
- export declare const Arrays: StoryObj<StoryProps<ArraysSchema>>;
117
- declare const TupleSchema: Schema.mutable<Schema.Struct<{
118
- tuple: Schema.Tuple<[typeof Schema.Number, typeof Schema.String, typeof Schema.Boolean]>;
119
- geopoint: Schema.Tuple<[Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.Element<typeof Schema.Number, "?">]>;
120
- }>>;
121
- type TupleSchema = Schema.Schema.Type<typeof TupleSchema>;
122
- export declare const Tuple: StoryObj<StoryProps<TupleSchema>>;
123
- declare const ColorSchema: Schema.mutable<Schema.Struct<{
124
- color: Schema.Union<[Schema.Literal<["red"]>, Schema.Literal<["green"]>, Schema.Literal<["blue"]>]>;
125
- }>>;
126
- type ColorType = Schema.Schema.Type<typeof ColorSchema>;
127
- export declare const Enum: StoryObj<StoryProps<ColorType>>;
128
- declare const RefSchema: Schema.Struct<{
129
- contact: Schema.SchemaClass<Ref<import("@dxos/echo-schema").TypedObjectFields<{
130
- name: Schema.optional<typeof Schema.String>;
131
- identifiers: Schema.mutable<Schema.Array$<Schema.Struct<{
132
- type: typeof Schema.String;
133
- value: typeof Schema.String;
134
- }>>>;
135
- }, import("@dxos/echo-schema").TypedObjectOptions>>, import("@dxos/echo-protocol").EncodedReference, never>;
136
- optionalContact: Schema.optional<Schema.SchemaClass<Ref<import("@dxos/echo-schema").TypedObjectFields<{
137
- name: Schema.optional<typeof Schema.String>;
138
- identifiers: Schema.mutable<Schema.Array$<Schema.Struct<{
139
- type: typeof Schema.String;
140
- value: typeof Schema.String;
141
- }>>>;
142
- }, import("@dxos/echo-schema").TypedObjectOptions>>, import("@dxos/echo-protocol").EncodedReference, never>>;
143
- refArray: Schema.optional<Schema.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
144
- name: Schema.optional<typeof Schema.String>;
145
- identifiers: Schema.mutable<Schema.Array$<Schema.Struct<{
146
- type: typeof Schema.String;
147
- value: typeof Schema.String;
148
- }>>>;
149
- }, import("@dxos/echo-schema").TypedObjectOptions>>>>;
150
- unknownExpando: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
151
- }>;
152
- type RefSchema = Schema.Schema.Type<typeof RefSchema>;
153
- export declare const Refs: StoryObj<StoryProps<RefSchema>>;
127
+ type Story<T extends AnyProperties> = StoryObj<DefaultStoryProps<T>>;
128
+ export declare const Default: Story<ExcludeId<typeof Person>>;
129
+ export declare const Readonly: Story<ExcludeId<typeof Person>>;
130
+ export declare const Static: Story<ExcludeId<typeof Person>>;
131
+ export declare const Empty: Story<ExcludeId<typeof Person>>;
154
132
  //# sourceMappingURL=Form.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,UAAU,EAAE,OAAO,EAAU,GAAG,EA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AAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,KAAK,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAmDrB,QAAA,MAAM,IAAI;;;;;;aAjDY,CAAC,SAAS,aAAa,mEAK1C,iBAAiB,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEiB,CAAC;eAE1B,IAAI;AAEnB,KAAK,KAAK,CAAC,CAAC,SAAS,aAAa,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAQrE,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAMnD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAMpD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAMlD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAEjD,CAAC"}
@@ -0,0 +1,43 @@
1
+ import * as SchemaAST from 'effect/SchemaAST';
2
+ import React from 'react';
3
+ import { type ProjectionModel } from '@dxos/schema';
4
+ import { type RefFieldProps } from './fields';
5
+ import { type FormFieldComponentProps, type FormFieldMap, type FormFieldProvider } from './FormFieldComponent';
6
+ export type FormFieldProps = {
7
+ /**
8
+ * AST of the property to render.
9
+ */
10
+ type: SchemaAST.AST;
11
+ /**
12
+ * Name of the property.
13
+ */
14
+ name: string;
15
+ /**
16
+ * Path to the current object from the root. Used with nested forms.
17
+ */
18
+ path?: (string | number)[];
19
+ /**
20
+ * Optional projection for projection-based field management.
21
+ */
22
+ projection?: ProjectionModel;
23
+ /**
24
+ * Map of custom renderers for specific properties.
25
+ * Prefer fieldProvider for plugin specific input surfaces.
26
+ */
27
+ fieldMap?: FormFieldMap;
28
+ /**
29
+ * Function to lookup custom renderers for specific properties.
30
+ */
31
+ fieldProvider?: FormFieldProvider;
32
+ /**
33
+ * Typename of the ref type that the create props apply to.
34
+ * When set, createOptionLabel/createOptionIcon/createInitialValuePath/createFieldMap/onCreate
35
+ * are only passed to ref fields whose typename matches.
36
+ */
37
+ createTypename?: string;
38
+ } & Pick<FormFieldComponentProps, 'autoFocus' | 'readonly' | 'layout'> & Pick<RefFieldProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'useSchema' | 'getOptions' | 'onCreate'>;
39
+ export declare function FormField(props: FormFieldProps): React.JSX.Element | null;
40
+ export declare namespace FormField {
41
+ var displayName: string;
42
+ }
43
+ //# sourceMappingURL=FormField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAcvC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAKpD,OAAO,EAOL,KAAK,aAAa,EAInB,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;IAEpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC,GACpE,IAAI,CACF,aAAa,EACX,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,WAAW,GACX,YAAY,GACZ,UAAU,CACb,CAAC;kCAEsB,KAAK,EAAE,cAAc"}
@@ -0,0 +1,79 @@
1
+ import type * as Schema from 'effect/Schema';
2
+ import type * as SchemaAST from 'effect/SchemaAST';
3
+ import React, { Component, type FC, type FocusEvent, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';
4
+ import { type Database } from '@dxos/echo';
5
+ import { type Format } from '@dxos/echo/internal';
6
+ import { type FormFieldStatus } from '../../hooks';
7
+ /**
8
+ * Dynamic props passed to input components.
9
+ */
10
+ export type FormFieldStateProps<T = any> = {
11
+ getStatus: () => FormFieldStatus;
12
+ getValue: () => T | undefined;
13
+ onBlur: (event: FocusEvent<HTMLElement>) => void;
14
+ onValueChange: (type: SchemaAST.AST, value: T) => void;
15
+ };
16
+ /**
17
+ * Presentation mode.
18
+ * - full: Show label, control, and status.
19
+ * - compact: Show label and control.
20
+ * - inline: Control only.
21
+ * - static: Plain DOM; omit all undefined values.
22
+ */
23
+ export type Presentation = 'full' | 'compact' | 'inline' | 'static';
24
+ /**
25
+ * Props passed to input components.
26
+ */
27
+ export type FormFieldComponentProps<T = any> = {
28
+ type: SchemaAST.AST;
29
+ format?: Format.TypeFormat;
30
+ readonly?: boolean;
31
+ label: string;
32
+ placeholder?: string;
33
+ autoFocus?: boolean;
34
+ layout?: Presentation;
35
+ /** Database the form is editing against; populated for fields whose value is an ECHO object/Ref. */
36
+ db?: Database.Database;
37
+ } & FormFieldStateProps<T>;
38
+ /**
39
+ * Form field component.
40
+ */
41
+ export type FormFieldComponent = FC<FormFieldComponentProps>;
42
+ export type FormFieldMap = Record<string, FormFieldComponent>;
43
+ export type FormFieldProvider = (props: {
44
+ prop: string;
45
+ schema: Schema.Schema<any>;
46
+ fieldProps: FormFieldComponentProps;
47
+ }) => ReactElement | undefined;
48
+ export type FormFieldLabelProps = {
49
+ asChild?: boolean;
50
+ error?: string;
51
+ } & Pick<FormFieldComponentProps, 'label' | 'readonly'>;
52
+ export declare function FormFieldLabel({ label, error, readonly, asChild }: FormFieldLabelProps): React.JSX.Element;
53
+ export declare namespace FormFieldLabel {
54
+ var displayName: string;
55
+ }
56
+ export type FormFieldWrapperProps<T = any> = Pick<FormFieldComponentProps, 'readonly' | 'label' | 'layout' | 'getStatus' | 'getValue'> & {
57
+ children?: (props: {
58
+ value: T;
59
+ }) => ReactNode;
60
+ };
61
+ export declare const FormFieldWrapper: <T>(props: FormFieldWrapperProps<T>) => React.JSX.Element | null;
62
+ type FormFieldErrorState = {
63
+ error: Error | undefined;
64
+ };
65
+ type FormFieldErrorBoundaryProps = PropsWithChildren<{
66
+ path?: (string | number)[];
67
+ }>;
68
+ export declare class FormFieldErrorBoundary extends Component<FormFieldErrorBoundaryProps, FormFieldErrorState> {
69
+ static getDerivedStateFromError(error: Error): {
70
+ error: Error;
71
+ };
72
+ state: {
73
+ error: undefined;
74
+ };
75
+ componentDidUpdate(prevProps: FormFieldErrorBoundaryProps): void;
76
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
77
+ private resetError;
78
+ }
79
+ //# sourceMappingURL=FormFieldComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldComponent.d.ts","s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IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,qBAAa,sBAAuB,SAAQ,SAAS,CAAC,2BAA2B,EAAE,mBAAmB,CAAC;IACrG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAE9D;IAEQ,KAAK;QAAK,KAAK;MAAc;IAE7B,kBAAkB,CAAC,SAAS,EAAE,2BAA2B,QAIjE;IAEQ,MAAM,kRAWd;IAED,OAAO,CAAC,UAAU;CAGnB"}
@@ -0,0 +1,9 @@
1
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ import { type FormFieldComponentProps } from './FormFieldComponent';
4
+ declare const DefaultStory: ({ type, placeholder, readonly, onBlur, onValueChange, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
5
+ declare const meta: Meta<typeof DefaultStory>;
6
+ export default meta;
7
+ type Story = StoryObj<typeof meta>;
8
+ export declare const Default: Story;
9
+ //# sourceMappingURL=FormFieldComponent.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldComponent.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldComponent.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,sBAAsB,CAAC;AAEtF,QAAA,MAAM,YAAY,qEAOf,uBAAuB,CAAC,MAAM,CAAC,sBAsBjC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAOnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { type AnyProperties } from '@dxos/echo/internal';
3
+ import { type SchemaProperty } from '@dxos/effect';
4
+ import { type FormHandlerProps } from '../../hooks';
5
+ import { type FormFieldProps } from './FormField';
6
+ export type FormFieldSetProps<T extends AnyProperties> = {
7
+ label?: string;
8
+ sort?: string[];
9
+ exclude?: (props: SchemaProperty[]) => SchemaProperty[];
10
+ } & Pick<FormHandlerProps<T>, 'schema'> & Pick<FormFieldProps, 'path' | 'autoFocus' | 'readonly' | 'layout' | 'projection' | 'fieldMap' | 'fieldProvider' | 'createTypename' | 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'useSchema' | 'getOptions' | 'onCreate'>;
11
+ export declare function FormFieldSet({ label, schema, readonly, path, sort, exclude, projection, layout, ...props }: FormFieldSetProps<any>): React.JSX.Element | null;
12
+ export declare namespace FormFieldSet {
13
+ var displayName: string;
14
+ }
15
+ //# sourceMappingURL=FormFieldSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldSet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldSet.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAK7D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;CACzD,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GACrC,IAAI,CACF,cAAc,EACZ,MAAM,GACN,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,WAAW,GACX,YAAY,GACZ,UAAU,CACb,CAAC;qCAKyB,EAC3B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,GAAG,CAAC"}