@sanity/ui 2.8.4 → 2.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.8.4",
3
+ "version": "2.8.5",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -20,28 +20,38 @@ export default function NestedStory() {
20
20
  return (
21
21
  <LayerProvider>
22
22
  {open1 && (
23
- <Dialog cardShadow={1} header="Dialog 1" id="dialog1">
23
+ <Dialog animate cardShadow={1} header="Dialog 1" id="dialog1">
24
24
  <Box padding={4}>
25
25
  <Button onClick={() => setOpen2(true)} ref={dialog2Button} text="Open Dialog 2" />
26
26
  </Box>
27
27
 
28
28
  {open2 && (
29
- <Dialog cardShadow={2} header="Dialog 2" id="dialog2" onClose={() => setOpen2(false)}>
29
+ <Dialog
30
+ animate
31
+ cardShadow={2}
32
+ header="Dialog 2"
33
+ id="dialog2"
34
+ onClose={() => setOpen2(false)}
35
+ onClickOutside={() => setOpen2(false)}
36
+ >
30
37
  <Box padding={4}>
31
38
  <Button onClick={() => setOpen3(true)} ref={dialog3Button} text="Open Dialog 3" />
32
39
  </Box>
33
40
 
34
41
  {open3 && (
35
42
  <Dialog
43
+ animate
36
44
  cardShadow={4}
37
45
  header="Dialog 3"
38
46
  id="dialog3"
39
47
  onClose={() => setOpen3(false)}
48
+ onClickOutside={() => setOpen3(false)}
40
49
  >
41
50
  <Box padding={4}>
42
51
  <MenuButton
43
52
  button={<Button text="Test" />}
44
53
  id="menu3"
54
+ popover={{animate: true}}
45
55
  menu={
46
56
  <Menu>
47
57
  <MenuItem text="Test" />
@@ -1,4 +1,4 @@
1
- import {useEffect} from 'react'
1
+ import {useDebugValue, useEffect} from 'react'
2
2
  import {useEffectEvent} from 'use-effect-event'
3
3
  import {EMPTY_ARRAY} from '../constants'
4
4
 
@@ -69,4 +69,6 @@ export function useClickOutsideEvent(
69
69
  document.removeEventListener('mousedown', handleEvent)
70
70
  }
71
71
  }, [hasListener, onEvent])
72
+
73
+ useDebugValue(listener ? 'MouseDown On' : 'MouseDown Off')
72
74
  }