UNPKG

@wordpress/components

Version:
28 lines (25 loc) 649 B
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * Internal dependencies */ import VisuallyHidden from '../visually-hidden'; import { Label as BaseLabel } from './styles/input-control-styles'; export default function Label({ children, hideLabelFromVision, htmlFor, ...props }) { if (!children) return null; if (hideLabelFromVision) { return createElement(VisuallyHidden, { as: "label", htmlFor: htmlFor }, children); } return createElement(BaseLabel, _extends({ htmlFor: htmlFor }, props), children); } //# sourceMappingURL=label.js.map