@fluentui/react-popover 0.0.0-nightly-20230427-0418.1 → 0.0.0-nightly-20230501-0418.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.
Files changed (48) hide show
  1. package/CHANGELOG.json +25 -25
  2. package/CHANGELOG.md +15 -15
  3. package/package.json +12 -12
  4. package/dist/index.d.ts +0 -313
  5. package/lib/Popover.js +0 -2
  6. package/lib/Popover.js.map +0 -1
  7. package/lib/PopoverSurface.js +0 -2
  8. package/lib/PopoverSurface.js.map +0 -1
  9. package/lib/PopoverTrigger.js +0 -2
  10. package/lib/PopoverTrigger.js.map +0 -1
  11. package/lib/components/Popover/Popover.js +0 -12
  12. package/lib/components/Popover/Popover.js.map +0 -1
  13. package/lib/components/Popover/Popover.types.js +0 -2
  14. package/lib/components/Popover/Popover.types.js.map +0 -1
  15. package/lib/components/Popover/constants.js +0 -9
  16. package/lib/components/Popover/constants.js.map +0 -1
  17. package/lib/components/Popover/index.js +0 -5
  18. package/lib/components/Popover/index.js.map +0 -1
  19. package/lib/components/Popover/renderPopover.js +0 -44
  20. package/lib/components/Popover/renderPopover.js.map +0 -1
  21. package/lib/components/Popover/usePopover.js +0 -182
  22. package/lib/components/Popover/usePopover.js.map +0 -1
  23. package/lib/components/PopoverSurface/PopoverSurface.js +0 -16
  24. package/lib/components/PopoverSurface/PopoverSurface.js.map +0 -1
  25. package/lib/components/PopoverSurface/PopoverSurface.types.js +0 -2
  26. package/lib/components/PopoverSurface/PopoverSurface.types.js.map +0 -1
  27. package/lib/components/PopoverSurface/index.js +0 -6
  28. package/lib/components/PopoverSurface/index.js.map +0 -1
  29. package/lib/components/PopoverSurface/renderPopoverSurface.js +0 -23
  30. package/lib/components/PopoverSurface/renderPopoverSurface.js.map +0 -1
  31. package/lib/components/PopoverSurface/usePopoverSurface.js +0 -79
  32. package/lib/components/PopoverSurface/usePopoverSurface.js.map +0 -1
  33. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.js +0 -116
  34. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.js.map +0 -1
  35. package/lib/components/PopoverTrigger/PopoverTrigger.js +0 -14
  36. package/lib/components/PopoverTrigger/PopoverTrigger.js.map +0 -1
  37. package/lib/components/PopoverTrigger/PopoverTrigger.types.js +0 -2
  38. package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +0 -1
  39. package/lib/components/PopoverTrigger/index.js +0 -5
  40. package/lib/components/PopoverTrigger/index.js.map +0 -1
  41. package/lib/components/PopoverTrigger/renderPopoverTrigger.js +0 -6
  42. package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +0 -1
  43. package/lib/components/PopoverTrigger/usePopoverTrigger.js +0 -78
  44. package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +0 -1
  45. package/lib/index.js +0 -5
  46. package/lib/index.js.map +0 -1
  47. package/lib/popoverContext.js +0 -24
  48. package/lib/popoverContext.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-popover",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 27 Apr 2023 04:23:09 GMT",
6
- "tag": "@fluentui/react-popover_v0.0.0-nightly-20230427-0418.1",
7
- "version": "0.0.0-nightly-20230427-0418.1",
5
+ "date": "Mon, 01 May 2023 04:24:01 GMT",
6
+ "tag": "@fluentui/react-popover_v0.0.0-nightly-20230501-0418.1",
7
+ "version": "0.0.0-nightly-20230501-0418.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,68 +16,68 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-popover",
19
- "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230427-0418.1",
20
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
19
+ "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230501-0418.1",
20
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
26
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
25
+ "comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230501-0418.1",
26
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
32
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
31
+ "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230501-0418.1",
32
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
38
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
37
+ "comment": "Bump @fluentui/react-portal to v0.0.0-nightly-20230501-0418.1",
38
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
44
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
43
+ "comment": "Bump @fluentui/react-positioning to v0.0.0-nightly-20230501-0418.1",
44
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
50
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
49
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230501-0418.1",
50
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
56
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
55
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230501-0418.1",
56
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
62
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
61
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230501-0418.1",
62
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
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-20230427-0418.1",
68
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
67
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230501-0418.1",
68
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
69
69
  },
70
70
  {
71
71
  "author": "beachball",
72
72
  "package": "@fluentui/react-popover",
73
- "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230427-0418.1",
74
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
73
+ "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230501-0418.1",
74
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
75
75
  },
76
76
  {
77
77
  "author": "beachball",
78
78
  "package": "@fluentui/react-popover",
79
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230427-0418.1",
80
- "commit": "a9e0a4f587386948c891437cdbe3b10437aa9485"
79
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230501-0418.1",
80
+ "commit": "ec7f7770aa9dd65ad47721639ad0c5d238d9e037"
81
81
  }
82
82
  ]
83
83
  }
package/CHANGELOG.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # Change Log - @fluentui/react-popover
2
2
 
3
- This log was last generated on Thu, 27 Apr 2023 04:23:09 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 01 May 2023 04:24:01 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230427-0418.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v0.0.0-nightly-20230427-0418.1)
7
+ ## [0.0.0-nightly-20230501-0418.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v0.0.0-nightly-20230501-0418.1)
8
8
 
9
- Thu, 27 Apr 2023 04:23:09 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.10..@fluentui/react-popover_v0.0.0-nightly-20230427-0418.1)
9
+ Mon, 01 May 2023 04:24:01 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.10..@fluentui/react-popover_v0.0.0-nightly-20230501-0418.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-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
16
- - Bump @fluentui/react-aria to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
17
- - Bump @fluentui/react-context-selector to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
18
- - Bump @fluentui/react-portal to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
19
- - Bump @fluentui/react-positioning to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
20
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
21
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
22
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
23
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
24
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
25
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230427-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/a9e0a4f587386948c891437cdbe3b10437aa9485) by beachball)
15
+ - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
16
+ - Bump @fluentui/react-aria to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
17
+ - Bump @fluentui/react-context-selector to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
18
+ - Bump @fluentui/react-portal to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
19
+ - Bump @fluentui/react-positioning to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
20
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
21
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
22
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
23
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
24
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
25
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230501-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/ec7f7770aa9dd65ad47721639ad0c5d238d9e037) by beachball)
26
26
 
27
27
  ## [9.5.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.10)
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-popover",
3
- "version": "0.0.0-nightly-20230427-0418.1",
3
+ "version": "0.0.0-nightly-20230501-0418.1",
4
4
  "description": "Popover component for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -29,22 +29,22 @@
29
29
  "devDependencies": {
30
30
  "@fluentui/eslint-plugin": "*",
31
31
  "@fluentui/react-conformance": "*",
32
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230427-0418.1",
32
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230501-0418.1",
33
33
  "@fluentui/scripts-api-extractor": "*",
34
34
  "@fluentui/scripts-cypress": "*",
35
35
  "@fluentui/scripts-tasks": "*"
36
36
  },
37
37
  "dependencies": {
38
- "@fluentui/keyboard-keys": "0.0.0-nightly-20230427-0418.1",
39
- "@fluentui/react-aria": "0.0.0-nightly-20230427-0418.1",
40
- "@fluentui/react-context-selector": "0.0.0-nightly-20230427-0418.1",
41
- "@fluentui/react-portal": "0.0.0-nightly-20230427-0418.1",
42
- "@fluentui/react-positioning": "0.0.0-nightly-20230427-0418.1",
43
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230427-0418.1",
44
- "@fluentui/react-tabster": "0.0.0-nightly-20230427-0418.1",
45
- "@fluentui/react-theme": "0.0.0-nightly-20230427-0418.1",
46
- "@fluentui/react-utilities": "0.0.0-nightly-20230427-0418.1",
47
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230427-0418.1",
38
+ "@fluentui/keyboard-keys": "0.0.0-nightly-20230501-0418.1",
39
+ "@fluentui/react-aria": "0.0.0-nightly-20230501-0418.1",
40
+ "@fluentui/react-context-selector": "0.0.0-nightly-20230501-0418.1",
41
+ "@fluentui/react-portal": "0.0.0-nightly-20230501-0418.1",
42
+ "@fluentui/react-positioning": "0.0.0-nightly-20230501-0418.1",
43
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230501-0418.1",
44
+ "@fluentui/react-tabster": "0.0.0-nightly-20230501-0418.1",
45
+ "@fluentui/react-theme": "0.0.0-nightly-20230501-0418.1",
46
+ "@fluentui/react-utilities": "0.0.0-nightly-20230501-0418.1",
47
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230501-0418.1",
48
48
  "@griffel/react": "^1.5.2",
49
49
  "@swc/helpers": "^0.4.14"
50
50
  },
package/dist/index.d.ts DELETED
@@ -1,313 +0,0 @@
1
- import { ARIAButtonResultProps } from '@fluentui/react-aria';
2
- import { ARIAButtonType } from '@fluentui/react-aria';
3
- import type { ComponentProps } from '@fluentui/react-utilities';
4
- import type { ComponentState } from '@fluentui/react-utilities';
5
- import type { ContextSelector } from '@fluentui/react-context-selector';
6
- import { FC } from 'react';
7
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
8
- import { JSXElementConstructor } from 'react';
9
- import type { PortalProps } from '@fluentui/react-portal';
10
- import type { PositioningShorthand } from '@fluentui/react-positioning';
11
- import type { PositioningVirtualElement } from '@fluentui/react-positioning';
12
- import { Provider } from 'react';
13
- import { ProviderProps } from 'react';
14
- import * as React_2 from 'react';
15
- import { ReactElement } from 'react';
16
- import type { SetVirtualMouseTarget } from '@fluentui/react-positioning';
17
- import type { Slot } from '@fluentui/react-utilities';
18
- import type { SlotClassNames } from '@fluentui/react-utilities';
19
- import type { TriggerProps } from '@fluentui/react-utilities';
20
-
21
- export declare const arrowHeights: Record<PopoverSize, number>;
22
-
23
- /**
24
- * Data attached to open/close events
25
- */
26
- export declare type OnOpenChangeData = {
27
- open: boolean;
28
- };
29
-
30
- /**
31
- * The supported events that will trigger open/close of the menu
32
- */
33
- export declare type OpenPopoverEvents = MouseEvent | TouchEvent | React_2.FocusEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement>;
34
-
35
- /**
36
- * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
37
- */
38
- export declare const Popover: React_2.FC<PopoverProps>;
39
-
40
- /**
41
- * Context shared between Popover and its children components
42
- */
43
- export declare type PopoverContextValue = Pick<PopoverState, 'open' | 'toggleOpen' | 'setOpen' | 'triggerRef' | 'contentRef' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'withArrow' | 'arrowRef' | 'size' | 'appearance' | 'trapFocus' | 'inertTrapFocus' | 'inline'>;
44
-
45
- /**
46
- * Popover Props
47
- */
48
- export declare type PopoverProps = Pick<PortalProps, 'mountNode'> & {
49
- /**
50
- * A popover can appear styled with brand or inverted.
51
- * When not specified, the default style is used.
52
- */
53
- appearance?: 'brand' | 'inverted';
54
- /**
55
- * Can contain two children including {@link PopoverTrigger} and {@link PopoverSurface}.
56
- * Alternatively can only contain {@link PopoverSurface} if using a custom `target`.
57
- */
58
- children: [JSX.Element, JSX.Element] | JSX.Element;
59
- /**
60
- * Close when scroll outside of it
61
- *
62
- * @default false
63
- */
64
- closeOnScroll?: boolean;
65
- /**
66
- * Used to set the initial open state of the Popover in uncontrolled mode
67
- *
68
- * @default false
69
- */
70
- defaultOpen?: boolean;
71
- /**
72
- * Popovers are rendered out of DOM order on `document.body` by default, use this to render the popover in DOM order
73
- *
74
- * @default false
75
- */
76
- inline?: boolean;
77
- /**
78
- * Sets the delay for closing popover on mouse leave
79
- */
80
- mouseLeaveDelay?: number;
81
- /**
82
- * Display an arrow pointing to the target.
83
- *
84
- * @default false
85
- */
86
- withArrow?: boolean;
87
- /**
88
- * Call back when the component requests to change value
89
- * The `open` value is used as a hint when directly controlling the component
90
- */
91
- onOpenChange?: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;
92
- /**
93
- * Controls the opening of the Popover
94
- *
95
- * @default false
96
- */
97
- open?: boolean;
98
- /**
99
- * Flag to open the Popover as a context menu. Disables all other interactions
100
- *
101
- * @default false
102
- */
103
- openOnContext?: boolean;
104
- /**
105
- * Flag to open the Popover by hovering the trigger
106
- *
107
- * @default false
108
- */
109
- openOnHover?: boolean;
110
- /**
111
- * Configures the position of the Popover
112
- */
113
- positioning?: PositioningShorthand;
114
- /**
115
- * Determines popover padding and arrow size
116
- *
117
- * @default medium
118
- */
119
- size?: PopoverSize;
120
- /**
121
- * Should trap focus
122
- *
123
- * @default false
124
- */
125
- trapFocus?: boolean;
126
- /**
127
- * Must be used with the `trapFocus` prop
128
- * Enables older Fluent UI focus trap behavior where the user
129
- * cannot tab into the window outside of the document. This is now
130
- * non-standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)
131
- * where the focus trap involves setting outside elements inert.
132
- *
133
- * @deprecated this behavior is default provided now, to opt-out of it in favor of standard behavior use the `inertTrapFocus` property
134
- */
135
- legacyTrapFocus?: boolean;
136
- /**
137
- * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)
138
- * where the focus trap involves setting outside elements inert,
139
- * making navigation leak from the trapped area back to the browser toolbar and vice-versa.
140
- *
141
- * @default false
142
- */
143
- inertTrapFocus?: boolean;
144
- /**
145
- * By default Popover focuses the first focusable element in PopoverSurface on open.
146
- * Specify `disableAutoFocus` to prevent this behavior.
147
- *
148
- * @default false
149
- */
150
- unstable_disableAutoFocus?: boolean;
151
- };
152
-
153
- export declare const PopoverProvider: Provider<PopoverContextValue> & FC<ProviderProps<PopoverContextValue>>;
154
-
155
- /**
156
- * Determines popover padding and arrow size
157
- */
158
- export declare type PopoverSize = 'small' | 'medium' | 'large';
159
-
160
- /**
161
- * Popover State
162
- */
163
- export declare type PopoverState = Pick<PopoverProps, 'appearance' | 'mountNode' | 'onOpenChange' | 'openOnContext' | 'openOnHover' | 'trapFocus' | 'withArrow' | 'inertTrapFocus'> & Required<Pick<PopoverProps, 'inline' | 'open'>> & Pick<PopoverProps, 'children'> & {
164
- /**
165
- * Ref of the pointing arrow
166
- */
167
- arrowRef: React_2.MutableRefObject<HTMLDivElement | null>;
168
- /**
169
- * Ref of the PopoverSurface
170
- */
171
- contentRef: React_2.MutableRefObject<HTMLElement | null>;
172
- /**
173
- * Anchors the popper to the mouse click for context events
174
- */
175
- contextTarget: PositioningVirtualElement | undefined;
176
- popoverSurface: React_2.ReactElement | undefined;
177
- popoverTrigger: React_2.ReactElement | undefined;
178
- /**
179
- * A callback to set the target of the popper to the mouse click for context events
180
- */
181
- setContextTarget: SetVirtualMouseTarget;
182
- /**
183
- * Callback to open/close the Popover
184
- */
185
- setOpen: (e: OpenPopoverEvents, open: boolean) => void;
186
- size: NonNullable<PopoverProps['size']>;
187
- /**
188
- * Callback to toggle the open state of the Popover
189
- */
190
- toggleOpen: (e: OpenPopoverEvents) => void;
191
- /**
192
- * Ref of the PopoverTrigger
193
- */
194
- triggerRef: React_2.MutableRefObject<HTMLElement | null>;
195
- };
196
-
197
- /**
198
- * PopoverSurface component renders react children in a positioned box
199
- */
200
- export declare const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps>;
201
-
202
- export declare const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots>;
203
-
204
- /**
205
- * PopoverSurface Props
206
- */
207
- export declare type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
208
-
209
- /**
210
- * Names of the slots in PopoverSurfaceProps
211
- */
212
- export declare type PopoverSurfaceSlots = {
213
- root: Slot<'div'>;
214
- };
215
-
216
- /**
217
- * PopoverSurface State
218
- */
219
- export declare type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> & Pick<PopoverContextValue, 'appearance' | 'arrowRef' | 'inline' | 'mountNode' | 'size' | 'withArrow'> & {
220
- /**
221
- * CSS class for the arrow element
222
- */
223
- arrowClassName?: string;
224
- };
225
-
226
- /**
227
- * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
228
- */
229
- export declare const PopoverTrigger: React_2.FC<PopoverTriggerProps>;
230
-
231
- /**
232
- * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog
233
- */
234
- export declare type PopoverTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<Type, Props & {
235
- 'aria-expanded'?: 'true' | 'false';
236
- ref: React_2.Ref<unknown>;
237
- onMouseEnter: React_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;
238
- onMouseLeave: React_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;
239
- onContextMenu: React_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;
240
- }>;
241
-
242
- /**
243
- * PopoverTrigger Props
244
- */
245
- export declare type PopoverTriggerProps = TriggerProps<PopoverTriggerChildProps> & {
246
- /**
247
- * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.
248
- * @default false
249
- */
250
- disableButtonEnhancement?: boolean;
251
- };
252
-
253
- /**
254
- * PopoverTrigger State
255
- */
256
- export declare type PopoverTriggerState = {
257
- children: React_2.ReactElement | null;
258
- };
259
-
260
- /**
261
- * Render the final JSX of Popover
262
- */
263
- export declare const renderPopover_unstable: (state: PopoverState) => JSX.Element;
264
-
265
- /**
266
- * Render the final JSX of PopoverSurface
267
- */
268
- export declare const renderPopoverSurface_unstable: (state: PopoverSurfaceState) => JSX.Element;
269
-
270
- /**
271
- * Render the final JSX of PopoverTrigger
272
- */
273
- export declare const renderPopoverTrigger_unstable: (state: PopoverTriggerState) => ReactElement<any, string | JSXElementConstructor<any>> | null;
274
-
275
- /**
276
- * Create the state required to render Popover.
277
- *
278
- * The returned state can be modified with hooks such as usePopoverStyles,
279
- * before being passed to renderPopover_unstable.
280
- *
281
- * @param props - props from this instance of Popover
282
- */
283
- export declare const usePopover_unstable: (props: PopoverProps) => PopoverState;
284
-
285
- export declare const usePopoverContext_unstable: <T>(selector: ContextSelector<PopoverContextValue, T>) => T;
286
-
287
- /**
288
- * Create the state required to render PopoverSurface.
289
- *
290
- * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
291
- * before being passed to renderPopoverSurface_unstable.
292
- *
293
- * @param props - props from this instance of PopoverSurface
294
- * @param ref - reference to root HTMLDivElement of PopoverSurface
295
- */
296
- export declare const usePopoverSurface_unstable: (props: PopoverSurfaceProps, ref: React_2.Ref<HTMLDivElement>) => PopoverSurfaceState;
297
-
298
- /**
299
- * Apply styling to the PopoverSurface slots based on the state
300
- */
301
- export declare const usePopoverSurfaceStyles_unstable: (state: PopoverSurfaceState) => PopoverSurfaceState;
302
-
303
- /**
304
- * Create the state required to render PopoverTrigger.
305
- *
306
- * The returned state can be modified with hooks such as usePopoverTriggerStyles,
307
- * before being passed to renderPopoverTrigger_unstable.
308
- *
309
- * @param props - props from this instance of PopoverTrigger
310
- */
311
- export declare const usePopoverTrigger_unstable: (props: PopoverTriggerProps) => PopoverTriggerState;
312
-
313
- export { }
package/lib/Popover.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './components/Popover/index';
2
- //# sourceMappingURL=Popover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../src/Popover.ts"],"sourcesContent":["export * from './components/Popover/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1,2 +0,0 @@
1
- export * from './components/PopoverSurface/index';
2
- //# sourceMappingURL=PopoverSurface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../src/PopoverSurface.ts"],"sourcesContent":["export * from './components/PopoverSurface/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1,2 +0,0 @@
1
- export * from './components/PopoverTrigger/index';
2
- //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../src/PopoverTrigger.ts"],"sourcesContent":["export * from './components/PopoverTrigger/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { usePopover_unstable } from './usePopover';
3
- import { renderPopover_unstable } from './renderPopover';
4
- /**
5
- * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
6
- */
7
- export const Popover = props => {
8
- const state = usePopover_unstable(props);
9
- return renderPopover_unstable(state);
10
- };
11
- Popover.displayName = 'Popover';
12
- //# sourceMappingURL=Popover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,sBAAsB,QAAQ;AAGvC;;;AAGA,OAAO,MAAMC,OAAA,GAAkCC,KAAA,IAAS;EACtD,MAAMC,KAAA,GAAQJ,mBAAA,CAAoBG,KAAA;EAElC,OAAOF,sBAAA,CAAuBG,KAAA;AAChC;AAEAF,OAAA,CAAQG,WAAW,GAAG"}
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- //# sourceMappingURL=Popover.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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';\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?: boolean;\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 * @deprecated this behavior is default provided now, to opt-out of it in favor of standard behavior use the `inertTrapFocus` property\n */\n legacyTrapFocus?: boolean;\n /**\n * Enables 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 * making navigation leak from the trapped area back to the browser toolbar and vice-versa.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\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 | 'inertTrapFocus'\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
@@ -1,9 +0,0 @@
1
- /**
2
- * @internal
3
- * The default value of the tooltip's border radius (borderRadiusMedium).
4
- *
5
- * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.
6
- * While we could use getComputedStyle, that adds a performance penalty for something that
7
- * will likely never change.
8
- */export const popoverSurfaceBorderRadius = 4;
9
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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"],"mappings":"AAAA;;;;;;;GAQA,OAAO,MAAMA,0BAAA,GAA6B"}
@@ -1,5 +0,0 @@
1
- export * from './Popover';
2
- export * from './Popover.types';
3
- export * from './renderPopover';
4
- export * from './usePopover';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/Popover/index.ts"],"sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -1,44 +0,0 @@
1
- import * as React from 'react';
2
- import { PopoverContext } from '../../popoverContext';
3
- /**
4
- * Render the final JSX of Popover
5
- */
6
- export const renderPopover_unstable = state => {
7
- const {
8
- appearance,
9
- arrowRef,
10
- contentRef,
11
- inline,
12
- mountNode,
13
- open,
14
- openOnContext,
15
- openOnHover,
16
- setOpen,
17
- size,
18
- toggleOpen,
19
- trapFocus,
20
- triggerRef,
21
- withArrow,
22
- inertTrapFocus
23
- } = state;
24
- return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
25
- value: {
26
- appearance,
27
- arrowRef,
28
- contentRef,
29
- inline,
30
- mountNode,
31
- open,
32
- openOnContext,
33
- openOnHover,
34
- setOpen,
35
- toggleOpen,
36
- triggerRef,
37
- size,
38
- trapFocus,
39
- inertTrapFocus,
40
- withArrow
41
- }
42
- }, state.popoverTrigger, state.open && state.popoverSurface);
43
- };
44
- //# sourceMappingURL=renderPopover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","PopoverContext","renderPopover_unstable","state","appearance","arrowRef","contentRef","inline","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","inertTrapFocus","createElement","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 inertTrapFocus,\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 inertTrapFocus,\n withArrow,\n }}\n >\n {state.popoverTrigger}\n {state.open && state.popoverSurface}\n </PopoverContext.Provider>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,cAAc,QAAQ;AAG/B;;;AAGA,OAAO,MAAMC,sBAAA,GAA0BC,KAAA,IAAwB;EAC7D,MAAM;IACJC,UAAA;IACAC,QAAA;IACAC,UAAA;IACAC,MAAA;IACAC,SAAA;IACAC,IAAA;IACAC,aAAA;IACAC,WAAA;IACAC,OAAA;IACAC,IAAA;IACAC,UAAA;IACAC,SAAA;IACAC,UAAA;IACAC,SAAA;IACAC;EAAc,CACf,GAAGf,KAAA;EAEJ,oBACEH,KAAA,CAAAmB,aAAA,CAAClB,cAAA,CAAemB,QAAQ;IACtBC,KAAA,EAAO;MACLjB,UAAA;MACAC,QAAA;MACAC,UAAA;MACAC,MAAA;MACAC,SAAA;MACAC,IAAA;MACAC,aAAA;MACAC,WAAA;MACAC,OAAA;MACAE,UAAA;MACAE,UAAA;MACAH,IAAA;MACAE,SAAA;MACAG,cAAA;MACAD;IACF;KAECd,KAAA,CAAMmB,cAAc,EACpBnB,KAAA,CAAMM,IAAI,IAAIN,KAAA,CAAMoB,cAAc;AAGzC"}