@wordpress/components
Version:
UI components for WordPress.
33 lines (32 loc) • 714 B
JavaScript
// packages/components/src/input-control/label.tsx
import { VisuallyHidden } from "../visually-hidden";
import { Label as BaseLabel, LabelWrapper } from "./styles/input-control-styles";
import { jsx as _jsx } from "react/jsx-runtime";
function Label({
children,
hideLabelFromVision,
htmlFor,
...props
}) {
if (!children) {
return null;
}
if (hideLabelFromVision) {
return /* @__PURE__ */ _jsx(VisuallyHidden, {
as: "label",
htmlFor,
children
});
}
return /* @__PURE__ */ _jsx(LabelWrapper, {
children: /* @__PURE__ */ _jsx(BaseLabel, {
htmlFor,
...props,
children
})
});
}
export {
Label as default
};
//# sourceMappingURL=label.js.map