@wordpress/components
Version:
UI components for WordPress.
8 lines (7 loc) • 1.65 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/higher-order/with-constrained-tabbing/index.tsx"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useConstrainedTabbing } from '@wordpress/compose';\n\n/**\n * `withConstrainedTabbing` is a React [higher-order component](https://facebook.github.io/react/docs/higher-order-components.html)\n * adding the ability to constrain keyboard navigation with the Tab key within a component.\n * For accessibility reasons, some UI components need to constrain Tab navigation, for example\n * modal dialogs or similar UI. Use of this component is recommended only in cases where a way to\n * navigate away from the wrapped component is implemented by other means, usually by pressing\n * the Escape key or using a specific UI control, e.g. a \"Close\" button.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst withConstrainedTabbing = createHigherOrderComponent(WrappedComponent => function ComponentWithConstrainedTabbing(props) {\n const ref = useConstrainedTabbing();\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n tabIndex: -1,\n children: /*#__PURE__*/_jsx(WrappedComponent, {\n ...props\n })\n });\n}, 'withConstrainedTabbing');\nexport default withConstrainedTabbing;"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAkE;AAUlE,yBAA4B;AAC5B,IAAM,6BAAyB,2CAA2B,sBAAoB,SAAS,gCAAgC,OAAO;AAC5H,QAAM,UAAM,sCAAsB;AAClC,SAAoB,uCAAAA,KAAK,OAAO;AAAA,IAC9B;AAAA,IACA,UAAU;AAAA,IACV,UAAuB,uCAAAA,KAAK,kBAAkB;AAAA,MAC5C,GAAG;AAAA,IACL,CAAC;AAAA,EACH,CAAC;AACH,GAAG,wBAAwB;AAC3B,IAAO,mCAAQ;",
"names": ["_jsx"]
}