@wordpress/components
Version:
UI components for WordPress.
38 lines (36 loc) • 884 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Label;
var _visuallyHidden = require("../visually-hidden");
var _inputControlStyles = require("./styles/input-control-styles");
var _jsxRuntime = require("react/jsx-runtime");
/**
* Internal dependencies
*/
function Label({
children,
hideLabelFromVision,
htmlFor,
...props
}) {
if (!children) {
return null;
}
if (hideLabelFromVision) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_visuallyHidden.VisuallyHidden, {
as: "label",
htmlFor: htmlFor,
children: children
});
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_inputControlStyles.LabelWrapper, {
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_inputControlStyles.Label, {
htmlFor: htmlFor,
...props,
children: children
})
});
}
//# sourceMappingURL=label.js.map