@fluentui/react-popover 0.0.0-nightly-20230222-0421.1 → 0.0.0-nightly-20230223-2115.1
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/.swcrc +33 -0
 - package/CHANGELOG.json +44 -23
 - package/CHANGELOG.md +24 -14
 - package/lib/Popover.js.map +1 -1
 - package/lib/PopoverSurface.js.map +1 -1
 - package/lib/PopoverTrigger.js.map +1 -1
 - package/lib/components/Popover/Popover.js +1 -0
 - package/lib/components/Popover/Popover.js.map +1 -1
 - package/lib/components/Popover/Popover.types.js +1 -1
 - package/lib/components/Popover/Popover.types.js.map +1 -1
 - package/lib/components/Popover/constants.js +1 -2
 - package/lib/components/Popover/constants.js.map +1 -1
 - package/lib/components/Popover/index.js.map +1 -1
 - package/lib/components/Popover/renderPopover.js.map +1 -1
 - package/lib/components/Popover/usePopover.js +5 -8
 - package/lib/components/Popover/usePopover.js.map +1 -1
 - package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
 - package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
 - package/lib/components/PopoverSurface/index.js.map +1 -1
 - package/lib/components/PopoverSurface/renderPopoverSurface.js +2 -3
 - package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
 - package/lib/components/PopoverSurface/usePopoverSurface.js +5 -3
 - package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
 - package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
 - package/lib/components/PopoverTrigger/PopoverTrigger.js +1 -0
 - package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
 - package/lib/components/PopoverTrigger/PopoverTrigger.types.js +1 -1
 - package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
 - package/lib/components/PopoverTrigger/index.js.map +1 -1
 - package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -2
 - package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
 - package/lib/components/PopoverTrigger/usePopoverTrigger.js +1 -0
 - package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
 - package/lib/index.js.map +1 -1
 - package/lib/popoverContext.js +4 -1
 - package/lib/popoverContext.js.map +1 -1
 - package/lib-commonjs/Popover.js +5 -4
 - package/lib-commonjs/Popover.js.map +1 -1
 - package/lib-commonjs/PopoverSurface.js +5 -4
 - package/lib-commonjs/PopoverSurface.js.map +1 -1
 - package/lib-commonjs/PopoverTrigger.js +5 -4
 - package/lib-commonjs/PopoverTrigger.js.map +1 -1
 - package/lib-commonjs/components/Popover/Popover.js +14 -13
 - package/lib-commonjs/components/Popover/Popover.js.map +1 -1
 - package/lib-commonjs/components/Popover/Popover.types.js +5 -2
 - package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
 - package/lib-commonjs/components/Popover/constants.js +10 -8
 - package/lib-commonjs/components/Popover/constants.js.map +1 -1
 - package/lib-commonjs/components/Popover/index.js +8 -7
 - package/lib-commonjs/components/Popover/index.js.map +1 -1
 - package/lib-commonjs/components/Popover/renderPopover.js +31 -47
 - package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
 - package/lib-commonjs/components/Popover/usePopover.js +176 -173
 - package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +16 -15
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +3 -2
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/index.js +9 -8
 - package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +25 -28
 - package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +70 -80
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +243 -113
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +15 -14
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +5 -2
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/index.js +8 -7
 - package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +12 -11
 - package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +71 -80
 - package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
 - package/lib-commonjs/index.js +30 -92
 - package/lib-commonjs/index.js.map +1 -1
 - package/lib-commonjs/popoverContext.js +37 -25
 - package/lib-commonjs/popoverContext.js.map +1 -1
 - package/package.json +13 -13
 
    
        package/.swcrc
    ADDED
    
    | 
         @@ -0,0 +1,33 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {
         
     | 
| 
      
 2 
     | 
    
         
            +
              "$schema": "https://json.schemastore.org/swcrc",
         
     | 
| 
      
 3 
     | 
    
         
            +
              "env": {
         
     | 
| 
      
 4 
     | 
    
         
            +
                "targets": {
         
     | 
| 
      
 5 
     | 
    
         
            +
                  "chrome": "84",
         
     | 
| 
      
 6 
     | 
    
         
            +
                  "edge": "84",
         
     | 
| 
      
 7 
     | 
    
         
            +
                  "firefox": "75",
         
     | 
| 
      
 8 
     | 
    
         
            +
                  "opera": "73",
         
     | 
| 
      
 9 
     | 
    
         
            +
                  "safari": "14.1"
         
     | 
| 
      
 10 
     | 
    
         
            +
                }
         
     | 
| 
      
 11 
     | 
    
         
            +
              },
         
     | 
| 
      
 12 
     | 
    
         
            +
              "exclude": [
         
     | 
| 
      
 13 
     | 
    
         
            +
                "/testing",
         
     | 
| 
      
 14 
     | 
    
         
            +
                "/**/*.cy.ts",
         
     | 
| 
      
 15 
     | 
    
         
            +
                "/**/*.cy.tsx",
         
     | 
| 
      
 16 
     | 
    
         
            +
                "/**/*.spec.ts",
         
     | 
| 
      
 17 
     | 
    
         
            +
                "/**/*.spec.tsx",
         
     | 
| 
      
 18 
     | 
    
         
            +
                "/**/*.test.ts",
         
     | 
| 
      
 19 
     | 
    
         
            +
                "/**/*.test.tsx"
         
     | 
| 
      
 20 
     | 
    
         
            +
              ],
         
     | 
| 
      
 21 
     | 
    
         
            +
              "jsc": {
         
     | 
| 
      
 22 
     | 
    
         
            +
                "parser": {
         
     | 
| 
      
 23 
     | 
    
         
            +
                  "syntax": "typescript",
         
     | 
| 
      
 24 
     | 
    
         
            +
                  "tsx": true,
         
     | 
| 
      
 25 
     | 
    
         
            +
                  "decorators": false,
         
     | 
| 
      
 26 
     | 
    
         
            +
                  "dynamicImport": false
         
     | 
| 
      
 27 
     | 
    
         
            +
                },
         
     | 
| 
      
 28 
     | 
    
         
            +
                "target": "es2019",
         
     | 
| 
      
 29 
     | 
    
         
            +
                "externalHelpers": true
         
     | 
| 
      
 30 
     | 
    
         
            +
              },
         
     | 
| 
      
 31 
     | 
    
         
            +
              "minify": false,
         
     | 
| 
      
 32 
     | 
    
         
            +
              "sourceMaps": true
         
     | 
| 
      
 33 
     | 
    
         
            +
            }
         
     | 
    
        package/CHANGELOG.json
    CHANGED
    
    | 
         @@ -2,9 +2,9 @@ 
     | 
|
| 
       2 
2 
     | 
    
         
             
              "name": "@fluentui/react-popover",
         
     | 
| 
       3 
3 
     | 
    
         
             
              "entries": [
         
     | 
| 
       4 
4 
     | 
    
         
             
                {
         
     | 
| 
       5 
     | 
    
         
            -
                  "date": " 
     | 
| 
       6 
     | 
    
         
            -
                  "tag": "@fluentui/react-popover_v0.0.0-nightly- 
     | 
| 
       7 
     | 
    
         
            -
                  "version": "0.0.0-nightly- 
     | 
| 
      
 5 
     | 
    
         
            +
                  "date": "Thu, 23 Feb 2023 21:23:13 GMT",
         
     | 
| 
      
 6 
     | 
    
         
            +
                  "tag": "@fluentui/react-popover_v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 7 
     | 
    
         
            +
                  "version": "0.0.0-nightly-20230223-2115.1",
         
     | 
| 
       8 
8 
     | 
    
         
             
                  "comments": {
         
     | 
| 
       9 
9 
     | 
    
         
             
                    "prerelease": [
         
     | 
| 
       10 
10 
     | 
    
         
             
                      {
         
     | 
| 
         @@ -16,62 +16,83 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
                      {
         
     | 
| 
       17 
17 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       18 
18 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       19 
     | 
    
         
            -
                        "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly- 
     | 
| 
       20 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 19 
     | 
    
         
            +
                        "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 20 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       21 
21 
     | 
    
         
             
                      },
         
     | 
| 
       22 
22 
     | 
    
         
             
                      {
         
     | 
| 
       23 
23 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       24 
24 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       25 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-aria to v0.0.0-nightly- 
     | 
| 
       26 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 25 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 26 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       27 
27 
     | 
    
         
             
                      },
         
     | 
| 
       28 
28 
     | 
    
         
             
                      {
         
     | 
| 
       29 
29 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       30 
30 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       31 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly- 
     | 
| 
       32 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 31 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 32 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       33 
33 
     | 
    
         
             
                      },
         
     | 
| 
       34 
34 
     | 
    
         
             
                      {
         
     | 
| 
       35 
35 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       36 
36 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       37 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-portal to v0.0.0-nightly- 
     | 
| 
       38 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 37 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-portal to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 38 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       39 
39 
     | 
    
         
             
                      },
         
     | 
| 
       40 
40 
     | 
    
         
             
                      {
         
     | 
| 
       41 
41 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       42 
42 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       43 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-positioning to v0.0.0-nightly- 
     | 
| 
       44 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 43 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-positioning to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 44 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       45 
45 
     | 
    
         
             
                      },
         
     | 
| 
       46 
46 
     | 
    
         
             
                      {
         
     | 
| 
       47 
47 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       48 
48 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       49 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly- 
     | 
| 
       50 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 49 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 50 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       51 
51 
     | 
    
         
             
                      },
         
     | 
| 
       52 
52 
     | 
    
         
             
                      {
         
     | 
| 
       53 
53 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       54 
54 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       55 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly- 
     | 
| 
       56 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 55 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 56 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       57 
57 
     | 
    
         
             
                      },
         
     | 
| 
       58 
58 
     | 
    
         
             
                      {
         
     | 
| 
       59 
59 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       60 
60 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       61 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-theme to v0.0.0-nightly- 
     | 
| 
       62 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 61 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 62 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       63 
63 
     | 
    
         
             
                      },
         
     | 
| 
       64 
64 
     | 
    
         
             
                      {
         
     | 
| 
       65 
65 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       66 
66 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       67 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly- 
     | 
| 
       68 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 67 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 68 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
       69 
69 
     | 
    
         
             
                      },
         
     | 
| 
       70 
70 
     | 
    
         
             
                      {
         
     | 
| 
       71 
71 
     | 
    
         
             
                        "author": "beachball",
         
     | 
| 
       72 
72 
     | 
    
         
             
                        "package": "@fluentui/react-popover",
         
     | 
| 
       73 
     | 
    
         
            -
                        "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly- 
     | 
| 
       74 
     | 
    
         
            -
                        "commit": " 
     | 
| 
      
 73 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230223-2115.1",
         
     | 
| 
      
 74 
     | 
    
         
            +
                        "commit": "a400eb0e4c7e02093ab7fb103c74a8dcca00f17b"
         
     | 
| 
      
 75 
     | 
    
         
            +
                      }
         
     | 
| 
      
 76 
     | 
    
         
            +
                    ]
         
     | 
| 
      
 77 
     | 
    
         
            +
                  }
         
     | 
| 
      
 78 
     | 
    
         
            +
                },
         
     | 
| 
      
 79 
     | 
    
         
            +
                {
         
     | 
| 
      
 80 
     | 
    
         
            +
                  "date": "Wed, 22 Feb 2023 23:06:06 GMT",
         
     | 
| 
      
 81 
     | 
    
         
            +
                  "tag": "@fluentui/react-popover_v9.4.11",
         
     | 
| 
      
 82 
     | 
    
         
            +
                  "version": "9.4.11",
         
     | 
| 
      
 83 
     | 
    
         
            +
                  "comments": {
         
     | 
| 
      
 84 
     | 
    
         
            +
                    "patch": [
         
     | 
| 
      
 85 
     | 
    
         
            +
                      {
         
     | 
| 
      
 86 
     | 
    
         
            +
                        "author": "lingfangao@hotmail.com",
         
     | 
| 
      
 87 
     | 
    
         
            +
                        "package": "@fluentui/react-popover",
         
     | 
| 
      
 88 
     | 
    
         
            +
                        "commit": "2d33c558d38690193fd05b7048a1310e00e1f2e0",
         
     | 
| 
      
 89 
     | 
    
         
            +
                        "comment": "fix: Popover without focus trap should not be aria-hidden"
         
     | 
| 
      
 90 
     | 
    
         
            +
                      },
         
     | 
| 
      
 91 
     | 
    
         
            +
                      {
         
     | 
| 
      
 92 
     | 
    
         
            +
                        "author": "beachball",
         
     | 
| 
      
 93 
     | 
    
         
            +
                        "package": "@fluentui/react-popover",
         
     | 
| 
      
 94 
     | 
    
         
            +
                        "comment": "Bump @fluentui/react-positioning to v9.5.0",
         
     | 
| 
      
 95 
     | 
    
         
            +
                        "commit": "9ee6caa17f745e014ecba467a4528181ae49be30"
         
     | 
| 
       75 
96 
     | 
    
         
             
                      }
         
     | 
| 
       76 
97 
     | 
    
         
             
                    ]
         
     | 
| 
       77 
98 
     | 
    
         
             
                  }
         
     | 
    
        package/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,27 +1,37 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Change Log - @fluentui/react-popover
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            This log was last generated on  
     | 
| 
      
 3 
     | 
    
         
            +
            This log was last generated on Thu, 23 Feb 2023 21:23:13 GMT and should not be manually modified.
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            <!-- Start content -->
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
            ## [0.0.0-nightly- 
     | 
| 
      
 7 
     | 
    
         
            +
            ## [0.0.0-nightly-20230223-2115.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v0.0.0-nightly-20230223-2115.1)
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.4. 
     | 
| 
      
 9 
     | 
    
         
            +
            Thu, 23 Feb 2023 21:23:13 GMT 
         
     | 
| 
      
 10 
     | 
    
         
            +
            [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.4.11..@fluentui/react-popover_v0.0.0-nightly-20230223-2115.1)
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
            ### Changes
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
            - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
         
     | 
| 
       15 
     | 
    
         
            -
            - Bump @fluentui/keyboard-keys to v0.0.0-nightly- 
     | 
| 
       16 
     | 
    
         
            -
            - Bump @fluentui/react-aria to v0.0.0-nightly- 
     | 
| 
       17 
     | 
    
         
            -
            - Bump @fluentui/react-context-selector to v0.0.0-nightly- 
     | 
| 
       18 
     | 
    
         
            -
            - Bump @fluentui/react-portal to v0.0.0-nightly- 
     | 
| 
       19 
     | 
    
         
            -
            - Bump @fluentui/react-positioning to v0.0.0-nightly- 
     | 
| 
       20 
     | 
    
         
            -
            - Bump @fluentui/react-shared-contexts to v0.0.0-nightly- 
     | 
| 
       21 
     | 
    
         
            -
            - Bump @fluentui/react-tabster to v0.0.0-nightly- 
     | 
| 
       22 
     | 
    
         
            -
            - Bump @fluentui/react-theme to v0.0.0-nightly- 
     | 
| 
       23 
     | 
    
         
            -
            - Bump @fluentui/react-utilities to v0.0.0-nightly- 
     | 
| 
       24 
     | 
    
         
            -
            - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly- 
     | 
| 
      
 15 
     | 
    
         
            +
            - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 16 
     | 
    
         
            +
            - Bump @fluentui/react-aria to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 17 
     | 
    
         
            +
            - Bump @fluentui/react-context-selector to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 18 
     | 
    
         
            +
            - Bump @fluentui/react-portal to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 19 
     | 
    
         
            +
            - Bump @fluentui/react-positioning to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 20 
     | 
    
         
            +
            - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 21 
     | 
    
         
            +
            - Bump @fluentui/react-tabster to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 22 
     | 
    
         
            +
            - Bump @fluentui/react-theme to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 23 
     | 
    
         
            +
            - Bump @fluentui/react-utilities to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 24 
     | 
    
         
            +
            - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230223-2115.1 ([commit](https://github.com/microsoft/fluentui/commit/a400eb0e4c7e02093ab7fb103c74a8dcca00f17b) by beachball)
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            ## [9.4.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.4.11)
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            Wed, 22 Feb 2023 23:06:06 GMT 
         
     | 
| 
      
 29 
     | 
    
         
            +
            [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.4.10..@fluentui/react-popover_v9.4.11)
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            ### Patches
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            - fix: Popover without focus trap should not be aria-hidden ([PR #26932](https://github.com/microsoft/fluentui/pull/26932) by lingfangao@hotmail.com)
         
     | 
| 
      
 34 
     | 
    
         
            +
            - Bump @fluentui/react-positioning to v9.5.0 ([PR #26616](https://github.com/microsoft/fluentui/pull/26616) by beachball)
         
     | 
| 
       25 
35 
     | 
    
         | 
| 
       26 
36 
     | 
    
         
             
            ## [9.4.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.4.10)
         
     | 
| 
       27 
37 
     | 
    
         | 
    
        package/lib/Popover.js.map
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,cAAc","names":[],"sources":["../src/Popover.ts"],"sourcesContent":["export * from './components/Popover/index';\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,cAAc","names":[],"sources":["../src/PopoverSurface.ts"],"sourcesContent":["export * from './components/PopoverSurface/index';\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,cAAc","names":[],"sources":["../src/PopoverTrigger.ts"],"sourcesContent":["export * from './components/PopoverTrigger/index';\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":" 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,YAAYA,WAAW;AACvB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,sBAAsB,QAAQ;AAGvC;;;AAGA,OAAO,MAAMC,UAAkCC,SAAS;EACtD,MAAMC,QAAQJ,oBAAoBG;EAElC,OAAOF,uBAAuBG;AAChC;AAEAF,QAAQG,WAAW,GAAG","names":["React","usePopover_unstable","renderPopover_unstable","Popover","props","state","displayName"],"sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { renderPopover_unstable } from './renderPopover';\nimport type { PopoverProps } from './Popover.types';\n\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover: React.FC<PopoverProps> = props => {\n  const state = usePopover_unstable(props);\n\n  return renderPopover_unstable(state);\n};\n\nPopover.displayName = 'Popover';\n"]}
         
     | 
| 
         @@ -1,2 +1,2 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            import * as React from 'react';
         
     | 
| 
       2 
2 
     | 
    
         
             
            //# sourceMappingURL=Popover.types.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,YAAYA,WAAW","names":["React"],"sources":["../../../src/components/Popover/Popover.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n  PositioningVirtualElement,\n  PositioningShorthand,\n  SetVirtualMouseTarget,\n} from '@fluentui/react-positioning';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport type { UseModalAttributesOptions } from '@fluentui/react-tabster';\n\n/**\n * Determines popover padding and arrow size\n */\nexport type PopoverSize = 'small' | 'medium' | 'large';\n\n/**\n * Popover Props\n */\nexport type PopoverProps = Pick<PortalProps, 'mountNode'> & {\n  /**\n   * A popover can appear styled with brand or inverted.\n   * When not specified, the default style is used.\n   */\n  appearance?: 'brand' | 'inverted';\n\n  /**\n   * Can contain two children including {@link PopoverTrigger} and {@link PopoverSurface}.\n   * Alternatively can only contain {@link PopoverSurface} if using a custom `target`.\n   */\n  children: [JSX.Element, JSX.Element] | JSX.Element;\n\n  /**\n   * Close when scroll outside of it\n   *\n   * @default false\n   */\n  closeOnScroll?: boolean;\n\n  /**\n   * Used to set the initial open state of the Popover in uncontrolled mode\n   *\n   * @default false\n   */\n  defaultOpen?: boolean;\n\n  /**\n   * Popovers are rendered out of DOM order on `document.body` by default, use this to render the popover in DOM order\n   *\n   * @default false\n   */\n  inline?: boolean;\n\n  /**\n   * Sets the delay for closing popover on mouse leave\n   */\n  mouseLeaveDelay?: number;\n\n  /**\n   * Display an arrow pointing to the target.\n   *\n   * @default false\n   */\n  withArrow?: boolean;\n\n  /**\n   * Call back when the component requests to change value\n   * The `open` value is used as a hint when directly controlling the component\n   */\n  onOpenChange?: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;\n\n  /**\n   * Controls the opening of the Popover\n   *\n   * @default false\n   */\n  open?: boolean;\n\n  /**\n   * Flag to open the Popover as a context menu. Disables all other interactions\n   *\n   * @default false\n   */\n  openOnContext?: boolean;\n\n  /**\n   * Flag to open the Popover by hovering the trigger\n   *\n   * @default false\n   */\n  openOnHover?: boolean;\n\n  /**\n   * Configures the position of the Popover\n   */\n  positioning?: PositioningShorthand;\n\n  /**\n   * Determines popover padding and arrow size\n   *\n   * @default medium\n   */\n  size?: PopoverSize;\n\n  /**\n   * Should trap focus\n   *\n   * @default false\n   */\n  trapFocus?: UseModalAttributesOptions['trapFocus'];\n\n  /**\n   * Must be used with the `trapFocus` prop\n   * Enables older Fluent UI focus trap behavior where the user\n   * cannot tab into the window outside of the document. This is now\n   * non-standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n   * where the focus trap involves setting outside elements inert.\n   *\n   * @default false\n   */\n  legacyTrapFocus?: UseModalAttributesOptions['legacyTrapFocus'];\n\n  /**\n   * By default Popover focuses the first focusable element in PopoverSurface on open.\n   * Specify `disableAutoFocus` to prevent this behavior.\n   *\n   * @default false\n   */\n  // eslint-disable-next-line @typescript-eslint/naming-convention\n  unstable_disableAutoFocus?: boolean;\n};\n\n/**\n * Popover State\n */\nexport type PopoverState = Pick<\n  PopoverProps,\n  | 'appearance'\n  | 'mountNode'\n  | 'onOpenChange'\n  | 'openOnContext'\n  | 'openOnHover'\n  | 'trapFocus'\n  | 'withArrow'\n  | 'legacyTrapFocus'\n> &\n  Required<Pick<PopoverProps, 'inline' | 'open'>> &\n  Pick<PopoverProps, 'children'> & {\n    /**\n     * Ref of the pointing arrow\n     */\n    arrowRef: React.MutableRefObject<HTMLDivElement | null>;\n\n    /**\n     * Ref of the PopoverSurface\n     */\n    contentRef: React.MutableRefObject<HTMLElement | null>;\n\n    /**\n     * Anchors the popper to the mouse click for context events\n     */\n    contextTarget: PositioningVirtualElement | undefined;\n\n    popoverSurface: React.ReactElement | undefined;\n\n    popoverTrigger: React.ReactElement | undefined;\n\n    /**\n     * A callback to set the target of the popper to the mouse click for context events\n     */\n    setContextTarget: SetVirtualMouseTarget;\n\n    /**\n     * Callback to open/close the Popover\n     */\n    setOpen: (e: OpenPopoverEvents, open: boolean) => void;\n\n    size: NonNullable<PopoverProps['size']>;\n\n    /**\n     * Callback to toggle the open state of the Popover\n     */\n    toggleOpen: (e: OpenPopoverEvents) => void;\n\n    /**\n     * Ref of the PopoverTrigger\n     */\n    triggerRef: React.MutableRefObject<HTMLElement | null>;\n  };\n\n/**\n * Data attached to open/close events\n */\nexport type OnOpenChangeData = { open: boolean };\n\n/**\n * The supported events that will trigger open/close of the menu\n */\nexport type OpenPopoverEvents =\n  | MouseEvent\n  | TouchEvent\n  | React.FocusEvent<HTMLElement>\n  | React.KeyboardEvent<HTMLElement>\n  | React.MouseEvent<HTMLElement>;\n"]}
         
     | 
| 
         @@ -5,6 +5,5 @@ 
     | 
|
| 
       5 
5 
     | 
    
         
             
             * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.
         
     | 
| 
       6 
6 
     | 
    
         
             
             * While we could use getComputedStyle, that adds a performance penalty for something that
         
     | 
| 
       7 
7 
     | 
    
         
             
             * will likely never change.
         
     | 
| 
       8 
     | 
    
         
            -
             */
         
     | 
| 
       9 
     | 
    
         
            -
            export const popoverSurfaceBorderRadius = 4;
         
     | 
| 
      
 8 
     | 
    
         
            +
             */export const popoverSurfaceBorderRadius = 4;
         
     | 
| 
       10 
9 
     | 
    
         
             
            //# sourceMappingURL=constants.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA;;;;;;;GAQA,OAAO,MAAMA,6BAA6B","names":["popoverSurfaceBorderRadius"],"sources":["../../../src/components/Popover/constants.ts"],"sourcesContent":["/**\n * @internal\n * The default value of the tooltip's border radius (borderRadiusMedium).\n *\n * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.\n * While we could use getComputedStyle, that adds a performance penalty for something that\n * will likely never change.\n */\nexport const popoverSurfaceBorderRadius = 4;\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","names":[],"sources":["../../../src/components/Popover/index.ts"],"sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":"AAAA, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,YAAYA,WAAW;AACvB,SAASC,cAAc,QAAQ;AAG/B;;;AAGA,OAAO,MAAMC,yBAA0BC,SAAwB;EAC7D,MAAM;IACJC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;EAAe,CAChB,GAAGf;EAEJ,oBACEH,oBAACC,eAAekB,QAAQ;IACtBC,OAAO;MACLhB;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAE;MACAE;MACAH;MACAE;MACAG;MACAD;IACF;KAECd,MAAMkB,cAAc,EACpBlB,MAAMM,IAAI,IAAIN,MAAMmB,cAAc;AAGzC","names":["React","PopoverContext","renderPopover_unstable","state","appearance","arrowRef","contentRef","inline","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","legacyTrapFocus","Provider","value","popoverTrigger","popoverSurface"],"sources":["../../../src/components/Popover/renderPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PopoverContext } from '../../popoverContext';\nimport type { PopoverState } from './Popover.types';\n\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover_unstable = (state: PopoverState) => {\n  const {\n    appearance,\n    arrowRef,\n    contentRef,\n    inline,\n    mountNode,\n    open,\n    openOnContext,\n    openOnHover,\n    setOpen,\n    size,\n    toggleOpen,\n    trapFocus,\n    triggerRef,\n    withArrow,\n    legacyTrapFocus,\n  } = state;\n\n  return (\n    <PopoverContext.Provider\n      value={{\n        appearance,\n        arrowRef,\n        contentRef,\n        inline,\n        mountNode,\n        open,\n        openOnContext,\n        openOnHover,\n        setOpen,\n        toggleOpen,\n        triggerRef,\n        size,\n        trapFocus,\n        legacyTrapFocus,\n        withArrow,\n      }}\n    >\n      {state.popoverTrigger}\n      {state.open && state.popoverSurface}\n    </PopoverContext.Provider>\n  );\n};\n"]}
         
     | 
| 
         @@ -15,7 +15,6 @@ import { popoverSurfaceBorderRadius } from './constants'; 
     | 
|
| 
       15 
15 
     | 
    
         
             
             * @param props - props from this instance of Popover
         
     | 
| 
       16 
16 
     | 
    
         
             
             */
         
     | 
| 
       17 
17 
     | 
    
         
             
            export const usePopover_unstable = props => {
         
     | 
| 
       18 
     | 
    
         
            -
              var _a;
         
     | 
| 
       19 
18 
     | 
    
         
             
              const [contextTarget, setContextTarget] = usePositioningMouseTarget();
         
     | 
| 
       20 
19 
     | 
    
         
             
              const initialState = {
         
     | 
| 
       21 
20 
     | 
    
         
             
                size: 'medium',
         
     | 
| 
         @@ -45,7 +44,6 @@ export const usePopover_unstable = props => { 
     | 
|
| 
       45 
44 
     | 
    
         
             
              const [open, setOpenState] = useOpenState(initialState);
         
     | 
| 
       46 
45 
     | 
    
         
             
              const setOpenTimeoutRef = React.useRef(0);
         
     | 
| 
       47 
46 
     | 
    
         
             
              const setOpen = useEventCallback((e, shouldOpen) => {
         
     | 
| 
       48 
     | 
    
         
            -
                var _a;
         
     | 
| 
       49 
47 
     | 
    
         
             
                clearTimeout(setOpenTimeoutRef.current);
         
     | 
| 
       50 
48 
     | 
    
         
             
                if (!(e instanceof Event) && e.persist) {
         
     | 
| 
       51 
49 
     | 
    
         
             
                  // < React 17 still uses pooled synthetic events
         
     | 
| 
         @@ -57,7 +55,7 @@ export const usePopover_unstable = props => { 
     | 
|
| 
       57 
55 
     | 
    
         
             
                  // @ts-ignore
         
     | 
| 
       58 
56 
     | 
    
         
             
                  setOpenTimeoutRef.current = setTimeout(() => {
         
     | 
| 
       59 
57 
     | 
    
         
             
                    setOpenState(e, shouldOpen);
         
     | 
| 
       60 
     | 
    
         
            -
                  },  
     | 
| 
      
 58 
     | 
    
         
            +
                  }, props.mouseLeaveDelay ?? 500);
         
     | 
| 
       61 
59 
     | 
    
         
             
                } else {
         
     | 
| 
       62 
60 
     | 
    
         
             
                  setOpenState(e, shouldOpen);
         
     | 
| 
       63 
61 
     | 
    
         
             
                }
         
     | 
| 
         @@ -96,12 +94,11 @@ export const usePopover_unstable = props => { 
     | 
|
| 
       96 
94 
     | 
    
         
             
                findFirstFocusable
         
     | 
| 
       97 
95 
     | 
    
         
             
              } = useFocusFinders();
         
     | 
| 
       98 
96 
     | 
    
         
             
              React.useEffect(() => {
         
     | 
| 
       99 
     | 
    
         
            -
                var _a;
         
     | 
| 
       100 
97 
     | 
    
         
             
                if (props.unstable_disableAutoFocus) {
         
     | 
| 
       101 
98 
     | 
    
         
             
                  return;
         
     | 
| 
       102 
99 
     | 
    
         
             
                }
         
     | 
| 
       103 
100 
     | 
    
         
             
                if (open && positioningRefs.contentRef.current) {
         
     | 
| 
       104 
     | 
    
         
            -
                  const containerTabIndex =  
     | 
| 
      
 101 
     | 
    
         
            +
                  const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;
         
     | 
| 
       105 
102 
     | 
    
         
             
                  const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;
         
     | 
| 
       106 
103 
     | 
    
         
             
                  firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
         
     | 
| 
       107 
104 
     | 
    
         
             
                }
         
     | 
| 
         @@ -116,7 +113,7 @@ export const usePopover_unstable = props => { 
     | 
|
| 
       116 
113 
     | 
    
         
             
                toggleOpen,
         
     | 
| 
       117 
114 
     | 
    
         
             
                setContextTarget,
         
     | 
| 
       118 
115 
     | 
    
         
             
                contextTarget,
         
     | 
| 
       119 
     | 
    
         
            -
                inline:  
     | 
| 
      
 116 
     | 
    
         
            +
                inline: props.inline ?? false
         
     | 
| 
       120 
117 
     | 
    
         
             
              };
         
     | 
| 
       121 
118 
     | 
    
         
             
            };
         
     | 
| 
       122 
119 
     | 
    
         
             
            /**
         
     | 
| 
         @@ -124,8 +121,8 @@ export const usePopover_unstable = props => { 
     | 
|
| 
       124 
121 
     | 
    
         
             
             */
         
     | 
| 
       125 
122 
     | 
    
         
             
            function useOpenState(state) {
         
     | 
| 
       126 
123 
     | 
    
         
             
              const onOpenChange = useEventCallback((e, data) => {
         
     | 
| 
       127 
     | 
    
         
            -
                var  
     | 
| 
       128 
     | 
    
         
            -
                return ( 
     | 
| 
      
 124 
     | 
    
         
            +
                var _state_onOpenChange;
         
     | 
| 
      
 125 
     | 
    
         
            +
                return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);
         
     | 
| 
       129 
126 
     | 
    
         
             
              });
         
     | 
| 
       130 
127 
     | 
    
         
             
              const [open, setOpenState] = useControllableState({
         
     | 
| 
       131 
128 
     | 
    
         
             
                state: state.open,
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,QACb,2BAA2B;AAClC,SAASC,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AACjF,SACEC,cAAc,EACdC,2BAA2B,EAC3BC,gBAAgB,E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AET,KAAK,CAACT,aAAa,GAAGS,KAAK,CAACvD,aAAa,GAAGc,SAAS;IAC7D,GAAGvB,2BAA2B,CAACgE,KAAK,CAACU,WAAW;GACjD;EAED;EACA,IAAIL,kBAAkB,CAACM,WAAW,EAAE;IAClCX,KAAK,CAACY,SAAS,GAAG,KAAK;;EAGzB,IAAIZ,KAAK,CAACY,SAAS,EAAE;IACnBP,kBAAkB,CAACQ,MAAM,GAAG5E,gBAAgB,CAACoE,kBAAkB,CAACQ,MAAM,EAAExE,YAAY,CAAC2D,KAAK,CAACpD,IAAI,CAAC,CAAC;;EAGnG,MAAM;IAAEkE,SAAS,EAAE3B,UAAU;IAAE4B,YAAY,EAAE3B,UAAU;IAAE4B;EAAQ,CAAE,GAAGjF,cAAc,CAACsE,kBAAkB,CAAC;EAExG,OAAO;IACLlB,UAAU;IACVC,UAAU;IACV4B;GACQ;AACZ","names":["React","useControllableState","useEventCallback","useOnClickOutside","useOnScrollOutside","useFluent_unstable","useFluent","usePositioning","resolvePositioningShorthand","mergeArrowOffset","usePositioningMouseTarget","elementContains","useFocusFinders","arrowHeights","popoverSurfaceBorderRadius","usePopover_unstable","props","contextTarget","setContextTarget","initialState","size","children","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","e","shouldOpen","clearTimeout","current","Event","persist","type","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","unstable_disableAutoFocus","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","inline","state","onOpenChange","data","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","target","positioning","coverTarget","withArrow","offset","targetRef","containerRef","arrowRef"],"sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-popover/src/components/Popover/usePopover.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n  useControllableState,\n  useEventCallback,\n  useOnClickOutside,\n  useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n  usePositioning,\n  resolvePositioningShorthand,\n  mergeArrowOffset,\n  usePositioningMouseTarget,\n} from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\n\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = (props: PopoverProps): PopoverState => {\n  const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n  const initialState = {\n    size: 'medium',\n    contextTarget,\n    setContextTarget,\n    ...props,\n  } as const;\n\n  const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (children.length === 0) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at least one child');\n    }\n\n    if (children.length > 2) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at most two children');\n    }\n  }\n\n  let popoverTrigger: React.ReactElement | undefined = undefined;\n  let popoverSurface: React.ReactElement | undefined = undefined;\n  if (children.length === 2) {\n    popoverTrigger = children[0];\n    popoverSurface = children[1];\n  } else if (children.length === 1) {\n    popoverSurface = children[0];\n  }\n\n  const [open, setOpenState] = useOpenState(initialState);\n\n  const setOpenTimeoutRef = React.useRef(0);\n\n  const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n    clearTimeout(setOpenTimeoutRef.current);\n    if (!(e instanceof Event) && e.persist) {\n      // < React 17 still uses pooled synthetic events\n      e.persist();\n    }\n\n    if (e.type === 'mouseleave') {\n      // FIXME leaking Node timeout type\n      // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n      // @ts-ignore\n      setOpenTimeoutRef.current = setTimeout(() => {\n        setOpenState(e, shouldOpen);\n      }, props.mouseLeaveDelay ?? 500);\n    } else {\n      setOpenState(e, shouldOpen);\n    }\n  });\n\n  // Clear timeout on unmount\n  // Setting state after a component unmounts can cause memory leaks\n  React.useEffect(() => {\n    return () => {\n      clearTimeout(setOpenTimeoutRef.current);\n    };\n  }, []);\n\n  const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n    e => {\n      setOpen(e, !open);\n    },\n    [setOpen, open],\n  );\n\n  const positioningRefs = usePopoverRefs(initialState);\n\n  const { targetDocument } = useFluent();\n  useOnClickOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open,\n  });\n\n  // only close on scroll for context, or when closeOnScroll is specified\n  const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n  useOnScrollOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open || !closeOnScroll,\n  });\n\n  const { findFirstFocusable } = useFocusFinders();\n\n  React.useEffect(() => {\n    if (props.unstable_disableAutoFocus) {\n      return;\n    }\n\n    if (open && positioningRefs.contentRef.current) {\n      const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;\n      const firstFocusable = isNaN(containerTabIndex)\n        ? findFirstFocusable(positioningRefs.contentRef.current)\n        : positioningRefs.contentRef.current;\n      firstFocusable?.focus();\n    }\n  }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n  return {\n    ...initialState,\n    ...positioningRefs,\n    popoverTrigger,\n    popoverSurface,\n    open,\n    setOpen,\n    toggleOpen,\n    setContextTarget,\n    contextTarget,\n    inline: props.inline ?? false,\n  };\n};\n\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(\n  state: Pick<PopoverState, 'setContextTarget' | 'onOpenChange'> & Pick<PopoverProps, 'open' | 'defaultOpen'>,\n) {\n  const onOpenChange: PopoverState['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n  const [open, setOpenState] = useControllableState({\n    state: state.open,\n    defaultState: state.defaultOpen,\n    initialState: false,\n  });\n  state.open = open !== undefined ? open : state.open;\n  const setContextTarget = state.setContextTarget;\n\n  const setOpen = React.useCallback(\n    (e: OpenPopoverEvents, shouldOpen: boolean) => {\n      if (shouldOpen && e.type === 'contextmenu') {\n        setContextTarget(e as React.MouseEvent);\n      }\n\n      if (!shouldOpen) {\n        setContextTarget(undefined);\n      }\n\n      setOpenState(shouldOpen);\n      onOpenChange?.(e, { open: shouldOpen });\n    },\n    [setOpenState, onOpenChange, setContextTarget],\n  );\n\n  return [open, setOpen] as const;\n}\n\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(\n  state: Pick<PopoverState, 'size' | 'contextTarget'> &\n    Pick<PopoverProps, 'positioning' | 'openOnContext' | 'withArrow'>,\n) {\n  const positioningOptions = {\n    position: 'above' as const,\n    align: 'center' as const,\n    arrowPadding: 2 * popoverSurfaceBorderRadius,\n    target: state.openOnContext ? state.contextTarget : undefined,\n    ...resolvePositioningShorthand(state.positioning),\n  };\n\n  // no reason to render arrow when covering the target\n  if (positioningOptions.coverTarget) {\n    state.withArrow = false;\n  }\n\n  if (state.withArrow) {\n    positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n  }\n\n  const { targetRef: triggerRef, containerRef: contentRef, arrowRef } = usePositioning(positioningOptions);\n\n  return {\n    triggerRef,\n    contentRef,\n    arrowRef,\n  } as const;\n}\n"]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,YAAYA,WAAW;AACvB,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,iBAAiB,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AW,EAAE;IAClCX,MAAMY,SAAS,GAAG,KAAK;EACzB;EAEA,IAAIZ,MAAMY,SAAS,EAAE;IACnBP,mBAAmBQ,MAAM,GAAG5E,iBAAiBoE,mBAAmBQ,MAAM,EAAExE,YAAY,CAAC2D,MAAMpD,IAAI,CAAC;EAClG;EAEA,MAAM;IAAEkE,WAAW3B;IAAY4B,cAAc3B;IAAY4B;EAAQ,CAAE,GAAGjF,eAAesE;EAErF,OAAO;IACLlB;IACAC;IACA4B;EACF;AACF","names":["React","useControllableState","useEventCallback","useOnClickOutside","useOnScrollOutside","useFluent_unstable","useFluent","usePositioning","resolvePositioningShorthand","mergeArrowOffset","usePositioningMouseTarget","elementContains","useFocusFinders","arrowHeights","popoverSurfaceBorderRadius","usePopover_unstable","props","contextTarget","setContextTarget","initialState","size","children","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","e","shouldOpen","clearTimeout","current","Event","persist","type","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","unstable_disableAutoFocus","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","inline","state","onOpenChange","data","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","target","positioning","coverTarget","withArrow","offset","targetRef","containerRef","arrowRef"],"sources":["../../../src/components/Popover/usePopover.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n  useControllableState,\n  useEventCallback,\n  useOnClickOutside,\n  useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n  usePositioning,\n  resolvePositioningShorthand,\n  mergeArrowOffset,\n  usePositioningMouseTarget,\n} from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\n\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = (props: PopoverProps): PopoverState => {\n  const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n  const initialState = {\n    size: 'medium',\n    contextTarget,\n    setContextTarget,\n    ...props,\n  } as const;\n\n  const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (children.length === 0) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at least one child');\n    }\n\n    if (children.length > 2) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at most two children');\n    }\n  }\n\n  let popoverTrigger: React.ReactElement | undefined = undefined;\n  let popoverSurface: React.ReactElement | undefined = undefined;\n  if (children.length === 2) {\n    popoverTrigger = children[0];\n    popoverSurface = children[1];\n  } else if (children.length === 1) {\n    popoverSurface = children[0];\n  }\n\n  const [open, setOpenState] = useOpenState(initialState);\n\n  const setOpenTimeoutRef = React.useRef(0);\n\n  const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n    clearTimeout(setOpenTimeoutRef.current);\n    if (!(e instanceof Event) && e.persist) {\n      // < React 17 still uses pooled synthetic events\n      e.persist();\n    }\n\n    if (e.type === 'mouseleave') {\n      // FIXME leaking Node timeout type\n      // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n      // @ts-ignore\n      setOpenTimeoutRef.current = setTimeout(() => {\n        setOpenState(e, shouldOpen);\n      }, props.mouseLeaveDelay ?? 500);\n    } else {\n      setOpenState(e, shouldOpen);\n    }\n  });\n\n  // Clear timeout on unmount\n  // Setting state after a component unmounts can cause memory leaks\n  React.useEffect(() => {\n    return () => {\n      clearTimeout(setOpenTimeoutRef.current);\n    };\n  }, []);\n\n  const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n    e => {\n      setOpen(e, !open);\n    },\n    [setOpen, open],\n  );\n\n  const positioningRefs = usePopoverRefs(initialState);\n\n  const { targetDocument } = useFluent();\n  useOnClickOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open,\n  });\n\n  // only close on scroll for context, or when closeOnScroll is specified\n  const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n  useOnScrollOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open || !closeOnScroll,\n  });\n\n  const { findFirstFocusable } = useFocusFinders();\n\n  React.useEffect(() => {\n    if (props.unstable_disableAutoFocus) {\n      return;\n    }\n\n    if (open && positioningRefs.contentRef.current) {\n      const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;\n      const firstFocusable = isNaN(containerTabIndex)\n        ? findFirstFocusable(positioningRefs.contentRef.current)\n        : positioningRefs.contentRef.current;\n      firstFocusable?.focus();\n    }\n  }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n  return {\n    ...initialState,\n    ...positioningRefs,\n    popoverTrigger,\n    popoverSurface,\n    open,\n    setOpen,\n    toggleOpen,\n    setContextTarget,\n    contextTarget,\n    inline: props.inline ?? false,\n  };\n};\n\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(\n  state: Pick<PopoverState, 'setContextTarget' | 'onOpenChange'> & Pick<PopoverProps, 'open' | 'defaultOpen'>,\n) {\n  const onOpenChange: PopoverState['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n  const [open, setOpenState] = useControllableState({\n    state: state.open,\n    defaultState: state.defaultOpen,\n    initialState: false,\n  });\n  state.open = open !== undefined ? open : state.open;\n  const setContextTarget = state.setContextTarget;\n\n  const setOpen = React.useCallback(\n    (e: OpenPopoverEvents, shouldOpen: boolean) => {\n      if (shouldOpen && e.type === 'contextmenu') {\n        setContextTarget(e as React.MouseEvent);\n      }\n\n      if (!shouldOpen) {\n        setContextTarget(undefined);\n      }\n\n      setOpenState(shouldOpen);\n      onOpenChange?.(e, { open: shouldOpen });\n    },\n    [setOpenState, onOpenChange, setContextTarget],\n  );\n\n  return [open, setOpen] as const;\n}\n\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(\n  state: Pick<PopoverState, 'size' | 'contextTarget'> &\n    Pick<PopoverProps, 'positioning' | 'openOnContext' | 'withArrow'>,\n) {\n  const positioningOptions = {\n    position: 'above' as const,\n    align: 'center' as const,\n    arrowPadding: 2 * popoverSurfaceBorderRadius,\n    target: state.openOnContext ? state.contextTarget : undefined,\n    ...resolvePositioningShorthand(state.positioning),\n  };\n\n  // no reason to render arrow when covering the target\n  if (positioningOptions.coverTarget) {\n    state.withArrow = false;\n  }\n\n  if (state.withArrow) {\n    positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n  }\n\n  const { targetRef: triggerRef, containerRef: contentRef, arrowRef } = usePositioning(positioningOptions);\n\n  return {\n    triggerRef,\n    contentRef,\n    arrowRef,\n  } as const;\n}\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":"AAAA, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,YAAYA,WAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,gCAAgC,QAAQ;AAIjD;;;AAGA,OAAO,MAAMC,8BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC,QAAQ;EACvG,MAAMC,QAAQP,2BAA2BK,OAAOC;EAEhDJ,iCAAiCK;EACjC,OAAON,8BAA8BM;AACvC;AAEAJ,eAAeK,WAAW,GAAG","names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","PopoverSurface","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/PopoverSurface/PopoverSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePopoverSurface_unstable } from './usePopoverSurface';\nimport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nimport { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles';\nimport type { PopoverSurfaceProps } from './PopoverSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * PopoverSurface component renders react children in a positioned box\n */\nexport const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps> = React.forwardRef((props, ref) => {\n  const state = usePopoverSurface_unstable(props, ref);\n\n  usePopoverSurfaceStyles_unstable(state);\n  return renderPopoverSurface_unstable(state);\n});\n\nPopoverSurface.displayName = 'PopoverSurface';\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA","names":[],"sources":["../../../src/components/PopoverSurface/PopoverSurface.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverContextValue } from '../../popoverContext';\n\n/**\n * PopoverSurface Props\n */\nexport type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;\n\n/**\n * Names of the slots in PopoverSurfaceProps\n */\nexport type PopoverSurfaceSlots = {\n  root: Slot<'div'>;\n};\n\n/**\n * PopoverSurface State\n */\nexport type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> &\n  Pick<PopoverContextValue, 'appearance' | 'arrowRef' | 'inline' | 'mountNode' | 'size' | 'withArrow'> & {\n    /**\n     * CSS class for the arrow element\n     */\n    arrowClassName?: string;\n  };\n"]}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","names":[],"sources":["../../../src/components/PopoverSurface/index.ts"],"sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles';\n"]}
         
     | 
| 
         @@ -1,3 +1,4 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import _extends from "@swc/helpers/src/_extends.mjs";
         
     | 
| 
       1 
2 
     | 
    
         
             
            import * as React from 'react';
         
     | 
| 
       2 
3 
     | 
    
         
             
            import { Portal } from '@fluentui/react-portal';
         
     | 
| 
       3 
4 
     | 
    
         
             
            import { getSlots } from '@fluentui/react-utilities';
         
     | 
| 
         @@ -9,9 +10,7 @@ export const renderPopoverSurface_unstable = state => { 
     | 
|
| 
       9 
10 
     | 
    
         
             
                slots,
         
     | 
| 
       10 
11 
     | 
    
         
             
                slotProps
         
     | 
| 
       11 
12 
     | 
    
         
             
              } = getSlots(state);
         
     | 
| 
       12 
     | 
    
         
            -
              const surface = /*#__PURE__*/React.createElement(slots.root, {
         
     | 
| 
       13 
     | 
    
         
            -
                ...slotProps.root
         
     | 
| 
       14 
     | 
    
         
            -
              }, state.withArrow && /*#__PURE__*/React.createElement("div", {
         
     | 
| 
      
 13 
     | 
    
         
            +
              const surface = /*#__PURE__*/React.createElement(slots.root, _extends({}, slotProps.root), state.withArrow && /*#__PURE__*/React.createElement("div", {
         
     | 
| 
       15 
14 
     | 
    
         
             
                ref: state.arrowRef,
         
     | 
| 
       16 
15 
     | 
    
         
             
                className: state.arrowClassName
         
     | 
| 
       17 
16 
     | 
    
         
             
              }), slotProps.root.children);
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":"AAAA, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":";AAAA,YAAYA,WAAW;AACvB,SAASC,MAAM,QAAQ;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,gCAAiCC,SAA+B;EAC3E,MAAM;IAAEC;IAAOC;EAAS,CAAE,GAAGJ,SAA8BE;EAE3D,MAAMG,uBACJP,oBAACK,MAAMG,IAAI,eAAKF,UAAUE,IAAI,GAC3BJ,MAAMK,SAAS,iBAAIT,oBAACU;IAAIC,KAAKP,MAAMQ,QAAQ;IAAEC,WAAWT,MAAMU;MAC9DR,UAAUE,IAAI,CAACO,QAAQ;EAI5B,IAAIX,MAAMY,MAAM,EAAE;IAChB,OAAOT;EACT;EAEA,oBAAOP,oBAACC;IAAOgB,WAAWb,MAAMa;KAAYV;AAC9C","names":["React","Portal","getSlots","renderPopoverSurface_unstable","state","slots","slotProps","surface","root","withArrow","div","ref","arrowRef","className","arrowClassName","children","inline","mountNode"],"sources":["../../../src/components/PopoverSurface/renderPopoverSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Portal } from '@fluentui/react-portal';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = (state: PopoverSurfaceState) => {\n  const { slots, slotProps } = getSlots<PopoverSurfaceSlots>(state);\n\n  const surface = (\n    <slots.root {...slotProps.root}>\n      {state.withArrow && <div ref={state.arrowRef} className={state.arrowClassName} />}\n      {slotProps.root.children}\n    </slots.root>\n  );\n\n  if (state.inline) {\n    return surface;\n  }\n\n  return <Portal mountNode={state.mountNode}>{surface}</Portal>;\n};\n"]}
         
     | 
| 
         @@ -1,3 +1,4 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import * as React from 'react';
         
     | 
| 
       1 
2 
     | 
    
         
             
            import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
         
     | 
| 
       2 
3 
     | 
    
         
             
            import { useModalAttributes } from '@fluentui/react-tabster';
         
     | 
| 
       3 
4 
     | 
    
         
             
            import { usePopoverContext_unstable } from '../../popoverContext';
         
     | 
| 
         @@ -26,7 +27,8 @@ export const usePopoverSurface_unstable = (props, ref) => { 
     | 
|
| 
       26 
27 
     | 
    
         
             
                modalAttributes
         
     | 
| 
       27 
28 
     | 
    
         
             
              } = useModalAttributes({
         
     | 
| 
       28 
29 
     | 
    
         
             
                trapFocus,
         
     | 
| 
       29 
     | 
    
         
            -
                legacyTrapFocus
         
     | 
| 
      
 30 
     | 
    
         
            +
                legacyTrapFocus,
         
     | 
| 
      
 31 
     | 
    
         
            +
                alwaysFocusable: !trapFocus
         
     | 
| 
       30 
32 
     | 
    
         
             
              });
         
     | 
| 
       31 
33 
     | 
    
         
             
              const state = {
         
     | 
| 
       32 
34 
     | 
    
         
             
                inline,
         
     | 
| 
         @@ -64,10 +66,10 @@ export const usePopoverSurface_unstable = (props, ref) => { 
     | 
|
| 
       64 
66 
     | 
    
         
             
                onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
         
     | 
| 
       65 
67 
     | 
    
         
             
              };
         
     | 
| 
       66 
68 
     | 
    
         
             
              state.root.onKeyDown = e => {
         
     | 
| 
       67 
     | 
    
         
            -
                var  
     | 
| 
      
 69 
     | 
    
         
            +
                var _contentRef_current;
         
     | 
| 
       68 
70 
     | 
    
         
             
                // only close if the event happened inside the current popover
         
     | 
| 
       69 
71 
     | 
    
         
             
                // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
         
     | 
| 
       70 
     | 
    
         
            -
                if (e.key === 'Escape' && (( 
     | 
| 
      
 72 
     | 
    
         
            +
                if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {
         
     | 
| 
       71 
73 
     | 
    
         
             
                  setOpen(e, false);
         
     | 
| 
       72 
74 
     | 
    
         
             
                }
         
     | 
| 
       73 
75 
     | 
    
         
             
                onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":" 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"mappings":"AAAA,YAAYA,WAAW;AACvB,SAASC,qBAAqB,EAAEC,aAAa,QAAQ;AACrD,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAG3C;;;;;;;;;AASA,OAAO,MAAMC,6BAA6B,CACxCC,OACAC,QACwB;EACxB,MAAMC,aAAaJ,2BAA2BK,WAAWA,QAAQD,UAAU;EAC3E,MAAME,cAAcN,2BAA2BK,WAAWA,QAAQC,WAAW;EAC7E,MAAMC,UAAUP,2BAA2BK,WAAWA,QAAQE,OAAO;EACrE,MAAMC,YAAYR,2BAA2BK,WAAWA,QAAQG,SAAS;EACzE,MAAMC,WAAWT,2BAA2BK,WAAWA,QAAQI,QAAQ;EACvE,MAAMC,OAAOV,2BAA2BK,WAAWA,QAAQK,IAAI;EAC/D,MAAMC,YAAYX,2BAA2BK,WAAWA,QAAQM,SAAS;EACzE,MAAMC,aAAaZ,2BAA2BK,WAAWA,QAAQO,UAAU;EAC3E,MAAMC,YAAYb,2BAA2BK,WAAWA,QAAQQ,SAAS;EACzE,MAAMC,kBAAkBd,2BAA2BK,WAAWA,QAAQS,eAAe;EACrF,MAAMC,SAASf,2BAA2BK,WAAWA,QAAQU,MAAM;EACnE,MAAM;IAAEC;EAAe,CAAE,GAAGjB,mBAAmB;IAAEc;IAAWC;IAAiBG,iBAAiB,CAACJ;EAAU;EAEzG,MAAMK,QAA6B;IACjCH;IACAH;IACAD;IACAD;IACAD;IACAD;IACAW,YAAY;MACVC,MAAM;IACR;IACAA,MAAMvB,sBAAsB,OAAO;MACjCM,KAAKL,cAAcK,KAAKC;MACxBiB,MAAMR,YAAY,WAAW,OAAO;MACpC,cAAcA,YAAY,IAAI,GAAGS,SAAS;MAC1C,GAAGN,eAAe;MAClB,GAAGd;IACL;EACF;EAEA,MAAM;IACJqB,cAAcC;IACdC,cAAcC;IACdC,WAAWC;EAAiB,CAC7B,GAAGV,MAAME,IAAI;EACdF,MAAME,IAAI,CAACG,YAAY,GAAIM,KAAwC;IACjE,IAAIvB,aAAa;MACfC,QAAQsB,GAAG,IAAI;IACjB;IAEAL,iGAAuBK;EACzB;EAEAX,MAAME,IAAI,CAACK,YAAY,GAAII,KAAwC;IACjE,IAAIvB,aAAa;MACfC,QAAQsB,GAAG,KAAK;IAClB;IAEAH,iGAAuBG;EACzB;EAEAX,MAAME,IAAI,CAACO,SAAS,GAAIE,KAA2C;QAGvCzB;IAF1B;IACA;IACA,IAAIyB,EAAEC,GAAG,KAAK,aAAY1B,kCAAW2B,OAAO,cAAlB3B,8DAAoB4B,SAASH,EAAEI,MAAM,IAAqB;MAClF1B,QAAQsB,GAAG,KAAK;IAClB;IAEAD,wFAAoBC;EACtB;EAEA,OAAOX;AACT","names":["React","getNativeElementProps","useMergedRefs","useModalAttributes","usePopoverContext_unstable","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","legacyTrapFocus","inline","modalAttributes","alwaysFocusable","state","components","root","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","key","current","contains","target"],"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n  props: PopoverSurfaceProps,\n  ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n  const contentRef = usePopoverContext_unstable(context => context.contentRef);\n  const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n  const setOpen = usePopoverContext_unstable(context => context.setOpen);\n  const mountNode = usePopoverContext_unstable(context => context.mountNode);\n  const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n  const size = usePopoverContext_unstable(context => context.size);\n  const withArrow = usePopoverContext_unstable(context => context.withArrow);\n  const appearance = usePopoverContext_unstable(context => context.appearance);\n  const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n  const legacyTrapFocus = usePopoverContext_unstable(context => context.legacyTrapFocus);\n  const inline = usePopoverContext_unstable(context => context.inline);\n  const { modalAttributes } = useModalAttributes({ trapFocus, legacyTrapFocus, alwaysFocusable: !trapFocus });\n\n  const state: PopoverSurfaceState = {\n    inline,\n    appearance,\n    withArrow,\n    size,\n    arrowRef,\n    mountNode,\n    components: {\n      root: 'div',\n    },\n    root: getNativeElementProps('div', {\n      ref: useMergedRefs(ref, contentRef),\n      role: trapFocus ? 'dialog' : 'group',\n      'aria-modal': trapFocus ? true : undefined,\n      ...modalAttributes,\n      ...props,\n    }),\n  };\n\n  const {\n    onMouseEnter: onMouseEnterOriginal,\n    onMouseLeave: onMouseLeaveOriginal,\n    onKeyDown: onKeyDownOriginal,\n  } = state.root;\n  state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n    if (openOnHover) {\n      setOpen(e, true);\n    }\n\n    onMouseEnterOriginal?.(e);\n  };\n\n  state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n    if (openOnHover) {\n      setOpen(e, false);\n    }\n\n    onMouseLeaveOriginal?.(e);\n  };\n\n  state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    // only close if the event happened inside the current popover\n    // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n    if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n      setOpen(e, false);\n    }\n\n    onKeyDownOriginal?.(e);\n  };\n\n  return state;\n};\n"]}
         
     |