-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Apply minor fixes to form core components (#276)
- Loading branch information
Showing
37 changed files
with
333 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
import classNames from 'classnames'; | ||
import type { ComponentProps } from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import { useRandomId } from '../../../hooks'; | ||
import { InputContainer, type IInputContainerBaseProps } from '../inputContainer'; | ||
|
||
export interface ICheckboxGroupProps extends ComponentProps<'div'> {} | ||
export interface ICheckboxGroupProps | ||
extends Pick<IInputContainerBaseProps, 'alert' | 'label' | 'helpText' | 'isOptional'> { | ||
/** | ||
* Additional classes for the component. | ||
*/ | ||
className?: string; | ||
/** | ||
* Children of the component. | ||
*/ | ||
children?: ReactNode; | ||
} | ||
|
||
export const CheckboxGroup: React.FC<ICheckboxGroupProps> = (props) => { | ||
const { className, ...otherProps } = props; | ||
const { className, children, ...otherProps } = props; | ||
|
||
return <div className={classNames('flex min-w-0 flex-col gap-2 md:gap-3', className)} {...otherProps} />; | ||
const id = useRandomId(); | ||
|
||
return ( | ||
<InputContainer id={id} useCustomWrapper={true} {...otherProps}> | ||
<div className={classNames('flex min-w-0 flex-col gap-2 md:gap-3', className)}>{children}</div> | ||
</InputContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...nts/forms/radioGroup/radio/radio.test.tsx → ...ore/components/forms/radio/radio.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.