2020-09-01 14:51:59 +00:00
|
|
|
import React from "react";
|
|
|
|
import { Title } from "@patternfly/react-core";
|
2020-08-28 05:23:39 +00:00
|
|
|
|
2020-12-11 17:34:18 +00:00
|
|
|
import "./form-panel.css";
|
2020-08-28 05:23:39 +00:00
|
|
|
|
|
|
|
interface FormPanelProps extends React.HTMLProps<HTMLFormElement> {
|
|
|
|
title: string;
|
2020-12-11 17:34:18 +00:00
|
|
|
scrollId: string;
|
2020-08-28 05:23:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const FormPanel = (props: FormPanelProps) => {
|
2020-12-11 17:34:18 +00:00
|
|
|
const { title, children, scrollId, ...rest } = props;
|
2020-08-28 05:23:39 +00:00
|
|
|
return (
|
2020-12-11 17:34:18 +00:00
|
|
|
<section {...rest} className="kc-form-panel__panel">
|
|
|
|
<Title
|
|
|
|
headingLevel="h4"
|
|
|
|
size="xl"
|
|
|
|
className="kc-form-panel__title"
|
|
|
|
id={scrollId}
|
|
|
|
tabIndex={0} // so that jumpLink sends focus to the section for a11y
|
|
|
|
>
|
2020-08-28 05:23:39 +00:00
|
|
|
{title}
|
|
|
|
</Title>
|
|
|
|
{children}
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|