UNPKG

@wordpress/block-editor

Version:
8 lines (7 loc) 1.49 kB
{ "version": 3, "sources": ["../../../src/components/list-view/expander.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { isRTL } from '@wordpress/i18n';\n\nexport default function ListViewExpander( { onClick } ) {\n\treturn (\n\t\t// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js\n\t\t//\n\t\t// The expander component is implemented as a pseudo element in the w3 example\n\t\t// https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html\n\t\t//\n\t\t// We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree.\n\t\t// For the current tree grid implementation, please do not try to make this a button.\n\t\t<span\n\t\t\tclassName=\"block-editor-list-view__expander\"\n\t\t\tonClick={ ( event ) => onClick( event, { forceToggle: true } ) }\n\t\t\taria-hidden=\"true\"\n\t\t\tdata-testid=\"list-view-expander\"\n\t\t>\n\t\t\t<Icon icon={ isRTL() ? chevronLeftSmall : chevronRightSmall } />\n\t\t</span>\n\t);\n}\n"], "mappings": ";AAGA,SAAS,mBAAmB,kBAAkB,YAAY;AAC1D,SAAS,aAAa;AAiBnB;AAfY,SAAR,iBAAmC,EAAE,QAAQ,GAAI;AACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,SAAU,CAAE,UAAW,QAAS,OAAO,EAAE,aAAa,KAAK,CAAE;AAAA,QAC7D,eAAY;AAAA,QACZ,eAAY;AAAA,QAEZ,8BAAC,QAAK,MAAO,MAAM,IAAI,mBAAmB,mBAAoB;AAAA;AAAA,IAC/D;AAAA;AAEF;", "names": [] }