@koobiq/react-components 0.11.0 → 0.12.0
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/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Container/Container.js +13 -4
- package/dist/components/Container/types.d.ts +18 -3
- package/dist/components/Container/types.js +3 -1
- package/dist/components/DateInput/DateInput.js +36 -32
- package/dist/components/DateInput/DateInput.module.css.js +4 -1
- package/dist/components/DateInput/types.d.ts +10 -12
- package/dist/components/DateInput/types.js +5 -5
- package/dist/components/DatePicker/DatePicker.js +18 -2
- package/dist/components/DatePicker/types.d.ts +2 -2
- package/dist/components/Dialog/Dialog.js +2 -2
- package/dist/components/Dialog/components/DialogCloseButton.d.ts +2 -2
- package/dist/components/Form/Form.d.ts +9 -13
- package/dist/components/Form/Form.js +29 -32
- package/dist/components/Form/Form.module.css.js +19 -7
- package/dist/components/Form/FormContext.d.ts +5 -3
- package/dist/components/Form/components/FormActions/FormActions.d.ts +7 -0
- package/dist/components/Form/components/FormActions/FormActions.js +9 -0
- package/dist/components/Form/components/FormActions/index.d.ts +1 -0
- package/dist/components/Form/components/FormCaption/FormCaption.d.ts +16 -0
- package/dist/components/Form/components/FormCaption/FormCaption.js +17 -0
- package/dist/components/Form/components/FormCaption/index.d.ts +1 -0
- package/dist/components/Form/components/FormGroup/FormGroup.d.ts +7 -0
- package/dist/components/Form/components/FormGroup/FormGroup.js +9 -0
- package/dist/components/Form/components/FormGroup/index.d.ts +1 -0
- package/dist/components/Form/components/index.d.ts +3 -0
- package/dist/components/Form/types.d.ts +7 -3
- package/dist/components/Form/utils.js +12 -12
- package/dist/components/FormField/FormField.d.ts +22 -0
- package/dist/components/FormField/FormField.js +55 -0
- package/dist/components/FormField/FormField.module.css.js +17 -0
- package/dist/components/FormField/FormFieldAddon/FormFieldAddon.d.ts +10 -0
- package/dist/components/{FieldComponents/FieldAddon/FieldAddon.js → FormField/FormFieldAddon/FormFieldAddon.js} +9 -14
- package/dist/components/FormField/FormFieldAddon/FormFieldAddon.module.css.js +20 -0
- package/dist/components/FormField/FormFieldAddon/index.d.ts +1 -0
- package/dist/components/{FieldComponents/FieldCaption/FieldCaption.d.ts → FormField/FormFieldCaption/FormFieldCaption.d.ts} +3 -3
- package/dist/components/{FieldComponents/FieldCaption/FieldCaption.js → FormField/FormFieldCaption/FormFieldCaption.js} +4 -4
- package/dist/components/{FieldComponents/FieldError/FieldError.module.css.js → FormField/FormFieldCaption/FormFieldCaption.module.css.js} +1 -1
- package/dist/components/FormField/FormFieldCaption/index.d.ts +1 -0
- package/dist/components/FormField/FormFieldControlGroup/FormFieldControlGroup.d.ts +2 -0
- package/dist/components/{FieldComponents/FieldContentGroup/FieldContentGroup.js → FormField/FormFieldControlGroup/FormFieldControlGroup.js} +11 -29
- package/dist/components/FormField/FormFieldControlGroup/FormFieldControlGroup.module.css.js +23 -0
- package/dist/components/FormField/FormFieldControlGroup/FormFieldControlGroupContext.d.ts +10 -0
- package/dist/components/FormField/FormFieldControlGroup/FormFieldControlGroupContext.js +7 -0
- package/dist/components/FormField/FormFieldControlGroup/index.d.ts +3 -0
- package/dist/components/FormField/FormFieldControlGroup/types.d.ts +30 -0
- package/dist/components/FormField/FormFieldControlGroup/types.js +7 -0
- package/dist/components/FormField/FormFieldError/FormFieldError.d.ts +8 -0
- package/dist/components/FormField/FormFieldError/FormFieldError.js +17 -0
- package/dist/components/{FieldComponents/FieldCaption/FieldCaption.module.css.js → FormField/FormFieldError/FormFieldError.module.css.js} +1 -1
- package/dist/components/FormField/FormFieldError/index.d.ts +1 -0
- package/dist/components/FormField/FormFieldInput/FormFieldInput.d.ts +8 -0
- package/dist/components/FormField/FormFieldInput/FormFieldInput.js +12 -0
- package/dist/components/{FieldComponents/Field/Field.module.css.js → FormField/FormFieldInput/FormFieldInput.module.css.js} +1 -1
- package/dist/components/FormField/FormFieldInput/index.d.ts +1 -0
- package/dist/components/FormField/FormFieldInputDate/FormFieldInputDate.d.ts +8 -0
- package/dist/components/FormField/FormFieldInputDate/FormFieldInputDate.js +9 -0
- package/dist/components/FormField/FormFieldInputDate/FormFieldInputDate.module.css.js +8 -0
- package/dist/components/FormField/FormFieldInputDate/index.d.ts +1 -0
- package/dist/components/FormField/FormFieldLabel/FormFieldLabel.d.ts +4 -0
- package/dist/components/{FormControlLabel/FormControlLabel.js → FormField/FormFieldLabel/FormFieldLabel.js} +5 -4
- package/dist/components/FormField/FormFieldLabel/FormFieldLabel.module.css.js +14 -0
- package/dist/components/FormField/FormFieldLabel/index.d.ts +2 -0
- package/dist/components/{FormControlLabel → FormField/FormFieldLabel}/types.d.ts +1 -1
- package/dist/components/FormField/FormFieldSelect/FormFieldSelect.d.ts +4 -0
- package/dist/components/FormField/FormFieldSelect/FormFieldSelect.js +33 -0
- package/dist/components/FormField/FormFieldSelect/FormFieldSelect.module.css.js +20 -0
- package/dist/components/FormField/FormFieldSelect/index.d.ts +2 -0
- package/dist/components/FormField/FormFieldSelect/types.d.ts +7 -0
- package/dist/components/FormField/index.d.ts +9 -0
- package/dist/components/FormField/types.d.ts +19 -0
- package/dist/components/FormField/types.js +6 -0
- package/dist/components/Input/Input.d.ts +8 -10
- package/dist/components/Input/Input.js +22 -23
- package/dist/components/Input/Input.module.css.js +5 -1
- package/dist/components/Input/types.d.ts +10 -12
- package/dist/components/Input/types.js +5 -5
- package/dist/components/InputNumber/InputNumber.d.ts +8 -10
- package/dist/components/InputNumber/InputNumber.js +22 -22
- package/dist/components/InputNumber/InputNumber.module.css.js +8 -0
- package/dist/components/InputNumber/components/InputNumberCounterControls.js +2 -2
- package/dist/components/InputNumber/types.d.ts +10 -12
- package/dist/components/InputNumber/types.js +5 -5
- package/dist/components/List/components/ListSection/ListSection.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +14 -13
- package/dist/components/RadioGroup/RadioGroup.module.css.js +4 -1
- package/dist/components/RadioGroup/components/Radio/Radio.d.ts +1 -1
- package/dist/components/RadioGroup/types.d.ts +7 -9
- package/dist/components/RadioGroup/types.js +3 -3
- package/dist/components/SearchInput/SearchInput.d.ts +8 -10
- package/dist/components/SearchInput/SearchInput.js +39 -30
- package/dist/components/SearchInput/SearchInput.module.css.js +4 -1
- package/dist/components/SearchInput/types.d.ts +10 -12
- package/dist/components/SearchInput/types.js +5 -5
- package/dist/components/Select/Select.js +37 -28
- package/dist/components/Select/Select.module.css.js +4 -4
- package/dist/components/Select/components/TagGroup/TagGroupMultiline.js +2 -2
- package/dist/components/Select/components/TagGroup/TagGroupResponsive.js +2 -2
- package/dist/components/Select/types.d.ts +8 -10
- package/dist/components/Select/types.js +3 -3
- package/dist/components/Textarea/Textarea.d.ts +5 -5
- package/dist/components/Textarea/Textarea.js +6 -4
- package/dist/components/Textarea/Textarea.module.css.js +8 -2
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.d.ts +1 -1
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js +24 -20
- package/dist/components/Textarea/types.d.ts +8 -10
- package/dist/components/Textarea/types.js +5 -5
- package/dist/components/TimePicker/TimePicker.js +37 -31
- package/dist/components/TimePicker/TimePicker.module.css.js +4 -1
- package/dist/components/TimePicker/types.d.ts +9 -11
- package/dist/components/TimePicker/types.js +3 -3
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/index.js +28 -12
- package/dist/style.css +442 -386
- package/package.json +5 -5
- package/dist/components/FieldComponents/Field/Field.d.ts +0 -4
- package/dist/components/FieldComponents/Field/Field.js +0 -10
- package/dist/components/FieldComponents/Field/index.d.ts +0 -2
- package/dist/components/FieldComponents/Field/types.d.ts +0 -4
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.d.ts +0 -11
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.module.css.js +0 -20
- package/dist/components/FieldComponents/FieldAddon/index.d.ts +0 -1
- package/dist/components/FieldComponents/FieldCaption/index.d.ts +0 -1
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroup.d.ts +0 -2
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroup.module.css.js +0 -29
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroupContext.d.ts +0 -10
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroupContext.js +0 -7
- package/dist/components/FieldComponents/FieldContentGroup/index.d.ts +0 -3
- package/dist/components/FieldComponents/FieldContentGroup/types.d.ts +0 -29
- package/dist/components/FieldComponents/FieldContentGroup/types.js +0 -4
- package/dist/components/FieldComponents/FieldError/FieldError.d.ts +0 -8
- package/dist/components/FieldComponents/FieldError/FieldError.js +0 -19
- package/dist/components/FieldComponents/FieldError/index.d.ts +0 -1
- package/dist/components/FieldComponents/FieldInput/FieldInput.d.ts +0 -12
- package/dist/components/FieldComponents/FieldInput/FieldInput.js +0 -34
- package/dist/components/FieldComponents/FieldInput/FieldInput.module.css.js +0 -20
- package/dist/components/FieldComponents/FieldInput/index.d.ts +0 -1
- package/dist/components/FieldComponents/FieldInputDate/FieldInputDate.d.ts +0 -12
- package/dist/components/FieldComponents/FieldInputDate/FieldInputDate.js +0 -32
- package/dist/components/FieldComponents/FieldInputDate/FieldInputDate.module.css.js +0 -20
- package/dist/components/FieldComponents/FieldInputDate/index.d.ts +0 -1
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.d.ts +0 -4
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.js +0 -45
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.module.css.js +0 -26
- package/dist/components/FieldComponents/FieldSelect/index.d.ts +0 -2
- package/dist/components/FieldComponents/FieldSelect/types.d.ts +0 -11
- package/dist/components/FieldComponents/index.d.ts +0 -8
- package/dist/components/FormControl/FormControl.d.ts +0 -4
- package/dist/components/FormControl/FormControl.js +0 -34
- package/dist/components/FormControl/FormControl.module.css.js +0 -17
- package/dist/components/FormControl/index.d.ts +0 -2
- package/dist/components/FormControl/types.d.ts +0 -19
- package/dist/components/FormControl/types.js +0 -6
- package/dist/components/FormControlLabel/FormControlLabel.d.ts +0 -4
- package/dist/components/FormControlLabel/FormControlLabel.module.css.js +0 -14
- package/dist/components/FormControlLabel/index.d.ts +0 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { polymorphicForwardRef, clsx, isNotNil } from "@koobiq/react-core";
|
|
3
|
+
import { Button } from "@koobiq/react-primitives";
|
|
4
|
+
import s from "./FormFieldSelect.module.css.js";
|
|
5
|
+
import { isPrimitiveNode } from "../../../utils/isPrimitiveNode.js";
|
|
6
|
+
import { useFormFieldControlGroup } from "../FormFieldControlGroup/FormFieldControlGroupContext.js";
|
|
7
|
+
const FormFieldSelect = polymorphicForwardRef(({ as = "div", placeholder, children, className, ...other }, ref) => {
|
|
8
|
+
const content = children ?? placeholder;
|
|
9
|
+
const { isDisabled } = useFormFieldControlGroup();
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
11
|
+
Button,
|
|
12
|
+
{
|
|
13
|
+
...other,
|
|
14
|
+
as,
|
|
15
|
+
isDisabled,
|
|
16
|
+
"data-slot": "select-value",
|
|
17
|
+
className: clsx(
|
|
18
|
+
s.base,
|
|
19
|
+
!isNotNil(children) && s.hasPlaceholder,
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
ref,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: s.hiddenPlaceholder, "aria-hidden": true, children: placeholder }),
|
|
25
|
+
/* @__PURE__ */ jsx("div", { className: s.container, children: isPrimitiveNode(content) ? /* @__PURE__ */ jsx("span", { className: s.content, children: content }) : children })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
FormFieldSelect.displayName = "FormFieldSelect";
|
|
31
|
+
export {
|
|
32
|
+
FormFieldSelect
|
|
33
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const base = "kbq-formfieldselect-301ef6";
|
|
2
|
+
const container = "kbq-formfieldselect-container-920d39";
|
|
3
|
+
const content = "kbq-formfieldselect-content-9846b3";
|
|
4
|
+
const hasPlaceholder = "kbq-formfieldselect-hasPlaceholder-29f7ed";
|
|
5
|
+
const hiddenPlaceholder = "kbq-formfieldselect-hiddenPlaceholder-6598b6";
|
|
6
|
+
const s = {
|
|
7
|
+
base,
|
|
8
|
+
container,
|
|
9
|
+
content,
|
|
10
|
+
hasPlaceholder,
|
|
11
|
+
hiddenPlaceholder
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
base,
|
|
15
|
+
container,
|
|
16
|
+
content,
|
|
17
|
+
s as default,
|
|
18
|
+
hasPlaceholder,
|
|
19
|
+
hiddenPlaceholder
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './FormFieldInput';
|
|
2
|
+
export * from './FormFieldSelect';
|
|
3
|
+
export * from './FormFieldCaption';
|
|
4
|
+
export * from './FormFieldLabel';
|
|
5
|
+
export * from './FormFieldError';
|
|
6
|
+
export * from './FormFieldControlGroup';
|
|
7
|
+
export * from './FormFieldInputDate';
|
|
8
|
+
export * from './FormField';
|
|
9
|
+
export * from './types';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DataAttributeProps } from '@koobiq/react-core';
|
|
2
|
+
export declare const formFieldPropLabelPlacement: readonly ["top", "side"];
|
|
3
|
+
export type FormFieldPropLabelPlacement = (typeof formFieldPropLabelPlacement)[number];
|
|
4
|
+
export declare const formFieldPropLabelAlign: readonly ["start", "end"];
|
|
5
|
+
export type FormFieldPropLabelAlign = (typeof formFieldPropLabelAlign)[number];
|
|
6
|
+
export type FormFieldBaseProps = {
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The label's overall position relative to the element it is labeling.
|
|
11
|
+
* @default 'top'
|
|
12
|
+
*/
|
|
13
|
+
labelPlacement?: FormFieldPropLabelPlacement;
|
|
14
|
+
/**
|
|
15
|
+
* The label's horizontal alignment relative to the element it is labeling.
|
|
16
|
+
* @default 'start'
|
|
17
|
+
*/
|
|
18
|
+
labelAlign?: FormFieldPropLabelAlign;
|
|
19
|
+
} & DataAttributeProps;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TextField } from '@koobiq/react-primitives';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { type FormControlLabelProps } from '../FormControlLabel';
|
|
5
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").TextFieldProps<HTMLInputElement>, "children" | "validationState" | "description" | "inputElementType">, "caption" | "style" | "className" | "variant" | "labelPlacement" | "labelAlign" | "fullWidth" | "slotProps" | "data-testid" | "startAddon" | "endAddon" | "isLabelHidden" | keyof {
|
|
2
|
+
import type { FormFieldProps, FormFieldLabelProps, FormFieldInputProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldControlGroupProps } from '../FormField';
|
|
3
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").TextFieldProps<HTMLInputElement>, "children" | "description" | "validationState" | "inputElementType">, "caption" | "style" | "className" | "data-testid" | "startAddon" | "endAddon" | "variant" | "slotProps" | "labelPlacement" | "labelAlign" | "fullWidth" | "isLabelHidden" | keyof {
|
|
6
4
|
disabled?: boolean;
|
|
7
5
|
error?: boolean;
|
|
8
6
|
required?: boolean;
|
|
@@ -21,12 +19,12 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
21
19
|
style?: import("react").CSSProperties;
|
|
22
20
|
'data-testid'?: string | number;
|
|
23
21
|
slotProps?: {
|
|
24
|
-
root?:
|
|
25
|
-
label?:
|
|
26
|
-
caption?:
|
|
27
|
-
group?:
|
|
28
|
-
errorMessage?:
|
|
29
|
-
input?:
|
|
22
|
+
root?: FormFieldProps<typeof TextField<HTMLInputElement>>;
|
|
23
|
+
label?: FormFieldLabelProps;
|
|
24
|
+
caption?: FormFieldCaptionProps;
|
|
25
|
+
group?: FormFieldControlGroupProps;
|
|
26
|
+
errorMessage?: FormFieldErrorProps;
|
|
27
|
+
input?: FormFieldInputProps;
|
|
30
28
|
};
|
|
31
29
|
} & {
|
|
32
30
|
disabled?: boolean;
|
|
@@ -5,13 +5,8 @@ import { deprecate } from "@koobiq/logger";
|
|
|
5
5
|
import { useDOMRef, mergeProps } from "@koobiq/react-core";
|
|
6
6
|
import { TextField } from "@koobiq/react-primitives";
|
|
7
7
|
import s from "./Input.module.css.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Field } from "../FieldComponents/Field/Field.js";
|
|
11
|
-
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
12
|
-
import { FieldInput } from "../FieldComponents/FieldInput/FieldInput.js";
|
|
13
|
-
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
14
|
-
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
8
|
+
import { FormField } from "../FormField/FormField.js";
|
|
9
|
+
import { useForm } from "../Form/FormContext.js";
|
|
15
10
|
const Input = forwardRef((props, ref) => {
|
|
16
11
|
const {
|
|
17
12
|
variant = "filled",
|
|
@@ -36,9 +31,10 @@ const Input = forwardRef((props, ref) => {
|
|
|
36
31
|
caption,
|
|
37
32
|
...other
|
|
38
33
|
} = props;
|
|
39
|
-
const isDisabled
|
|
34
|
+
const { isDisabled: formIsDisabled, isReadOnly: formIsReadOnly } = useForm();
|
|
35
|
+
const isDisabled = isDisabledProp ?? disabled ?? formIsDisabled;
|
|
36
|
+
const isReadOnly = isReadOnlyProp ?? readonly ?? formIsReadOnly;
|
|
40
37
|
const isRequired = isRequiredProp ?? required;
|
|
41
|
-
const isReadOnly = isReadOnlyProp ?? readonly;
|
|
42
38
|
const isInvalid = isInvalidProp ?? error;
|
|
43
39
|
const isLabelHidden = isLabelHiddenProp ?? hiddenLabel;
|
|
44
40
|
if (process.env.NODE_ENV !== "production" && "disabled" in props) {
|
|
@@ -83,41 +79,44 @@ const Input = forwardRef((props, ref) => {
|
|
|
83
79
|
},
|
|
84
80
|
slotProps?.root
|
|
85
81
|
);
|
|
86
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
+
return /* @__PURE__ */ jsx(FormField, { as: TextField, inputElementType: "input", ...rootProps, children: ({ isInvalid: isInvalid2, isRequired: isRequired2, isDisabled: isDisabled2 }) => {
|
|
87
83
|
const labelProps = mergeProps(
|
|
88
84
|
{ isHidden: isLabelHidden, isRequired: isRequired2, children: label },
|
|
89
85
|
slotProps?.label
|
|
90
86
|
);
|
|
91
87
|
const inputProps = mergeProps(
|
|
92
|
-
{
|
|
93
|
-
variant,
|
|
94
|
-
isInvalid: isInvalid2,
|
|
95
|
-
isDisabled: isDisabled2,
|
|
96
|
-
ref: inputRef
|
|
97
|
-
},
|
|
88
|
+
{ ref: inputRef },
|
|
98
89
|
slotProps?.input
|
|
99
90
|
);
|
|
100
91
|
const groupProps = mergeProps(
|
|
101
92
|
{
|
|
102
93
|
endAddon,
|
|
103
94
|
variant,
|
|
95
|
+
onMouseDown: (e) => {
|
|
96
|
+
if (e.currentTarget !== e.target) return;
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
inputRef?.current?.focus();
|
|
99
|
+
},
|
|
104
100
|
isInvalid: isInvalid2,
|
|
105
101
|
isDisabled: isDisabled2,
|
|
106
102
|
startAddon
|
|
107
103
|
},
|
|
108
104
|
slotProps?.group
|
|
109
105
|
);
|
|
110
|
-
const captionProps = mergeProps(
|
|
106
|
+
const captionProps = mergeProps(
|
|
107
|
+
{ children: caption },
|
|
108
|
+
slotProps?.caption
|
|
109
|
+
);
|
|
111
110
|
const errorProps = mergeProps(
|
|
112
|
-
{ children: errorMessage
|
|
111
|
+
{ children: errorMessage },
|
|
113
112
|
slotProps?.errorMessage
|
|
114
113
|
);
|
|
115
114
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
116
|
-
/* @__PURE__ */ jsx(
|
|
117
|
-
/* @__PURE__ */ jsxs(
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
/* @__PURE__ */ jsx(
|
|
115
|
+
/* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
|
|
116
|
+
/* @__PURE__ */ jsxs("div", { className: s.body, children: [
|
|
117
|
+
/* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Input, { ...inputProps }) }),
|
|
118
|
+
/* @__PURE__ */ jsx(FormField.Caption, { ...captionProps }),
|
|
119
|
+
/* @__PURE__ */ jsx(FormField.Error, { ...errorProps })
|
|
121
120
|
] })
|
|
122
121
|
] });
|
|
123
122
|
} });
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { ComponentRef, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { ExtendableProps } from '@koobiq/react-core';
|
|
3
3
|
import type { TextField, TextFieldProps } from '@koobiq/react-primitives';
|
|
4
|
-
import {
|
|
5
|
-
import { type FormControlProps, type FormControlPropLabelAlign, type FormControlPropLabelPlacement } from '../FormControl';
|
|
6
|
-
import type { FormControlLabelProps } from '../FormControlLabel';
|
|
4
|
+
import type { FormFieldProps, FormFieldLabelProps, FormFieldInputProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldPropLabelAlign, FormFieldControlGroupProps, FormFieldPropLabelPlacement, FormFieldControlGroupPropVariant } from '../FormField';
|
|
7
5
|
export declare const inputPropVariant: readonly ["filled", "transparent"];
|
|
8
6
|
export declare const inputPropLabelPlacement: readonly ["top", "side"];
|
|
9
|
-
export type InputPropVariant =
|
|
10
|
-
export type InputPropLabelPlacement =
|
|
7
|
+
export type InputPropVariant = FormFieldControlGroupPropVariant;
|
|
8
|
+
export type InputPropLabelPlacement = FormFieldPropLabelPlacement;
|
|
11
9
|
export declare const inputPropLabelAlign: readonly ["start", "end"];
|
|
12
|
-
export type InputPropLabelAlign =
|
|
10
|
+
export type InputPropLabelAlign = FormFieldPropLabelAlign;
|
|
13
11
|
type InputDeprecatedProps = {
|
|
14
12
|
/**
|
|
15
13
|
* If `true`, the component is disabled.
|
|
@@ -80,12 +78,12 @@ export type InputProps = ExtendableProps<{
|
|
|
80
78
|
'data-testid'?: string | number;
|
|
81
79
|
/** The props used for each slot inside. */
|
|
82
80
|
slotProps?: {
|
|
83
|
-
root?:
|
|
84
|
-
label?:
|
|
85
|
-
caption?:
|
|
86
|
-
group?:
|
|
87
|
-
errorMessage?:
|
|
88
|
-
input?:
|
|
81
|
+
root?: FormFieldProps<typeof TextField<HTMLInputElement>>;
|
|
82
|
+
label?: FormFieldLabelProps;
|
|
83
|
+
caption?: FormFieldCaptionProps;
|
|
84
|
+
group?: FormFieldControlGroupProps;
|
|
85
|
+
errorMessage?: FormFieldErrorProps;
|
|
86
|
+
input?: FormFieldInputProps;
|
|
89
87
|
};
|
|
90
88
|
} & InputDeprecatedProps, Omit<TextFieldProps<HTMLInputElement>, 'description' | 'children' | 'inputElementType' | 'validationState'>>;
|
|
91
89
|
export type InputRef = ComponentRef<'input'>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const inputPropVariant =
|
|
4
|
-
const inputPropLabelPlacement =
|
|
5
|
-
const inputPropLabelAlign =
|
|
1
|
+
import { formFieldControlGroupPropVariant } from "../FormField/FormFieldControlGroup/types.js";
|
|
2
|
+
import { formFieldPropLabelPlacement, formFieldPropLabelAlign } from "../FormField/types.js";
|
|
3
|
+
const inputPropVariant = formFieldControlGroupPropVariant;
|
|
4
|
+
const inputPropLabelPlacement = formFieldPropLabelPlacement;
|
|
5
|
+
const inputPropLabelAlign = formFieldPropLabelAlign;
|
|
6
6
|
export {
|
|
7
7
|
inputPropLabelAlign,
|
|
8
8
|
inputPropLabelPlacement,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { NumberField } from '@koobiq/react-primitives';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { type FormControlLabelProps } from '../FormControlLabel';
|
|
5
|
-
export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").NumberFieldProps, "children" | "validationState" | "description" | "inputElementType">, "caption" | "style" | "className" | "variant" | "labelPlacement" | "labelAlign" | "fullWidth" | "slotProps" | "data-testid" | "startAddon" | "endAddon" | "isLabelHidden" | keyof {
|
|
2
|
+
import type { FormFieldProps, FormFieldLabelProps, FormFieldInputProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldControlGroupProps } from '../FormField';
|
|
3
|
+
export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").NumberFieldProps, "children" | "description" | "validationState" | "inputElementType">, "caption" | "style" | "className" | "data-testid" | "startAddon" | "endAddon" | "variant" | "slotProps" | "labelPlacement" | "labelAlign" | "fullWidth" | "isLabelHidden" | keyof {
|
|
6
4
|
disabled?: boolean;
|
|
7
5
|
error?: boolean;
|
|
8
6
|
required?: boolean;
|
|
@@ -21,12 +19,12 @@ export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit
|
|
|
21
19
|
style?: import("react").CSSProperties;
|
|
22
20
|
'data-testid'?: string | number;
|
|
23
21
|
slotProps?: {
|
|
24
|
-
root?:
|
|
25
|
-
label?:
|
|
26
|
-
input?:
|
|
27
|
-
caption?:
|
|
28
|
-
group?:
|
|
29
|
-
errorMessage?:
|
|
22
|
+
root?: FormFieldProps<typeof NumberField>;
|
|
23
|
+
label?: FormFieldLabelProps;
|
|
24
|
+
input?: FormFieldInputProps;
|
|
25
|
+
caption?: FormFieldCaptionProps;
|
|
26
|
+
group?: FormFieldControlGroupProps;
|
|
27
|
+
errorMessage?: FormFieldErrorProps;
|
|
30
28
|
};
|
|
31
29
|
} & {
|
|
32
30
|
disabled?: boolean;
|
|
@@ -4,14 +4,10 @@ import { forwardRef } from "react";
|
|
|
4
4
|
import { deprecate } from "@koobiq/logger";
|
|
5
5
|
import { useDOMRef, mergeProps } from "@koobiq/react-core";
|
|
6
6
|
import { NumberField } from "@koobiq/react-primitives";
|
|
7
|
+
import s from "./InputNumber.module.css.js";
|
|
7
8
|
import { InputNumberCounterControls } from "./components/InputNumberCounterControls.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Field } from "../FieldComponents/Field/Field.js";
|
|
11
|
-
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
12
|
-
import { FieldInput } from "../FieldComponents/FieldInput/FieldInput.js";
|
|
13
|
-
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
14
|
-
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
9
|
+
import { useForm } from "../Form/FormContext.js";
|
|
10
|
+
import { FormField } from "../FormField/FormField.js";
|
|
15
11
|
const InputNumber = forwardRef(
|
|
16
12
|
(props, ref) => {
|
|
17
13
|
const {
|
|
@@ -37,10 +33,11 @@ const InputNumber = forwardRef(
|
|
|
37
33
|
caption,
|
|
38
34
|
...other
|
|
39
35
|
} = props;
|
|
36
|
+
const { isDisabled: formIsDisabled, isReadOnly: formIsReadOnly } = useForm();
|
|
40
37
|
const inputRef = useDOMRef(ref);
|
|
41
|
-
const isDisabled = isDisabledProp ?? disabled;
|
|
38
|
+
const isDisabled = isDisabledProp ?? disabled ?? formIsDisabled;
|
|
39
|
+
const isReadOnly = isReadOnlyProp ?? readonly ?? formIsReadOnly;
|
|
42
40
|
const isRequired = isRequiredProp ?? required;
|
|
43
|
-
const isReadOnly = isReadOnlyProp ?? readonly;
|
|
44
41
|
const isInvalid = isInvalidProp ?? error;
|
|
45
42
|
const isLabelHidden = isLabelHiddenProp ?? hiddenLabel;
|
|
46
43
|
if (process.env.NODE_ENV !== "production" && "disabled" in props) {
|
|
@@ -84,28 +81,31 @@ const InputNumber = forwardRef(
|
|
|
84
81
|
},
|
|
85
82
|
slotProps?.root
|
|
86
83
|
);
|
|
87
|
-
return /* @__PURE__ */ jsx(
|
|
84
|
+
return /* @__PURE__ */ jsx(FormField, { as: NumberField, ...rootProps, children: ({ isInvalid: isInvalid2, isRequired: isRequired2, isDisabled: isDisabled2 }) => {
|
|
88
85
|
const labelProps = mergeProps(
|
|
89
86
|
{ isHidden: isLabelHidden, children: label, isRequired: isRequired2 },
|
|
90
87
|
slotProps?.label
|
|
91
88
|
);
|
|
92
89
|
const inputProps = mergeProps(
|
|
93
|
-
{
|
|
94
|
-
variant,
|
|
95
|
-
isInvalid: isInvalid2,
|
|
96
|
-
isDisabled: isDisabled2,
|
|
97
|
-
ref: inputRef
|
|
98
|
-
},
|
|
90
|
+
{ ref: inputRef },
|
|
99
91
|
slotProps?.input
|
|
100
92
|
);
|
|
101
93
|
const captionProps = mergeProps({ children: caption }, slotProps?.caption);
|
|
102
|
-
const errorProps = mergeProps(
|
|
94
|
+
const errorProps = mergeProps(
|
|
95
|
+
{ children: errorMessage },
|
|
96
|
+
slotProps?.errorMessage
|
|
97
|
+
);
|
|
103
98
|
const groupProps = mergeProps(
|
|
104
99
|
{
|
|
105
100
|
endAddon: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
106
101
|
endAddon,
|
|
107
102
|
/* @__PURE__ */ jsx(InputNumberCounterControls, {})
|
|
108
103
|
] }),
|
|
104
|
+
onMouseDown: (e) => {
|
|
105
|
+
if (e.currentTarget !== e.target) return;
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
inputRef?.current?.focus();
|
|
108
|
+
},
|
|
109
109
|
isInvalid: isInvalid2,
|
|
110
110
|
variant,
|
|
111
111
|
startAddon,
|
|
@@ -114,11 +114,11 @@ const InputNumber = forwardRef(
|
|
|
114
114
|
slotProps?.group
|
|
115
115
|
);
|
|
116
116
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
118
|
-
/* @__PURE__ */ jsxs(
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
/* @__PURE__ */ jsx(
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
117
|
+
/* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
|
|
118
|
+
/* @__PURE__ */ jsxs("div", { className: s.body, children: [
|
|
119
|
+
/* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Input, { ...inputProps }) }),
|
|
120
|
+
/* @__PURE__ */ jsx(FormField.Caption, { ...captionProps }),
|
|
121
|
+
/* @__PURE__ */ jsx(FormField.Error, { ...errorProps })
|
|
122
122
|
] })
|
|
123
123
|
] });
|
|
124
124
|
} });
|
|
@@ -2,10 +2,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { clsx } from "@koobiq/react-core";
|
|
3
3
|
import { IconChevronUpS16, IconChevronDownS16 } from "@koobiq/react-icons";
|
|
4
4
|
import s from "./InputNumberCounterControls.module.css.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useFormFieldControlGroup } from "../../FormField/FormFieldControlGroup/FormFieldControlGroupContext.js";
|
|
6
6
|
import { IconButton } from "../../IconButton/IconButton.js";
|
|
7
7
|
const InputNumberCounterControls = () => {
|
|
8
|
-
const { isInvalid } =
|
|
8
|
+
const { isInvalid } = useFormFieldControlGroup();
|
|
9
9
|
const variant = isInvalid ? "error" : "fade-contrast";
|
|
10
10
|
return /* @__PURE__ */ jsxs("div", { className: s.base, children: [
|
|
11
11
|
/* @__PURE__ */ jsx(
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { ComponentRef, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { ExtendableProps } from '@koobiq/react-core';
|
|
3
3
|
import type { NumberField, NumberFieldProps } from '@koobiq/react-primitives';
|
|
4
|
-
import {
|
|
5
|
-
import { type FormControlProps, type FormControlPropLabelAlign, type FormControlPropLabelPlacement } from '../FormControl';
|
|
6
|
-
import type { FormControlLabelProps } from '../FormControlLabel';
|
|
4
|
+
import type { FormFieldProps, FormFieldLabelProps, FormFieldInputProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldPropLabelAlign, FormFieldControlGroupProps, FormFieldPropLabelPlacement, FormFieldControlGroupPropVariant } from '../FormField';
|
|
7
5
|
export declare const inputNumberPropVariant: readonly ["filled", "transparent"];
|
|
8
|
-
export type InputNumberPropVariant =
|
|
6
|
+
export type InputNumberPropVariant = FormFieldControlGroupPropVariant;
|
|
9
7
|
export declare const inputNumberPropLabelPlacement: readonly ["top", "side"];
|
|
10
|
-
export type InputNumberPropLabelPlacement =
|
|
8
|
+
export type InputNumberPropLabelPlacement = FormFieldPropLabelPlacement;
|
|
11
9
|
export declare const inputNumberPropLabelAlign: readonly ["start", "end"];
|
|
12
|
-
export type InputNumberPropLabelAlign =
|
|
10
|
+
export type InputNumberPropLabelAlign = FormFieldPropLabelAlign;
|
|
13
11
|
type InputNumberDeprecatedProps = {
|
|
14
12
|
/**
|
|
15
13
|
* If `true`, the component is disabled.
|
|
@@ -80,12 +78,12 @@ export type InputNumberProps = ExtendableProps<{
|
|
|
80
78
|
'data-testid'?: string | number;
|
|
81
79
|
/** The props used for each slot inside. */
|
|
82
80
|
slotProps?: {
|
|
83
|
-
root?:
|
|
84
|
-
label?:
|
|
85
|
-
input?:
|
|
86
|
-
caption?:
|
|
87
|
-
group?:
|
|
88
|
-
errorMessage?:
|
|
81
|
+
root?: FormFieldProps<typeof NumberField>;
|
|
82
|
+
label?: FormFieldLabelProps;
|
|
83
|
+
input?: FormFieldInputProps;
|
|
84
|
+
caption?: FormFieldCaptionProps;
|
|
85
|
+
group?: FormFieldControlGroupProps;
|
|
86
|
+
errorMessage?: FormFieldErrorProps;
|
|
89
87
|
};
|
|
90
88
|
} & InputNumberDeprecatedProps, Omit<NumberFieldProps, 'description' | 'children' | 'inputElementType' | 'validationState'>>;
|
|
91
89
|
export type InputNumberRef = ComponentRef<'input'>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const inputNumberPropVariant =
|
|
4
|
-
const inputNumberPropLabelPlacement =
|
|
5
|
-
const inputNumberPropLabelAlign =
|
|
1
|
+
import { formFieldControlGroupPropVariant } from "../FormField/FormFieldControlGroup/types.js";
|
|
2
|
+
import { formFieldPropLabelPlacement, formFieldPropLabelAlign } from "../FormField/types.js";
|
|
3
|
+
const inputNumberPropVariant = formFieldControlGroupPropVariant;
|
|
4
|
+
const inputNumberPropLabelPlacement = formFieldPropLabelPlacement;
|
|
5
|
+
const inputNumberPropLabelAlign = formFieldPropLabelAlign;
|
|
6
6
|
export {
|
|
7
7
|
inputNumberPropLabelAlign,
|
|
8
8
|
inputNumberPropLabelPlacement,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useListBoxSection } from "@koobiq/react-primitives";
|
|
4
4
|
import { utilClasses } from "../../../../styles/utility.js";
|
|
5
|
-
import { ListOption } from "../ListOption/ListOption.js";
|
|
6
5
|
import { Typography } from "../../../Typography/Typography.js";
|
|
6
|
+
import { ListOption } from "../ListOption/ListOption.js";
|
|
7
7
|
const { listHeading } = utilClasses;
|
|
8
8
|
function ListSection({ section, state }) {
|
|
9
9
|
const { itemProps, headingProps, groupProps } = useListBoxSection({
|
|
@@ -6,12 +6,9 @@ import { mergeProps } from "@koobiq/react-core";
|
|
|
6
6
|
import { RadioGroup as RadioGroup$1 } from "@koobiq/react-primitives";
|
|
7
7
|
import s from "./RadioGroup.module.css.js";
|
|
8
8
|
import { RadioGroupContext } from "./RadioContext.js";
|
|
9
|
+
import { useForm } from "../Form/FormContext.js";
|
|
9
10
|
import { flex } from "../layout/flex/flex.js";
|
|
10
|
-
import {
|
|
11
|
-
import { FormControlLabel } from "../FormControlLabel/FormControlLabel.js";
|
|
12
|
-
import { Field } from "../FieldComponents/Field/Field.js";
|
|
13
|
-
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
14
|
-
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
11
|
+
import { FormField } from "../FormField/FormField.js";
|
|
15
12
|
const RadioGroup = forwardRef(
|
|
16
13
|
(props, ref) => {
|
|
17
14
|
const {
|
|
@@ -38,10 +35,11 @@ const RadioGroup = forwardRef(
|
|
|
38
35
|
readonly,
|
|
39
36
|
required
|
|
40
37
|
} = props;
|
|
38
|
+
const { isDisabled: formIsDisabled, isReadOnly: formIsReadOnly } = useForm();
|
|
41
39
|
const caption = captionProp ?? description;
|
|
42
|
-
const isDisabled = isDisabledProp ?? disabled;
|
|
40
|
+
const isDisabled = isDisabledProp ?? disabled ?? formIsDisabled;
|
|
43
41
|
const isInvalid = isInvalidProp ?? error;
|
|
44
|
-
const isReadOnly = isReadOnlyProp ?? readonly;
|
|
42
|
+
const isReadOnly = isReadOnlyProp ?? readonly ?? formIsReadOnly;
|
|
45
43
|
const isRequired = isRequiredProp ?? required;
|
|
46
44
|
if (process.env.NODE_ENV !== "production" && "description" in props) {
|
|
47
45
|
deprecate(
|
|
@@ -96,7 +94,7 @@ const RadioGroup = forwardRef(
|
|
|
96
94
|
},
|
|
97
95
|
slotProps?.radioGroup
|
|
98
96
|
);
|
|
99
|
-
return /* @__PURE__ */ jsx(RadioGroupContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx(
|
|
97
|
+
return /* @__PURE__ */ jsx(RadioGroupContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx(FormField, { as: RadioGroup$1, ...rootProps, children: ({ isRequired: isRequired2 }) => {
|
|
100
98
|
const labelProps = mergeProps(
|
|
101
99
|
{
|
|
102
100
|
as: "span",
|
|
@@ -107,14 +105,17 @@ const RadioGroup = forwardRef(
|
|
|
107
105
|
},
|
|
108
106
|
slotProps?.label
|
|
109
107
|
);
|
|
110
|
-
const errorProps = mergeProps(
|
|
108
|
+
const errorProps = mergeProps(
|
|
109
|
+
{ children: errorMessage },
|
|
110
|
+
slotProps?.errorMessage
|
|
111
|
+
);
|
|
111
112
|
const captionProps = mergeProps({ children: caption }, slotProps?.caption);
|
|
112
113
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
-
/* @__PURE__ */ jsxs(
|
|
114
|
+
/* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
|
|
115
|
+
/* @__PURE__ */ jsxs("div", { className: s.body, children: [
|
|
115
116
|
/* @__PURE__ */ jsx("div", { ...radioGroupProps, children }),
|
|
116
|
-
/* @__PURE__ */ jsx(
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
117
|
+
/* @__PURE__ */ jsx(FormField.Caption, { ...captionProps }),
|
|
118
|
+
/* @__PURE__ */ jsx(FormField.Error, { ...errorProps })
|
|
118
119
|
] })
|
|
119
120
|
] });
|
|
120
121
|
} }) });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RadioProps as RadioPropsPrimitive } from '@koobiq/react-primitives';
|
|
2
|
-
export declare const Radio: import("react").ForwardRefExoticComponent<Omit<RadioPropsPrimitive, "children" | "style" | "className" | "disabled" | "size" | "
|
|
2
|
+
export declare const Radio: import("react").ForwardRefExoticComponent<Omit<RadioPropsPrimitive, "children" | "style" | "className" | "disabled" | "size" | "data-testid" | "slotProps" | "labelPlacement"> & {
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
size?: import("./types").RadioPropSize;
|
|
5
5
|
labelPlacement?: import("./types").RadioPropLabelPlacement;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { ExtendableComponentPropsWithRef, ExtendableProps } from '@koobiq/react-core';
|
|
3
3
|
import type { RadioGroup as RadioGroupPrimitive, RadioGroupProps as RadioGroupPrimitiveProps } from '@koobiq/react-primitives';
|
|
4
|
-
import type {
|
|
5
|
-
import { type FormControlPropLabelAlign, type FormControlPropLabelPlacement, type FormControlProps } from '../FormControl';
|
|
6
|
-
import type { FormControlLabelProps } from '../FormControlLabel';
|
|
4
|
+
import type { FormFieldProps, FormFieldLabelProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldPropLabelAlign, FormFieldPropLabelPlacement } from '../FormField';
|
|
7
5
|
export declare const radioGroupPropSize: readonly ["normal", "big"];
|
|
8
6
|
export type RadioGroupPropSize = (typeof radioGroupPropSize)[number];
|
|
9
7
|
export declare const radioGroupPropOrientation: readonly ["horizontal", "vertical"];
|
|
10
8
|
export type RadioGroupPropOrientation = (typeof radioGroupPropOrientation)[number];
|
|
11
9
|
export declare const radioGroupPropLabelPlacement: readonly ["top", "side"];
|
|
12
|
-
export type RadioGroupPropLabelPlacement =
|
|
10
|
+
export type RadioGroupPropLabelPlacement = FormFieldPropLabelPlacement;
|
|
13
11
|
export declare const radioGroupPropLabelAlign: readonly ["start", "end"];
|
|
14
|
-
export type RadioGroupPropLabelAlign =
|
|
12
|
+
export type RadioGroupPropLabelAlign = FormFieldPropLabelAlign;
|
|
15
13
|
type RadioGroupDeprecatedProps = {
|
|
16
14
|
/**
|
|
17
15
|
* If `true`, the component is disabled.
|
|
@@ -81,10 +79,10 @@ export type RadioGroupBaseProps = ExtendableProps<{
|
|
|
81
79
|
labelAlign?: RadioGroupPropLabelAlign;
|
|
82
80
|
/** The props used for each slot inside. */
|
|
83
81
|
slotProps?: {
|
|
84
|
-
root?:
|
|
85
|
-
caption?:
|
|
86
|
-
errorMessage?:
|
|
87
|
-
label?:
|
|
82
|
+
root?: FormFieldProps<typeof RadioGroupPrimitive>;
|
|
83
|
+
caption?: FormFieldCaptionProps;
|
|
84
|
+
errorMessage?: FormFieldErrorProps;
|
|
85
|
+
label?: FormFieldLabelProps<'span'>;
|
|
88
86
|
radioGroup?: ComponentPropsWithRef<'div'>;
|
|
89
87
|
};
|
|
90
88
|
} & RadioGroupDeprecatedProps, Omit<RadioGroupPrimitiveProps, 'validationState'>>;
|