UNPKG

@wordpress/block-editor

Version:
8 lines (7 loc) 1.54 kB
{ "version": 3, "sources": ["../../../src/components/responsive-block-control/label.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { _x, sprintf } from '@wordpress/i18n';\n\nexport default function ResponsiveBlockControlLabel( {\n\tproperty,\n\tviewport,\n\tdesc,\n} ) {\n\tconst instanceId = useInstanceId( ResponsiveBlockControlLabel );\n\tconst accessibleLabel =\n\t\tdesc ||\n\t\tsprintf(\n\t\t\t/* translators: 1: property name. 2: viewport name. */\n\t\t\t_x(\n\t\t\t\t'Controls the %1$s property for %2$s viewports.',\n\t\t\t\t'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'\n\t\t\t),\n\t\t\tproperty,\n\t\t\tviewport.label\n\t\t);\n\treturn (\n\t\t<>\n\t\t\t<span aria-describedby={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ viewport.label }\n\t\t\t</span>\n\t\t\t<VisuallyHidden as=\"span\" id={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ accessibleLabel }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"], "mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,IAAI,eAAe;AAoB1B,mBACC,KADD;AAlBa,SAAR,4BAA8C;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,aAAa,cAAe,2BAA4B;AAC9D,QAAM,kBACL,QACA;AAAA;AAAA,IAEC;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACV;AACD,SACC,iCACC;AAAA,wBAAC,UAAK,oBAAmB,YAAa,UAAW,IAC9C,mBAAS,OACZ;AAAA,IACA,oBAAC,kBAAe,IAAG,QAAO,IAAK,YAAa,UAAW,IACpD,2BACH;AAAA,KACD;AAEF;", "names": [] }