@dxos/react-ui-form 0.8.4-main.7ace549 → 0.8.4-main.8360d9e660
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.
- package/README.md +0 -1
- package/dist/lib/browser/index.mjs +2298 -2290
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2298 -2290
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +9 -3
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +81 -27
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +53 -92
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormField.d.ts +37 -0
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +77 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts +18 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts +16 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts +10 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
- package/dist/types/src/components/{ControlSection/ControlSection.stories.d.ts → Form/fields/SelectOptionField.stories.d.ts} +8 -10
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/index.d.ts +12 -0
- package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/index.d.ts +2 -4
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +14 -9
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +5 -2
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
- package/dist/types/src/components/Settings/Settings.d.ts +56 -0
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
- package/dist/types/src/components/{Form/custom/SelectOptionsInput.stories.d.ts → Settings/Settings.stories.d.ts} +6 -4
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +2 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +9 -11
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +7 -3
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +0 -2
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
- package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts +6 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +6 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/properties.d.ts +7 -0
- package/dist/types/src/util/properties.d.ts.map +1 -0
- package/dist/types/src/util/refs.d.ts +1 -2
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -47
- package/src/components/FieldEditor/FieldEditor.stories.tsx +43 -24
- package/src/components/FieldEditor/FieldEditor.tsx +73 -77
- package/src/components/Form/Form.stories.tsx +147 -246
- package/src/components/Form/Form.tsx +347 -110
- package/src/components/Form/FormField.tsx +294 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +171 -0
- package/src/components/Form/FormFieldSet.tsx +127 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +149 -0
- package/src/components/Form/fields/BooleanField.tsx +22 -0
- package/src/components/Form/fields/GeoPointField.tsx +120 -0
- package/src/components/Form/fields/MarkdownField.tsx +78 -0
- package/src/components/Form/fields/NumberField.tsx +39 -0
- package/src/components/Form/fields/RefField.tsx +194 -0
- package/src/components/Form/fields/SelectField.tsx +65 -0
- package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +19 -16
- package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +24 -18
- package/src/components/Form/fields/TextAreaField.tsx +38 -0
- package/src/components/Form/fields/TextField.tsx +38 -0
- package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +15 -8
- package/src/components/Form/fields/index.ts +15 -0
- package/src/components/Form/index.ts +3 -4
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +15 -12
- package/src/components/ObjectPicker/ObjectPicker.tsx +76 -62
- package/src/components/Settings/Settings.stories.tsx +56 -0
- package/src/components/Settings/Settings.tsx +230 -0
- package/src/components/{ControlSection → Settings}/index.ts +1 -1
- package/src/components/ViewEditor/ViewEditor.stories.tsx +42 -36
- package/src/components/ViewEditor/ViewEditor.test.tsx +5 -4
- package/src/components/ViewEditor/ViewEditor.tsx +295 -197
- package/src/components/index.ts +1 -1
- package/src/components/testing.tsx +12 -7
- package/src/hooks/index.ts +2 -3
- package/src/hooks/useFormHandler.ts +380 -0
- package/src/hooks/useKeyHandler.tsx +37 -0
- package/src/translations.ts +8 -6
- package/src/util/index.ts +1 -1
- package/src/util/properties.ts +18 -0
- package/src/util/refs.ts +7 -13
- package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
- package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/index.d.ts +0 -2
- package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
- package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
- package/dist/types/src/components/Form/Defaults.d.ts +0 -14
- package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormActions.d.ts +0 -9
- package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContent.d.ts +0 -63
- package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContext.d.ts +0 -23
- package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
- package/dist/types/src/components/Form/Input.d.ts +0 -29
- package/dist/types/src/components/Form/Input.d.ts.map +0 -1
- package/dist/types/src/components/Form/RefField.d.ts +0 -22
- package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
- package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/index.d.ts +0 -4
- package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/factory.d.ts +0 -8
- package/dist/types/src/components/Form/factory.d.ts.map +0 -1
- package/dist/types/src/hooks/useForm.d.ts +0 -67
- package/dist/types/src/hooks/useForm.d.ts.map +0 -1
- package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
- package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
- package/dist/types/src/util/schema.d.ts +0 -3
- package/dist/types/src/util/schema.d.ts.map +0 -1
- package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
- package/src/components/ControlSection/ControlSection.tsx +0 -153
- package/src/components/Form/ArrayField.tsx +0 -127
- package/src/components/Form/Defaults.tsx +0 -205
- package/src/components/Form/FormActions.tsx +0 -59
- package/src/components/Form/FormContent.tsx +0 -362
- package/src/components/Form/FormContext.tsx +0 -110
- package/src/components/Form/Input.tsx +0 -54
- package/src/components/Form/RefField.tsx +0 -283
- package/src/components/Form/custom/GeoPointInput.tsx +0 -80
- package/src/components/Form/custom/index.ts +0 -7
- package/src/components/Form/factory.tsx +0 -34
- package/src/hooks/useForm.ts +0 -296
- package/src/hooks/useQueryRefOptions.ts +0 -62
- package/src/hooks/useRefQueryLookupHandler.ts +0 -39
- package/src/util/schema.ts +0 -12
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
-
import { type ProjectionModel, type SchemaProperty } from '@dxos/schema';
|
|
5
|
-
import { type QueryRefOptions } from '../../hooks';
|
|
6
|
-
import { type ComponentLookup } from './Form';
|
|
7
|
-
import { type InputComponent } from './Input';
|
|
8
|
-
import { type RefFieldProps } from './RefField';
|
|
9
|
-
export type FormFieldProps = {
|
|
10
|
-
property: SchemaProperty<any>;
|
|
11
|
-
path?: (string | number)[];
|
|
12
|
-
/** Used to indicate if input should be presented inline (e.g. for array items). */
|
|
13
|
-
inline?: boolean;
|
|
14
|
-
projection?: ProjectionModel;
|
|
15
|
-
lookupComponent?: ComponentLookup;
|
|
16
|
-
Custom?: Partial<Record<string, InputComponent>>;
|
|
17
|
-
} & Pick<RefFieldProps, 'readonly' | 'onQueryRefOptions' | 'createOptionLabel' | 'createOptionIcon' | 'onCreate' | 'createSchema' | 'createInitialValuePath'>;
|
|
18
|
-
export declare const FormField: ({ property, path, readonly, inline, projection, onQueryRefOptions, createOptionLabel, createOptionIcon, onCreate, createSchema, createInitialValuePath, lookupComponent, Custom, }: FormFieldProps) => React.JSX.Element | null;
|
|
19
|
-
export type FormFieldsProps = ThemedClassName<{
|
|
20
|
-
testId?: string;
|
|
21
|
-
schema: Schema.Schema.All;
|
|
22
|
-
/**
|
|
23
|
-
* Path to the current object from the root. Used with nested forms.
|
|
24
|
-
*/
|
|
25
|
-
path?: (string | number)[];
|
|
26
|
-
filter?: (props: SchemaProperty<any>[]) => SchemaProperty<any>[];
|
|
27
|
-
sort?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Optional projection for projection-based field management
|
|
30
|
-
*/
|
|
31
|
-
projection?: ProjectionModel;
|
|
32
|
-
lookupComponent?: ComponentLookup;
|
|
33
|
-
/**
|
|
34
|
-
* Map of custom renderers for specific properties.
|
|
35
|
-
* Prefer lookupComponent for plugin specific input surfaces.
|
|
36
|
-
*/
|
|
37
|
-
Custom?: Partial<Record<string, InputComponent>>;
|
|
38
|
-
onQueryRefOptions?: QueryRefOptions;
|
|
39
|
-
} & Pick<FormFieldProps, 'readonly'> & Pick<RefFieldProps, 'onQueryRefOptions' | 'createOptionLabel' | 'createOptionIcon' | 'onCreate' | 'createSchema' | 'createInitialValuePath'>>;
|
|
40
|
-
export declare const FormFields: React.ForwardRefExoticComponent<Omit<{
|
|
41
|
-
testId?: string;
|
|
42
|
-
schema: Schema.Schema.All;
|
|
43
|
-
/**
|
|
44
|
-
* Path to the current object from the root. Used with nested forms.
|
|
45
|
-
*/
|
|
46
|
-
path?: (string | number)[];
|
|
47
|
-
filter?: (props: SchemaProperty<any>[]) => SchemaProperty<any>[];
|
|
48
|
-
sort?: string[];
|
|
49
|
-
/**
|
|
50
|
-
* Optional projection for projection-based field management
|
|
51
|
-
*/
|
|
52
|
-
projection?: ProjectionModel;
|
|
53
|
-
lookupComponent?: ComponentLookup;
|
|
54
|
-
/**
|
|
55
|
-
* Map of custom renderers for specific properties.
|
|
56
|
-
* Prefer lookupComponent for plugin specific input surfaces.
|
|
57
|
-
*/
|
|
58
|
-
Custom?: Partial<Record<string, InputComponent>>;
|
|
59
|
-
onQueryRefOptions?: QueryRefOptions;
|
|
60
|
-
} & Pick<FormFieldProps, "readonly"> & Pick<RefFieldProps, "onQueryRefOptions" | "createOptionLabel" | "createOptionIcon" | "onCreate" | "createSchema" | "createInitialValuePath">, "className"> & {
|
|
61
|
-
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
62
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
-
//# sourceMappingURL=FormContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormContent.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAiF,MAAM,OAAO,CAAC;AAGtG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAuB,MAAM,cAAc,CAAC;AAG9F,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,eAAe,CAAC,EAAE,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,cAAc,CAAC,GAAG,CAAC,EAAE;WACzD,MAAM,EAAE;IACf;;OAEG;iBACU,eAAe;sBACV,eAAe;IACjC;;;OAGG;aACM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;wBAC5B,eAAe;;;wCAwFtC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { type FocusEvent, type PropsWithChildren, type RefObject } from 'react';
|
|
2
|
-
import { type AnyProperties } from '@dxos/echo/internal';
|
|
3
|
-
import { type SimpleType } from '@dxos/effect';
|
|
4
|
-
import { type FormHandler, type FormOptions } from '../../hooks';
|
|
5
|
-
type FormContextValue<T extends AnyProperties> = FormHandler<T>;
|
|
6
|
-
export declare const useFormContext: <T extends AnyProperties>() => FormContextValue<T>;
|
|
7
|
-
export declare const useFormValues: (path?: (string | number)[]) => any;
|
|
8
|
-
export type FormInputStateProps = {
|
|
9
|
-
getStatus: () => {
|
|
10
|
-
status?: 'error';
|
|
11
|
-
error?: string;
|
|
12
|
-
};
|
|
13
|
-
getValue: <V>() => V | undefined;
|
|
14
|
-
onValueChange: (type: SimpleType, value: any) => void;
|
|
15
|
-
onBlur: (event: FocusEvent<HTMLElement>) => void;
|
|
16
|
-
};
|
|
17
|
-
export declare const useInputProps: (path?: (string | number)[]) => FormInputStateProps;
|
|
18
|
-
export declare const FormProvider: ({ children, formRef, autoSave, ...formOptions }: PropsWithChildren<FormOptions<any> & {
|
|
19
|
-
formRef?: RefObject<HTMLDivElement | null>;
|
|
20
|
-
autoSave?: boolean;
|
|
21
|
-
}>) => React.JSX.Element;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=FormContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,K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-
import { type Format } from '@dxos/echo/internal';
|
|
3
|
-
import { type SimpleType } from '@dxos/effect';
|
|
4
|
-
import { type FormInputStateProps } from './FormContext';
|
|
5
|
-
/**
|
|
6
|
-
* Props passed to input components.
|
|
7
|
-
*/
|
|
8
|
-
export type InputProps = {
|
|
9
|
-
type: SimpleType;
|
|
10
|
-
format?: Format.TypeFormat;
|
|
11
|
-
label: string;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
inputOnly?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Specifies the readonly variant: either disabled inputs, elements indicating they are usually editable but currently are not; or `static`, a field’s representation as regular content without signifiers that it is ever editable.
|
|
16
|
-
*/
|
|
17
|
-
readonly?: 'disabled-input' | 'static' | false;
|
|
18
|
-
} & FormInputStateProps;
|
|
19
|
-
/**
|
|
20
|
-
* Form input component.
|
|
21
|
-
*/
|
|
22
|
-
export type InputComponent = FC<InputProps>;
|
|
23
|
-
export type InputHeaderProps = {
|
|
24
|
-
error?: string;
|
|
25
|
-
label: string;
|
|
26
|
-
readonly?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export declare const InputHeader: ({ error, label, readonly }: InputHeaderProps) => React.JSX.Element;
|
|
29
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,GAAG,QAAQ,GAAG,KAAK,CAAC;CAChD,GAAG,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,4BAA4B,gBAAgB,sBAavE,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import '@dxos/lit-ui/dx-tag-picker.pcss';
|
|
2
|
-
import type * as Schema from 'effect/Schema';
|
|
3
|
-
import type * as SchemaAST from 'effect/SchemaAST';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { type EchoSchema } from '@dxos/echo/internal';
|
|
6
|
-
import { type QueryRefOptions } from '../../hooks';
|
|
7
|
-
import { type InputProps } from './Input';
|
|
8
|
-
export type RefFieldProps = InputProps & {
|
|
9
|
-
ast?: SchemaAST.AST;
|
|
10
|
-
array?: boolean;
|
|
11
|
-
createOptionLabel?: [string, {
|
|
12
|
-
ns: string;
|
|
13
|
-
}];
|
|
14
|
-
createOptionIcon?: string;
|
|
15
|
-
onCreate?: (values: any) => void;
|
|
16
|
-
createSchema?: Schema.Schema.AnyNoContext;
|
|
17
|
-
createInitialValuePath?: string;
|
|
18
|
-
onQueryRefOptions?: QueryRefOptions;
|
|
19
|
-
schema?: EchoSchema;
|
|
20
|
-
};
|
|
21
|
-
export declare const RefField: ({ type, label, readonly, placeholder, inputOnly, array, ast, getValue, createOptionLabel, createOptionIcon, onBlur, onCreate, createSchema, createInitialValuePath, onQueryRefOptions, onValueChange, ...restInputProps }: RefFieldProps) => React.JSX.Element | null;
|
|
22
|
-
//# sourceMappingURL=RefField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,iCAAiC,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EACL,KAAK,UAAU,EAMhB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,aAAa,CAAC;AAKvE,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IACvC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAOF,eAAO,MAAM,QAAQ,GAAI,2NAkBtB,aAAa,6BAuKf,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeoPointInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/GeoPointInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAO3F,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,aAAa,GAAI,uEAAuE,UAAU,sBAkE9G,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOptionsInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/SelectOptionsInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAU9G,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,iBAAiB,GAAI,+DAA+D,UAAU,sBA8K1G,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOptionsInput.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/SelectOptionsInput.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAuCxC,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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type InputProps } from '../Input';
|
|
3
|
-
export declare const TupleInput: ({ binding, type, label, readonly, getStatus, getValue, onValueChange, onBlur, }: InputProps & {
|
|
4
|
-
binding: string[];
|
|
5
|
-
}) => React.JSX.Element;
|
|
6
|
-
//# sourceMappingURL=TupleInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TupleInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/TupleInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAIxD,eAAO,MAAM,UAAU,GAAI,iFASxB,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,sBAuBpC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Format } from '@dxos/echo/internal';
|
|
2
|
-
import { type SimpleType } from '@dxos/effect';
|
|
3
|
-
import { type InputComponent } from './Input';
|
|
4
|
-
/**
|
|
5
|
-
* Get property input component.
|
|
6
|
-
*/
|
|
7
|
-
export declare const getInputComponent: (type: SimpleType, format?: Format.TypeFormat | string) => InputComponent | undefined;
|
|
8
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/factory.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,UAAU,EAChB,SAAS,MAAM,CAAC,UAAU,GAAG,MAAM,KAClC,cAAc,GAAG,SAgBnB,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type * as Schema from 'effect/Schema';
|
|
2
|
-
import { type AnyProperties } from '@dxos/echo/internal';
|
|
3
|
-
import { type JsonPath, type SimpleType } from '@dxos/effect';
|
|
4
|
-
import { type ValidationError } from '@dxos/schema';
|
|
5
|
-
import { type MaybePromise } from '@dxos/util';
|
|
6
|
-
/**
|
|
7
|
-
* Return type from `useForm` hook.
|
|
8
|
-
*/
|
|
9
|
-
export type FormHandler<T extends AnyProperties> = {
|
|
10
|
-
values: Partial<T>;
|
|
11
|
-
errors: Record<JsonPath, string>;
|
|
12
|
-
touched: Record<JsonPath, boolean>;
|
|
13
|
-
changed: Record<JsonPath, boolean>;
|
|
14
|
-
canSave: boolean;
|
|
15
|
-
formIsValid: boolean;
|
|
16
|
-
handleSave: () => void;
|
|
17
|
-
getStatus: (path: string | (string | number)[]) => {
|
|
18
|
-
status?: 'error';
|
|
19
|
-
error?: string;
|
|
20
|
-
};
|
|
21
|
-
getValue: <V>(path: (string | number)[]) => V | undefined;
|
|
22
|
-
onValueChange: <V>(path: (string | number)[], type: SimpleType, value: V) => void;
|
|
23
|
-
onTouched: (path: (string | number)[]) => void;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Hook options.
|
|
27
|
-
*/
|
|
28
|
-
export interface FormOptions<T extends AnyProperties> {
|
|
29
|
-
/**
|
|
30
|
-
* Effect schema (Type literal).
|
|
31
|
-
*/
|
|
32
|
-
schema: Schema.Schema<T, any>;
|
|
33
|
-
/**
|
|
34
|
-
* Initial values (which may not pass validation).
|
|
35
|
-
*/
|
|
36
|
-
initialValues: Partial<T>;
|
|
37
|
-
/**
|
|
38
|
-
* Callback for value changes. Note: This is called even when values are invalid.
|
|
39
|
-
* Sometimes the parent component may want to know about changes even if the form is
|
|
40
|
-
* in an invalid state.
|
|
41
|
-
*/
|
|
42
|
-
onValuesChanged?: (values: Partial<T>) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Custom validation function that runs only after schema validation passes.
|
|
45
|
-
* Use this for complex validation logic that can't be expressed in the schema.
|
|
46
|
-
* @returns Array of validation errors, or undefined if validation passes
|
|
47
|
-
*/
|
|
48
|
-
onValidate?: (values: T) => ValidationError[] | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Called when the form is valid.
|
|
51
|
-
*/
|
|
52
|
-
onValid?: (values: T, meta: {
|
|
53
|
-
changed: FormHandler<T>['changed'];
|
|
54
|
-
}) => void;
|
|
55
|
-
/**
|
|
56
|
-
* Called when the form is submitted and passes validation.
|
|
57
|
-
*/
|
|
58
|
-
onSave?: (values: T, meta: {
|
|
59
|
-
changed: FormHandler<T>['changed'];
|
|
60
|
-
}) => MaybePromise<void>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Creates a hook for managing form state, including values, validation, and submission.
|
|
64
|
-
* Deeply integrated with `@dxos/schema` for schema-based validation.
|
|
65
|
-
*/
|
|
66
|
-
export declare const useForm: <T extends AnyProperties>({ schema, initialValues, onValuesChanged, onValidate, onValid, onSave, }: FormOptions<T>) => FormHandler<T>;
|
|
67
|
-
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAI7C,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAA4C,MAAM,cAAc,CAAC;AAGxG,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,IAAI;IAKjD,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAA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AM,EAAE,CAAC,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAE5E;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;KAAE,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAC1F;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,aAAa,EAAE,0EAO9C,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAsLhC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type TypeAnnotation } from '@dxos/echo/internal';
|
|
2
|
-
import { type DXN } from '@dxos/keys';
|
|
3
|
-
import { type Palette } from '@dxos/react-ui-types';
|
|
4
|
-
import { type MaybePromise } from '@dxos/util';
|
|
5
|
-
export type RefOption = {
|
|
6
|
-
dxn: DXN;
|
|
7
|
-
label?: string;
|
|
8
|
-
};
|
|
9
|
-
export type QueryRefOptions = (type: TypeAnnotation) => MaybePromise<RefOption[]>;
|
|
10
|
-
export type QueryTag = {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
hue?: Palette;
|
|
14
|
-
};
|
|
15
|
-
type UseQueryRefOptionsProps = {
|
|
16
|
-
refTypeInfo: TypeAnnotation | undefined;
|
|
17
|
-
onQueryRefOptions?: QueryRefOptions;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Hook to query reference options based on type information.
|
|
21
|
-
* Used internally within forms to fetch and format reference options for reference fields.
|
|
22
|
-
*/
|
|
23
|
-
export declare const useQueryRefOptions: ({ refTypeInfo, onQueryRefOptions }: UseQueryRefOptionsProps) => {
|
|
24
|
-
options: QueryTag[];
|
|
25
|
-
update: () => void;
|
|
26
|
-
loading: boolean;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=useQueryRefOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryRefOptions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useQueryRefOptions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;AAElF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAAE,WAAW,EAAE,cAAc,GAAG,SAAS,CAAC;IAAC,iBAAiB,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC;AAEhH;;;GAGG;AAEH,eAAO,MAAM,kBAAkB,GAAI,oCAAoC,uBAAuB;;;;CAiC7F,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
2
|
-
import { type QueryRefOptions } from './useQueryRefOptions';
|
|
3
|
-
type UseRefQueryLookupProps = {
|
|
4
|
-
space?: Space;
|
|
5
|
-
};
|
|
6
|
-
export declare const useRefQueryLookupHandler: ({ space }: UseRefQueryLookupProps) => QueryRefOptions;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=useRefQueryLookupHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRefQueryLookupHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useRefQueryLookupHandler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,KAAK,sBAAsB,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEhD,eAAO,MAAM,wBAAwB,GAAI,WAAW,sBAAsB,KAAG,eAuB5E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/util/schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAI9C,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,CAAC,GAAG,8BAGtD,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
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type ComponentPropsWithoutRef, type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
Button,
|
|
9
|
-
type ButtonProps,
|
|
10
|
-
Input,
|
|
11
|
-
type Label,
|
|
12
|
-
type ThemedClassName,
|
|
13
|
-
toLocalizedString,
|
|
14
|
-
useTranslation,
|
|
15
|
-
} from '@dxos/react-ui';
|
|
16
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
-
|
|
19
|
-
import { translationKey } from '../../translations';
|
|
20
|
-
|
|
21
|
-
export type ControlPageProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
|
|
22
|
-
|
|
23
|
-
export const ControlPage = ({ children, classNames, ...props }: ControlPageProps) => {
|
|
24
|
-
return (
|
|
25
|
-
<StackItem.Content scrollable classNames='[--control-spacing:var(--dx-trimMd)]'>
|
|
26
|
-
<div role='none' className={mx('pli-cardSpacingInline pbe-trimLg', classNames)} {...props}>
|
|
27
|
-
{children}
|
|
28
|
-
</div>
|
|
29
|
-
</StackItem.Content>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ControlSectionProps = PropsWithChildren<{
|
|
34
|
-
title: Label;
|
|
35
|
-
description?: Label;
|
|
36
|
-
}>;
|
|
37
|
-
|
|
38
|
-
export const ControlSection = ({ title, description, children }: ControlSectionProps) => {
|
|
39
|
-
return (
|
|
40
|
-
<>
|
|
41
|
-
<ControlSectionHeading title={title} description={description} />
|
|
42
|
-
{children}
|
|
43
|
-
</>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const ControlSectionHeading = ({ title, description }: Omit<ControlSectionProps, 'children'>) => {
|
|
48
|
-
const { t } = useTranslation(translationKey);
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<h2 className='pli-trimMd container-max-width text-xl mbs-trimLg mbe-trimMd'>{toLocalizedString(title, t)}</h2>
|
|
52
|
-
{description && (
|
|
53
|
-
<p className='pli-trimMd mlb-trimMd container-max-width text-description'>
|
|
54
|
-
{toLocalizedString(description, t)}
|
|
55
|
-
</p>
|
|
56
|
-
)}
|
|
57
|
-
</>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const ControlGroupButton = ({ classNames, ...props }: ButtonProps) => {
|
|
62
|
-
return <Button {...props} classNames={['md:col-span-2', classNames]} />;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export type ControlGroupProps = ThemedClassName<PropsWithChildren>;
|
|
66
|
-
|
|
67
|
-
export const ControlGroup = ({ children, classNames }: ControlGroupProps) => (
|
|
68
|
-
<div
|
|
69
|
-
role='none'
|
|
70
|
-
className={mx(
|
|
71
|
-
'group container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content] gap-trimMd',
|
|
72
|
-
'[--control-spacing:0px] [&_input]:justify-self-end [&_button]:justify-self-end',
|
|
73
|
-
classNames,
|
|
74
|
-
)}
|
|
75
|
-
>
|
|
76
|
-
{children}
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
export const ControlFrame = ({ children }: ControlGroupProps) => (
|
|
81
|
-
<div
|
|
82
|
-
role='none'
|
|
83
|
-
className={mx(
|
|
84
|
-
'container-max-width grid grid-cols-1 md:grid-cols-[1fr_1fr] gap-trimSm md:gap-trimMd p-trimMd',
|
|
85
|
-
'border border-separator rounded-md',
|
|
86
|
-
)}
|
|
87
|
-
>
|
|
88
|
-
{children}
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
export const controlItemClasses = mx([
|
|
93
|
-
'container-max-width grid md:col-span-2 grid-cols-subgrid gap-trimSm items-center',
|
|
94
|
-
// TODO(burdon): Use grid gap consistently or apply margins consistently?
|
|
95
|
-
'mlb-[--control-spacing] *:first:!mbs-0 *:last:!mbe-0 pli-trimMd plb-trimMd',
|
|
96
|
-
'border border-separator rounded-md',
|
|
97
|
-
]);
|
|
98
|
-
|
|
99
|
-
const controlItemTitleClasses = 'mbe-0 text-lg text-baseText font-normal';
|
|
100
|
-
const controlItemDescriptionClasses = 'mlb-trimSm md:mbe-0 text-base text-description';
|
|
101
|
-
|
|
102
|
-
export type ControlItemProps = PropsWithChildren<{
|
|
103
|
-
title: Label;
|
|
104
|
-
description?: Label;
|
|
105
|
-
}>;
|
|
106
|
-
|
|
107
|
-
export const ControlItem = ({ title, description, children }: ControlItemProps) => {
|
|
108
|
-
const { t } = useTranslation(translationKey);
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<div className={controlItemClasses}>
|
|
112
|
-
<div role='none'>
|
|
113
|
-
<h3 className={controlItemTitleClasses}>{toLocalizedString(title, t)}</h3>
|
|
114
|
-
{description && <p className={controlItemDescriptionClasses}>{toLocalizedString(description, t)}</p>}
|
|
115
|
-
</div>
|
|
116
|
-
{children}
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const ControlItemInput = ({ title, description, children }: ControlItemProps) => {
|
|
122
|
-
const { t } = useTranslation(translationKey);
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<Input.Root>
|
|
126
|
-
<div className={controlItemClasses}>
|
|
127
|
-
<div role='none'>
|
|
128
|
-
<Input.Label classNames={controlItemTitleClasses}>{toLocalizedString(title, t)}</Input.Label>
|
|
129
|
-
{description && (
|
|
130
|
-
<Input.DescriptionAndValidation>
|
|
131
|
-
<Input.Description classNames={controlItemDescriptionClasses}>
|
|
132
|
-
{toLocalizedString(description, t)}
|
|
133
|
-
</Input.Description>
|
|
134
|
-
</Input.DescriptionAndValidation>
|
|
135
|
-
)}
|
|
136
|
-
</div>
|
|
137
|
-
{children}
|
|
138
|
-
</div>
|
|
139
|
-
</Input.Root>
|
|
140
|
-
);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const ControlFrameItem = ({ title, description, children }: ControlItemProps) => {
|
|
144
|
-
const { t } = useTranslation(translationKey);
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<div role='group' className='min-is-0'>
|
|
148
|
-
<h3 className='text-lg mbe-2'>{toLocalizedString(title, t)}</h3>
|
|
149
|
-
{description && <p className='mlb-trimSm md:mbe-0 text-description'>{toLocalizedString(description, t)}</p>}
|
|
150
|
-
{children}
|
|
151
|
-
</div>
|
|
152
|
-
);
|
|
153
|
-
};
|