{"version":3,"file":"index.cjs","names":["createHigherOrderComponent","useConstrainedTabbing"],"sources":["../../../src/higher-order/with-constrained-tabbing/index.tsx"],"sourcesContent":["import {\n\tcreateHigherOrderComponent,\n\tuseConstrainedTabbing,\n} 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 */\nconst withConstrainedTabbing = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\tfunction ComponentWithConstrainedTabbing( props ) {\n\t\t\tconst ref = useConstrainedTabbing();\n\t\t\treturn (\n\t\t\t\t<div ref={ ref } tabIndex={ -1 }>\n\t\t\t\t\t<WrappedComponent { ...props } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t'withConstrainedTabbing'\n);\n\nexport default withConstrainedTabbing;\n"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAM,0BAAA,GAAyBA,mBAAAA,2BAAAA,EAC5B,qBACD,SAAS,gCAAiC,OAAQ;CACjD,MAAM,OAAA,GAAMC,mBAAAA,sBAAAA,CAAsB;CAClC,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAW;EAAM,UAAW;EAC3B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD,EAAkB,GAAK,MAAS,CAAA;CAC5B,CAAA;AAEP,GACD,wBACD"}