Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove element when label is not provided #28

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove element when label is not provided
  • Loading branch information
tfirdaus committed Dec 14, 2024
commit 555290bc20cbc782c4f9632193da05ea1d866f3c
40 changes: 21 additions & 19 deletions packages/kubrick/src/CheckboxGroup/CheckboxGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,27 @@ export const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(
aria-invalid={isInvalid}
ref={ref}
>
<span
{...labelProps}
className={clsx({
classNames: classes.label,
prefixedNames: 'label',
})}
>
{label}
{isRequired ?
<span
className={clsx({
classNames: classes.markedRequired,
prefixedNames: 'marked-required',
})}
>
*
</span>
: ''}
</span>
{label && (
<span
{...labelProps}
className={clsx({
classNames: classes.label,
prefixedNames: 'label',
})}
>
{label}
{isRequired ?
<span
className={clsx({
classNames: classes.markedRequired,
prefixedNames: 'marked-required',
})}
>
*
</span>
: ''}
</span>
)}
<CheckboxGroupContext.Provider value={state}>
<div
className={clsx({
Expand Down
Loading