UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.24 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": ";AAGA,SAAS,sBAAsB;AAC/B,SAAS,SAAS,WAAW,oBAAoB;AACjD,SAAS,OAAO,YAAY;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,qBAAK,gBAAgB;AAAA,MACvC,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAoB,qBAAK,cAAc;AAAA,IACrC,UAAuB,qBAAK,WAAW;AAAA,MACrC;AAAA,MACA,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;", "names": [] }