@a-type/ui 6.0.60 → 6.0.61
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/dist/components/forms/CheckboxField.d.ts +2 -1
- package/dist/components/forms/CheckboxField.js +2 -2
- package/dist/components/forms/CheckboxField.js.map +1 -1
- package/dist/components/forms/EmojiField.d.ts +3 -2
- package/dist/components/forms/EmojiField.js +2 -2
- package/dist/components/forms/EmojiField.js.map +1 -1
- package/dist/components/forms/FormikForm.d.ts +4 -3
- package/dist/components/forms/FormikForm.js +3 -3
- package/dist/components/forms/FormikForm.js.map +1 -1
- package/dist/components/forms/FormikForm.stories.d.ts +2 -2
- package/dist/components/forms/NumberStepperField.d.ts +3 -2
- package/dist/components/forms/NumberStepperField.js +2 -2
- package/dist/components/forms/NumberStepperField.js.map +1 -1
- package/dist/components/forms/TextField.d.ts +2 -2
- package/dist/components/forms/TextField.js +4 -4
- package/dist/components/forms/TextField.js.map +1 -1
- package/dist/components/forms/ToggleGroupField.d.ts +3 -2
- package/dist/components/forms/ToggleGroupField.js +3 -3
- package/dist/components/forms/ToggleGroupField.js.map +1 -1
- package/package.json +1 -1
- package/src/components/forms/CheckboxField.tsx +3 -1
- package/src/components/forms/EmojiField.tsx +4 -2
- package/src/components/forms/FormikForm.tsx +10 -2
- package/src/components/forms/NumberStepperField.tsx +7 -2
- package/src/components/forms/TextField.tsx +4 -2
- package/src/components/forms/ToggleGroupField.tsx +15 -12
|
@@ -4,7 +4,8 @@ export interface CheckboxFieldProps {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
required?: boolean;
|
|
6
6
|
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
7
8
|
id?: string;
|
|
8
9
|
description?: ReactNode;
|
|
9
10
|
}
|
|
10
|
-
export declare function CheckboxField({ name, label, className, required, id: providedId, description, ...rest }: CheckboxFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function CheckboxField({ name, label, className, style, required, id: providedId, description, ...rest }: CheckboxFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,10 +15,10 @@ import { useIdOrGenerated } from '../../hooks/useIdOrGenerated.js';
|
|
|
15
15
|
import { Checkbox } from '../checkbox/index.js';
|
|
16
16
|
import { Field } from './Field.js';
|
|
17
17
|
export function CheckboxField(_a) {
|
|
18
|
-
var { name, label, className, required, id: providedId, description } = _a, rest = __rest(_a, ["name", "label", "className", "required", "id", "description"]);
|
|
18
|
+
var { name, label, className, style, required, id: providedId, description } = _a, rest = __rest(_a, ["name", "label", "className", "style", "required", "id", "description"]);
|
|
19
19
|
const [props, _, tools] = useField({ name, required, type: 'checkbox' });
|
|
20
20
|
const id = useIdOrGenerated(providedId);
|
|
21
|
-
return (_jsxs(Field, { horizontal: true, className: className, id: id, children: [_jsx(Field.Control, { render: _jsx(Checkbox, Object.assign({}, props, { checked: props.checked, onCheckedChange: (v) => {
|
|
21
|
+
return (_jsxs(Field, { horizontal: true, className: className, style: style, id: id, children: [_jsx(Field.Control, { render: _jsx(Checkbox, Object.assign({}, props, { checked: props.checked, onCheckedChange: (v) => {
|
|
22
22
|
tools.setValue(!!v);
|
|
23
23
|
} }, rest)) }), label && _jsx(Field.Label, { children: label }), description && _jsx(Field.Description, { children: description })] }));
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxField.js","sourceRoot":"","sources":["../../../src/components/forms/CheckboxField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxField.js","sourceRoot":"","sources":["../../../src/components/forms/CheckboxField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAYnC,MAAM,UAAU,aAAa,CAAC,EAST;QATS,EAC7B,IAAI,EACJ,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,EAAE,EAAE,UAAU,EACd,WAAW,OAES,EADjB,IAAI,cARsB,wEAS7B,CADO;IAEP,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IACzE,MAAM,EAAE,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,OAAO,CACN,MAAC,KAAK,IAAC,UAAU,QAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,aAC3D,KAAC,KAAK,CAAC,OAAO,IACb,MAAM,EACL,KAAC,QAAQ,oBACJ,KAAK,IACT,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE;wBACtB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACrB,CAAC,IACG,IAAI,EACP,GAEF,EACD,KAAK,IAAI,KAAC,KAAK,CAAC,KAAK,cAAE,KAAK,GAAe,EAC3C,WAAW,IAAI,KAAC,KAAK,CAAC,WAAW,cAAE,WAAW,GAAqB,IAC7D,CACR,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '../button/Button.js';
|
|
3
|
-
export type EmojiFieldProps = Omit<ButtonProps, 'className'> & {
|
|
3
|
+
export type EmojiFieldProps = Omit<ButtonProps, 'className' | 'style'> & {
|
|
4
4
|
name: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
required?: string;
|
|
7
7
|
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
8
9
|
description?: ReactNode;
|
|
9
10
|
};
|
|
10
|
-
export declare function EmojiField({ name, label, className, required, id: providedId, description, ...rest }: EmojiFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function EmojiField({ name, label, className, required, id: providedId, description, style, ...rest }: EmojiFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,11 +20,11 @@ import { Popover } from '../popover/Popover.js';
|
|
|
20
20
|
import cls from './EmojiField.module.css';
|
|
21
21
|
import { Field } from './Field.js';
|
|
22
22
|
export function EmojiField(_a) {
|
|
23
|
-
var { name, label, className, required, id: providedId, description } = _a, rest = __rest(_a, ["name", "label", "className", "required", "id", "description"]);
|
|
23
|
+
var { name, label, className, required, id: providedId, description, style } = _a, rest = __rest(_a, ["name", "label", "className", "required", "id", "description", "style"]);
|
|
24
24
|
const [props, _, tools] = useField({ name });
|
|
25
25
|
const id = useIdOrGenerated(providedId);
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
27
|
-
return (_jsxs(Field, { horizontal: true, className: className, id: id, children: [_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(Field.Control, { render: _jsx("input", Object.assign({ type: "hidden" }, props)) }), _jsx(Popover.Trigger, { render: _jsx(Button, Object.assign({ id: `${id}-trigger`, "aria-label": "Select emoji", size: "wrapper" }, rest, { children: _jsx(Button.Icon, { className: cls.triggerIcon, children: props.value || _jsx(Icon, { name: "smile" }) }) })) }), _jsx(Popover.Content, { children: _jsx(EmojiPicker, { onValueChange: (v) => {
|
|
27
|
+
return (_jsxs(Field, { horizontal: true, className: className, style: style, id: id, children: [_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(Field.Control, { render: _jsx("input", Object.assign({ type: "hidden" }, props)) }), _jsx(Popover.Trigger, { render: _jsx(Button, Object.assign({ id: `${id}-trigger`, "aria-label": "Select emoji", size: "wrapper" }, rest, { children: _jsx(Button.Icon, { className: cls.triggerIcon, children: props.value || _jsx(Icon, { name: "smile" }) }) })) }), _jsx(Popover.Content, { children: _jsx(EmojiPicker, { onValueChange: (v) => {
|
|
28
28
|
tools.setValue(v);
|
|
29
29
|
setOpen(false);
|
|
30
30
|
}, onClear: required
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiField.js","sourceRoot":"","sources":["../../../src/components/forms/EmojiField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,GAAG,MAAM,yBAAyB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"EmojiField.js","sourceRoot":"","sources":["../../../src/components/forms/EmojiField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAA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EAAE,EAAE;gCACpB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gCAClB,OAAO,CAAC,KAAK,CAAC,CAAC;4BAChB,CAAC,EACD,OAAO,EACN,QAAQ;gCACP,CAAC,CAAC,SAAS;gCACX,CAAC,CAAC,GAAG,EAAE;oCACL,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;oCACnB,OAAO,CAAC,KAAK,CAAC,CAAC;gCACf,CAAC,EAEL,EAAE,EAAE,EAAE,GACL,GACe,IACT,EACT,KAAK,IAAI,KAAC,KAAK,CAAC,KAAK,cAAE,KAAK,GAAe,EAC3C,WAAW,IAAI,KAAC,KAAK,CAAC,WAAW,cAAE,WAAW,GAAqB,IAC7D,CACR,CAAC;AACH,CAAC"}
|
|
@@ -7,17 +7,18 @@ import { SwitchField } from './SwitchField.js';
|
|
|
7
7
|
import { TextAreaField } from './TextField.js';
|
|
8
8
|
export interface FormikFormProps<T extends FormikValues = FormikValues> extends FormikConfig<T> {
|
|
9
9
|
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
10
11
|
}
|
|
11
12
|
export { FieldArray } from 'formik';
|
|
12
|
-
export declare function FormikFormRoot<Values extends FormikValues>({ className, children, onSubmit, ...props }: FormikFormProps<Values>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function FormikFormRoot<Values extends FormikValues>({ className, style, children, onSubmit, ...props }: FormikFormProps<Values>): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare const FormikForm: typeof FormikFormRoot & {
|
|
14
|
-
TextField: ({ ref, name, label, className, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description, ...rest }: import("./TextField.js").TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
TextField: ({ ref, name, label, className, style, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description, ...rest }: import("./TextField.js").TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
TextAreaField: typeof TextAreaField;
|
|
16
17
|
NumberStepperField: typeof NumberStepperField;
|
|
17
18
|
SubmitButton: typeof SubmitButton;
|
|
18
19
|
CheckboxField: typeof CheckboxField;
|
|
19
20
|
SwitchField: typeof SwitchField;
|
|
20
|
-
ToggleGroupField: (({ name, label, required, className, type, multiple, description, id: providedId, ...props }: import("./ToggleGroupField.js").ToggleGroupFieldProps<string>) => import("react/jsx-runtime").JSX.Element) & {
|
|
21
|
+
ToggleGroupField: (({ name, label, required, className, style, type, multiple, description, id: providedId, ...props }: import("./ToggleGroupField.js").ToggleGroupFieldProps<string>) => import("react/jsx-runtime").JSX.Element) & {
|
|
21
22
|
Item: import("react").FunctionComponent<import("@base-ui/react").Toggle.Props<string> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
22
23
|
};
|
|
23
24
|
EmojiField: typeof EmojiField;
|
|
@@ -22,7 +22,7 @@ import { TextAreaField, TextField } from './TextField.js';
|
|
|
22
22
|
import { ToggleGroupField } from './ToggleGroupField.js';
|
|
23
23
|
export { FieldArray } from 'formik';
|
|
24
24
|
export function FormikFormRoot(_a) {
|
|
25
|
-
var { className, children, onSubmit } = _a, props = __rest(_a, ["className", "children", "onSubmit"]);
|
|
25
|
+
var { className, style, children, onSubmit } = _a, props = __rest(_a, ["className", "style", "children", "onSubmit"]);
|
|
26
26
|
const wrappedOnSubmit = useCallback(async (values, bag) => {
|
|
27
27
|
try {
|
|
28
28
|
bag.setSubmitting(true);
|
|
@@ -33,9 +33,9 @@ export function FormikFormRoot(_a) {
|
|
|
33
33
|
}
|
|
34
34
|
}, [onSubmit]);
|
|
35
35
|
if (typeof children === 'function') {
|
|
36
|
-
return (_jsx(Formik, Object.assign({ onSubmit: wrappedOnSubmit }, props, { children: (formik) => _jsx(Form, { className: className, children: children(formik) }) })));
|
|
36
|
+
return (_jsx(Formik, Object.assign({ onSubmit: wrappedOnSubmit }, props, { children: (formik) => (_jsx(Form, { className: className, style: style, children: children(formik) })) })));
|
|
37
37
|
}
|
|
38
|
-
return (_jsx(Formik, Object.assign({ onSubmit: wrappedOnSubmit }, props, { children: _jsx(Form, { className: className, children: children }) })));
|
|
38
|
+
return (_jsx(Formik, Object.assign({ onSubmit: wrappedOnSubmit }, props, { children: _jsx(Form, { className: className, style: style, children: children }) })));
|
|
39
39
|
}
|
|
40
40
|
export const FormikForm = Object.assign(FormikFormRoot, {
|
|
41
41
|
TextField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormikForm.js","sourceRoot":"","sources":["../../../src/components/forms/FormikForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAA6C,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"FormikForm.js","sourceRoot":"","sources":["../../../src/components/forms/FormikForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAA6C,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC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cACnD,KAAC,IAAI,IAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,YACtC,QAAQ,GACH,IACC,CACT,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE;IACvD,SAAS;IACT,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,UAAU;CACV,CAAC,CAAC"}
|
|
@@ -8,13 +8,13 @@ import { SwitchField } from './SwitchField.js';
|
|
|
8
8
|
declare const meta: {
|
|
9
9
|
title: string;
|
|
10
10
|
component: typeof import("./FormikForm.js").FormikFormRoot & {
|
|
11
|
-
TextField: ({ ref, name, label, className, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description, ...rest }: import("./TextField.js").TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
TextField: ({ ref, name, label, className, style, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description, ...rest }: import("./TextField.js").TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
TextAreaField: typeof import("./TextField.js").TextAreaField;
|
|
13
13
|
NumberStepperField: typeof NumberStepperField;
|
|
14
14
|
SubmitButton: typeof SubmitButton;
|
|
15
15
|
CheckboxField: typeof CheckboxField;
|
|
16
16
|
SwitchField: typeof SwitchField;
|
|
17
|
-
ToggleGroupField: (({ name, label, required, className, type, multiple, description, id: providedId, ...props }: import("./ToggleGroupField.js").ToggleGroupFieldProps<string>) => import("react/jsx-runtime").JSX.Element) & {
|
|
17
|
+
ToggleGroupField: (({ name, label, required, className, style, type, multiple, description, id: providedId, ...props }: import("./ToggleGroupField.js").ToggleGroupFieldProps<string>) => import("react/jsx-runtime").JSX.Element) & {
|
|
18
18
|
Item: import("react").FunctionComponent<import("@base-ui/react").Toggle.Props<string> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
19
19
|
};
|
|
20
20
|
EmojiField: typeof EmojiField;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { NumberStepperProps } from '../numberStepper/NumberStepper.js';
|
|
3
|
-
export interface NumberStepperFieldProps extends Omit<NumberStepperProps, 'value' | 'onChange'> {
|
|
3
|
+
export interface NumberStepperFieldProps extends Omit<NumberStepperProps, 'value' | 'onChange' | 'className' | 'style'> {
|
|
4
4
|
name: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
7
8
|
id?: string;
|
|
8
9
|
onChange?: (value: number) => void;
|
|
9
10
|
description?: ReactNode;
|
|
10
11
|
}
|
|
11
|
-
export declare function NumberStepperField({ name, label, className, id: providedId, onChange, description, ...rest }: NumberStepperFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function NumberStepperField({ name, label, className, style, id: providedId, onChange, description, ...rest }: NumberStepperFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,10 +15,10 @@ import { useIdOrGenerated } from '../../hooks/useIdOrGenerated.js';
|
|
|
15
15
|
import { NumberStepper, } from '../numberStepper/NumberStepper.js';
|
|
16
16
|
import { Field } from './Field.js';
|
|
17
17
|
export function NumberStepperField(_a) {
|
|
18
|
-
var { name, label, className, id: providedId, onChange, description } = _a, rest = __rest(_a, ["name", "label", "className", "id", "onChange", "description"]);
|
|
18
|
+
var { name, label, className, style, id: providedId, onChange, description } = _a, rest = __rest(_a, ["name", "label", "className", "style", "id", "onChange", "description"]);
|
|
19
19
|
const [props, field, tools] = useField({ name });
|
|
20
20
|
const id = useIdOrGenerated(providedId);
|
|
21
|
-
return (_jsxs(Field, { className: className, id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: (composed) => (_jsxs(_Fragment, { children: [_jsx("input", Object.assign({ type: "hidden" }, props, composed)), _jsx(NumberStepper, Object.assign({ value: field.value, onChange: (v) => {
|
|
21
|
+
return (_jsxs(Field, { className: className, style: style, id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: (composed) => (_jsxs(_Fragment, { children: [_jsx("input", Object.assign({ type: "hidden" }, props, composed)), _jsx(NumberStepper, Object.assign({ value: field.value, onChange: (v) => {
|
|
22
22
|
tools.setValue(v);
|
|
23
23
|
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
24
24
|
} }, rest))] })) }), description && _jsx(Field.Description, { children: description })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberStepperField.js","sourceRoot":"","sources":["../../../src/components/forms/NumberStepperField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACN,aAAa,GAEb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberStepperField.js","sourceRoot":"","sources":["../../../src/components/forms/NumberStepperField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACN,aAAa,GAEb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAgBnC,MAAM,UAAU,kBAAkB,CAAC,EAST;QATS,EAClC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,KAAK,EACL,EAAE,EAAE,UAAU,EACd,QAAQ,EACR,WAAW,OAEc,EADtB,IAAI,cAR2B,wEASlC,CADO;IAEP,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,MAAM,EAAE,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,OAAO,CACN,MAAC,KAAK,IAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,aAC/C,KAAK,IAAI,KAAC,KAAK,CAAC,KAAK,cAAE,KAAK,GAAe,EAC5C,KAAC,KAAK,CAAC,OAAO,IACb,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CACrB,8BACC,8BAAO,IAAI,EAAC,QAAQ,IAAK,KAAK,EAAM,QAAQ,EAAI,EAChD,KAAC,aAAa,kBACb,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gCACf,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gCAClB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,CAAC;4BACf,CAAC,IACG,IAAI,EACP,IACA,CACH,GACA,EACD,WAAW,IAAI,KAAC,KAAK,CAAC,WAAW,cAAE,WAAW,GAAqB,IAC7D,CACR,CAAC;AACH,CAAC"}
|
|
@@ -11,7 +11,7 @@ export type TextFieldProps = {
|
|
|
11
11
|
ref?: Ref<HTMLDivElement>;
|
|
12
12
|
description?: ReactNode;
|
|
13
13
|
} & Omit<InputProps, 'ref'>;
|
|
14
|
-
export declare const TextField: ({ ref, name, label, className, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description, ...rest }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const TextField: ({ ref, name, label, className, style, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description, ...rest }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export type TextAreaFieldProps = {
|
|
16
16
|
name: string;
|
|
17
17
|
label?: string;
|
|
@@ -25,4 +25,4 @@ export type TextAreaFieldProps = {
|
|
|
25
25
|
description?: ReactNode;
|
|
26
26
|
ref?: Ref<HTMLDivElement>;
|
|
27
27
|
} & Omit<TextAreaProps, 'ref'>;
|
|
28
|
-
export declare function TextAreaField({ name, label, className, inputRef, onKeyDown, submitOnEnter, id: providedId, textAreaClassName, description, ref, ...rest }: TextAreaFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function TextAreaField({ name, label, className, style, inputRef, onKeyDown, submitOnEnter, id: providedId, textAreaClassName, description, ref, ...rest }: TextAreaFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,7 +21,7 @@ import { Field } from './Field.js';
|
|
|
21
21
|
import cls from './TextField.module.css';
|
|
22
22
|
const emptyRef = (() => { });
|
|
23
23
|
export const TextField = function TextField(_a) {
|
|
24
|
-
var { ref, name, label, className, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description } = _a, rest = __rest(_a, ["ref", "name", "label", "className", "autoFocusDelay", "autoFocus", "inputRef", "onChange", "onFocus", "onBlur", "id", "inputClassName", "description"]);
|
|
24
|
+
var { ref, name, label, className, style, autoFocusDelay, autoFocus, inputRef, onChange, onFocus, onBlur, id: providedId, inputClassName, description } = _a, rest = __rest(_a, ["ref", "name", "label", "className", "style", "autoFocusDelay", "autoFocus", "inputRef", "onChange", "onFocus", "onBlur", "id", "inputClassName", "description"]);
|
|
25
25
|
const [props] = useField({
|
|
26
26
|
name,
|
|
27
27
|
onChange,
|
|
@@ -38,10 +38,10 @@ export const TextField = function TextField(_a) {
|
|
|
38
38
|
}, autoFocusDelay);
|
|
39
39
|
}
|
|
40
40
|
}, [autoFocusDelay]);
|
|
41
|
-
return (_jsxs(Field, { className: className, stretch: true, ref: ref, id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: _jsx(Input, Object.assign({}, props, rest, { autoFocus: autoFocus, className: clsx(cls.input, inputClassName), ref: useMergedRef(innerInputRef, inputRef || emptyRef) })) }), description && _jsx(Field.Description, { children: description })] }));
|
|
41
|
+
return (_jsxs(Field, { className: className, style: style, stretch: true, ref: ref, id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: _jsx(Input, Object.assign({}, props, rest, { autoFocus: autoFocus, className: clsx(cls.input, inputClassName), ref: useMergedRef(innerInputRef, inputRef || emptyRef) })) }), description && _jsx(Field.Description, { children: description })] }));
|
|
42
42
|
};
|
|
43
43
|
export function TextAreaField(_a) {
|
|
44
|
-
var { name, label, className, inputRef, onKeyDown, submitOnEnter, id: providedId, textAreaClassName, description, ref } = _a, rest = __rest(_a, ["name", "label", "className", "inputRef", "onKeyDown", "submitOnEnter", "id", "textAreaClassName", "description", "ref"]);
|
|
44
|
+
var { name, label, className, style, inputRef, onKeyDown, submitOnEnter, id: providedId, textAreaClassName, description, ref } = _a, rest = __rest(_a, ["name", "label", "className", "style", "inputRef", "onKeyDown", "submitOnEnter", "id", "textAreaClassName", "description", "ref"]);
|
|
45
45
|
const [props] = useField(name);
|
|
46
46
|
const { submitForm } = useFormikContext();
|
|
47
47
|
const onKeyDownInner = useCallback((e) => {
|
|
@@ -52,6 +52,6 @@ export function TextAreaField(_a) {
|
|
|
52
52
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
53
53
|
}, [submitOnEnter, onKeyDown, submitForm]);
|
|
54
54
|
const id = useIdOrGenerated(providedId);
|
|
55
|
-
return (_jsxs(Field, { stretch: true, className: className, ref: ref, id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: _jsx(TextArea, Object.assign({ ref: inputRef }, props, rest, { className: clsx(cls.input, textAreaClassName), onKeyDown: onKeyDownInner })) }), description && _jsx(Field.Description, { children: description })] }));
|
|
55
|
+
return (_jsxs(Field, { stretch: true, className: className, style: style, ref: ref, id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: _jsx(TextArea, Object.assign({ ref: inputRef }, props, rest, { className: clsx(cls.input, textAreaClassName), onKeyDown: onKeyDownInner })) }), description && _jsx(Field.Description, { children: description })] }));
|
|
56
56
|
}
|
|
57
57
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../src/components/forms/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAKN,WAAW,EACX,SAAS,EACT,MAAM,GACN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAc,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAiB,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,GAAG,MAAM,wBAAwB,CAAC;AAazC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAE,CAAC,CAAQ,CAAC;AAEnC,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../src/components/forms/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAKN,WAAW,EACX,SAAS,EACT,MAAM,GACN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAc,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAiB,MAAM,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K,CAAC,OAAO,IACb,MAAM,EACL,KAAC,QAAQ,kBACR,GAAG,EAAE,QAAe,IAChB,KAAK,EACL,IAAI,IACR,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAC7C,SAAS,EAAE,cAAc,IACxB,GAEF,EACD,WAAW,IAAI,KAAC,KAAK,CAAC,WAAW,cAAE,WAAW,GAAqB,IAC7D,CACR,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ToggleGroupProps } from '../toggleGroup/toggleGroup.js';
|
|
3
|
-
export type ToggleGroupFieldProps<Value extends string> = ToggleGroupProps<Value> & {
|
|
3
|
+
export type ToggleGroupFieldProps<Value extends string> = Omit<ToggleGroupProps<Value>, 'style' | 'className'> & {
|
|
4
4
|
name: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
required?: boolean;
|
|
7
7
|
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
8
9
|
id?: string;
|
|
9
10
|
type?: 'single' | 'multiple';
|
|
10
11
|
description?: ReactNode;
|
|
11
12
|
};
|
|
12
|
-
declare function ToggleGroupFieldDefault({ name, label, required, className, type, multiple, description, id: providedId, ...props }: ToggleGroupFieldProps<string>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function ToggleGroupFieldDefault({ name, label, required, className, style, type, multiple, description, id: providedId, ...props }: ToggleGroupFieldProps<string>): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare const ToggleGroupField: typeof ToggleGroupFieldDefault & {
|
|
14
15
|
Item: import("react").FunctionComponent<import("@base-ui/react").Toggle.Props<string> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
16
|
};
|
|
@@ -15,17 +15,17 @@ import { useIdOrGenerated } from '../../hooks/useIdOrGenerated.js';
|
|
|
15
15
|
import { ToggleGroup } from '../toggleGroup/toggleGroup.js';
|
|
16
16
|
import { Field } from './Field.js';
|
|
17
17
|
function ToggleGroupFieldDefault(_a) {
|
|
18
|
-
var { name, label, required, className, type = 'single', multiple, description, id: providedId } = _a, props = __rest(_a, ["name", "label", "required", "className", "type", "multiple", "description", "id"]);
|
|
18
|
+
var { name, label, required, className, style, type = 'single', multiple, description, id: providedId } = _a, props = __rest(_a, ["name", "label", "required", "className", "style", "type", "multiple", "description", "id"]);
|
|
19
19
|
const id = useIdOrGenerated(providedId);
|
|
20
20
|
const [fieldProps, _, tools] = useField(Object.assign({ name, required }, props));
|
|
21
|
-
return (_jsxs(Field, { id: id, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: _jsx(ToggleGroup, Object.assign({}, fieldProps, { onValueChange: (v) => {
|
|
21
|
+
return (_jsxs(Field, { id: id, className: className, style: style, children: [label && _jsx(Field.Label, { children: label }), _jsx(Field.Control, { render: _jsx(ToggleGroup, Object.assign({}, fieldProps, { onValueChange: (v) => {
|
|
22
22
|
if (multiple || type === 'multiple') {
|
|
23
23
|
tools.setValue(v);
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
tools.setValue(v[0]);
|
|
27
27
|
}
|
|
28
|
-
}, multiple: multiple || type === 'multiple' }, props
|
|
28
|
+
}, multiple: multiple || type === 'multiple' }, props)) }), description && _jsx(Field.Description, { children: description })] }));
|
|
29
29
|
}
|
|
30
30
|
export const ToggleGroupField = Object.assign(ToggleGroupFieldDefault, {
|
|
31
31
|
Item: ToggleGroup.Item,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleGroupField.js","sourceRoot":"","sources":["../../../src/components/forms/ToggleGroupField.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,YA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,IAAI,IAAI,KAAK,UAAU,IACrC,KAAK,EACR,GAEF,EACD,WAAW,IAAI,KAAC,KAAK,CAAC,WAAW,cAAE,WAAW,GAAqB,IAC7D,CACR,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE;IACtE,IAAI,EAAE,WAAW,CAAC,IAAI;CACtB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ export interface CheckboxFieldProps {
|
|
|
9
9
|
label?: string;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
12
13
|
id?: string;
|
|
13
14
|
description?: ReactNode;
|
|
14
15
|
}
|
|
@@ -17,6 +18,7 @@ export function CheckboxField({
|
|
|
17
18
|
name,
|
|
18
19
|
label,
|
|
19
20
|
className,
|
|
21
|
+
style,
|
|
20
22
|
required,
|
|
21
23
|
id: providedId,
|
|
22
24
|
description,
|
|
@@ -25,7 +27,7 @@ export function CheckboxField({
|
|
|
25
27
|
const [props, _, tools] = useField({ name, required, type: 'checkbox' });
|
|
26
28
|
const id = useIdOrGenerated(providedId);
|
|
27
29
|
return (
|
|
28
|
-
<Field horizontal className={className} id={id}>
|
|
30
|
+
<Field horizontal className={className} style={style} id={id}>
|
|
29
31
|
<Field.Control
|
|
30
32
|
render={
|
|
31
33
|
<Checkbox
|
|
@@ -8,11 +8,12 @@ import { Popover } from '../popover/Popover.js';
|
|
|
8
8
|
import cls from './EmojiField.module.css';
|
|
9
9
|
import { Field } from './Field.js';
|
|
10
10
|
|
|
11
|
-
export type EmojiFieldProps = Omit<ButtonProps, 'className'> & {
|
|
11
|
+
export type EmojiFieldProps = Omit<ButtonProps, 'className' | 'style'> & {
|
|
12
12
|
name: string;
|
|
13
13
|
label?: string;
|
|
14
14
|
required?: string;
|
|
15
15
|
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
16
17
|
description?: ReactNode;
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -23,13 +24,14 @@ export function EmojiField({
|
|
|
23
24
|
required,
|
|
24
25
|
id: providedId,
|
|
25
26
|
description,
|
|
27
|
+
style,
|
|
26
28
|
...rest
|
|
27
29
|
}: EmojiFieldProps) {
|
|
28
30
|
const [props, _, tools] = useField({ name });
|
|
29
31
|
const id = useIdOrGenerated(providedId);
|
|
30
32
|
const [open, setOpen] = useState(false);
|
|
31
33
|
return (
|
|
32
|
-
<Field horizontal className={className} id={id}>
|
|
34
|
+
<Field horizontal className={className} style={style} id={id}>
|
|
33
35
|
<Popover open={open} onOpenChange={setOpen}>
|
|
34
36
|
<Field.Control render={<input type="hidden" {...props} />} />
|
|
35
37
|
<Popover.Trigger
|
|
@@ -12,12 +12,14 @@ import { ToggleGroupField } from './ToggleGroupField.js';
|
|
|
12
12
|
export interface FormikFormProps<T extends FormikValues = FormikValues>
|
|
13
13
|
extends FormikConfig<T> {
|
|
14
14
|
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export { FieldArray } from 'formik';
|
|
18
19
|
|
|
19
20
|
export function FormikFormRoot<Values extends FormikValues>({
|
|
20
21
|
className,
|
|
22
|
+
style,
|
|
21
23
|
children,
|
|
22
24
|
onSubmit,
|
|
23
25
|
...props
|
|
@@ -37,14 +39,20 @@ export function FormikFormRoot<Values extends FormikValues>({
|
|
|
37
39
|
if (typeof children === 'function') {
|
|
38
40
|
return (
|
|
39
41
|
<Formik<Values> onSubmit={wrappedOnSubmit} {...props}>
|
|
40
|
-
{(formik) =>
|
|
42
|
+
{(formik) => (
|
|
43
|
+
<Form className={className} style={style}>
|
|
44
|
+
{children(formik)}
|
|
45
|
+
</Form>
|
|
46
|
+
)}
|
|
41
47
|
</Formik>
|
|
42
48
|
);
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
return (
|
|
46
52
|
<Formik<Values> onSubmit={wrappedOnSubmit} {...props}>
|
|
47
|
-
<Form className={className}
|
|
53
|
+
<Form className={className} style={style}>
|
|
54
|
+
{children}
|
|
55
|
+
</Form>
|
|
48
56
|
</Formik>
|
|
49
57
|
);
|
|
50
58
|
}
|
|
@@ -8,10 +8,14 @@ import {
|
|
|
8
8
|
import { Field } from './Field.js';
|
|
9
9
|
|
|
10
10
|
export interface NumberStepperFieldProps
|
|
11
|
-
extends Omit<
|
|
11
|
+
extends Omit<
|
|
12
|
+
NumberStepperProps,
|
|
13
|
+
'value' | 'onChange' | 'className' | 'style'
|
|
14
|
+
> {
|
|
12
15
|
name: string;
|
|
13
16
|
label?: string;
|
|
14
17
|
className?: string;
|
|
18
|
+
style?: React.CSSProperties;
|
|
15
19
|
id?: string;
|
|
16
20
|
onChange?: (value: number) => void;
|
|
17
21
|
description?: ReactNode;
|
|
@@ -21,6 +25,7 @@ export function NumberStepperField({
|
|
|
21
25
|
name,
|
|
22
26
|
label,
|
|
23
27
|
className,
|
|
28
|
+
style,
|
|
24
29
|
id: providedId,
|
|
25
30
|
onChange,
|
|
26
31
|
description,
|
|
@@ -29,7 +34,7 @@ export function NumberStepperField({
|
|
|
29
34
|
const [props, field, tools] = useField({ name });
|
|
30
35
|
const id = useIdOrGenerated(providedId);
|
|
31
36
|
return (
|
|
32
|
-
<Field className={className} id={id}>
|
|
37
|
+
<Field className={className} style={style} id={id}>
|
|
33
38
|
{label && <Field.Label>{label}</Field.Label>}
|
|
34
39
|
<Field.Control
|
|
35
40
|
render={(composed) => (
|
|
@@ -34,6 +34,7 @@ export const TextField = function TextField({
|
|
|
34
34
|
name,
|
|
35
35
|
label,
|
|
36
36
|
className,
|
|
37
|
+
style,
|
|
37
38
|
autoFocusDelay,
|
|
38
39
|
autoFocus,
|
|
39
40
|
inputRef,
|
|
@@ -63,7 +64,7 @@ export const TextField = function TextField({
|
|
|
63
64
|
}, [autoFocusDelay]);
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
|
-
<Field className={className} stretch ref={ref} id={id}>
|
|
67
|
+
<Field className={className} style={style} stretch ref={ref} id={id}>
|
|
67
68
|
{label && <Field.Label>{label}</Field.Label>}
|
|
68
69
|
<Field.Control
|
|
69
70
|
render={
|
|
@@ -99,6 +100,7 @@ export function TextAreaField({
|
|
|
99
100
|
name,
|
|
100
101
|
label,
|
|
101
102
|
className,
|
|
103
|
+
style,
|
|
102
104
|
inputRef,
|
|
103
105
|
onKeyDown,
|
|
104
106
|
submitOnEnter,
|
|
@@ -123,7 +125,7 @@ export function TextAreaField({
|
|
|
123
125
|
const id = useIdOrGenerated(providedId);
|
|
124
126
|
|
|
125
127
|
return (
|
|
126
|
-
<Field stretch className={className} ref={ref} id={id}>
|
|
128
|
+
<Field stretch className={className} style={style} ref={ref} id={id}>
|
|
127
129
|
{label && <Field.Label>{label}</Field.Label>}
|
|
128
130
|
<Field.Control
|
|
129
131
|
render={
|
|
@@ -4,22 +4,26 @@ import { useIdOrGenerated } from '../../hooks/useIdOrGenerated.js';
|
|
|
4
4
|
import { ToggleGroup, ToggleGroupProps } from '../toggleGroup/toggleGroup.js';
|
|
5
5
|
import { Field } from './Field.js';
|
|
6
6
|
|
|
7
|
-
export type ToggleGroupFieldProps<Value extends string> =
|
|
8
|
-
ToggleGroupProps<Value
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export type ToggleGroupFieldProps<Value extends string> = Omit<
|
|
8
|
+
ToggleGroupProps<Value>,
|
|
9
|
+
'style' | 'className'
|
|
10
|
+
> & {
|
|
11
|
+
name: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
id?: string;
|
|
17
|
+
type?: 'single' | 'multiple';
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
function ToggleGroupFieldDefault({
|
|
19
22
|
name,
|
|
20
23
|
label,
|
|
21
24
|
required,
|
|
22
25
|
className,
|
|
26
|
+
style,
|
|
23
27
|
type = 'single',
|
|
24
28
|
multiple,
|
|
25
29
|
description,
|
|
@@ -30,7 +34,7 @@ function ToggleGroupFieldDefault({
|
|
|
30
34
|
const [fieldProps, _, tools] = useField({ name, required, ...props });
|
|
31
35
|
|
|
32
36
|
return (
|
|
33
|
-
<Field id={id}>
|
|
37
|
+
<Field id={id} className={className} style={style}>
|
|
34
38
|
{label && <Field.Label>{label}</Field.Label>}
|
|
35
39
|
<Field.Control
|
|
36
40
|
render={
|
|
@@ -45,7 +49,6 @@ function ToggleGroupFieldDefault({
|
|
|
45
49
|
}}
|
|
46
50
|
multiple={multiple || type === 'multiple'}
|
|
47
51
|
{...props}
|
|
48
|
-
className={className}
|
|
49
52
|
/>
|
|
50
53
|
}
|
|
51
54
|
/>
|