UNPKG

@gechiui/components

Version:
29 lines (26 loc) 680 B
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@gechiui/element"; /** * Internal dependencies */ import { VisuallyHidden } from '../visually-hidden'; import { Label as BaseLabel } from './styles/input-control-styles'; export default function Label(_ref) { let { children, hideLabelFromVision, htmlFor, ...props } = _ref; 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