Skip to content

Commit

Permalink
fix: ensure select and radio fields support read only arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
jperasmus authored Jan 8, 2024
1 parent adac562 commit cbdf66d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/core/types/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ type WithPuckProps<Props> = Props & {
id: string;
};

type FieldOption = {
label: string;
value: string | number | boolean;
};

type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;

export type BaseField = {
label?: string;
};
Expand All @@ -26,18 +33,12 @@ export type TextareaField = BaseField & {

export type SelectField = BaseField & {
type: "select";
options: {
label: string;
value: string | number | boolean;
}[];
options: FieldOptions;
};

export type RadioField = BaseField & {
type: "radio";
options: {
label: string;
value: string | number | boolean;
}[];
options: FieldOptions;
};

export type ArrayField<
Expand Down

0 comments on commit cbdf66d

Please sign in to comment.