UNPKG

@grafana/ui

Version:
32 lines (29 loc) 987 B
import { jsx, Fragment, jsxs } from 'react/jsx-runtime'; import { css } from '@emotion/css'; import { useStyles2 } from '../../themes/ThemeContext.mjs'; import { InlineFieldRow } from '../Forms/InlineFieldRow.mjs'; import { InlineLabel } from '../Forms/InlineLabel.mjs'; const SegmentSection = ({ label, htmlFor, children, fill }) => { const styles = useStyles2(getStyles); return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(InlineFieldRow, { children: [ /* @__PURE__ */ jsx(InlineLabel, { htmlFor, width: 12, className: styles.label, children: label }), children, fill && /* @__PURE__ */ jsx("div", { className: styles.fill, children: /* @__PURE__ */ jsx(InlineLabel, { children: "" }) }) ] }) }); }; const getStyles = (theme) => ({ label: css({ color: theme.colors.primary.text }), fill: css({ flexGrow: 1, marginBottom: theme.spacing(0.5) }) }); export { SegmentSection }; //# sourceMappingURL=SegmentSection.mjs.map