UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.3 kB
{ "version": 3, "sources": ["../../src/input-control/label.tsx"], "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport { Label as BaseLabel, LabelWrapper } from './styles/input-control-styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function Label({\n children,\n hideLabelFromVision,\n htmlFor,\n ...props\n}) {\n if (!children) {\n return null;\n }\n if (hideLabelFromVision) {\n return /*#__PURE__*/_jsx(VisuallyHidden, {\n as: \"label\",\n htmlFor: htmlFor,\n children: children\n });\n }\n return /*#__PURE__*/_jsx(LabelWrapper, {\n children: /*#__PURE__*/_jsx(BaseLabel, {\n htmlFor: htmlFor,\n ...props,\n children: children\n })\n });\n}"], "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,6BAA+B;AAC/B,kCAAiD;AACjD,yBAA4B;AACb,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AACA,MAAI,qBAAqB;AACvB,WAAoB,uCAAAA,KAAK,uCAAgB;AAAA,MACvC,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAoB,uCAAAA,KAAK,0CAAc;AAAA,IACrC,UAAuB,uCAAAA,KAAK,4BAAAC,OAAW;AAAA,MACrC;AAAA,MACA,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;", "names": ["_jsx", "BaseLabel"] }