Skip to content

Commit

Permalink
feat(ui-fields): Add spacing to CheckboxFormField (#15108)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and lodmfjord committed Jun 14, 2024
1 parent 290b1cb commit 1b48623
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/application/core/src/lib/fieldBuilders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export function buildCheckboxField(
large = true,
required,
backgroundColor = 'blue',
spacing,
} = data
return {
...extractCommonFields(data),
Expand All @@ -98,6 +99,7 @@ export function buildCheckboxField(
backgroundColor,
options,
required,
spacing,
type: FieldTypes.CHECKBOX,
component: FieldComponents.CHECKBOX,
}
Expand Down
1 change: 1 addition & 0 deletions libs/application/types/src/lib/Fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export interface CheckboxField extends BaseField {
required?: boolean
backgroundColor?: InputBackgroundColor
onSelect?: ((s: string[]) => void) | undefined
spacing?: 0 | 1 | 2
}

export interface DateField extends BaseField {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const CheckboxFormField: FC<React.PropsWithChildren<Props>> = ({
width,
required,
onSelect,
spacing,
} = field
const { formatMessage } = useLocale()

Expand Down Expand Up @@ -76,6 +77,7 @@ export const CheckboxFormField: FC<React.PropsWithChildren<Props>> = ({
}
strong={strong}
error={error}
spacing={spacing}
options={finalOptions?.map(
({ label, subLabel, rightContent, tooltip, ...o }) => ({
...o,
Expand Down

0 comments on commit 1b48623

Please sign in to comment.