Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const Form: React.FunctionComponent = ({
children = null,
className = '',
isHorizontal = false,
...props
}: FormProps) => (
<form novalidate="">
{children}
</form>
);
export const FormGroup: React.FunctionComponent = ({
children = null,
className = '',
label,
isRequired = false,
isValid = true,
validated = 'default',
isInline = false,
helperText,
helperTextInvalid,
fieldId,
...props
}: FormGroupProps) => {
const validHelperText = (
<div aria-live="polite" id="{`${fieldId}-helper`}">
{helperText}
</div>
);
const inValidHelperText = (
<div aria-live="polite" id="{`${fieldId}-helper`}">
{helperTextInvalid}
</div>
);
return (
{({ isHorizontal }: { isHorizontal: boolean }) => (
{({ isHorizontal }: { isHorizontal: boolean }) => (
<fieldset>
{isHorizontal ? <div>{children}</div> : children}
</fieldset>
)}
export const ActionGroup: React.FunctionComponent = ({
children = null,
className = '',
...props
}: ActionGroupProps) => {
const customClassName = css(styles.formGroup, styles.modifiers.action, className);
const classesHorizontal = css(styles.formHorizontalGroup);
const formActionsComponent = <div>{children}</div>;
return (
{({ isHorizontal }: { isHorizontal: boolean }) => (
<div>
{isHorizontal ? <div>{formActionsComponent}</div> : formActionsComponent}
</div>
)}
);
};
helperTextInvalid,
fieldId,
...props
}: FormGroupProps) => {
const validHelperText = (
<div aria-live="polite" id="{`${fieldId}-helper`}">
{helperText}
</div>
);
const inValidHelperText = (
<div aria-live="polite" id="{`${fieldId}-helper`}">
{helperTextInvalid}
</div>
);
return (
{({ isHorizontal }: { isHorizontal: boolean }) => (
<div>
{label && (
<label>
<span>{label}</span>
{isRequired && (
<span aria-hidden="true"></span></label></div>