UNPKG

@grafana/ui

Version:
25 lines (22 loc) 703 B
import { jsxs, jsx } from 'react/jsx-runtime'; import { css, cx } from '@emotion/css'; import { useStyles2 } from '../../themes/ThemeContext.mjs'; import { Legend } from './Legend.mjs'; "use strict"; const FieldSet = ({ label, children, className, ...rest }) => { const styles = useStyles2(getStyles); return /* @__PURE__ */ jsxs("fieldset", { className: cx(styles.wrapper, className), ...rest, children: [ label && /* @__PURE__ */ jsx(Legend, { children: label }), children ] }); }; const getStyles = (theme) => ({ wrapper: css({ marginBottom: theme.spacing(4), "&:last-child": { marginBottom: 0 } }) }); export { FieldSet }; //# sourceMappingURL=FieldSet.mjs.map