Skip to content

Commit 95360f5

Browse files
author
Nemobot
committed
export Option types
1 parent ec713c5 commit 95360f5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/CheckboxGroupField/createCheckboxGroupField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CheckboxGroupState, useCheckboxGroupState } from "@react-stately/checkb
99
import { Box, Inline, Inset, Stack } from "../internal";
1010
import { SelectionControlConfig } from "../Field/SelectionControlConfig";
1111

12-
type CheckboxOption = {
12+
export type CheckboxOption = {
1313
value: string;
1414
label: TextChildren;
1515
isDisabled: boolean;

src/Field/createFormFields.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ export function createFormFields(
8181
TextField,
8282
};
8383
}
84+
85+
export type { SelectOption } from "../SelectField/createSelectField";
86+
export type { RadioOption } from "../RadioGroupField/createRadioGroupField";
87+
export type { CheckboxOption } from "../CheckboxGroupField/createCheckboxGroupField";

src/RadioGroupField/createRadioGroupField.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import { useFocusRing } from "@react-aria/focus";
1313
import { Radio } from "./Radio";
1414
import { SelectionControlConfig } from "../Field/SelectionControlConfig";
1515

16-
type Option<A> = {
16+
export type RadioOption<A> = {
1717
value: A;
1818
label: LocalizedString;
1919
isDisabled?: boolean;
2020
};
2121

2222
export type RadioGroupFieldProps<A> = FieldProps<A | undefined, A> & {
2323
name: string;
24-
options: Array<Option<A>>;
24+
options: Array<RadioOption<A>>;
2525
orientation?: "vertical" | "horizontal";
2626
};
2727

@@ -90,7 +90,7 @@ export function createRadioGroupField(
9090
option,
9191
state,
9292
}: {
93-
option: Option<A>;
93+
option: RadioOption<A>;
9494
state: RadioGroupState;
9595
}) {
9696
const ref = useRef<HTMLInputElement>(null);

0 commit comments

Comments
 (0)