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

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 (99) hide show
  1. package/README.md +0 -1
  2. package/dist/lib/browser/index.mjs +620 -583
  3. package/dist/lib/browser/index.mjs.map +4 -4
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node-esm/index.mjs +620 -583
  6. package/dist/lib/node-esm/index.mjs.map +4 -4
  7. package/dist/lib/node-esm/meta.json +1 -1
  8. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +3 -3
  9. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  10. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +61 -61
  11. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  12. package/dist/types/src/components/Form/Form.d.ts +18 -15
  13. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  14. package/dist/types/src/components/Form/Form.stories.d.ts +67 -67
  15. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  16. package/dist/types/src/components/Form/FormField.d.ts +7 -1
  17. package/dist/types/src/components/Form/FormField.d.ts.map +1 -1
  18. package/dist/types/src/components/Form/FormFieldComponent.d.ts +0 -1
  19. package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -1
  20. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +2 -2
  21. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -1
  22. package/dist/types/src/components/Form/FormFieldSet.d.ts +9 -10
  23. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -1
  24. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -1
  25. package/dist/types/src/components/Form/fields/RefField.d.ts +7 -5
  26. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -1
  27. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -1
  28. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +61 -61
  29. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +10 -2
  30. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  31. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +61 -61
  32. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/Settings/Settings.d.ts +39 -0
  34. package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
  35. package/dist/types/src/components/Settings/Settings.stories.d.ts +81 -0
  36. package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
  37. package/dist/types/src/components/Settings/index.d.ts +2 -0
  38. package/dist/types/src/components/Settings/index.d.ts.map +1 -0
  39. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +5 -5
  40. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  41. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +65 -64
  42. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  43. package/dist/types/src/components/index.d.ts +1 -1
  44. package/dist/types/src/components/index.d.ts.map +1 -1
  45. package/dist/types/src/components/testing.d.ts.map +1 -1
  46. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -1
  47. package/dist/types/src/translations.d.ts +61 -61
  48. package/dist/types/src/translations.d.ts.map +1 -1
  49. package/dist/types/src/util/index.d.ts +0 -1
  50. package/dist/types/src/util/index.d.ts.map +1 -1
  51. package/dist/types/src/util/refs.d.ts +1 -0
  52. package/dist/types/src/util/refs.d.ts.map +1 -1
  53. package/dist/types/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +36 -38
  55. package/src/components/FieldEditor/FieldEditor.stories.tsx +4 -6
  56. package/src/components/FieldEditor/FieldEditor.tsx +3 -4
  57. package/src/components/Form/AUDIT.md +17 -0
  58. package/src/components/Form/Form.stories.tsx +23 -24
  59. package/src/components/Form/Form.tsx +58 -65
  60. package/src/components/Form/FormField.tsx +27 -8
  61. package/src/components/Form/FormFieldComponent.stories.tsx +5 -5
  62. package/src/components/Form/FormFieldComponent.tsx +17 -20
  63. package/src/components/Form/FormFieldSet.tsx +108 -104
  64. package/src/components/Form/fields/ArrayField.tsx +11 -8
  65. package/src/components/Form/fields/GeoPointField.tsx +6 -6
  66. package/src/components/Form/fields/MarkdownField.tsx +1 -1
  67. package/src/components/Form/fields/RefField.tsx +35 -17
  68. package/src/components/Form/fields/SelectField.tsx +1 -1
  69. package/src/components/Form/fields/SelectOptionField.stories.tsx +2 -2
  70. package/src/components/Form/fields/SelectOptionField.tsx +9 -10
  71. package/src/components/Form/fields/TupleField.tsx +1 -1
  72. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +10 -14
  73. package/src/components/ObjectPicker/ObjectPicker.tsx +71 -60
  74. package/src/components/Settings/Settings.stories.tsx +56 -0
  75. package/src/components/Settings/Settings.tsx +129 -0
  76. package/src/components/{ControlSection → Settings}/index.ts +1 -1
  77. package/src/components/ViewEditor/ViewEditor.stories.tsx +22 -20
  78. package/src/components/ViewEditor/ViewEditor.test.tsx +3 -6
  79. package/src/components/ViewEditor/ViewEditor.tsx +99 -70
  80. package/src/components/index.ts +1 -1
  81. package/src/components/testing.tsx +20 -8
  82. package/src/hooks/useFormHandler.ts +42 -24
  83. package/src/translations.ts +62 -63
  84. package/src/util/index.ts +0 -1
  85. package/src/util/refs.ts +7 -3
  86. package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
  87. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
  88. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -87
  89. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
  90. package/dist/types/src/components/ControlSection/index.d.ts +0 -2
  91. package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
  92. package/dist/types/src/components/Form/Form-old.stories.d.ts +0 -131
  93. package/dist/types/src/components/Form/Form-old.stories.d.ts.map +0 -1
  94. package/dist/types/src/util/echo.d.ts +0 -6
  95. package/dist/types/src/util/echo.d.ts.map +0 -1
  96. package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
  97. package/src/components/ControlSection/ControlSection.tsx +0 -153
  98. package/src/components/Form/Form-old.stories.tsx +0 -314
  99. package/src/util/echo.ts +0 -25
@@ -10,79 +10,78 @@ export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [translationKey]: {
13
- 'fields label': 'Fields',
14
- 'hidden fields label': 'Hidden Fields',
15
- 'empty readonly ref field label': '(none)',
13
+ 'fields.label': 'Fields',
14
+ 'hidden-fields.label': 'Hidden Fields',
15
+ 'empty-readonly-ref-field.label': '(none)',
16
16
 
17
- // TODO(burdon): Standardize field/property.
18
- 'add property button label': 'Add property',
19
- 'field property label': 'Property',
20
- 'field property placeholder': 'Property name',
21
- 'field format label': 'Type',
22
- 'field path label': 'Field path',
23
- 'add field': 'Add field',
24
- 'delete field': 'Delete field',
25
- 'field limit reached': 'Maximum number of fields reached',
26
- 'boolean input true value': 'Yes',
27
- 'boolean input false value': 'No',
28
- 'show field label': 'Show field',
29
- 'hide field label': 'Hide field',
30
- 'delete field label': 'Delete field',
31
- 'ref field combobox input placeholder': 'Search…',
32
- 'ref field placeholder_one': 'Select…',
33
- 'ref field placeholder_other': 'Select items…',
17
+ 'add-property-button.label': 'Add property',
18
+ 'field-property.label': 'Property',
19
+ 'field-property.placeholder': 'Property name',
20
+ 'field-format.label': 'Type',
21
+ 'field-path.label': 'Field path',
22
+ 'add-field.button': 'Add field',
23
+ 'boolean-input-true.value': 'Yes',
24
+ 'boolean-input-false.value': 'No',
25
+ 'show-field.label': 'Show field',
26
+ 'hide-field.label': 'Hide field',
27
+ 'delete-field.label': 'Delete field',
28
+ 'ref-field-combobox-input.placeholder': 'Search…',
29
+ 'ref-field.placeholder': 'Select…',
30
+ 'ref-field.placeholder_one': 'Select…',
31
+ 'ref-field.placeholder_other': 'Select items…',
32
+ 'create-option.label': 'Create',
34
33
 
35
- 'example placeholder': 'Example',
36
- 'latitude placeholder': 'Latitude (e.g., 40.7128)',
37
- 'longitude placeholder': 'Longitude (e.g., -74.0060)',
34
+ 'example.placeholder': 'Example',
35
+ 'latitude.placeholder': 'Latitude (e.g., 40.7128)',
36
+ 'longitude.placeholder': 'Longitude (e.g., -74.0060)',
38
37
 
39
- 'cancel button label': 'Cancel',
40
- 'save button label': 'Save',
38
+ 'cancel-button.label': 'Cancel',
39
+ 'save-button.label': 'Save',
41
40
 
42
- // FormatEnum
43
- 'format boolean': 'Boolean',
44
- 'format currency': 'Currency',
45
- 'format date': 'Date',
46
- 'format date-time': 'DateTime',
47
- 'format did': 'DID',
48
- 'format duration': 'Duration',
49
- 'format dxn': 'DXN',
50
- 'format email': 'Email',
51
- 'format formula': 'Formula',
52
- 'format hostname': 'Hostname',
53
- 'format integer': 'Integer',
54
- 'format json': 'JSON',
55
- 'format lnglat': 'Geopoint',
56
- 'format markdown': 'Markdown',
57
- 'format percent': 'Percent',
58
- 'format ref': 'Reference',
59
- 'format regex': 'RegExp',
60
- 'format string': 'String',
61
- 'format single-select': 'Select',
62
- 'format multi-select': 'Multi-select',
63
- 'format text': 'Long text',
64
- 'format time': 'Time',
65
- 'format timestamp': 'Timestamp',
66
- 'format user': 'User',
67
- 'format number': 'Number',
68
- 'format uri': 'URI',
69
- 'format url': 'URL',
70
- 'format uuid': 'UUID',
41
+ // TypeFormat
42
+ 'format.boolean.label': 'Boolean',
43
+ 'format.currency.label': 'Currency',
44
+ 'format.date.label': 'Date',
45
+ 'format.date-time.label': 'DateTime',
46
+ 'format.did.label': 'DID',
47
+ 'format.duration.label': 'Duration',
48
+ 'format.dxn.label': 'DXN',
49
+ 'format.email.label': 'Email',
50
+ 'format.formula.label': 'Formula',
51
+ 'format.hostname.label': 'Hostname',
52
+ 'format.integer.label': 'Integer',
53
+ 'format.json.label': 'JSON',
54
+ 'format.lnglat.label': 'Geopoint',
55
+ 'format.markdown.label': 'Markdown',
56
+ 'format.percent.label': 'Percent',
57
+ 'format.ref.label': 'Reference',
58
+ 'format.regex.label': 'RegExp',
59
+ 'format.string.label': 'String',
60
+ 'format.single-select.label': 'Select',
61
+ 'format.multi-select.label': 'Multi-select',
62
+ 'format.text.label': 'Long text',
63
+ 'format.time.label': 'Time',
64
+ 'format.timestamp.label': 'Timestamp',
65
+ 'format.user.label': 'User',
66
+ 'format.number.label': 'Number',
67
+ 'format.uri.label': 'URI',
68
+ 'format.url.label': 'URL',
69
+ 'format.uuid.label': 'UUID',
71
70
 
72
71
  // GeoPointField.
73
- 'latitude label': 'Latitude',
74
- 'longitude label': 'Longitude',
72
+ 'latitude.label': 'Latitude',
73
+ 'longitude.label': 'Longitude',
75
74
 
76
75
  // SelectOptionsField.
77
- 'select option label': 'Label',
78
- 'select option label placeholder': 'Option label',
79
- 'select option color': 'Color',
80
- 'select option delete': 'Delete',
81
- 'select option add': 'Add option',
76
+ 'select-option.label': 'Label',
77
+ 'select-option-label.placeholder': 'Option label',
78
+ 'select-option-delete.button': 'Delete',
79
+ 'select-option-add.button': 'Add option',
82
80
 
83
81
  // System schema message.
84
- 'system schema title': 'System type',
85
- 'system schema description': 'System type: cannot add or remove fields.',
82
+ 'system-schema.title': 'System type',
83
+ 'system-schema.description': 'System type: cannot add or remove fields.',
84
+ 'remove.button': 'Remove',
86
85
  },
87
86
  },
88
87
  },
package/src/util/index.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './echo';
6
5
  export * from './field';
7
6
  export * from './formatting';
8
7
  export * from './properties';
package/src/util/refs.ts CHANGED
@@ -5,11 +5,13 @@
5
5
  import type * as SchemaAST from 'effect/SchemaAST';
6
6
 
7
7
  import { Ref } from '@dxos/echo';
8
- import { getArrayElementType, isArrayType } from '@dxos/effect';
8
+ import { type ReferenceAnnotationValue, ReferenceAnnotationId } from '@dxos/echo/internal';
9
+ import { findAnnotation, getArrayElementType, isArrayType } from '@dxos/effect';
9
10
 
10
11
  type RefProps = {
11
12
  ast: SchemaAST.AST;
12
13
  isArray: boolean;
14
+ typename?: string;
13
15
  };
14
16
 
15
17
  export const getRefProps = (ast: SchemaAST.AST): RefProps | undefined => {
@@ -18,14 +20,16 @@ export const getRefProps = (ast: SchemaAST.AST): RefProps | undefined => {
18
20
  const elementType = getArrayElementType(ast);
19
21
  if (elementType) {
20
22
  if (Ref.isRefType(elementType)) {
21
- return { ast: elementType, isArray: true };
23
+ const typename = findAnnotation<ReferenceAnnotationValue>(elementType, ReferenceAnnotationId)?.typename;
24
+ return { ast: elementType, isArray: true, typename };
22
25
  }
23
26
  }
24
27
  }
25
28
 
26
29
  // Direct reference.
27
30
  if (Ref.isRefType(ast)) {
28
- return { ast, isArray: false };
31
+ const typename = findAnnotation<ReferenceAnnotationValue>(ast, ReferenceAnnotationId)?.typename;
32
+ return { ast, isArray: false, typename };
29
33
  }
30
34
 
31
35
  return undefined;
@@ -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 ControlPageParams = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
4
- export declare const ControlPage: ({ children, classNames, ...props }: ControlPageParams) => 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,iBAAiB,GAAG,eAAe,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAEjF,eAAO,MAAM,WAAW,GAAI,oCAAoC,iBAAiB,sBAQhF,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,87 +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/ui-types").Label;
8
- description?: import("@dxos/ui-types").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 "@dxos/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 'add property button label': "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 'example placeholder': "Example";
38
- readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
39
- readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
40
- readonly 'cancel button label': "Cancel";
41
- readonly 'save button label': "Save";
42
- readonly 'format boolean': "Boolean";
43
- readonly 'format currency': "Currency";
44
- readonly 'format date': "Date";
45
- readonly 'format date-time': "DateTime";
46
- readonly 'format did': "DID";
47
- readonly 'format duration': "Duration";
48
- readonly 'format dxn': "DXN";
49
- readonly 'format email': "Email";
50
- readonly 'format formula': "Formula";
51
- readonly 'format hostname': "Hostname";
52
- readonly 'format integer': "Integer";
53
- readonly 'format json': "JSON";
54
- readonly 'format lnglat': "Geopoint";
55
- readonly 'format markdown': "Markdown";
56
- readonly 'format percent': "Percent";
57
- readonly 'format ref': "Reference";
58
- readonly 'format regex': "RegExp";
59
- readonly 'format string': "String";
60
- readonly 'format single-select': "Select";
61
- readonly 'format multi-select': "Multi-select";
62
- readonly 'format text': "Long text";
63
- readonly 'format time': "Time";
64
- readonly 'format timestamp': "Timestamp";
65
- readonly 'format user': "User";
66
- readonly 'format number': "Number";
67
- readonly 'format uri': "URI";
68
- readonly 'format url': "URL";
69
- readonly 'format uuid': "UUID";
70
- readonly 'latitude label': "Latitude";
71
- readonly 'longitude label': "Longitude";
72
- readonly 'select option label': "Label";
73
- readonly 'select option label placeholder': "Option label";
74
- readonly 'select option color': "Color";
75
- readonly 'select option delete': "Delete";
76
- readonly 'select option add': "Add option";
77
- readonly 'system schema title': "System type";
78
- readonly 'system schema description': "System type: cannot add or remove fields.";
79
- };
80
- };
81
- }];
82
- };
83
- };
84
- export default meta;
85
- type Story = StoryObj<typeof meta>;
86
- export declare const Default: Story;
87
- //# 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"}
@@ -1,131 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- import * as Schema from 'effect/Schema';
3
- import React from 'react';
4
- import { type AnyProperties } from '@dxos/echo/internal';
5
- import { type FormRootProps } from './Form';
6
- type StoryProps<T extends AnyProperties> = {
7
- debug?: boolean;
8
- schema: Schema.Schema.AnyNoContext;
9
- } & FormRootProps<T>;
10
- declare const meta: {
11
- title: string;
12
- component: any;
13
- render: <T extends AnyProperties = any>({ debug, schema, values: valuesProp, ...props }: StoryProps<T>) => React.JSX.Element;
14
- decorators: import("@storybook/react").Decorator[];
15
- parameters: {
16
- layout: string;
17
- translations: [{
18
- readonly 'en-US': {
19
- readonly "@dxos/react-ui-form": {
20
- readonly 'fields label': "Fields";
21
- readonly 'hidden fields label': "Hidden Fields";
22
- readonly 'empty readonly ref field label': "(none)";
23
- readonly 'add property button label': "Add property";
24
- readonly 'field property label': "Property";
25
- readonly 'field property placeholder': "Property name";
26
- readonly 'field format label': "Type";
27
- readonly 'field path label': "Field path";
28
- readonly 'add field': "Add field";
29
- readonly 'delete field': "Delete field";
30
- readonly 'field limit reached': "Maximum number of fields reached";
31
- readonly 'boolean input true value': "Yes";
32
- readonly 'boolean input false value': "No";
33
- readonly 'show field label': "Show field";
34
- readonly 'hide field label': "Hide field";
35
- readonly 'delete field label': "Delete field";
36
- readonly 'ref field combobox input placeholder': "Search…";
37
- readonly 'ref field placeholder_one': "Select…";
38
- readonly 'ref field placeholder_other': "Select items…";
39
- readonly 'example placeholder': "Example";
40
- readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
41
- readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
42
- readonly 'cancel button label': "Cancel";
43
- readonly 'save button label': "Save";
44
- readonly 'format boolean': "Boolean";
45
- readonly 'format currency': "Currency";
46
- readonly 'format date': "Date";
47
- readonly 'format date-time': "DateTime";
48
- readonly 'format did': "DID";
49
- readonly 'format duration': "Duration";
50
- readonly 'format dxn': "DXN";
51
- readonly 'format email': "Email";
52
- readonly 'format formula': "Formula";
53
- readonly 'format hostname': "Hostname";
54
- readonly 'format integer': "Integer";
55
- readonly 'format json': "JSON";
56
- readonly 'format lnglat': "Geopoint";
57
- readonly 'format markdown': "Markdown";
58
- readonly 'format percent': "Percent";
59
- readonly 'format ref': "Reference";
60
- readonly 'format regex': "RegExp";
61
- readonly 'format string': "String";
62
- readonly 'format single-select': "Select";
63
- readonly 'format multi-select': "Multi-select";
64
- readonly 'format text': "Long text";
65
- readonly 'format time': "Time";
66
- readonly 'format timestamp': "Timestamp";
67
- readonly 'format user': "User";
68
- readonly 'format number': "Number";
69
- readonly 'format uri': "URI";
70
- readonly 'format url': "URL";
71
- readonly 'format uuid': "UUID";
72
- readonly 'latitude label': "Latitude";
73
- readonly 'longitude label': "Longitude";
74
- readonly 'select option label': "Label";
75
- readonly 'select option label placeholder': "Option label";
76
- readonly 'select option color': "Color";
77
- readonly 'select option delete': "Delete";
78
- readonly 'select option add': "Add option";
79
- readonly 'system schema title': "System type";
80
- readonly 'system schema description': "System type: cannot add or remove fields.";
81
- };
82
- };
83
- }];
84
- };
85
- argTypes: {
86
- readonly: {
87
- control: "boolean";
88
- description: string;
89
- };
90
- };
91
- };
92
- export default meta;
93
- type Story = StoryObj<typeof meta>;
94
- export declare const Default: Story;
95
- export declare const Organization: Story;
96
- export declare const OrganizationAutoSave: Story;
97
- export declare const Person: Story;
98
- declare const ShapeSchema: Schema.mutable<Schema.Struct<{
99
- shape: Schema.optional<Schema.Union<[Schema.Struct<{
100
- type: Schema.Literal<["circle"]>;
101
- radius: Schema.optional<Schema.SchemaClass<number, number, never>>;
102
- }>, Schema.Struct<{
103
- type: Schema.Literal<["square"]>;
104
- size: Schema.optional<Schema.refine<number, typeof Schema.Number>>;
105
- }>]>>;
106
- }>>;
107
- type ShapeSchema = Schema.Schema.Type<typeof ShapeSchema>;
108
- export declare const DiscriminatedShape: StoryObj<StoryProps<ShapeSchema>>;
109
- declare const ArraysSchema: Schema.mutable<Schema.Struct<{
110
- names: Schema.Array$<Schema.filter<typeof Schema.String>>;
111
- addresses: Schema.Array$<Schema.Struct<{
112
- street: Schema.optional<Schema.SchemaClass<string, string, never>>;
113
- city: Schema.optional<Schema.SchemaClass<string, string, never>>;
114
- zip: Schema.optional<Schema.refine<string, typeof Schema.String>>;
115
- location: Schema.optional<Schema.Tuple<[Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.Element<typeof Schema.Number, "?">]>>;
116
- }>>;
117
- }>>;
118
- type ArraysSchema = Schema.Schema.Type<typeof ArraysSchema>;
119
- export declare const Arrays: StoryObj<StoryProps<ArraysSchema>>;
120
- declare const TupleSchema: Schema.mutable<Schema.Struct<{
121
- tuple: Schema.Tuple<[typeof Schema.Number, typeof Schema.String, typeof Schema.Boolean]>;
122
- geopoint: Schema.Tuple<[Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.Element<typeof Schema.Number, "?">]>;
123
- }>>;
124
- type TupleSchema = Schema.Schema.Type<typeof TupleSchema>;
125
- export declare const Tuple: StoryObj<StoryProps<TupleSchema>>;
126
- declare const ColorSchema: Schema.mutable<Schema.Struct<{
127
- color: Schema.Union<[Schema.Literal<["red"]>, Schema.Literal<["green"]>, Schema.Literal<["blue"]>]>;
128
- }>>;
129
- type ColorType = Schema.Schema.Type<typeof ColorSchema>;
130
- export declare const Enum: StoryObj<StoryProps<ColorType>>;
131
- //# sourceMappingURL=Form-old.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Form-old.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form-old.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAIlD,KAAK,UAAU,CAAC,CAAC,SAAS,aAAa,IAAI;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;CACpC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAuErB,QAAA,MAAM,IAAI;;eAEgB,GAAG;aAvEP,CAAC,SAAS,aAAa,yDAK1C,UAAU,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EiB,CAAC;AAElC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAU1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAWlC,CAAC;AAKF,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAC;AAMF,QAAA,MAAM,WAAW;;;;;;;;GAaM,CAAC;AAExB,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1D,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAuBhE,CAAC;AAMF,QAAA,MAAM,YAAY;;;;;;;;GAGK,CAAC;AAExB,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAUrD,CAAC;AAOF,QAAA,MAAM,WAAW;;;GAGM,CAAC;AAExB,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1D,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAUnD,CAAC;AAMF,QAAA,MAAM,WAAW;;GAIM,CAAC;AAExB,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAExD,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAShD,CAAC"}
@@ -1,6 +0,0 @@
1
- import { type JsonPath } from '@dxos/effect';
2
- /**
3
- * Sets a value on an object, using Obj.change() if it's an ECHO object.
4
- */
5
- export declare const setValueEchoAware: <T extends object>(obj: T, path: JsonPath, value: any) => T;
6
- //# sourceMappingURL=echo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../../../../src/util/echo.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAA4C,MAAM,cAAc,CAAC;AAEvF;;GAEG;AAOH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,QAAQ,EAAE,OAAO,GAAG,KAAG,CAQxF,CAAC"}
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React from 'react';
7
-
8
- import { withTheme } from '@dxos/react-ui/testing';
9
-
10
- import { translations } from '../../translations';
11
-
12
- import { ControlPage, ControlSection } from './ControlSection';
13
-
14
- const meta = {
15
- title: 'ui/react-ui-form/ControlSection',
16
- component: ControlSection,
17
- render: (args) => (
18
- <ControlPage classNames='is-[40rem]'>
19
- <ControlSection {...args} />
20
- </ControlPage>
21
- ),
22
- decorators: [withTheme],
23
- parameters: {
24
- layout: 'centered',
25
- translations,
26
- },
27
- } satisfies Meta<typeof ControlSection>;
28
-
29
- export default meta;
30
-
31
- type Story = StoryObj<typeof meta>;
32
-
33
- export const Default: Story = {
34
- args: {
35
- title: 'Control Section',
36
- description: 'This is a control section',
37
- },
38
- };