@interop-ui/react-focus-scope
Advanced tools
Comparing version 0.0.1-5 to 0.0.1-6
{ | ||
"name": "@interop-ui/react-focus-scope", | ||
"version": "0.0.1-5", | ||
"version": "0.0.1-6", | ||
"license": "MIT", | ||
@@ -20,4 +20,4 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@interop-ui/react-utils": "0.0.1-14", | ||
"@interop-ui/utils": "0.0.1-6" | ||
"@interop-ui/react-utils": "0.0.1-15", | ||
"@interop-ui/utils": "0.0.1-7" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
@@ -13,27 +13,2 @@ # `react-focus-scope` | ||
```js | ||
import * as React from 'react'; | ||
import { FocusScope } from '@interop-ui/react-focus-scope'; | ||
function MyComponent(props) { | ||
const [open, setOpen] = React.useState(false); | ||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen((prev) => !prev)}> | ||
Open | ||
</button> | ||
{open && ( | ||
<FocusScope trapped> | ||
{({ ref }) => ( | ||
<div ref={ref}> | ||
<input type="text" /> | ||
<button type="button">Click me</button> | ||
</div> | ||
)} | ||
</FocusScope> | ||
)} | ||
</button> | ||
); | ||
} | ||
``` | ||
This is an internal utility, not intended for public usage. |
35942
14
+ Added@interop-ui/react-polymorphic@0.0.1-2(transitive)
+ Added@interop-ui/react-utils@0.0.1-15(transitive)
+ Added@interop-ui/utils@0.0.1-7(transitive)
- Removed@interop-ui/react-utils@0.0.1-14(transitive)
- Removed@interop-ui/utils@0.0.1-6(transitive)
Updated@interop-ui/utils@0.0.1-7