Skip to content

Commit

Permalink
add FieldLabel size prop
Browse files Browse the repository at this point in the history
  • Loading branch information
fibo committed Aug 21, 2024
1 parent 4ebb9a9 commit 17f96a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
dist
temp
2 changes: 1 addition & 1 deletion src/doc_snippets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const Snippets: FC = () => (
</Field>

<FieldHorizontal>
<FieldLabel isNormal>
<FieldLabel size="normal">
<Label>From</Label>
</FieldLabel>
<FieldBody>
Expand Down
13 changes: 5 additions & 8 deletions src/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ export type FieldBodyProps = HTMLAttributes<HTMLDivElement> & BulmaProp
* @example
* ```tsx
* <FieldHorizontal>
* <FieldLabel isNormal>
* <FieldLabel size="normal">
* <Label>From</Label>
* </FieldLabel>
* <FieldBody>
Expand Down Expand Up @@ -852,7 +852,7 @@ export type FieldHorizontalProps = HTMLAttributes<HTMLDivElement> & BulmaProp

/** @see {@link FieldHorizontal} */
export const FieldLabel: FC<PropsWithChildren<FieldLabelProps>> = ({
isNormal,
size,
bulma,
className,
children,
Expand All @@ -862,9 +862,7 @@ export const FieldLabel: FC<PropsWithChildren<FieldLabelProps>> = ({
className={classnames<Bulma>(
className as Bulma,
"field-label",
{
"is-normal": isNormal,
},
is(size),
bulma,
)}
{...props}
Expand All @@ -873,9 +871,8 @@ export const FieldLabel: FC<PropsWithChildren<FieldLabelProps>> = ({
</div>
)
export type FieldLabelProps = HTMLAttributes<HTMLDivElement> &
BulmaProp & {
isNormal: boolean
}
BulmaProp &
SizeProp<Size>

/**
* A custom file upload input.
Expand Down

0 comments on commit 17f96a5

Please sign in to comment.