@dxos/react-ui-form 0.8.4-main.b97322e → 0.8.4-main.bc674ce

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 (197) hide show
  1. package/dist/lib/browser/index.mjs +2220 -2058
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +2220 -2058
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/ControlSection/ControlSection.d.ts +4 -4
  8. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +1 -1
  9. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +84 -5
  10. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +1 -1
  11. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +6 -5
  12. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  13. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +82 -5
  14. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  15. package/dist/types/src/components/Form/Form-old.stories.d.ts +131 -0
  16. package/dist/types/src/components/Form/Form-old.stories.d.ts.map +1 -0
  17. package/dist/types/src/components/Form/Form.d.ts +81 -25
  18. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  19. package/dist/types/src/components/Form/Form.stories.d.ts +127 -55
  20. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/Form/FormField.d.ts +37 -0
  22. package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
  23. package/dist/types/src/components/Form/FormFieldComponent.d.ts +78 -0
  24. package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
  25. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
  26. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
  27. package/dist/types/src/components/Form/FormFieldSet.d.ts +19 -0
  28. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
  29. package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
  30. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
  31. package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
  32. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
  33. package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
  34. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
  35. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +4 -0
  36. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
  37. package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
  38. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
  39. package/dist/types/src/components/Form/fields/RefField.d.ts +14 -0
  40. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
  41. package/dist/types/src/components/Form/fields/SelectField.d.ts +10 -0
  42. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
  43. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
  44. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
  45. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +82 -0
  46. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
  47. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
  48. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
  49. package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
  50. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
  51. package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
  52. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
  53. package/dist/types/src/components/Form/fields/index.d.ts +12 -0
  54. package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
  55. package/dist/types/src/components/Form/index.d.ts +2 -4
  56. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  57. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +46 -0
  58. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -0
  59. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +85 -0
  60. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -0
  61. package/dist/types/src/components/ObjectPicker/index.d.ts +2 -0
  62. package/dist/types/src/components/ObjectPicker/index.d.ts.map +1 -0
  63. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +21 -9
  64. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  65. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +83 -8
  66. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  67. package/dist/types/src/components/index.d.ts +1 -1
  68. package/dist/types/src/components/index.d.ts.map +1 -1
  69. package/dist/types/src/components/testing.d.ts +4 -3
  70. package/dist/types/src/components/testing.d.ts.map +1 -1
  71. package/dist/types/src/hooks/index.d.ts +2 -3
  72. package/dist/types/src/hooks/index.d.ts.map +1 -1
  73. package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
  74. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
  75. package/dist/types/src/hooks/useKeyHandler.d.ts +6 -0
  76. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
  77. package/dist/types/src/translations.d.ts +19 -10
  78. package/dist/types/src/translations.d.ts.map +1 -1
  79. package/dist/types/src/util/echo.d.ts +6 -0
  80. package/dist/types/src/util/echo.d.ts.map +1 -0
  81. package/dist/types/src/util/field.d.ts +3 -3
  82. package/dist/types/src/util/field.d.ts.map +1 -1
  83. package/dist/types/src/util/formatting.d.ts +2 -2
  84. package/dist/types/src/util/formatting.d.ts.map +1 -1
  85. package/dist/types/src/util/index.d.ts +2 -1
  86. package/dist/types/src/util/index.d.ts.map +1 -1
  87. package/dist/types/src/util/properties.d.ts +7 -0
  88. package/dist/types/src/util/properties.d.ts.map +1 -0
  89. package/dist/types/src/util/refs.d.ts +2 -3
  90. package/dist/types/src/util/refs.d.ts.map +1 -1
  91. package/dist/types/tsconfig.tsbuildinfo +1 -1
  92. package/package.json +51 -40
  93. package/src/components/ControlSection/ControlSection.stories.tsx +11 -14
  94. package/src/components/ControlSection/ControlSection.tsx +30 -16
  95. package/src/components/FieldEditor/FieldEditor.stories.tsx +52 -31
  96. package/src/components/FieldEditor/FieldEditor.test.tsx +3 -2
  97. package/src/components/FieldEditor/FieldEditor.tsx +86 -81
  98. package/src/components/Form/Form-old.stories.tsx +314 -0
  99. package/src/components/Form/Form.stories.tsx +155 -219
  100. package/src/components/Form/Form.tsx +320 -96
  101. package/src/components/Form/FormField.tsx +286 -0
  102. package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
  103. package/src/components/Form/FormFieldComponent.tsx +174 -0
  104. package/src/components/Form/FormFieldSet.tsx +125 -0
  105. package/src/components/Form/README.md +3 -0
  106. package/src/components/Form/fields/ArrayField.tsx +151 -0
  107. package/src/components/Form/fields/BooleanField.tsx +22 -0
  108. package/src/components/Form/fields/GeoPointField.tsx +120 -0
  109. package/src/components/Form/fields/MarkdownField.tsx +78 -0
  110. package/src/components/Form/fields/NumberField.tsx +39 -0
  111. package/src/components/Form/fields/RefField.tsx +181 -0
  112. package/src/components/Form/fields/SelectField.tsx +65 -0
  113. package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +25 -22
  114. package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +47 -42
  115. package/src/components/Form/fields/TextAreaField.tsx +38 -0
  116. package/src/components/Form/fields/TextField.tsx +38 -0
  117. package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +16 -9
  118. package/src/components/Form/fields/index.ts +15 -0
  119. package/src/components/Form/index.ts +3 -4
  120. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +214 -0
  121. package/src/components/ObjectPicker/ObjectPicker.tsx +175 -0
  122. package/src/components/ObjectPicker/index.ts +5 -0
  123. package/src/components/ViewEditor/ViewEditor.stories.tsx +137 -61
  124. package/src/components/ViewEditor/ViewEditor.test.tsx +19 -17
  125. package/src/components/ViewEditor/ViewEditor.tsx +324 -203
  126. package/src/components/index.ts +1 -2
  127. package/src/components/testing.tsx +19 -11
  128. package/src/hooks/index.ts +2 -3
  129. package/src/hooks/useFormHandler.ts +362 -0
  130. package/src/hooks/useKeyHandler.tsx +37 -0
  131. package/src/translations.ts +21 -12
  132. package/src/util/echo.ts +25 -0
  133. package/src/util/field.ts +33 -43
  134. package/src/util/formatting.ts +22 -22
  135. package/src/util/index.ts +2 -1
  136. package/src/util/properties.ts +18 -0
  137. package/src/util/refs.ts +12 -18
  138. package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
  139. package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
  140. package/dist/types/src/components/Form/Defaults.d.ts +0 -14
  141. package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
  142. package/dist/types/src/components/Form/FormActions.d.ts +0 -9
  143. package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
  144. package/dist/types/src/components/Form/FormContent.d.ts +0 -57
  145. package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
  146. package/dist/types/src/components/Form/FormContext.d.ts +0 -23
  147. package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
  148. package/dist/types/src/components/Form/Input.d.ts +0 -26
  149. package/dist/types/src/components/Form/Input.d.ts.map +0 -1
  150. package/dist/types/src/components/Form/RefField.d.ts +0 -12
  151. package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
  152. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
  153. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
  154. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
  155. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
  156. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -7
  157. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
  158. package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
  159. package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
  160. package/dist/types/src/components/Form/custom/index.d.ts +0 -4
  161. package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
  162. package/dist/types/src/components/Form/factory.d.ts +0 -8
  163. package/dist/types/src/components/Form/factory.d.ts.map +0 -1
  164. package/dist/types/src/components/deprecated/Form.d.ts +0 -15
  165. package/dist/types/src/components/deprecated/Form.d.ts.map +0 -1
  166. package/dist/types/src/components/deprecated/Form.stories.d.ts +0 -13
  167. package/dist/types/src/components/deprecated/Form.stories.d.ts.map +0 -1
  168. package/dist/types/src/components/deprecated/FormInput.d.ts +0 -16
  169. package/dist/types/src/components/deprecated/FormInput.d.ts.map +0 -1
  170. package/dist/types/src/components/deprecated/index.d.ts +0 -2
  171. package/dist/types/src/components/deprecated/index.d.ts.map +0 -1
  172. package/dist/types/src/hooks/useForm.d.ts +0 -67
  173. package/dist/types/src/hooks/useForm.d.ts.map +0 -1
  174. package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -23
  175. package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
  176. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
  177. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
  178. package/dist/types/src/util/schema.d.ts +0 -3
  179. package/dist/types/src/util/schema.d.ts.map +0 -1
  180. package/src/components/Form/ArrayField.tsx +0 -124
  181. package/src/components/Form/Defaults.tsx +0 -203
  182. package/src/components/Form/FormActions.tsx +0 -53
  183. package/src/components/Form/FormContent.tsx +0 -240
  184. package/src/components/Form/FormContext.tsx +0 -110
  185. package/src/components/Form/Input.tsx +0 -51
  186. package/src/components/Form/RefField.tsx +0 -213
  187. package/src/components/Form/custom/GeoPointInput.tsx +0 -72
  188. package/src/components/Form/custom/index.ts +0 -7
  189. package/src/components/Form/factory.tsx +0 -31
  190. package/src/components/deprecated/Form.stories.tsx +0 -62
  191. package/src/components/deprecated/Form.tsx +0 -119
  192. package/src/components/deprecated/FormInput.tsx +0 -71
  193. package/src/components/deprecated/index.ts +0 -5
  194. package/src/hooks/useForm.ts +0 -291
  195. package/src/hooks/useQueryRefOptions.ts +0 -53
  196. package/src/hooks/useRefQueryLookupHandler.ts +0 -39
  197. package/src/util/schema.ts +0 -14
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { type AnyProperties } from '@dxos/echo/internal';
3
+ import { type SchemaProperty } from '@dxos/effect';
4
+ import { type ThemedClassName } from '@dxos/react-ui';
5
+ import { type FormHandlerProps } from '../../hooks';
6
+ import { type FormFieldProps } from './FormField';
7
+ export type FormFieldSetProps<T extends AnyProperties> = ThemedClassName<{
8
+ label?: string;
9
+ exclude?: (props: SchemaProperty[]) => SchemaProperty[];
10
+ sort?: string[];
11
+ } & Pick<FormHandlerProps<T>, 'schema'> & Pick<FormFieldProps, 'path' | 'autoFocus' | 'readonly' | 'layout' | 'projection' | 'fieldMap' | 'fieldProvider' | 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'db' | 'schemaHook' | 'getOptions' | 'onCreate'>>;
12
+ export declare const FormFieldSet: React.ForwardRefExoticComponent<Omit<{
13
+ label?: string;
14
+ exclude?: (props: SchemaProperty[]) => SchemaProperty[];
15
+ sort?: string[];
16
+ } & Pick<FormHandlerProps<any>, "schema"> & Pick<FormFieldProps, "path" | "autoFocus" | "readonly" | "layout" | "createOptionLabel" | "createOptionIcon" | "createInitialValuePath" | "onCreate" | "db" | "schemaHook" | "getOptions" | "fieldProvider" | "projection" | "fieldMap">, "className"> & {
17
+ classNames?: import("@dxos/ui-types").ClassNameValue;
18
+ } & React.RefAttributes<HTMLDivElement>>;
19
+ //# 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,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI,eAAe,CACtE;IACE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;IACxD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,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,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,IAAI,GACJ,YAAY,GACZ,YAAY,GACZ,UAAU,CACb,CACJ,CAAC;AAEF,eAAO,MAAM,YAAY;YAvBb,MAAM;cACJ,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE;WAChD,MAAM,EAAE;;;wCAmGlB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as SchemaAST from 'effect/SchemaAST';
2
+ import React from 'react';
3
+ import { type FormFieldProps } from '../FormField';
4
+ import { type FormFieldStateProps } from '../FormFieldComponent';
5
+ export type ArrayFieldProps = {
6
+ label: string;
7
+ fieldProps: FormFieldStateProps;
8
+ } & FormFieldProps;
9
+ export declare const ArrayField: {
10
+ ({ type, path, label, readonly, layout, fieldProps: inputProps, ...props }: ArrayFieldProps): React.JSX.Element | null;
11
+ displayName: string;
12
+ };
13
+ /**
14
+ * Returns the default empty value for a given AST.
15
+ * Used for initializing new array values etc.
16
+ */
17
+ export declare const getDefaultValue: (ast?: SchemaAST.AST) => any;
18
+ //# sourceMappingURL=ArrayField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/ArrayField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAgC,MAAM,OAAO,CAAC;AAQrD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;CACjC,GAAG,cAAc,CAAC;AAEnB,eAAO,MAAM,UAAU;gFAQpB,eAAe;;CA4FjB,CAAC;AAIF;;;GAGG;AAEH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,CAAC,GAAG,KAAG,GAmBrD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const BooleanField: ({ type, readonly, onValueChange, ...props }: FormFieldComponentProps<boolean>) => React.JSX.Element;
4
+ //# sourceMappingURL=BooleanField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BooleanField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/BooleanField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,YAAY,GAAI,6CAA6C,uBAAuB,CAAC,OAAO,CAAC,sBAWzG,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type GeoPoint } from '@dxos/echo/internal';
3
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
4
+ export declare const GeoPointField: ({ type, label, readonly, layout, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<GeoPoint>) => React.JSX.Element | null;
5
+ //# sourceMappingURL=GeoPointField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoPointField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/GeoPointField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKjE,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,GAAI,gFAS3B,uBAAuB,CAAC,QAAQ,CAAC,6BA+EnC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const MarkdownField: ({ type, readonly, label, placeholder, layout, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps) => React.JSX.Element | null;
4
+ //# sourceMappingURL=MarkdownField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,GAAI,6FAU3B,uBAAuB,6BAyDzB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const NumberField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<number>) => React.JSX.Element;
4
+ //# sourceMappingURL=NumberField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,WAAW,GAAI,kEAOzB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import '@dxos/lit-ui/dx-tag-picker.pcss';
2
+ import React from 'react';
3
+ import { type Database, Entity, type Type } from '@dxos/echo';
4
+ import { type ObjectPickerContentProps, type RefOption } from '../../ObjectPicker';
5
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
6
+ export type RefFieldProps = FormFieldComponentProps & Pick<ObjectPickerContentProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath'> & {
7
+ db?: Database.Database;
8
+ resultsHook?: (db?: Database.Database, typename?: string) => Entity.Any[];
9
+ schemaHook?: (db?: Database.Database, typename?: string) => Type.Entity.Any;
10
+ getOptions?: (objects: Entity.Any[]) => RefOption[];
11
+ onCreate?: (schema: Type.Entity.Any, values: any) => void;
12
+ };
13
+ export declare const RefField: (props: RefFieldProps) => React.JSX.Element | null;
14
+ //# sourceMappingURL=RefField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,iCAAiC,CAAC;AAEzC,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAU3E,OAAO,EAAgB,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAiBrF,MAAM,MAAM,aAAa,GAAG,uBAAuB,GACjD,IAAI,CAAC,wBAAwB,EAAE,mBAAmB,GAAG,kBAAkB,GAAG,wBAAwB,CAAC,GAAG;IACpG,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IAC5E,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,SAAS,EAAE,CAAC;IACpD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEJ,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,6BAsI5C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export type SelectFieldOptions = FormFieldComponentProps & {
4
+ options?: Array<{
5
+ value: string | number;
6
+ label?: string;
7
+ }>;
8
+ };
9
+ export declare const SelectField: ({ type, readonly, label, layout, placeholder, options, getStatus, getValue, onValueChange, }: SelectFieldOptions) => React.JSX.Element | null;
10
+ //# sourceMappingURL=SelectField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,8FAUzB,kBAAkB,6BAwCpB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type SelectOption } from '@dxos/echo/internal';
3
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
4
+ export declare const SelectOptionField: ({ type, readonly, label, getStatus, getValue, onValueChange, }: FormFieldComponentProps<SelectOption[] | undefined>) => React.JSX.Element;
5
+ //# sourceMappingURL=SelectOptionField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectOptionField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQxD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,iBAAiB,GAAI,gEAO/B,uBAAuB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,sBA6KrD,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: any;
6
+ render: () => React.JSX.Element;
7
+ decorators: import("@storybook/react").Decorator[];
8
+ parameters: {
9
+ layout: string;
10
+ translations: [{
11
+ readonly 'en-US': {
12
+ readonly "@dxos/react-ui-form": {
13
+ readonly 'fields label': "Fields";
14
+ readonly 'hidden fields label': "Hidden Fields";
15
+ readonly 'empty readonly ref field label': "(none)";
16
+ readonly 'add property button label': "Add property";
17
+ readonly 'field property label': "Property";
18
+ readonly 'field property placeholder': "Property name";
19
+ readonly 'field format label': "Type";
20
+ readonly 'field path label': "Field path";
21
+ readonly 'add field': "Add field";
22
+ readonly 'delete field': "Delete field";
23
+ readonly 'field limit reached': "Maximum number of fields reached";
24
+ readonly 'boolean input true value': "Yes";
25
+ readonly 'boolean input false value': "No";
26
+ readonly 'show field label': "Show field";
27
+ readonly 'hide field label': "Hide field";
28
+ readonly 'delete field label': "Delete field";
29
+ readonly 'ref field combobox input placeholder': "Search…";
30
+ readonly 'ref field placeholder_one': "Select…";
31
+ readonly 'ref field placeholder_other': "Select items…";
32
+ readonly 'example placeholder': "Example";
33
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
34
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
35
+ readonly 'cancel button label': "Cancel";
36
+ readonly 'save button label': "Save";
37
+ readonly 'format boolean': "Boolean";
38
+ readonly 'format currency': "Currency";
39
+ readonly 'format date': "Date";
40
+ readonly 'format date-time': "DateTime";
41
+ readonly 'format did': "DID";
42
+ readonly 'format duration': "Duration";
43
+ readonly 'format dxn': "DXN";
44
+ readonly 'format email': "Email";
45
+ readonly 'format formula': "Formula";
46
+ readonly 'format hostname': "Hostname";
47
+ readonly 'format integer': "Integer";
48
+ readonly 'format json': "JSON";
49
+ readonly 'format lnglat': "Geopoint";
50
+ readonly 'format markdown': "Markdown";
51
+ readonly 'format percent': "Percent";
52
+ readonly 'format ref': "Reference";
53
+ readonly 'format regex': "RegExp";
54
+ readonly 'format string': "String";
55
+ readonly 'format single-select': "Select";
56
+ readonly 'format multi-select': "Multi-select";
57
+ readonly 'format text': "Long text";
58
+ readonly 'format time': "Time";
59
+ readonly 'format timestamp': "Timestamp";
60
+ readonly 'format user': "User";
61
+ readonly 'format number': "Number";
62
+ readonly 'format uri': "URI";
63
+ readonly 'format url': "URL";
64
+ readonly 'format uuid': "UUID";
65
+ readonly 'latitude label': "Latitude";
66
+ readonly 'longitude label': "Longitude";
67
+ readonly 'select option label': "Label";
68
+ readonly 'select option label placeholder': "Option label";
69
+ readonly 'select option color': "Color";
70
+ readonly 'select option delete': "Delete";
71
+ readonly 'select option add': "Add option";
72
+ readonly 'system schema title': "System type";
73
+ readonly 'system schema description': "System type: cannot add or remove fields.";
74
+ };
75
+ };
76
+ }];
77
+ };
78
+ };
79
+ export default meta;
80
+ type Story = StoryObj<typeof meta>;
81
+ export declare const Default: Story;
82
+ //# sourceMappingURL=SelectOptionField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectOptionField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0CxC,QAAA,MAAM,IAAI;;eAEwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOA,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const TextAreaField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
4
+ //# sourceMappingURL=TextAreaField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextAreaField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa,GAAI,kEAO3B,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const TextField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
4
+ //# sourceMappingURL=TextField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,SAAS,GAAI,kEAOvB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const TupleField: ({ binding, type, readonly, label, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<Record<string, number>> & {
4
+ binding: string[];
5
+ }) => React.JSX.Element;
6
+ //# sourceMappingURL=TupleField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TupleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TupleField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAIrF,eAAO,MAAM,UAAU,GAAI,iFASxB,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,sBA4BA,CAAC"}
@@ -0,0 +1,12 @@
1
+ export * from './ArrayField';
2
+ export * from './BooleanField';
3
+ export * from './GeoPointField';
4
+ export * from './MarkdownField';
5
+ export * from './NumberField';
6
+ export * from './RefField';
7
+ export * from './SelectField';
8
+ export * from './SelectOptionField';
9
+ export * from './TextField';
10
+ export * from './TextAreaField';
11
+ export * from './TupleField';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
@@ -1,6 +1,4 @@
1
- export * from './custom';
2
- export * from './Defaults';
1
+ export * from './fields';
3
2
  export * from './Form';
4
- export * from './FormContext';
5
- export * from './Input';
3
+ export * from './FormFieldComponent';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type * as Schema from 'effect/Schema';
2
+ import React from 'react';
3
+ import { type Palette, type ThemedClassName } from '@dxos/react-ui';
4
+ export type RefOption = {
5
+ id: string;
6
+ label: string;
7
+ hue?: Palette;
8
+ };
9
+ export type ObjectPickerContentProps = ThemedClassName<{
10
+ options: RefOption[];
11
+ selectedIds?: string[];
12
+ createOptionLabel?: [string, {
13
+ ns: string;
14
+ }];
15
+ createOptionIcon?: string;
16
+ createSchema?: Schema.Schema.AnyNoContext;
17
+ createInitialValuePath?: string;
18
+ onCreate?: (values: any) => void;
19
+ onSelect: (id: string) => void;
20
+ }>;
21
+ export declare const ObjectPicker: {
22
+ Root: ({ modal, modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children, }: import("@dxos/react-ui-searchlist").ComboboxRootProps) => React.JSX.Element;
23
+ Portal: React.FC<import("@dxos/react-ui").PopoverPortalProps>;
24
+ Trigger: React.ForwardRefExoticComponent<Omit<import("@dxos/react-ui").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
25
+ VirtualTrigger: {
26
+ (props: import("@dxos/react-ui").PopoverVirtualTriggerProps & {
27
+ __scopePopover?: import("@radix-ui/react-context").Scope;
28
+ }): React.JSX.Element;
29
+ displayName: string;
30
+ };
31
+ Content: React.ForwardRefExoticComponent<Omit<{
32
+ options: RefOption[];
33
+ selectedIds?: string[];
34
+ createOptionLabel?: [string, {
35
+ ns: string;
36
+ }];
37
+ createOptionIcon?: string;
38
+ createSchema?: Schema.Schema.AnyNoContext;
39
+ createInitialValuePath?: string;
40
+ onCreate?: (values: any) => void;
41
+ onSelect: (id: string) => void;
42
+ }, "className"> & {
43
+ classNames?: import("@dxos/ui-types").ClassNameValue;
44
+ } & React.RefAttributes<HTMLDivElement>>;
45
+ };
46
+ //# sourceMappingURL=ObjectPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAgE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,KAAK,OAAO,EAAW,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAM7F,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC,CAAC;AA4IH,eAAO,MAAM,YAAY;;;;;;0BAxEf,CAAJ;;;;;iBA5EK,SAAS,EAAE;sBACN,MAAM,EAAE;4BACF,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;2BACzB,MAAM;uBACV,MAAM,CAAC,MAAM,CAAC,YAAY;iCAChB,MAAM;mBACpB,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;kBACtB,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;;CAmJ/B,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ render: () => React.JSX.Element;
6
+ decorators: import("@storybook/react").Decorator[];
7
+ parameters: {
8
+ layout: string;
9
+ controls: {
10
+ disable: boolean;
11
+ };
12
+ translations: [{
13
+ readonly 'en-US': {
14
+ readonly "@dxos/react-ui-form": {
15
+ readonly 'fields label': "Fields";
16
+ readonly 'hidden fields label': "Hidden Fields";
17
+ readonly 'empty readonly ref field label': "(none)";
18
+ readonly 'add property button label': "Add property";
19
+ readonly 'field property label': "Property";
20
+ readonly 'field property placeholder': "Property name";
21
+ readonly 'field format label': "Type";
22
+ readonly 'field path label': "Field path";
23
+ readonly 'add field': "Add field";
24
+ readonly 'delete field': "Delete field";
25
+ readonly 'field limit reached': "Maximum number of fields reached";
26
+ readonly 'boolean input true value': "Yes";
27
+ readonly 'boolean input false value': "No";
28
+ readonly 'show field label': "Show field";
29
+ readonly 'hide field label': "Hide field";
30
+ readonly 'delete field label': "Delete field";
31
+ readonly 'ref field combobox input placeholder': "Search…";
32
+ readonly 'ref field placeholder_one': "Select…";
33
+ readonly 'ref field placeholder_other': "Select items…";
34
+ readonly 'example placeholder': "Example";
35
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
36
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
37
+ readonly 'cancel button label': "Cancel";
38
+ readonly 'save button label': "Save";
39
+ readonly 'format boolean': "Boolean";
40
+ readonly 'format currency': "Currency";
41
+ readonly 'format date': "Date";
42
+ readonly 'format date-time': "DateTime";
43
+ readonly 'format did': "DID";
44
+ readonly 'format duration': "Duration";
45
+ readonly 'format dxn': "DXN";
46
+ readonly 'format email': "Email";
47
+ readonly 'format formula': "Formula";
48
+ readonly 'format hostname': "Hostname";
49
+ readonly 'format integer': "Integer";
50
+ readonly 'format json': "JSON";
51
+ readonly 'format lnglat': "Geopoint";
52
+ readonly 'format markdown': "Markdown";
53
+ readonly 'format percent': "Percent";
54
+ readonly 'format ref': "Reference";
55
+ readonly 'format regex': "RegExp";
56
+ readonly 'format string': "String";
57
+ readonly 'format single-select': "Select";
58
+ readonly 'format multi-select': "Multi-select";
59
+ readonly 'format text': "Long text";
60
+ readonly 'format time': "Time";
61
+ readonly 'format timestamp': "Timestamp";
62
+ readonly 'format user': "User";
63
+ readonly 'format number': "Number";
64
+ readonly 'format uri': "URI";
65
+ readonly 'format url': "URL";
66
+ readonly 'format uuid': "UUID";
67
+ readonly 'latitude label': "Latitude";
68
+ readonly 'longitude label': "Longitude";
69
+ readonly 'select option label': "Label";
70
+ readonly 'select option label placeholder': "Option label";
71
+ readonly 'select option color': "Color";
72
+ readonly 'select option delete': "Delete";
73
+ readonly 'select option add': "Add option";
74
+ readonly 'system schema title': "System type";
75
+ readonly 'system schema description': "System type: cannot add or remove fields.";
76
+ };
77
+ };
78
+ }];
79
+ };
80
+ };
81
+ export default meta;
82
+ type Story = StoryObj<typeof meta>;
83
+ export declare const Default: Story;
84
+ export declare const WithTest: Story;
85
+ //# sourceMappingURL=ObjectPicker.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectPicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AA4FzE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KA2FtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './ObjectPicker';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
@@ -1,20 +1,32 @@
1
- import { Schema } from 'effect';
1
+ import * as Schema from 'effect/Schema';
2
2
  import React from 'react';
3
- import { type SchemaRegistry } from '@dxos/echo-db';
3
+ import { QueryAST, type SchemaRegistry } from '@dxos/echo';
4
4
  import { type ThemedClassName } from '@dxos/react-ui';
5
- import { type DataType } from '@dxos/schema';
6
- import { type FormProps } from '../Form';
5
+ import { type QueryFormProps } from '@dxos/react-ui-components';
6
+ import { ProjectionModel, type View } from '@dxos/schema';
7
7
  export type ViewEditorProps = ThemedClassName<{
8
8
  schema: Schema.Schema.AnyNoContext;
9
- view: DataType.View;
10
- registry?: SchemaRegistry;
9
+ view: View.View;
10
+ mode?: 'schema' | 'tag';
11
+ registry?: SchemaRegistry.SchemaRegistry;
11
12
  readonly?: boolean;
12
13
  showHeading?: boolean;
13
- onTypenameChanged?: (typename: string) => void;
14
+ onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
14
15
  onDelete?: (fieldId: string) => void;
15
- } & Pick<FormProps<any>, 'outerSpacing'>>;
16
+ } & Pick<QueryFormProps, 'types' | 'tags'>>;
16
17
  /**
17
18
  * Schema-based object form.
18
19
  */
19
- export declare const ViewEditor: ({ classNames, schema, view, registry, readonly: _readonly, showHeading, onTypenameChanged, onDelete, outerSpacing, }: ViewEditorProps) => React.JSX.Element;
20
+ export declare const ViewEditor: React.ForwardRefExoticComponent<Omit<{
21
+ schema: Schema.Schema.AnyNoContext;
22
+ view: View.View;
23
+ mode?: "schema" | "tag";
24
+ registry?: SchemaRegistry.SchemaRegistry;
25
+ readonly?: boolean;
26
+ showHeading?: boolean;
27
+ onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
28
+ onDelete?: (fieldId: string) => void;
29
+ } & Pick<QueryFormProps, "types" | "tags">, "className"> & {
30
+ classNames?: import("@dxos/ui-types").ClassNameValue;
31
+ } & React.RefAttributes<ProjectionModel>>;
20
32
  //# sourceMappingURL=ViewEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAuB,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAI3F,OAAO,EAAiD,KAAK,QAAQ,EAAmB,MAAM,cAAc,CAAC;AAI7G,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAY/C,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,sHAUxB,eAAe,sBAsNjB,CAAC"}
1
+ {"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAsF,MAAM,OAAO,CAAC;AAE3G,OAAO,EAA8B,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAIvF,OAAO,EAA8B,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAGL,eAAe,EAEf,KAAK,IAAI,EAGV,MAAM,cAAc,CAAC;AAgBtB,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,CAC3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU;YAdX,MAAM,CAAC,MAAM,CAAC,YAAY;UAC5B,IAAI,CAAC,IAAI;WACR,QAAQ,GAAG,KAAK;eACZ,cAAc,CAAC,cAAc;eAC7B,OAAO;kBACJ,OAAO;qBACJ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;eACtD,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;;;yCAgKvC,CAAC"}
@@ -1,17 +1,92 @@
1
- import '@dxos-theme';
2
- import { type Meta, type StoryObj } from '@storybook/react-vite';
3
- import { type EchoSchema } from '@dxos/echo-schema';
4
- import { DataType, ProjectionModel } from '@dxos/schema';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ import { type EchoSchema } from '@dxos/echo/internal';
4
+ import { type ProjectionModel, View } from '@dxos/schema';
5
5
  import { type ViewEditorProps } from './ViewEditor';
6
6
  export type ViewEditorDebugObjects = {
7
7
  schema: EchoSchema;
8
- view: DataType.View;
8
+ view: View.View;
9
9
  projection: ProjectionModel;
10
10
  };
11
- type StoryProps = Pick<ViewEditorProps, 'readonly'>;
12
- declare const meta: Meta<StoryProps>;
11
+ type StoryProps = Pick<ViewEditorProps, 'readonly' | 'mode'>;
12
+ declare const meta: {
13
+ title: string;
14
+ render: (props: StoryProps) => React.JSX.Element;
15
+ decorators: import("@storybook/react").Decorator[];
16
+ parameters: {
17
+ layout: string;
18
+ translations: [{
19
+ readonly 'en-US': {
20
+ readonly "@dxos/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 'add property button label': "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 combobox input placeholder': "Search…";
38
+ readonly 'ref field placeholder_one': "Select…";
39
+ readonly 'ref field placeholder_other': "Select items…";
40
+ readonly 'example placeholder': "Example";
41
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
42
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
43
+ readonly 'cancel button label': "Cancel";
44
+ readonly 'save button label': "Save";
45
+ readonly 'format boolean': "Boolean";
46
+ readonly 'format currency': "Currency";
47
+ readonly 'format date': "Date";
48
+ readonly 'format date-time': "DateTime";
49
+ readonly 'format did': "DID";
50
+ readonly 'format duration': "Duration";
51
+ readonly 'format dxn': "DXN";
52
+ readonly 'format email': "Email";
53
+ readonly 'format formula': "Formula";
54
+ readonly 'format hostname': "Hostname";
55
+ readonly 'format integer': "Integer";
56
+ readonly 'format json': "JSON";
57
+ readonly 'format lnglat': "Geopoint";
58
+ readonly 'format markdown': "Markdown";
59
+ readonly 'format percent': "Percent";
60
+ readonly 'format ref': "Reference";
61
+ readonly 'format regex': "RegExp";
62
+ readonly 'format string': "String";
63
+ readonly 'format single-select': "Select";
64
+ readonly 'format multi-select': "Multi-select";
65
+ readonly 'format text': "Long text";
66
+ readonly 'format time': "Time";
67
+ readonly 'format timestamp': "Timestamp";
68
+ readonly 'format user': "User";
69
+ readonly 'format number': "Number";
70
+ readonly 'format uri': "URI";
71
+ readonly 'format url': "URL";
72
+ readonly 'format uuid': "UUID";
73
+ readonly 'latitude label': "Latitude";
74
+ readonly 'longitude label': "Longitude";
75
+ readonly 'select option label': "Label";
76
+ readonly 'select option label placeholder': "Option label";
77
+ readonly 'select option color': "Color";
78
+ readonly 'select option delete': "Delete";
79
+ readonly 'select option add': "Add option";
80
+ readonly 'system schema title': "System type";
81
+ readonly 'system schema description': "System type: cannot add or remove fields.";
82
+ };
83
+ };
84
+ }];
85
+ };
86
+ };
13
87
  export default meta;
14
- type Story = StoryObj<StoryProps>;
88
+ type Story = StoryObj<typeof meta>;
15
89
  export declare const Default: Story;
16
90
  export declare const Readonly: Story;
91
+ export declare const TagQueryMode: Story;
17
92
  //# sourceMappingURL=ViewEditor.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAU,KAAK,UAAU,EAA6B,MAAM,mBAAmB,CAAC;AAIvF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAc,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAKhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,KAAK,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAiFpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAK1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
1
+ {"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AAK5E,OAAO,EAAE,KAAK,eAAe,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAMhF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,KAAK,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AA+H7D,QAAA,MAAM,IAAI;;oBA7HmB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJF,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC"}