@grafana/ui
Version:
Grafana Components Library
39 lines (32 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var jsxRuntime = require('react/jsx-runtime');
var classNames = require('classnames');
var Icon = require('../Icon/Icon.cjs');
var Tooltip = require('../Tooltip/Tooltip.cjs');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
;
const FormLabel = ({
children,
isFocused,
isInvalid,
className,
htmlFor,
tooltip,
width,
interactive,
...rest
}) => {
const classes = classNames__default.default(className, `gf-form-label width-${width ? width : "10"}`, {
"gf-form-label--is-focused": isFocused,
"gf-form-label--is-invalid": isInvalid
});
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: classes, ...rest, htmlFor, children: [
children,
tooltip && /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { placement: "top", content: tooltip, theme: "info", interactive, children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { name: "info-circle", size: "sm", style: { marginLeft: "10px" } }) })
] });
};
const InlineFormLabel = FormLabel;
exports.InlineFormLabel = InlineFormLabel;
//# sourceMappingURL=FormLabel.cjs.map