@dxos/react-ui-form 0.8.4-main.406dc2a → 0.8.4-main.4668b7de9b

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 (283) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +0 -1
  3. package/dist/lib/browser/index.mjs +3504 -2302
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/translations.mjs +83 -0
  7. package/dist/lib/browser/translations.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +3504 -2302
  9. package/dist/lib/node-esm/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/lib/node-esm/translations.mjs +85 -0
  12. package/dist/lib/node-esm/translations.mjs.map +7 -0
  13. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
  14. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  15. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +69 -60
  16. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/Form/Form.d.ts +135 -26
  18. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  19. package/dist/types/src/components/Form/Form.stories.d.ts +175 -138
  20. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/Form/FormField.d.ts +53 -0
  22. package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
  23. package/dist/types/src/components/Form/FormFieldComponent.d.ts +91 -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 +21 -0
  28. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
  29. package/dist/types/src/components/Form/FormTooltipsContext.d.ts +19 -0
  30. package/dist/types/src/components/Form/FormTooltipsContext.d.ts.map +1 -0
  31. package/dist/types/src/components/Form/Layout/FormLayout.d.ts +50 -0
  32. package/dist/types/src/components/Form/Layout/FormLayout.d.ts.map +1 -0
  33. package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts +119 -0
  34. package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +1 -0
  35. package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts +2 -0
  36. package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts.map +1 -0
  37. package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts +2 -0
  38. package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts.map +1 -0
  39. package/dist/types/src/components/Form/Layout/annotation.d.ts +30 -0
  40. package/dist/types/src/components/Form/Layout/annotation.d.ts.map +1 -0
  41. package/dist/types/src/components/Form/Layout/index.d.ts +4 -0
  42. package/dist/types/src/components/Form/Layout/index.d.ts.map +1 -0
  43. package/dist/types/src/components/Form/Layout/parser.d.ts +31 -0
  44. package/dist/types/src/components/Form/Layout/parser.d.ts.map +1 -0
  45. package/dist/types/src/components/Form/Layout/parser.test.d.ts +2 -0
  46. package/dist/types/src/components/Form/Layout/parser.test.d.ts.map +1 -0
  47. package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
  48. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
  49. package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
  50. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
  51. package/dist/types/src/components/Form/fields/DateField.d.ts +4 -0
  52. package/dist/types/src/components/Form/fields/DateField.d.ts.map +1 -0
  53. package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
  54. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
  55. package/dist/types/src/components/Form/fields/InlineRefField.d.ts +13 -0
  56. package/dist/types/src/components/Form/fields/InlineRefField.d.ts.map +1 -0
  57. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +11 -0
  58. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
  59. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +85 -0
  60. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
  61. package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
  62. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
  63. package/dist/types/src/components/Form/fields/RefField.d.ts +22 -0
  64. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
  65. package/dist/types/src/components/Form/fields/SelectField.d.ts +13 -0
  66. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
  67. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
  68. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
  69. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +85 -0
  70. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
  72. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
  73. package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
  74. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
  75. package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
  76. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
  77. package/dist/types/src/components/Form/fields/index.d.ts +14 -0
  78. package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
  79. package/dist/types/src/components/Form/index.d.ts +5 -4
  80. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  81. package/dist/types/src/components/Form/meta-tags.d.ts +30 -0
  82. package/dist/types/src/components/Form/meta-tags.d.ts.map +1 -0
  83. package/dist/types/src/components/Form/meta-tags.test.d.ts +2 -0
  84. package/dist/types/src/components/Form/meta-tags.test.d.ts.map +1 -0
  85. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +8 -0
  86. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
  87. package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
  88. package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
  89. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +39 -12
  90. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  91. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +65 -59
  92. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
  93. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
  94. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
  95. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +128 -0
  96. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
  97. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
  98. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
  99. package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
  100. package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
  101. package/dist/types/src/components/ObjectTree/ObjectTree.d.ts +9 -0
  102. package/dist/types/src/components/ObjectTree/ObjectTree.d.ts.map +1 -0
  103. package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts +87 -0
  104. package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts.map +1 -0
  105. package/dist/types/src/components/ObjectTree/index.d.ts +2 -0
  106. package/dist/types/src/components/ObjectTree/index.d.ts.map +1 -0
  107. package/dist/types/src/components/Settings/Settings.d.ts +51 -0
  108. package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
  109. package/dist/types/src/components/Settings/Settings.stories.d.ts +85 -0
  110. package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
  111. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
  112. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
  113. package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
  114. package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
  115. package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
  116. package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
  117. package/dist/types/src/components/Settings/index.d.ts +4 -0
  118. package/dist/types/src/components/Settings/index.d.ts.map +1 -0
  119. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +16 -20
  120. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  121. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +72 -66
  122. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  123. package/dist/types/src/components/index.d.ts +4 -1
  124. package/dist/types/src/components/index.d.ts.map +1 -1
  125. package/dist/types/src/components/testing.d.ts +13 -6
  126. package/dist/types/src/components/testing.d.ts.map +1 -1
  127. package/dist/types/src/hooks/index.d.ts +2 -3
  128. package/dist/types/src/hooks/index.d.ts.map +1 -1
  129. package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
  130. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
  131. package/dist/types/src/hooks/useKeyHandler.d.ts +7 -0
  132. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
  133. package/dist/types/src/index.d.ts +0 -2
  134. package/dist/types/src/index.d.ts.map +1 -1
  135. package/dist/types/src/translations.d.ts +66 -60
  136. package/dist/types/src/translations.d.ts.map +1 -1
  137. package/dist/types/src/util/field-type.d.ts +19 -0
  138. package/dist/types/src/util/field-type.d.ts.map +1 -0
  139. package/dist/types/src/util/field.d.ts +3 -3
  140. package/dist/types/src/util/field.d.ts.map +1 -1
  141. package/dist/types/src/util/formatting.d.ts +2 -2
  142. package/dist/types/src/util/formatting.d.ts.map +1 -1
  143. package/dist/types/src/util/index.d.ts +2 -1
  144. package/dist/types/src/util/index.d.ts.map +1 -1
  145. package/dist/types/src/util/properties.d.ts +24 -0
  146. package/dist/types/src/util/properties.d.ts.map +1 -0
  147. package/dist/types/src/util/properties.test.d.ts +2 -0
  148. package/dist/types/src/util/properties.test.d.ts.map +1 -0
  149. package/dist/types/src/util/refs.d.ts +2 -2
  150. package/dist/types/src/util/refs.d.ts.map +1 -1
  151. package/dist/types/tsconfig.tsbuildinfo +1 -1
  152. package/package.json +62 -51
  153. package/src/components/FieldEditor/FieldEditor.stories.tsx +44 -25
  154. package/src/components/FieldEditor/FieldEditor.test.tsx +4 -2
  155. package/src/components/FieldEditor/FieldEditor.tsx +88 -86
  156. package/src/components/Form/AUDIT.md +17 -0
  157. package/src/components/Form/Form.stories.tsx +134 -252
  158. package/src/components/Form/Form.tsx +461 -106
  159. package/src/components/Form/FormField.tsx +363 -0
  160. package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
  161. package/src/components/Form/FormFieldComponent.tsx +229 -0
  162. package/src/components/Form/FormFieldSet.tsx +173 -0
  163. package/src/components/Form/FormTooltipsContext.ts +25 -0
  164. package/src/components/Form/Layout/FormLayout.stories.test.tsx +51 -0
  165. package/src/components/Form/Layout/FormLayout.stories.tsx +422 -0
  166. package/src/components/Form/Layout/FormLayout.test.ts +59 -0
  167. package/src/components/Form/Layout/FormLayout.tsx +251 -0
  168. package/src/components/Form/Layout/annotation.ts +38 -0
  169. package/src/components/Form/Layout/index.ts +7 -0
  170. package/src/components/Form/Layout/parser.test.ts +120 -0
  171. package/src/components/Form/Layout/parser.ts +167 -0
  172. package/src/components/Form/README.md +3 -0
  173. package/src/components/Form/fields/ArrayField.tsx +178 -0
  174. package/src/components/Form/fields/BooleanField.tsx +22 -0
  175. package/src/components/Form/fields/DateField.tsx +101 -0
  176. package/src/components/Form/fields/GeoPointField.tsx +124 -0
  177. package/src/components/Form/fields/InlineRefField.tsx +146 -0
  178. package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
  179. package/src/components/Form/fields/MarkdownField.tsx +168 -0
  180. package/src/components/Form/fields/NumberField.tsx +39 -0
  181. package/src/components/Form/fields/RefField.tsx +235 -0
  182. package/src/components/Form/fields/SelectField.tsx +77 -0
  183. package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +23 -18
  184. package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +31 -24
  185. package/src/components/Form/fields/TextAreaField.tsx +38 -0
  186. package/src/components/Form/fields/TextField.tsx +38 -0
  187. package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +17 -9
  188. package/src/components/Form/fields/index.ts +17 -0
  189. package/src/components/Form/index.ts +6 -4
  190. package/src/components/Form/meta-tags.test.ts +47 -0
  191. package/src/components/Form/meta-tags.ts +33 -0
  192. package/src/components/ObjectForm/ObjectForm.tsx +109 -0
  193. package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
  194. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +30 -25
  195. package/src/components/ObjectPicker/ObjectPicker.tsx +123 -82
  196. package/src/components/ObjectProperties/ObjectProperties.stories.tsx +350 -0
  197. package/src/components/ObjectProperties/ObjectProperties.test.tsx +111 -0
  198. package/src/components/ObjectProperties/ObjectProperties.tsx +144 -0
  199. package/src/components/ObjectProperties/index.ts +5 -0
  200. package/src/components/ObjectTree/ObjectTree.stories.tsx +134 -0
  201. package/src/components/ObjectTree/ObjectTree.tsx +190 -0
  202. package/src/components/ObjectTree/index.ts +5 -0
  203. package/src/components/Settings/AUDIT.md +51 -0
  204. package/src/components/Settings/Settings.stories.tsx +104 -0
  205. package/src/components/Settings/Settings.tsx +81 -0
  206. package/src/components/Settings/SettingsFieldSet.tsx +257 -0
  207. package/src/components/Settings/SettingsItem.tsx +58 -0
  208. package/src/components/Settings/SettingsSelectField.tsx +59 -0
  209. package/src/components/Settings/index.ts +7 -0
  210. package/src/components/ViewEditor/ViewEditor.stories.tsx +75 -77
  211. package/src/components/ViewEditor/ViewEditor.test.tsx +16 -13
  212. package/src/components/ViewEditor/ViewEditor.tsx +295 -215
  213. package/src/components/index.ts +4 -1
  214. package/src/components/testing.tsx +24 -11
  215. package/src/hooks/index.ts +2 -3
  216. package/src/hooks/useFormHandler.ts +380 -0
  217. package/src/hooks/useKeyHandler.tsx +37 -0
  218. package/src/index.ts +0 -4
  219. package/src/translations.ts +71 -65
  220. package/src/util/field-type.ts +60 -0
  221. package/src/util/field.ts +25 -25
  222. package/src/util/formatting.ts +22 -22
  223. package/src/util/index.ts +2 -1
  224. package/src/util/properties.test.ts +121 -0
  225. package/src/util/properties.ts +61 -0
  226. package/src/util/refs.ts +16 -18
  227. package/src/vite-env.d.ts +10 -0
  228. package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
  229. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
  230. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -84
  231. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
  232. package/dist/types/src/components/ControlSection/index.d.ts +0 -2
  233. package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
  234. package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
  235. package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
  236. package/dist/types/src/components/Form/Defaults.d.ts +0 -14
  237. package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
  238. package/dist/types/src/components/Form/FormActions.d.ts +0 -9
  239. package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
  240. package/dist/types/src/components/Form/FormContent.d.ts +0 -63
  241. package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
  242. package/dist/types/src/components/Form/FormContext.d.ts +0 -23
  243. package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
  244. package/dist/types/src/components/Form/Input.d.ts +0 -29
  245. package/dist/types/src/components/Form/Input.d.ts.map +0 -1
  246. package/dist/types/src/components/Form/RefField.d.ts +0 -22
  247. package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
  248. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
  249. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
  250. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
  251. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
  252. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -79
  253. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
  254. package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
  255. package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
  256. package/dist/types/src/components/Form/custom/index.d.ts +0 -4
  257. package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
  258. package/dist/types/src/components/Form/factory.d.ts +0 -8
  259. package/dist/types/src/components/Form/factory.d.ts.map +0 -1
  260. package/dist/types/src/hooks/useForm.d.ts +0 -67
  261. package/dist/types/src/hooks/useForm.d.ts.map +0 -1
  262. package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
  263. package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
  264. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
  265. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
  266. package/dist/types/src/util/schema.d.ts +0 -3
  267. package/dist/types/src/util/schema.d.ts.map +0 -1
  268. package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
  269. package/src/components/ControlSection/ControlSection.tsx +0 -153
  270. package/src/components/Form/ArrayField.tsx +0 -125
  271. package/src/components/Form/Defaults.tsx +0 -205
  272. package/src/components/Form/FormActions.tsx +0 -54
  273. package/src/components/Form/FormContent.tsx +0 -322
  274. package/src/components/Form/FormContext.tsx +0 -110
  275. package/src/components/Form/Input.tsx +0 -54
  276. package/src/components/Form/RefField.tsx +0 -283
  277. package/src/components/Form/custom/GeoPointInput.tsx +0 -80
  278. package/src/components/Form/custom/index.ts +0 -7
  279. package/src/components/Form/factory.tsx +0 -31
  280. package/src/hooks/useForm.ts +0 -296
  281. package/src/hooks/useQueryRefOptions.ts +0 -62
  282. package/src/hooks/useRefQueryLookupHandler.ts +0 -39
  283. package/src/util/schema.ts +0 -12
@@ -0,0 +1,60 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as SchemaAST from 'effect/SchemaAST';
6
+
7
+ import { getAnnotation, isLiteralUnion } from '@dxos/effect';
8
+
9
+ /**
10
+ * Detected field type for a schema property.
11
+ */
12
+ export type SettingsFieldType = 'boolean' | 'string' | 'number' | 'select' | 'struct';
13
+
14
+ export type SelectOption = {
15
+ value: string | number;
16
+ label?: string;
17
+ };
18
+
19
+ /**
20
+ * Detect the field type from an Effect Schema AST node.
21
+ */
22
+ export const detectFieldType = (ast: SchemaAST.AST): SettingsFieldType | undefined => {
23
+ if (isLiteralUnion(ast)) {
24
+ return 'select';
25
+ }
26
+ if (SchemaAST.isTypeLiteral(ast)) {
27
+ return 'struct';
28
+ }
29
+
30
+ switch (ast._tag) {
31
+ case 'BooleanKeyword':
32
+ return 'boolean';
33
+ case 'StringKeyword':
34
+ return 'string';
35
+ case 'NumberKeyword':
36
+ return 'number';
37
+ }
38
+
39
+ return undefined;
40
+ };
41
+
42
+ /**
43
+ * Extract select options from a literal union AST node.
44
+ * Reads title annotations from individual literals for labels.
45
+ */
46
+ export const getSelectOptionsFromAst = (ast: SchemaAST.AST): SelectOption[] | undefined => {
47
+ if (!isLiteralUnion(ast)) {
48
+ return undefined;
49
+ }
50
+
51
+ return (ast as SchemaAST.Union<SchemaAST.Literal>).types.flatMap((literalNode) => {
52
+ const value = literalNode.literal;
53
+ if (typeof value !== 'string' && typeof value !== 'number') {
54
+ return [];
55
+ }
56
+ const title = getAnnotation<string>(SchemaAST.TitleAnnotationId, false)(literalNode);
57
+ const label = title ?? (typeof value === 'string' ? value.charAt(0).toUpperCase() + value.slice(1) : String(value));
58
+ return [{ value, label }];
59
+ });
60
+ };
package/src/util/field.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { FormatEnum, GeoLocation, TypeEnum } from '@dxos/echo/internal';
5
+ import { Format, GeoLocation, TypeEnum } from '@dxos/echo/internal';
6
6
  import { type ValidationError } from '@dxos/schema';
7
7
 
8
8
  /**
@@ -13,7 +13,7 @@ import { type ValidationError } from '@dxos/schema';
13
13
  */
14
14
  export type ParseProps = {
15
15
  type?: TypeEnum;
16
- format?: FormatEnum;
16
+ format?: Format.TypeFormat;
17
17
  value: any;
18
18
  };
19
19
 
@@ -57,31 +57,31 @@ export const parseValue = ({ type, format, value }: ParseProps) => {
57
57
  }
58
58
 
59
59
  switch (format) {
60
- case FormatEnum.Boolean:
60
+ case Format.TypeFormat.Boolean:
61
61
  return parseScalar(TypeEnum.Boolean);
62
62
 
63
- case FormatEnum.Number:
64
- case FormatEnum.Percent:
65
- case FormatEnum.Currency:
63
+ case Format.TypeFormat.Number:
64
+ case Format.TypeFormat.Percent:
65
+ case Format.TypeFormat.Currency:
66
66
  return parseScalar(TypeEnum.Number);
67
67
 
68
- case FormatEnum.String:
69
- case FormatEnum.Markdown: {
68
+ case Format.TypeFormat.String:
69
+ case Format.TypeFormat.Markdown: {
70
70
  return parseScalar(TypeEnum.String);
71
71
  }
72
72
 
73
- case FormatEnum.Ref:
74
- throw new Error(`unexpected format: ${FormatEnum.Ref}`);
73
+ case Format.TypeFormat.Ref:
74
+ throw new Error(`unexpected format: ${Format.TypeFormat.Ref}`);
75
75
 
76
- case FormatEnum.DateTime:
77
- case FormatEnum.Date:
78
- case FormatEnum.Time:
79
- case FormatEnum.Timestamp: {
76
+ case Format.TypeFormat.DateTime:
77
+ case Format.TypeFormat.Date:
78
+ case Format.TypeFormat.Time:
79
+ case Format.TypeFormat.Timestamp: {
80
80
  const date = new Date(value as string | number);
81
81
  return isNaN(date.getTime()) ? null : date;
82
82
  }
83
83
 
84
- case FormatEnum.GeoPoint: {
84
+ case Format.TypeFormat.GeoPoint: {
85
85
  // Parse string in format "lat,long" to GeoPoint [longitude, latitude].
86
86
  if (typeof value === 'string') {
87
87
  // Only keep digits, decimal points, minus signs, and commas.
@@ -108,23 +108,23 @@ export const parseValue = ({ type, format, value }: ParseProps) => {
108
108
  // TODO(burdon): Type and format.
109
109
  export type CellClassesForFieldTypeProps = {
110
110
  type?: TypeEnum;
111
- format?: FormatEnum;
111
+ format?: Format.TypeFormat;
112
112
  };
113
113
 
114
114
  export const cellClassesForFieldType = ({ type, format }: CellClassesForFieldTypeProps): string[] | undefined => {
115
115
  switch (format || type) {
116
- case FormatEnum.Markdown:
116
+ case Format.TypeFormat.Markdown:
117
117
  return undefined;
118
- case FormatEnum.Time:
119
- case FormatEnum.Timestamp:
120
- case FormatEnum.DateTime:
121
- case FormatEnum.Date:
122
- case FormatEnum.Duration:
118
+ case Format.TypeFormat.Time:
119
+ case Format.TypeFormat.Timestamp:
120
+ case Format.TypeFormat.DateTime:
121
+ case Format.TypeFormat.Date:
122
+ case Format.TypeFormat.Duration:
123
123
  return ['font-mono', 'text-right'];
124
- case FormatEnum.Currency:
124
+ case Format.TypeFormat.Currency:
125
125
  return ['text-right'];
126
- case FormatEnum.JSON:
127
- case FormatEnum.DID:
126
+ case Format.TypeFormat.JSON:
127
+ case Format.TypeFormat.DID:
128
128
  return ['font-mono'];
129
129
  case TypeEnum.Number:
130
130
  case TypeEnum.Boolean:
@@ -4,11 +4,11 @@
4
4
 
5
5
  import { format as formatDate } from 'date-fns/format';
6
6
 
7
- import { FormatEnum, GeoLocation, TypeEnum } from '@dxos/echo/internal';
7
+ import { Format, GeoLocation, TypeEnum } from '@dxos/echo/internal';
8
8
 
9
9
  type ValueFormatProps = {
10
10
  type: TypeEnum;
11
- format?: FormatEnum | undefined;
11
+ format?: Format.TypeFormat | undefined;
12
12
  value: any;
13
13
  locale?: string | undefined;
14
14
  };
@@ -41,20 +41,20 @@ export const formatForDisplay = ({ type, format, value, locale = undefined }: Va
41
41
  }
42
42
 
43
43
  switch (format) {
44
- case FormatEnum.Boolean: {
44
+ case Format.TypeFormat.Boolean: {
45
45
  return formatScalar(TypeEnum.Boolean);
46
46
  }
47
- case FormatEnum.Number: {
47
+ case Format.TypeFormat.Number: {
48
48
  return formatScalar(TypeEnum.Number);
49
49
  }
50
- case FormatEnum.String:
51
- case FormatEnum.Ref: {
50
+ case Format.TypeFormat.String:
51
+ case Format.TypeFormat.Ref: {
52
52
  return formatScalar(TypeEnum.String);
53
53
  }
54
- case FormatEnum.Percent: {
54
+ case Format.TypeFormat.Percent: {
55
55
  return `${(value as number) * 100}%`;
56
56
  }
57
- case FormatEnum.Currency: {
57
+ case Format.TypeFormat.Currency: {
58
58
  // TODO(burdon): Get from property annotation.
59
59
  return (value as number).toLocaleString(locale, {
60
60
  style: 'currency',
@@ -63,28 +63,28 @@ export const formatForDisplay = ({ type, format, value, locale = undefined }: Va
63
63
  maximumFractionDigits: 2,
64
64
  });
65
65
  }
66
- case FormatEnum.Date: {
66
+ case Format.TypeFormat.Date: {
67
67
  try {
68
68
  return formatDate(new Date(value as number), 'yyyy-MM-dd');
69
69
  } catch (error) {
70
70
  return 'Invalid Date';
71
71
  }
72
72
  }
73
- case FormatEnum.Time: {
73
+ case Format.TypeFormat.Time: {
74
74
  try {
75
75
  return formatDate(new Date(value as number), 'HH:mm:ss');
76
76
  } catch (error) {
77
77
  return 'Invalid Time';
78
78
  }
79
79
  }
80
- case FormatEnum.DateTime: {
80
+ case Format.TypeFormat.DateTime: {
81
81
  try {
82
82
  return formatDate(new Date(value as number), 'yyyy-MM-dd HH:mm:ss');
83
83
  } catch (error) {
84
84
  return 'Invalid DateTime';
85
85
  }
86
86
  }
87
- case FormatEnum.GeoPoint: {
87
+ case Format.TypeFormat.GeoPoint: {
88
88
  if (value === null || value === undefined) {
89
89
  return '';
90
90
  }
@@ -125,31 +125,31 @@ export const formatForEditing = ({ type, format, value, locale = undefined }: Va
125
125
  }
126
126
 
127
127
  switch (format) {
128
- case FormatEnum.Boolean:
129
- case FormatEnum.Number:
130
- case FormatEnum.String:
131
- case FormatEnum.Ref: {
128
+ case Format.TypeFormat.Boolean:
129
+ case Format.TypeFormat.Number:
130
+ case Format.TypeFormat.String:
131
+ case Format.TypeFormat.Ref: {
132
132
  return formatScalar(type);
133
133
  }
134
- case FormatEnum.Percent: {
134
+ case Format.TypeFormat.Percent: {
135
135
  return String(value * 100);
136
136
  }
137
- case FormatEnum.Currency: {
137
+ case Format.TypeFormat.Currency: {
138
138
  return String(value);
139
139
  }
140
- case FormatEnum.DateTime: {
140
+ case Format.TypeFormat.DateTime: {
141
141
  const date = new Date(value as number);
142
142
  return date.toISOString();
143
143
  }
144
- case FormatEnum.Date: {
144
+ case Format.TypeFormat.Date: {
145
145
  const date = new Date(value as number);
146
146
  return date.toISOString().split('T')[0];
147
147
  }
148
- case FormatEnum.Time: {
148
+ case Format.TypeFormat.Time: {
149
149
  const date = new Date(value as number);
150
150
  return date.toISOString().split('T')[1].split('.')[0];
151
151
  }
152
- case FormatEnum.GeoPoint: {
152
+ case Format.TypeFormat.GeoPoint: {
153
153
  // Handle null or undefined
154
154
  if (value === null || value === undefined) {
155
155
  return '';
package/src/util/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  //
4
4
 
5
5
  export * from './field';
6
+ export * from './field-type';
6
7
  export * from './formatting';
8
+ export * from './properties';
7
9
  export * from './refs';
8
- export * from './schema';
@@ -0,0 +1,121 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+ import * as SchemaAST from 'effect/SchemaAST';
7
+ import { describe, test } from 'vitest';
8
+
9
+ import { DXN, Annotation, JsonSchema, Type } from '@dxos/echo';
10
+ import { Format } from '@dxos/echo/internal';
11
+ import { findNode, getArrayElementType } from '@dxos/effect';
12
+
13
+ import { getFormProperties } from './properties';
14
+
15
+ describe('getFormProperties', () => {
16
+ test('filters out keyword fields annotated FormInputAnnotation.set(false)', ({ expect }) => {
17
+ const TestSchema = Schema.Struct({
18
+ name: Schema.optional(Schema.String),
19
+ hidden: Schema.String.pipe(Annotation.FormInputAnnotation.set(false)),
20
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.keywordHidden', '0.1.0')));
21
+
22
+ const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
23
+ expect(names).toContain('name');
24
+ expect(names).not.toContain('hidden');
25
+ });
26
+
27
+ test('filters out struct fields annotated FormInputAnnotation.set(false)', ({ expect }) => {
28
+ // Regression: JsonSchema fields are a Schema.Struct; encodedBoundAST strips
29
+ // annotations from non-keyword inner types, which previously bypassed the
30
+ // form-input filter (e.g., Routine.input).
31
+ const TestSchema = Schema.Struct({
32
+ name: Schema.optional(Schema.String),
33
+ schema: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)),
34
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.structHidden', '0.1.0')));
35
+
36
+ const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
37
+ expect(names).toContain('name');
38
+ expect(names).not.toContain('schema');
39
+ });
40
+
41
+ test('filters out array fields annotated FormInputAnnotation.set(false)', ({ expect }) => {
42
+ const TestSchema = Schema.Struct({
43
+ name: Schema.optional(Schema.String),
44
+ context: Schema.Array(Schema.Any).pipe(Annotation.FormInputAnnotation.set(false)),
45
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.arrayHidden', '0.1.0')));
46
+
47
+ const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
48
+ expect(names).toContain('name');
49
+ expect(names).not.toContain('context');
50
+ });
51
+
52
+ test('filters out optional fields annotated FormInputAnnotation.set(false)', ({ expect }) => {
53
+ // Regression: optional fields' `prop.type` is the union `T | undefined`; the
54
+ // annotation lives on the inner `T`. Without unwrapping, the filter would
55
+ // miss the annotation and the hidden field would render. Covers the
56
+ // conventional pattern `Schema.X.pipe(FormInputAnnotation.set(false), Schema.optional)`.
57
+ const TestSchema = Schema.Struct({
58
+ name: Schema.optional(Schema.String),
59
+ userId: Schema.String.pipe(Annotation.FormInputAnnotation.set(false), Schema.optional),
60
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.optionalHidden', '0.1.0')));
61
+
62
+ const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
63
+ expect(names).toContain('name');
64
+ expect(names).not.toContain('userId');
65
+ });
66
+
67
+ test('preserves a deeply-nested FormInputAnnotation through unions and arrays', ({ expect }) => {
68
+ // Regression: a hidden field nested below a discriminated union and arrays of structs (e.g.
69
+ // Segment.details(road).routes[].legs[].geometry). `encodedBoundAST` strips annotations from
70
+ // non-keyword inner types, so without keeping container types raw the annotation is lost by
71
+ // the time the form recurses to the leaf field. The transformation element (GeoPoint) is the
72
+ // trigger that forces the encode rebuild.
73
+ const Leg = Schema.Struct({
74
+ distance: Schema.Number,
75
+ geometry: Schema.Array(Format.GeoPoint).pipe(Annotation.FormInputAnnotation.set(false)),
76
+ });
77
+ const Route = Schema.Struct({ legs: Schema.Array(Leg) });
78
+ const TestSchema = Schema.Struct({
79
+ details: Schema.Union(
80
+ Schema.TaggedStruct('road', { routes: Schema.optional(Schema.Array(Route)) }),
81
+ Schema.TaggedStruct('other', { note: Schema.optional(Schema.String) }),
82
+ ),
83
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.nestedHidden', '0.1.0')));
84
+
85
+ // Drill as the form does: getFormProperties at each level, descending via the property type
86
+ // (array element / type literal) returned by the previous level.
87
+ const findTypeLiteralWith = (ast: SchemaAST.AST, prop: string) =>
88
+ findNode(
89
+ ast,
90
+ (node) => SchemaAST.isTypeLiteral(node) && SchemaAST.getPropertySignatures(node).some((p) => p.name === prop),
91
+ )!;
92
+ const propType = (ast: SchemaAST.AST, name: string) => getFormProperties(ast).find((p) => p.name === name)!.type;
93
+
94
+ const detailsType = propType(Type.getSchema(TestSchema).ast, 'details');
95
+ const roadTypeLiteral = findTypeLiteralWith(detailsType, 'routes');
96
+ const routeTypeLiteral = findNode(
97
+ getArrayElementType(propType(roadTypeLiteral, 'routes'))!,
98
+ SchemaAST.isTypeLiteral,
99
+ )!;
100
+ const legTypeLiteral = findNode(getArrayElementType(propType(routeTypeLiteral, 'legs'))!, SchemaAST.isTypeLiteral)!;
101
+
102
+ const names = getFormProperties(legTypeLiteral).map((prop) => prop.name);
103
+ expect(names).toContain('distance');
104
+ expect(names).not.toContain('geometry');
105
+ });
106
+
107
+ test('preserves annotation when chained with .annotations()', ({ expect }) => {
108
+ // Regression: `.pipe(FormInputAnnotation.set(false)).annotations({...})` must
109
+ // not lose the form-input annotation.
110
+ const TestSchema = Schema.Struct({
111
+ name: Schema.optional(Schema.String),
112
+ hidden: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)).annotations({
113
+ description: 'Hidden field',
114
+ }),
115
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.chainedHidden', '0.1.0')));
116
+
117
+ const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
118
+ expect(names).toContain('name');
119
+ expect(names).not.toContain('hidden');
120
+ });
121
+ });
@@ -0,0 +1,61 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Option from 'effect/Option';
6
+ import * as SchemaAST from 'effect/SchemaAST';
7
+
8
+ import { Annotation } from '@dxos/echo';
9
+ import { type SchemaProperty, getProperties, isArrayType, isNestedType } from '@dxos/effect';
10
+
11
+ /** The property's type with an optional `T | undefined` union unwrapped to its inner `T`. */
12
+ const unwrapOptional = (prop: SchemaAST.PropertySignature): SchemaAST.AST => {
13
+ if (!prop.isOptional || !SchemaAST.isUnion(prop.type)) {
14
+ return prop.type;
15
+ }
16
+ // Drop the `undefined` member, preserving the remaining union (don't collapse `A | B | undefined` to `A`).
17
+ const defined = prop.type.types.filter((type) => type._tag !== 'UndefinedKeyword');
18
+ if (defined.length === 0) {
19
+ return prop.type;
20
+ }
21
+ return defined.length === 1 ? defined[0] : SchemaAST.Union.make(defined, prop.type.annotations);
22
+ };
23
+
24
+ /**
25
+ * Get the property types of an AST and filter out properties that are not form inputs.
26
+ *
27
+ * The `FormInputAnnotation` is read from the raw property signature's AST (before
28
+ * `encodedBoundAST` is applied by `getProperties`), because `encodedBoundAST` strips
29
+ * annotations from non-keyword inner types (e.g., `Schema.Struct`, `Schema.Array`).
30
+ * Without this, fields like `Routine.input` (a JsonSchema struct) annotated
31
+ * `FormInputAnnotation.set(false)` would still render in the form.
32
+ *
33
+ * For optional fields, `prop.type` is the union `T | undefined` — the annotation
34
+ * lives on the inner `T`. Unwrap before reading so that the conventional pattern
35
+ * `Schema.String.pipe(FormInputAnnotation.set(false), Schema.optional)` works.
36
+ *
37
+ * Container properties (nested structs, unions, arrays) keep their *raw* AST rather than
38
+ * the `encodedBoundAST` produced by `getProperties`. `encodedBoundAST` strips annotations
39
+ * from non-keyword inner types, so a `FormInputAnnotation` nested beneath an encoded container
40
+ * (e.g. `RouteLeg.geometry`, reached via `Segment → details → routes → Route → legs`) would
41
+ * otherwise be lost by the time recursion reaches it. Leaf/transformation fields stay encoded
42
+ * (e.g. a `DateTime` still renders as its encoded string input).
43
+ */
44
+ export const getFormProperties = (ast: SchemaAST.AST): SchemaProperty[] => {
45
+ const signatures = SchemaAST.getPropertySignatures(ast);
46
+ const rawByName = new Map<PropertyKey, SchemaAST.AST>(signatures.map((prop) => [prop.name, unwrapOptional(prop)]));
47
+ const hidden = new Set(
48
+ signatures
49
+ .filter(
50
+ (prop) =>
51
+ Annotation.FormInputAnnotation.getFromAst(unwrapOptional(prop)).pipe(Option.getOrElse(() => true)) === false,
52
+ )
53
+ .map((prop) => prop.name),
54
+ );
55
+ return getProperties(ast)
56
+ .filter((prop) => !hidden.has(prop.name))
57
+ .map((prop) => {
58
+ const raw = rawByName.get(prop.name);
59
+ return raw && (isNestedType(raw) || isArrayType(raw)) ? { ...prop, type: raw } : prop;
60
+ });
61
+ };
package/src/util/refs.ts CHANGED
@@ -4,35 +4,33 @@
4
4
 
5
5
  import type * as SchemaAST from 'effect/SchemaAST';
6
6
 
7
- import { FormatEnum, ReferenceAnnotationId } from '@dxos/echo/internal';
8
- import { findAnnotation } from '@dxos/effect';
9
- import { type SchemaProperty } from '@dxos/schema';
10
-
11
- import { findArrayElementType } from './schema';
7
+ import { Ref } from '@dxos/echo';
8
+ import { type ReferenceAnnotationValue, ReferenceAnnotationId } from '@dxos/echo/internal';
9
+ import { findAnnotation, getArrayElementType, isArrayType } from '@dxos/effect';
12
10
 
13
11
  type RefProps = {
14
12
  ast: SchemaAST.AST;
15
13
  isArray: boolean;
14
+ typename?: string;
16
15
  };
17
16
 
18
- export const getRefProps = (property: SchemaProperty<any>): RefProps | undefined => {
19
- const { ast, format, array } = property;
20
-
21
- // Direct reference.
22
- if (format === FormatEnum.Ref) {
23
- return { ast, isArray: false };
24
- }
25
-
17
+ export const getRefProps = (ast: SchemaAST.AST): RefProps | undefined => {
26
18
  // Array of references.
27
- if (array) {
28
- const elementType = findArrayElementType(ast);
19
+ if (isArrayType(ast)) {
20
+ const elementType = getArrayElementType(ast);
29
21
  if (elementType) {
30
- const annotation = findAnnotation(elementType, ReferenceAnnotationId);
31
- if (annotation) {
32
- return { ast: elementType, isArray: true };
22
+ if (Ref.isRefType(elementType)) {
23
+ const typename = findAnnotation<ReferenceAnnotationValue>(elementType, ReferenceAnnotationId)?.typename;
24
+ return { ast: elementType, isArray: true, typename };
33
25
  }
34
26
  }
35
27
  }
36
28
 
29
+ // Direct reference.
30
+ if (Ref.isRefType(ast)) {
31
+ const typename = findAnnotation<ReferenceAnnotationValue>(ast, ReferenceAnnotationId)?.typename;
32
+ return { ast, isArray: false, typename };
33
+ }
34
+
37
35
  return undefined;
38
36
  };
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ //
4
+ // Copyright 2026 DXOS.org
5
+ //
6
+
7
+ declare module '*?raw' {
8
+ const content: string;
9
+ export default content;
10
+ }
@@ -1,23 +0,0 @@
1
- import React, { type ComponentPropsWithoutRef, type PropsWithChildren } from 'react';
2
- import { type ButtonProps, type Label, type ThemedClassName } from '@dxos/react-ui';
3
- export type ControlPageProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
4
- export declare const ControlPage: ({ children, classNames, ...props }: ControlPageProps) => React.JSX.Element;
5
- export type ControlSectionProps = PropsWithChildren<{
6
- title: Label;
7
- description?: Label;
8
- }>;
9
- export declare const ControlSection: ({ title, description, children }: ControlSectionProps) => React.JSX.Element;
10
- export declare const ControlSectionHeading: ({ title, description }: Omit<ControlSectionProps, "children">) => React.JSX.Element;
11
- export declare const ControlGroupButton: ({ classNames, ...props }: ButtonProps) => React.JSX.Element;
12
- export type ControlGroupProps = ThemedClassName<PropsWithChildren>;
13
- export declare const ControlGroup: ({ children, classNames }: ControlGroupProps) => React.JSX.Element;
14
- export declare const ControlFrame: ({ children }: ControlGroupProps) => React.JSX.Element;
15
- export declare const controlItemClasses: string;
16
- export type ControlItemProps = PropsWithChildren<{
17
- title: Label;
18
- description?: Label;
19
- }>;
20
- export declare const ControlItem: ({ title, description, children }: ControlItemProps) => React.JSX.Element;
21
- export declare const ControlItemInput: ({ title, description, children }: ControlItemProps) => React.JSX.Element;
22
- export declare const ControlFrameItem: ({ title, description, children }: ControlItemProps) => React.JSX.Element;
23
- //# sourceMappingURL=ControlSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ControlSection.d.ts","sourceRoot":"","sources":["../../../../../src/components/ControlSection/ControlSection.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,KAAK,EACV,KAAK,eAAe,EAGrB,MAAM,gBAAgB,CAAC;AAMxB,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAEhF,eAAO,MAAM,WAAW,GAAI,oCAAoC,gBAAgB,sBAQ/E,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,cAAc,GAAI,kCAAkC,mBAAmB,sBAOnF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,wBAAwB,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,sBAYlG,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,0BAA0B,WAAW,sBAEvE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAEnE,eAAO,MAAM,YAAY,GAAI,0BAA0B,iBAAiB,sBAWvE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,cAAc,iBAAiB,sBAU3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAK7B,CAAC;AAKH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,kCAAkC,gBAAgB,sBAY7E,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,kCAAkC,gBAAgB,sBAoBlF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,kCAAkC,gBAAgB,sBAUlF,CAAC"}
@@ -1,84 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- import React from 'react';
3
- declare const meta: {
4
- title: string;
5
- component: ({ title, description, children }: import("./ControlSection").ControlSectionProps) => React.JSX.Element;
6
- render: (args: {
7
- title: import("@dxos/react-ui").Label;
8
- description?: import("@dxos/react-ui").Label;
9
- } & {
10
- children?: React.ReactNode | undefined;
11
- }) => React.JSX.Element;
12
- decorators: import("@storybook/react").Decorator[];
13
- parameters: {
14
- layout: string;
15
- translations: [{
16
- readonly 'en-US': {
17
- readonly "react-ui-form": {
18
- readonly 'fields label': "Fields";
19
- readonly 'hidden fields label': "Hidden Fields";
20
- readonly 'empty readonly ref field label': "(none)";
21
- readonly 'button add property': "Add property";
22
- readonly 'field property label': "Property";
23
- readonly 'field property placeholder': "Property name";
24
- readonly 'field format label': "Type";
25
- readonly 'field path label': "Field path";
26
- readonly 'add field': "Add field";
27
- readonly 'delete field': "Delete field";
28
- readonly 'field limit reached': "Maximum number of fields reached";
29
- readonly 'boolean input true value': "Yes";
30
- readonly 'boolean input false value': "No";
31
- readonly 'show field label': "Show field";
32
- readonly 'hide field label': "Hide field";
33
- readonly 'delete field label': "Delete field";
34
- readonly 'ref field combobox input placeholder': "Search…";
35
- readonly 'ref field placeholder_one': "Select…";
36
- readonly 'ref field placeholder_other': "Select items…";
37
- readonly 'button cancel': "Cancel";
38
- readonly 'button save': "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 record type";
75
- readonly 'system schema description': "This is a system record type and cannot be modified, though the view can still be configured.";
76
- };
77
- };
78
- }];
79
- };
80
- };
81
- export default meta;
82
- type Story = StoryObj<typeof meta>;
83
- export declare const Default: Story;
84
- //# sourceMappingURL=ControlSection.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ControlSection.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ControlSection/ControlSection.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa6B,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './ControlSection';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ControlSection/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC"}