@fluentui/react-popover 9.5.9 → 9.5.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +129 -1
- package/CHANGELOG.md +35 -2
- package/lib/components/Popover/usePopover.js +3 -1
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js +3 -6
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/index.js +1 -1
- package/lib/components/PopoverSurface/index.js.map +1 -1
- package/lib/components/PopoverSurface/{usePopoverSurfaceStyles.js → usePopoverSurfaceStyles.styles.js} +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Popover/usePopover.js +3 -1
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +3 -4
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/{usePopoverSurfaceStyles.js → usePopoverSurfaceStyles.styles.js} +2 -2
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.styles.js.map +1 -0
- package/package.json +12 -12
- package/.swcrc +0 -30
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +0 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +0 -1
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,135 @@
|
|
2
2
|
"name": "@fluentui/react-popover",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Fri, 12 May 2023 20:22:01 GMT",
|
6
|
+
"tag": "@fluentui/react-popover_v9.5.11",
|
7
|
+
"version": "9.5.11",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "gcox@microsoft.com",
|
12
|
+
"package": "@fluentui/react-popover",
|
13
|
+
"commit": "ee977e20d359922798949a4f18af7a036ca36ca3",
|
14
|
+
"comment": "Update to use single hook selector"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "olfedias@microsoft.com",
|
18
|
+
"package": "@fluentui/react-popover",
|
19
|
+
"commit": "9d6394b6c751092fd1d4e26ccc618b5ba05086ec",
|
20
|
+
"comment": "chore: move makeStyles() calls to .styles.ts files"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "olfedias@microsoft.com",
|
24
|
+
"package": "@fluentui/react-popover",
|
25
|
+
"commit": "c28decb23d191a0daaaf6d5d1832429715102129",
|
26
|
+
"comment": "chore: exclude .swcrc from being published"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-popover",
|
31
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.3",
|
32
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-popover",
|
37
|
+
"comment": "Bump @fluentui/react-aria to v9.3.19",
|
38
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-popover",
|
43
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.19",
|
44
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"author": "beachball",
|
48
|
+
"package": "@fluentui/react-popover",
|
49
|
+
"comment": "Bump @fluentui/react-portal to v9.2.7",
|
50
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"author": "beachball",
|
54
|
+
"package": "@fluentui/react-popover",
|
55
|
+
"comment": "Bump @fluentui/react-positioning to v9.5.11",
|
56
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"author": "beachball",
|
60
|
+
"package": "@fluentui/react-popover",
|
61
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.4.0",
|
62
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"author": "beachball",
|
66
|
+
"package": "@fluentui/react-popover",
|
67
|
+
"comment": "Bump @fluentui/react-tabster to v9.7.0",
|
68
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"author": "beachball",
|
72
|
+
"package": "@fluentui/react-popover",
|
73
|
+
"comment": "Bump @fluentui/react-theme to v9.1.8",
|
74
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"author": "beachball",
|
78
|
+
"package": "@fluentui/react-popover",
|
79
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.1",
|
80
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"author": "beachball",
|
84
|
+
"package": "@fluentui/react-popover",
|
85
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.3",
|
86
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"author": "beachball",
|
90
|
+
"package": "@fluentui/react-popover",
|
91
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21",
|
92
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
93
|
+
}
|
94
|
+
],
|
95
|
+
"none": [
|
96
|
+
{
|
97
|
+
"author": "martinhochel@microsoft.com",
|
98
|
+
"package": "@fluentui/react-popover",
|
99
|
+
"commit": "dbda7fa69e3000aaf8dd4a061e254ebd35198b8e",
|
100
|
+
"comment": "fix: update npmignore files to fix npm8/node16 regression how npm publish works"
|
101
|
+
}
|
102
|
+
]
|
103
|
+
}
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"date": "Mon, 24 Apr 2023 08:12:39 GMT",
|
107
|
+
"tag": "@fluentui/react-popover_v9.5.10",
|
108
|
+
"version": "9.5.10",
|
109
|
+
"comments": {
|
110
|
+
"patch": [
|
111
|
+
{
|
112
|
+
"author": "bernardo.sunderhus@gmail.com",
|
113
|
+
"package": "@fluentui/react-popover",
|
114
|
+
"commit": "92f70e62b4c8256f81aae5d521477af851656f5d",
|
115
|
+
"comment": "bugfix: ensure legacyTrapFocus works properly"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"author": "bernardo.sunderhus@gmail.com",
|
119
|
+
"package": "@fluentui/react-popover",
|
120
|
+
"commit": "85c36e249b33b0bad79be4edd1a943dfc5233b11",
|
121
|
+
"comment": "bugfix: remove caret from react-jsx-runtime prerelease dependency"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"author": "beachball",
|
125
|
+
"package": "@fluentui/react-popover",
|
126
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
127
|
+
"commit": "505433ac64f144c9cca456097413d6af4582e5ee"
|
128
|
+
}
|
129
|
+
]
|
130
|
+
}
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"date": "Mon, 17 Apr 2023 17:53:52 GMT",
|
6
134
|
"tag": "@fluentui/react-popover_v9.5.9",
|
7
135
|
"version": "9.5.9",
|
8
136
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,45 @@
|
|
1
1
|
# Change Log - @fluentui/react-popover
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Fri, 12 May 2023 20:22:01 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.5.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.11)
|
8
|
+
|
9
|
+
Fri, 12 May 2023 20:22:01 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.10..@fluentui/react-popover_v9.5.11)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- Update to use single hook selector ([PR #27491](https://github.com/microsoft/fluentui/pull/27491) by gcox@microsoft.com)
|
15
|
+
- chore: move makeStyles() calls to .styles.ts files ([PR #27698](https://github.com/microsoft/fluentui/pull/27698) by olfedias@microsoft.com)
|
16
|
+
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
|
17
|
+
- Bump @fluentui/keyboard-keys to v9.0.3 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
18
|
+
- Bump @fluentui/react-aria to v9.3.19 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
19
|
+
- Bump @fluentui/react-context-selector to v9.1.19 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
20
|
+
- Bump @fluentui/react-portal to v9.2.7 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
21
|
+
- Bump @fluentui/react-positioning to v9.5.11 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
22
|
+
- Bump @fluentui/react-shared-contexts to v9.4.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
23
|
+
- Bump @fluentui/react-tabster to v9.7.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
24
|
+
- Bump @fluentui/react-theme to v9.1.8 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
25
|
+
- Bump @fluentui/react-utilities to v9.8.1 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
26
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.3 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
27
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
28
|
+
|
29
|
+
## [9.5.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.10)
|
30
|
+
|
31
|
+
Mon, 24 Apr 2023 08:12:39 GMT
|
32
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.9..@fluentui/react-popover_v9.5.10)
|
33
|
+
|
34
|
+
### Patches
|
35
|
+
|
36
|
+
- bugfix: ensure legacyTrapFocus works properly ([PR #27574](https://github.com/microsoft/fluentui/pull/27574) by bernardo.sunderhus@gmail.com)
|
37
|
+
- bugfix: remove caret from react-jsx-runtime prerelease dependency ([PR #27588](https://github.com/microsoft/fluentui/pull/27588) by bernardo.sunderhus@gmail.com)
|
38
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
|
39
|
+
|
7
40
|
## [9.5.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.9)
|
8
41
|
|
9
|
-
Mon, 17 Apr 2023 17:
|
42
|
+
Mon, 17 Apr 2023 17:53:52 GMT
|
10
43
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.8..@fluentui/react-popover_v9.5.9)
|
11
44
|
|
12
45
|
### Patches
|
@@ -105,10 +105,12 @@ export const usePopover_unstable = props => {
|
|
105
105
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
106
106
|
}
|
107
107
|
}, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);
|
108
|
-
var _props_inline;
|
108
|
+
var _props_inertTrapFocus, _props_inline;
|
109
109
|
return {
|
110
110
|
...initialState,
|
111
111
|
...positioningRefs,
|
112
|
+
// eslint-disable-next-line deprecation/deprecation
|
113
|
+
inertTrapFocus: (_props_inertTrapFocus = props.inertTrapFocus) !== null && _props_inertTrapFocus !== void 0 ? _props_inertTrapFocus : props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus,
|
112
114
|
popoverTrigger,
|
113
115
|
popoverSurface,
|
114
116
|
open,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"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","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inline","inline","state","onOpenChange","data","_state_onOpenChange","call","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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,QACb;AACP,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SACEC,cAAc,EACdC,2BAA2B,EAC3BC,gBAAgB,EAChBC,yBAAyB,QACpB;AACP,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,SAASC,0BAA0B,QAAQ;AAE3C;;;;;;;;AAQA,OAAO,MAAMC,mBAAA,GAAuBC,KAAA,IAAsC;EACxE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB,GAAGR,yBAAA;EAC1C,MAAMS,YAAA,GAAe;IACnBC,IAAA,EAAM;IACNH,aAAA;IACAC,gBAAA;IACA,GAAGF;EACL;EAEA,MAAMK,QAAA,GAAWrB,KAAA,CAAMsB,QAAQ,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E,kBAAA;EAErF,OAAO;IACLtB,UAAA;IACAC,UAAA;IACAgC;EACF;AACF"}
|
1
|
+
{"version":3,"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","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inertTrapFocus","_props_inline","inertTrapFocus","legacyTrapFocus","inline","state","onOpenChange","data","_state_onOpenChange","call","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 // eslint-disable-next-line deprecation/deprecation\n inertTrapFocus: props.inertTrapFocus ?? (props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus),\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,QACb;AACP,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SACEC,cAAc,EACdC,2BAA2B,EAC3BC,gBAAgB,EAChBC,yBAAyB,QACpB;AACP,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,SAASC,0BAA0B,QAAQ;AAE3C;;;;;;;;AAQA,OAAO,MAAMC,mBAAA,GAAuBC,KAAA,IAAsC;EACxE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB,GAAGR,yBAAA;EAC1C,MAAMS,YAAA,GAAe;IACnBC,IAAA,EAAM;IACNH,aAAA;IACAC,gBAAA;IACA,GAAGF;EACL;EAEA,MAAMK,QAAA,GAAWrB,KAAA,CAAMsB,QAAQ,CAACC,OAAO,CAACP,KAAA,CAAMK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Q,MAAM,EAAEhF,YAAY,CAACiE,KAAA,CAAM1D,IAAI,CAAC;EAClG;EAEA,MAAM;IAAE0E,SAAA,EAAWlC,UAAA;IAAYmC,YAAA,EAAclC,UAAA;IAAYmC;EAAQ,CAAE,GAAGzF,cAAA,CAAe8E,kBAAA;EAErF,OAAO;IACLzB,UAAA;IACAC,UAAA;IACAmC;EACF;AACF"}
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { usePopoverSurface_unstable } from './usePopoverSurface';
|
3
3
|
import { renderPopoverSurface_unstable } from './renderPopoverSurface';
|
4
|
-
import { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles';
|
5
|
-
import {
|
4
|
+
import { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles.styles';
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* PopoverSurface component renders react children in a positioned box
|
8
8
|
*/
|
9
9
|
export const PopoverSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
10
|
const state = usePopoverSurface_unstable(props, ref);
|
11
11
|
usePopoverSurfaceStyles_unstable(state);
|
12
|
-
|
13
|
-
usePopoverSurfaceStyles_unstable: useCustomStyles
|
14
|
-
} = useCustomStyleHooks_unstable();
|
15
|
-
useCustomStyles(state);
|
12
|
+
useCustomStyleHook_unstable('usePopoverSurfaceStyles_unstable')(state);
|
16
13
|
return renderPopoverSurface_unstable(state);
|
17
14
|
});
|
18
15
|
PopoverSurface.displayName = 'PopoverSurface';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","
|
1
|
+
{"version":3,"names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","useCustomStyleHook_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.styles';\nimport type { PopoverSurfaceProps } from './PopoverSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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\n useCustomStyleHook_unstable('usePopoverSurfaceStyles_unstable')(state);\n\n return renderPopoverSurface_unstable(state);\n});\n\nPopoverSurface.displayName = 'PopoverSurface';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,gCAAgC,QAAQ;AAGjD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,cAAA,gBAA2DL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvG,MAAMC,KAAA,GAAQR,0BAAA,CAA2BM,KAAA,EAAOC,GAAA;EAEhDL,gCAAA,CAAiCM,KAAA;EAEjCL,2BAAA,CAA4B,oCAAoCK,KAAA;EAEhE,OAAOP,6BAAA,CAA8BO,KAAA;AACvC;AAEAJ,cAAA,CAAeK,WAAW,GAAG"}
|
@@ -2,5 +2,5 @@ export * from './PopoverSurface';
|
|
2
2
|
export * from './PopoverSurface.types';
|
3
3
|
export * from './renderPopoverSurface';
|
4
4
|
export * from './usePopoverSurface';
|
5
|
-
export * from './usePopoverSurfaceStyles';
|
5
|
+
export * from './usePopoverSurfaceStyles.styles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"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"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/PopoverSurface/index.ts"],"sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
@@ -113,4 +113,4 @@ export const usePopoverSurfaceStyles_unstable = state => {
|
|
113
113
|
state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
|
114
114
|
return state;
|
115
115
|
};
|
116
|
-
//# sourceMappingURL=usePopoverSurfaceStyles.js.map
|
116
|
+
//# sourceMappingURL=usePopoverSurfaceStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["shorthands","__styles","mergeClasses","createArrowHeightStyles","createArrowStyles","tokens","typographyStyles","popoverSurfaceClassNames","root","arrowHeights","small","medium","large","useStyles","sj55zd","De3pzq","E5pizo","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","inverted","brand","smallPadding","z8tnut","z189sj","Byoj8tv","uwmqm3","mediumPadding","largePadding","smallArrow","a9b677","Bqenvij","mediumLargeArrow","arrow","qhf8xq","Bcdw1i0","Bj3rh1h","Ftih45","B1puzpu","Brfgrao","Bcvre1j","Ccq8qp","Baz25je","cmx5o7","B4f6apu","m598lv","Bk5zm6e","y0oebl","qa3bma","Bqjgrrk","Budzafs","Hv9wc6","hl6cv3","Bh2vraf","yayu3t","wedwtw","rhl9o9","Bu8t5uz","B6q6orb","Bwwlvwl","d","usePopoverSurfaceStyles_unstable","state","styles","className","size","appearance","arrowClassName"],"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.styles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { PopoverSize } from '../Popover/Popover.types';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots> = {\n root: 'fui-PopoverSurface',\n};\n\nexport const arrowHeights: Record<PopoverSize, number> = {\n small: 6,\n medium: 8,\n large: 8,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...typographyStyles.body1,\n },\n\n inverted: {\n backgroundColor: tokens.colorNeutralBackgroundStatic,\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n smallPadding: {\n ...shorthands.padding('12px'),\n },\n\n mediumPadding: {\n ...shorthands.padding('16px'),\n },\n\n largePadding: {\n ...shorthands.padding('20px'),\n },\n\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({ arrowHeight: undefined }),\n});\n\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = (state: PopoverSurfaceState): PopoverSurfaceState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n popoverSurfaceClassNames.root,\n styles.root,\n state.size === 'small' && styles.smallPadding,\n state.size === 'medium' && styles.mediumPadding,\n state.size === 'large' && styles.largePadding,\n state.appearance === 'inverted' && styles.inverted,\n state.appearance === 'brand' && styles.brand,\n state.root.className,\n );\n\n state.arrowClassName = mergeClasses(\n styles.arrow,\n state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ;AACrD,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ;AAC3D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAKzC,OAAO,MAAMC,wBAAA,GAAgE;EAC3EC,IAAA,EAAM;AACR;AAEA,OAAO,MAAMC,YAAA,GAA4C;EACvDC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,KAAA,EAAO;AACT;AAEA;;;AAGA,MAAMC,SAAA,gBAAYZ,QAAA;EAAAO,IAAA;IAAAM,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAtB,MAAA;IAAAD,MAAA;EAAA;EAAAwB,KAAA;IAAAvB,MAAA;IAAAD,MAAA;EAAA;EAAAyB,YAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,aAAA;IAAAJ,MAAA;I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,CAAO9B,KAAK,EACZ6B,KAAA,CAAMG,IAAI,KAAK,UAAUF,MAAA,CAAOlC,UAAU,GAAGkC,MAAA,CAAO/B,gBAAgB;EAGtE,OAAO8B,KAAA;AACT"}
|
@@ -116,10 +116,12 @@ const usePopover_unstable = (props)=>{
|
|
116
116
|
positioningRefs.contentRef,
|
117
117
|
props.unstable_disableAutoFocus
|
118
118
|
]);
|
119
|
-
var _props_inline;
|
119
|
+
var _props_inertTrapFocus, _props_inline;
|
120
120
|
return {
|
121
121
|
...initialState,
|
122
122
|
...positioningRefs,
|
123
|
+
// eslint-disable-next-line deprecation/deprecation
|
124
|
+
inertTrapFocus: (_props_inertTrapFocus = props.inertTrapFocus) !== null && _props_inertTrapFocus !== void 0 ? _props_inertTrapFocus : props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus,
|
123
125
|
popoverTrigger,
|
124
126
|
popoverSurface,
|
125
127
|
open,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Popover/usePopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { usePositioning, resolvePositioningShorthand, mergeArrowOffset, usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport { popoverSurfaceBorderRadius } from './constants';\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 => {\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props\n };\n const children = React.Children.toArray(props.children);\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 if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at most two children');\n }\n }\n let popoverTrigger = undefined;\n let popoverSurface = 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 const [open, setOpenState] = useOpenState(initialState);\n const setOpenTimeoutRef = React.useRef(0);\n const setOpen = useEventCallback((e, shouldOpen) => {\n clearTimeout(setOpenTimeoutRef.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave') {\n var _props_mouseLeaveDelay;\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 = props.mouseLeaveDelay) !== null && _props_mouseLeaveDelay !== void 0 ? _props_mouseLeaveDelay : 500);\n } else {\n setOpenState(e, shouldOpen);\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 const toggleOpen = React.useCallback(e => {\n setOpen(e, !open);\n }, [setOpen, open]);\n const positioningRefs = usePopoverRefs(initialState);\n const {\n targetDocument\n } = 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 // 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 const {\n findFirstFocusable\n } = useFocusFinders();\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n if (open && positioningRefs.contentRef.current) {\n var _positioningRefs_contentRef_current_getAttribute;\n const containerTabIndex = (_positioningRefs_contentRef_current_getAttribute = positioningRefs.contentRef.current.getAttribute('tabIndex')) !== null && _positioningRefs_contentRef_current_getAttribute !== void 0 ? _positioningRefs_contentRef_current_getAttribute : undefined;\n const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }\n }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n var _props_inline;\n return {\n ...initialState,\n ...positioningRefs,\n popoverTrigger,\n popoverSurface,\n open,\n setOpen,\n toggleOpen,\n setContextTarget,\n contextTarget,\n inline: (_props_inline = props.inline) !== null && _props_inline !== void 0 ? _props_inline : false\n };\n};\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(state) {\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, 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 const setOpen = React.useCallback((e, shouldOpen) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e);\n }\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n setOpenState(shouldOpen);\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {\n open: shouldOpen\n });\n }, [setOpenState, onOpenChange, setContextTarget]);\n return [open, setOpen];\n}\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(state) {\n const positioningOptions = {\n position: 'above',\n align: 'center',\n arrowPadding: 2 * popoverSurfaceBorderRadius,\n target: state.openOnContext ? state.contextTarget : undefined,\n ...resolvePositioningShorthand(state.positioning)\n };\n // no reason to render arrow when covering the target\n if (positioningOptions.coverTarget) {\n state.withArrow = false;\n }\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n }\n const {\n targetRef: triggerRef,\n containerRef: contentRef,\n arrowRef\n } = usePositioning(positioningOptions);\n return {\n triggerRef,\n contentRef,\n arrowRef\n };\n}\n//# sourceMappingURL=usePopover.js.map"],"names":["usePopover_unstable","props","contextTarget","setContextTarget","usePositioningMouseTarget","initialState","size","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","useEventCallback","e","shouldOpen","clearTimeout","current","Event","persist","type","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","useFluent","useOnClickOutside","contains","elementContains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","useOnScrollOutside","findFirstFocusable","useFocusFinders","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inline","inline","state","onOpenChange","data","_state_onOpenChange","call","useControllableState","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","popoverSurfaceBorderRadius","target","resolvePositioningShorthand","positioning","coverTarget","withArrow","offset","mergeArrowOffset","arrowHeights","targetRef","containerRef","arrowRef","usePositioning"],"mappings":";;;;+BAgBaA;;aAAAA;;;6DAhBU;gCACuE;qCAC9C;kCACyD;6BACzE;8BACA;uBACH;2BACc;AASpC,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,eAAe;QACnBC,MAAM;QACNJ;QACAC;QACA,GAAGF,KAAK;IACV;IACA,MAAMM,WAAWC,OAAMC,QAA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1EP,MAAMQ;QACR,EAAE;IACJ,GAAG;QAACP;QAAcgD;QAAclE;KAAiB;IACjD,OAAO;QAACiB;QAAMK;KAAQ;AACxB;AACA;;CAEC,GACD,SAASgB,eAAe2B,KAAK,EAAE;IAC7B,MAAMQ,qBAAqB;QACzBC,UAAU;QACVC,OAAO;QACPC,cAAc,IAAIC,qCAA0B;QAC5CC,QAAQb,MAAMb,aAAa,GAAGa,MAAMlE,aAAa,GAAGgB,SAAS;QAC7D,GAAGgE,IAAAA,6CAA2B,EAACd,MAAMe,WAAW,CAAC;IACnD;IACA,qDAAqD;IACrD,IAAIP,mBAAmBQ,WAAW,EAAE;QAClChB,MAAMiB,SAAS,GAAG,KAAK;IACzB,CAAC;IACD,IAAIjB,MAAMiB,SAAS,EAAE;QACnBT,mBAAmBU,MAAM,GAAGC,IAAAA,kCAAgB,EAACX,mBAAmBU,MAAM,EAAEE,mBAAY,CAACpB,MAAM9D,IAAI,CAAC;IAClG,CAAC;IACD,MAAM,EACJmF,WAAWtC,WAAU,EACrBuC,cAActC,WAAU,EACxBuC,SAAQ,EACT,GAAGC,IAAAA,gCAAc,EAAChB;IACnB,OAAO;QACLzB;QACAC;QACAuC;IACF;AACF,EACA,sCAAsC"}
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/usePopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { usePositioning, resolvePositioningShorthand, mergeArrowOffset, usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport { popoverSurfaceBorderRadius } from './constants';\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 => {\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props\n };\n const children = React.Children.toArray(props.children);\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 if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at most two children');\n }\n }\n let popoverTrigger = undefined;\n let popoverSurface = 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 const [open, setOpenState] = useOpenState(initialState);\n const setOpenTimeoutRef = React.useRef(0);\n const setOpen = useEventCallback((e, shouldOpen) => {\n clearTimeout(setOpenTimeoutRef.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave') {\n var _props_mouseLeaveDelay;\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 = props.mouseLeaveDelay) !== null && _props_mouseLeaveDelay !== void 0 ? _props_mouseLeaveDelay : 500);\n } else {\n setOpenState(e, shouldOpen);\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 const toggleOpen = React.useCallback(e => {\n setOpen(e, !open);\n }, [setOpen, open]);\n const positioningRefs = usePopoverRefs(initialState);\n const {\n targetDocument\n } = 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 // 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 const {\n findFirstFocusable\n } = useFocusFinders();\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n if (open && positioningRefs.contentRef.current) {\n var _positioningRefs_contentRef_current_getAttribute;\n const containerTabIndex = (_positioningRefs_contentRef_current_getAttribute = positioningRefs.contentRef.current.getAttribute('tabIndex')) !== null && _positioningRefs_contentRef_current_getAttribute !== void 0 ? _positioningRefs_contentRef_current_getAttribute : undefined;\n const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }\n }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n var _props_inertTrapFocus, _props_inline;\n return {\n ...initialState,\n ...positioningRefs,\n // eslint-disable-next-line deprecation/deprecation\n inertTrapFocus: (_props_inertTrapFocus = props.inertTrapFocus) !== null && _props_inertTrapFocus !== void 0 ? _props_inertTrapFocus : props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus,\n popoverTrigger,\n popoverSurface,\n open,\n setOpen,\n toggleOpen,\n setContextTarget,\n contextTarget,\n inline: (_props_inline = props.inline) !== null && _props_inline !== void 0 ? _props_inline : false\n };\n};\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(state) {\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, 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 const setOpen = React.useCallback((e, shouldOpen) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e);\n }\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n setOpenState(shouldOpen);\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {\n open: shouldOpen\n });\n }, [setOpenState, onOpenChange, setContextTarget]);\n return [open, setOpen];\n}\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(state) {\n const positioningOptions = {\n position: 'above',\n align: 'center',\n arrowPadding: 2 * popoverSurfaceBorderRadius,\n target: state.openOnContext ? state.contextTarget : undefined,\n ...resolvePositioningShorthand(state.positioning)\n };\n // no reason to render arrow when covering the target\n if (positioningOptions.coverTarget) {\n state.withArrow = false;\n }\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n }\n const {\n targetRef: triggerRef,\n containerRef: contentRef,\n arrowRef\n } = usePositioning(positioningOptions);\n return {\n triggerRef,\n contentRef,\n arrowRef\n };\n}\n//# sourceMappingURL=usePopover.js.map"],"names":["usePopover_unstable","props","contextTarget","setContextTarget","usePositioningMouseTarget","initialState","size","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","useEventCallback","e","shouldOpen","clearTimeout","current","Event","persist","type","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","useFluent","useOnClickOutside","contains","elementContains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","useOnScrollOutside","findFirstFocusable","useFocusFinders","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inertTrapFocus","_props_inline","inertTrapFocus","legacyTrapFocus","inline","state","onOpenChange","data","_state_onOpenChange","call","useControllableState","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","popoverSurfaceBorderRadius","target","resolvePositioningShorthand","positioning","coverTarget","withArrow","offset","mergeArrowOffset","arrowHeights","targetRef","containerRef","arrowRef","usePositioning"],"mappings":";;;;+BAgBaA;;aAAAA;;;6DAhBU;gCACuE;qCAC9C;kCACyD;6BACzE;8BACA;uBACH;2BACc;AASpC,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,eAAe;QACnBC,MAAM;QACNJ;QACAC;QACA,GAAGF,KAAK;IACV;IACA,MAAMM,WAAWC,OAAMC,QAAQ,CAACC,OAAO,CAACT,MAAMM,QAAQ;IACtD,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,SAASO,MAAM,KAAK,GAAG;YACzB,sCAAsC;YACtCC,QAAQC,IAAI,CAAC;QACf,CAAC;QACD,IAAIT,SAASO,MAAM,GAAG,GAAG;YACvB,sCAAsC;YACtCC,QAAQC,IAAI,CAAC;QACf,CAAC;IACH,CAAC;IACD,IAAIC,iBAAiBC;IACrB,IAAIC,iBAAiBD;IACrB,IAAIX,SAASO,MAAM,KAAK,GAAG;QACzBG,iBAAiBV,QAAQ,CAAC,EAAE;QAC5BY,iBAAiBZ,QAAQ,CAAC,EAAE;IAC9B,OAAO,IAAIA,SAASO,MAAM,KAAK,GAAG;QAChCK,iBAAiBZ,QAAQ,CAAC,EAAE;IAC9B,CAAC;IACD,MAAM,CAACa,MAAMC,aAAa,GAAGC,aAAajB;IAC1C,MAAMkB,oBAAoBf,OAAMgB,MAAM,CAAC;IACvC,MAAMC,UAAUC,IAAAA,gCAAgB,EAAC,CAACC,GAAGC,aAAe;QAClDC,aAAaN,kBAAkBO,OAAO;QACtC,IAAI,CAAEH,CAAAA,aAAaI,KAAI,KAAMJ,EAAEK,OAAO,EAAE;YACtC,gDAAgD;YAChDL,EAAEK,OAAO;QACX,CAAC;QACD,IAAIL,EAAEM,IAAI,KAAK,cAAc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,WAAU,EACxB0C,SAAQ,EACT,GAAGC,IAAAA,gCAAc,EAAChB;IACnB,OAAO;QACL5B;QACAC;QACA0C;IACF;AACF,EACA,sCAAsC"}
|
@@ -10,13 +10,12 @@ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildc
|
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
11
|
const _usePopoverSurface = require("./usePopoverSurface");
|
12
12
|
const _renderPopoverSurface = require("./renderPopoverSurface");
|
13
|
-
const
|
13
|
+
const _usePopoverSurfaceStylesStyles = require("./usePopoverSurfaceStyles.styles");
|
14
14
|
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
15
15
|
const PopoverSurface = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
16
16
|
const state = (0, _usePopoverSurface.usePopoverSurface_unstable)(props, ref);
|
17
|
-
(0,
|
18
|
-
|
19
|
-
useCustomStyles(state);
|
17
|
+
(0, _usePopoverSurfaceStylesStyles.usePopoverSurfaceStyles_unstable)(state);
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('usePopoverSurfaceStyles_unstable')(state);
|
20
19
|
return (0, _renderPopoverSurface.renderPopoverSurface_unstable)(state);
|
21
20
|
});
|
22
21
|
PopoverSurface.displayName = 'PopoverSurface'; //# sourceMappingURL=PopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/PopoverSurface/PopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { usePopoverSurface_unstable } from './usePopoverSurface';\nimport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nimport { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles';\nimport {
|
1
|
+
{"version":3,"sources":["../../../lib/components/PopoverSurface/PopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { usePopoverSurface_unstable } from './usePopoverSurface';\nimport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nimport { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * PopoverSurface component renders react children in a positioned box\n */\nexport const PopoverSurface = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = usePopoverSurface_unstable(props, ref);\n usePopoverSurfaceStyles_unstable(state);\n useCustomStyleHook_unstable('usePopoverSurfaceStyles_unstable')(state);\n return renderPopoverSurface_unstable(state);\n});\nPopoverSurface.displayName = 'PopoverSurface';\n//# sourceMappingURL=PopoverSurface.js.map"],"names":["PopoverSurface","React","forwardRef","props","ref","state","usePopoverSurface_unstable","usePopoverSurfaceStyles_unstable","useCustomStyleHook_unstable","renderPopoverSurface_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;mCACoB;sCACG;+CACG;qCACL;AAIrC,MAAMA,iBAAiB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC1E,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,+DAAgC,EAACF;IACjCG,IAAAA,gDAA2B,EAAC,oCAAoCH;IAChE,OAAOI,IAAAA,mDAA6B,EAACJ;AACvC;AACAL,eAAeU,WAAW,GAAG,kBAC7B,0CAA0C"}
|
@@ -7,7 +7,7 @@ _exportStar(require("./PopoverSurface"), exports);
|
|
7
7
|
_exportStar(require("./PopoverSurface.types"), exports);
|
8
8
|
_exportStar(require("./renderPopoverSurface"), exports);
|
9
9
|
_exportStar(require("./usePopoverSurface"), exports);
|
10
|
-
_exportStar(require("./usePopoverSurfaceStyles"), exports);
|
10
|
+
_exportStar(require("./usePopoverSurfaceStyles.styles"), exports);
|
11
11
|
//# sourceMappingURL=index.js.map
|
12
12
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/PopoverSurface/index.js"],"sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
1
|
+
{"version":3,"sources":["../../../lib/components/PopoverSurface/index.js"],"sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles.styles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
@@ -248,6 +248,6 @@ const usePopoverSurfaceStyles_unstable = (state)=>{
|
|
248
248
|
state.root.className = (0, _react.mergeClasses)(popoverSurfaceClassNames.root, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
|
249
249
|
state.arrowClassName = (0, _react.mergeClasses)(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
|
250
250
|
return state;
|
251
|
-
}; //# sourceMappingURL=usePopoverSurfaceStyles.js.map
|
251
|
+
}; //# sourceMappingURL=usePopoverSurfaceStyles.styles.js.map
|
252
252
|
|
253
|
-
//# sourceMappingURL=usePopoverSurfaceStyles.js.map
|
253
|
+
//# sourceMappingURL=usePopoverSurfaceStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.js"],"sourcesContent":["import { shorthands, __styles, mergeClasses } from '@griffel/react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const popoverSurfaceClassNames = {\n root: 'fui-PopoverSurface'\n};\nexport const arrowHeights = {\n small: 6,\n medium: 8,\n large: 8\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f19n0e5\",\n De3pzq: \"fxugw4r\",\n E5pizo: \"f1hg901r\",\n Bbmb7ep: [\"f1aa9q02\", \"f16jpd5f\"],\n Beyfa6y: [\"f16jpd5f\", \"f1aa9q02\"],\n B7oj6ja: [\"f1jar5jt\", \"fyu767a\"],\n Btl43ni: [\"fyu767a\", \"f1jar5jt\"],\n B4j52fo: \"f5ogflp\",\n Bekrc4i: [\"f1hqa2wf\", \"finvdd3\"],\n Bn0qgzm: \"f1f09k3d\",\n ibv6hh: [\"finvdd3\", \"f1hqa2wf\"],\n icvyot: \"fzkkow9\",\n vrafjx: [\"fcdblym\", \"fjik90z\"],\n oivjwe: \"fg706s2\",\n wvpqe5: [\"fjik90z\", \"fcdblym\"],\n g2u3we: \"fghlq4f\",\n h3c5rm: [\"f1gn591s\", \"fjscplz\"],\n B9xav0g: \"fb073pr\",\n zhjwy3: [\"fjscplz\", \"f1gn591s\"],\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n },\n inverted: {\n De3pzq: \"fg3r6xk\",\n sj55zd: \"fonrgv7\"\n },\n brand: {\n De3pzq: \"ffp7eso\",\n sj55zd: \"f1phragk\"\n },\n smallPadding: {\n z8tnut: \"f1kcqot9\",\n z189sj: [\"f11qrl6u\", \"fjlbh76\"],\n Byoj8tv: \"fpe6lb7\",\n uwmqm3: [\"fjlbh76\", \"f11qrl6u\"]\n },\n mediumPadding: {\n z8tnut: \"fqag9an\",\n z189sj: [\"f1gbmcue\", \"f1rh9g5y\"],\n Byoj8tv: \"fp67ikv\",\n uwmqm3: [\"f1rh9g5y\", \"f1gbmcue\"]\n },\n largePadding: {\n z8tnut: \"fc7z3ec\",\n z189sj: [\"fat0sn4\", \"fekwl8i\"],\n Byoj8tv: \"fe2my4m\",\n uwmqm3: [\"fekwl8i\", \"fat0sn4\"]\n },\n smallArrow: {\n a9b677: \"f1ekdpwm\",\n Bqenvij: \"f83vc9z\"\n },\n mediumLargeArrow: {\n a9b677: \"f1kmc0fn\",\n Bqenvij: \"fb6lvc5\"\n },\n arrow: {\n qhf8xq: \"f1euv43f\",\n De3pzq: \"f1u2r49w\",\n Bcdw1i0: \"fd7fpy0\",\n Bj3rh1h: \"f1bsuimh\",\n Ftih45: \"f1wl9k8s\",\n B1puzpu: \"f1wkw4r9\",\n Brfgrao: \"f1j7ml58\",\n Bcvre1j: \"fyl8oag\",\n Ccq8qp: \"frdoeuz\",\n Baz25je: \"fb81m9q\",\n cmx5o7: \"f1ljr5q2\",\n B4f6apu: \"fyfemzf\",\n m598lv: \"focyt6c\",\n Bk5zm6e: \"fnhxbxj\",\n y0oebl: \"fdw6hkg\",\n qa3bma: \"f11yjt3y\",\n Bqjgrrk: \"f1172wan\",\n Budzafs: [\"f9e5op9\", \"f112wvtl\"],\n Hv9wc6: [\"ftj5xct\", \"fyavhwi\"],\n hl6cv3: \"f1773hnp\",\n Bh2vraf: \"f1n8855c\",\n yayu3t: \"f1v7783n\",\n wedwtw: \"fsw6im5\",\n rhl9o9: \"fh2hsk5\",\n Bu8t5uz: \"f159pzir\",\n B6q6orb: \"f11yvu4\",\n Bwwlvwl: \"fm1ycve\"\n }\n}, {\n d: [\".f19n0e5{color:var(--colorNeutralForeground1);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f1hg901r{box-shadow:var(--shadow16);}\", \".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}\", \".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}\", \".f5ogflp{border-top-width:1px;}\", \".f1hqa2wf{border-right-width:1px;}\", \".finvdd3{border-left-width:1px;}\", \".f1f09k3d{border-bottom-width:1px;}\", \".fzkkow9{border-top-style:solid;}\", \".fcdblym{border-right-style:solid;}\", \".fjik90z{border-left-style:solid;}\", \".fg706s2{border-bottom-style:solid;}\", \".fghlq4f{border-top-color:var(--colorTransparentStroke);}\", \".f1gn591s{border-right-color:var(--colorTransparentStroke);}\", \".fjscplz{border-left-color:var(--colorTransparentStroke);}\", \".fb073pr{border-bottom-color:var(--colorTransparentStroke);}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\", \".fg3r6xk{background-color:var(--colorNeutralBackgroundStatic);}\", \".fonrgv7{color:var(--colorNeutralForegroundStaticInverted);}\", \".ffp7eso{background-color:var(--colorBrandBackground);}\", \".f1phragk{color:var(--colorNeutralForegroundOnBrand);}\", \".f1kcqot9{padding-top:12px;}\", \".f11qrl6u{padding-right:12px;}\", \".fjlbh76{padding-left:12px;}\", \".fpe6lb7{padding-bottom:12px;}\", \".fqag9an{padding-top:16px;}\", \".f1gbmcue{padding-right:16px;}\", \".f1rh9g5y{padding-left:16px;}\", \".fp67ikv{padding-bottom:16px;}\", \".fc7z3ec{padding-top:20px;}\", \".fat0sn4{padding-right:20px;}\", \".fekwl8i{padding-left:20px;}\", \".fe2my4m{padding-bottom:20px;}\", \".f1ekdpwm{width:8.484px;}\", \".f83vc9z{height:8.484px;}\", \".f1kmc0fn{width:11.312px;}\", \".fb6lvc5{height:11.312px;}\", \".f1euv43f{position:absolute;}\", \".f1u2r49w{background-color:inherit;}\", \".fd7fpy0{visibility:hidden;}\", \".f1bsuimh{z-index:-1;}\", \".f1wl9k8s::before{content:\\\"\\\";}\", \".f1wkw4r9::before{visibility:visible;}\", \".f1j7ml58::before{position:absolute;}\", \".fyl8oag::before{box-sizing:border-box;}\", \".frdoeuz::before{width:inherit;}\", \".fb81m9q::before{height:inherit;}\", \".f1ljr5q2::before{background-color:inherit;}\", \".fyfemzf::before{border-right-width:1px;}\", \".focyt6c::before{border-right-style:solid;}\", \".fnhxbxj::before{border-right-color:var(--colorTransparentStroke);}\", \".fdw6hkg::before{border-bottom-width:1px;}\", \".f11yjt3y::before{border-bottom-style:solid;}\", \".f1172wan::before{border-bottom-color:var(--colorTransparentStroke);}\", \".f9e5op9::before{border-bottom-right-radius:var(--borderRadiusSmall);}\", \".f112wvtl::before{border-bottom-left-radius:var(--borderRadiusSmall);}\", \".ftj5xct::before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}\", \".fyavhwi::before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);}\", \"[data-popper-placement^=\\\"top\\\"] .f1773hnp{bottom:-1px;}\", \"[data-popper-placement^=\\\"top\\\"] .f1n8855c{--angle:0;}\", \"[data-popper-placement^=\\\"right\\\"] .f1v7783n{left:-1px;}\", \"[data-popper-placement^=\\\"right\\\"] .fsw6im5{--angle:90deg;}\", \"[data-popper-placement^=\\\"bottom\\\"] .fh2hsk5{top:-1px;}\", \"[data-popper-placement^=\\\"bottom\\\"] .f159pzir{--angle:180deg;}\", \"[data-popper-placement^=\\\"left\\\"] .f11yvu4{right:-1px;}\", \"[data-popper-placement^=\\\"left\\\"] .fm1ycve{--angle:270deg;}\"]\n});\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(popoverSurfaceClassNames.root, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);\n state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);\n return state;\n};\n//# sourceMappingURL=usePopoverSurfaceStyles.styles.js.map"],"names":["popoverSurfaceClassNames","arrowHeights","usePopoverSurfaceStyles_unstable","root","small","medium","large","useStyles","__styles","sj55zd","De3pzq","E5pizo","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","inverted","brand","smallPadding","z8tnut","z189sj","Byoj8tv","uwmqm3","mediumPadding","largePadding","smallArrow","a9b677","Bqenvij","mediumLargeArrow","arrow","qhf8xq","Bcdw1i0","Bj3rh1h","Ftih45","B1puzpu","Brfgrao","Bcvre1j","Ccq8qp","Baz25je","cmx5o7","B4f6apu","m598lv","Bk5zm6e","y0oebl","qa3bma","Bqjgrrk","Budzafs","Hv9wc6","hl6cv3","Bh2vraf","yayu3t","wedwtw","rhl9o9","Bu8t5uz","B6q6orb","Bwwlvwl","d","state","styles","className","mergeClasses","size","appearance","arrowClassName"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IAGAC,YAAY,MAAZA;IAuGAC,gCAAgC,MAAhCA;;uBA7GsC;AAG5C,MAAMF,2BAA2B;IACtCG,MAAM;AACR;AACO,MAAMF,eAAe;IAC1BG,OAAO;IACPC,QAAQ;IACRC,OAAO;AACT;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCL,MAAM;QACJM,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,SAAS;YAAC;YAAY;SAAW;QACjCC,SAAS;YAAC;YAAY;SAAW;QACjCC,SAAS;YAAC;YAAY;SAAU;QAChCC,SAAS;YAAC;YAAW;SAAW;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2
2
|
"name": "@fluentui/react-popover",
|
3
|
-
"version": "9.5.
|
3
|
+
"version": "9.5.11",
|
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": "9.0.0-beta.
|
32
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.21",
|
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": "^9.0.
|
39
|
-
"@fluentui/react-aria": "^9.3.
|
40
|
-
"@fluentui/react-context-selector": "^9.1.
|
41
|
-
"@fluentui/react-portal": "^9.2.
|
42
|
-
"@fluentui/react-positioning": "^9.5.
|
43
|
-
"@fluentui/react-shared-contexts": "^9.
|
44
|
-
"@fluentui/react-tabster": "^9.
|
45
|
-
"@fluentui/react-theme": "^9.1.
|
46
|
-
"@fluentui/react-utilities": "^9.8.
|
47
|
-
"@fluentui/react-jsx-runtime": "
|
38
|
+
"@fluentui/keyboard-keys": "^9.0.3",
|
39
|
+
"@fluentui/react-aria": "^9.3.19",
|
40
|
+
"@fluentui/react-context-selector": "^9.1.19",
|
41
|
+
"@fluentui/react-portal": "^9.2.7",
|
42
|
+
"@fluentui/react-positioning": "^9.5.11",
|
43
|
+
"@fluentui/react-shared-contexts": "^9.4.0",
|
44
|
+
"@fluentui/react-tabster": "^9.7.0",
|
45
|
+
"@fluentui/react-theme": "^9.1.8",
|
46
|
+
"@fluentui/react-utilities": "^9.8.1",
|
47
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.3",
|
48
48
|
"@griffel/react": "^1.5.2",
|
49
49
|
"@swc/helpers": "^0.4.14"
|
50
50
|
},
|
package/.swcrc
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/swcrc",
|
3
|
-
"exclude": [
|
4
|
-
"/testing",
|
5
|
-
"/**/*.cy.ts",
|
6
|
-
"/**/*.cy.tsx",
|
7
|
-
"/**/*.spec.ts",
|
8
|
-
"/**/*.spec.tsx",
|
9
|
-
"/**/*.test.ts",
|
10
|
-
"/**/*.test.tsx"
|
11
|
-
],
|
12
|
-
"jsc": {
|
13
|
-
"parser": {
|
14
|
-
"syntax": "typescript",
|
15
|
-
"tsx": true,
|
16
|
-
"decorators": false,
|
17
|
-
"dynamicImport": false
|
18
|
-
},
|
19
|
-
"externalHelpers": true,
|
20
|
-
"transform": {
|
21
|
-
"react": {
|
22
|
-
"runtime": "classic",
|
23
|
-
"useSpread": true
|
24
|
-
}
|
25
|
-
},
|
26
|
-
"target": "es2019"
|
27
|
-
},
|
28
|
-
"minify": false,
|
29
|
-
"sourceMaps": true
|
30
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["shorthands","__styles","mergeClasses","createArrowHeightStyles","createArrowStyles","tokens","typographyStyles","popoverSurfaceClassNames","root","arrowHeights","small","medium","large","useStyles","sj55zd","De3pzq","E5pizo","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","inverted","brand","smallPadding","z8tnut","z189sj","Byoj8tv","uwmqm3","mediumPadding","largePadding","smallArrow","a9b677","Bqenvij","mediumLargeArrow","arrow","qhf8xq","Bcdw1i0","Bj3rh1h","Ftih45","B1puzpu","Brfgrao","Bcvre1j","Ccq8qp","Baz25je","cmx5o7","B4f6apu","m598lv","Bk5zm6e","y0oebl","qa3bma","Bqjgrrk","Budzafs","Hv9wc6","hl6cv3","Bh2vraf","yayu3t","wedwtw","rhl9o9","Bu8t5uz","B6q6orb","Bwwlvwl","d","usePopoverSurfaceStyles_unstable","state","styles","className","size","appearance","arrowClassName"],"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { PopoverSize } from '../Popover/Popover.types';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots> = {\n root: 'fui-PopoverSurface',\n};\n\nexport const arrowHeights: Record<PopoverSize, number> = {\n small: 6,\n medium: 8,\n large: 8,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...typographyStyles.body1,\n },\n\n inverted: {\n backgroundColor: tokens.colorNeutralBackgroundStatic,\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n smallPadding: {\n ...shorthands.padding('12px'),\n },\n\n mediumPadding: {\n ...shorthands.padding('16px'),\n },\n\n largePadding: {\n ...shorthands.padding('20px'),\n },\n\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({ arrowHeight: undefined }),\n});\n\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = (state: PopoverSurfaceState): PopoverSurfaceState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n popoverSurfaceClassNames.root,\n styles.root,\n state.size === 'small' && styles.smallPadding,\n state.size === 'medium' && styles.mediumPadding,\n state.size === 'large' && styles.largePadding,\n state.appearance === 'inverted' && styles.inverted,\n state.appearance === 'brand' && styles.brand,\n state.root.className,\n );\n\n state.arrowClassName = mergeClasses(\n styles.arrow,\n state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ;AACrD,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ;AAC3D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAKzC,OAAO,MAAMC,wBAAA,GAAgE;EAC3EC,IAAA,EAAM;AACR;AAEA,OAAO,MAAMC,YAAA,GAA4C;EACvDC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,KAAA,EAAO;AACT;AAEA;;;AAGA,MAAMC,SAAA,gBAAYZ,QAAA;EAAAO,IAAA;IAAAM,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAtB,MAAA;IAAAD,MAAA;EAAA;EAAAwB,KAAA;IAAAvB,MAAA;IAAAD,MAAA;EAAA;EAAAyB,YAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,aAAA;IAAAJ,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAE,YAAA;IAAAL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AAOlC,UAAU,GAAGkC,MAAA,CAAO/B,gBAAgB;EAGtE,OAAO8B,KAAA;AACT"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/PopoverSurface/usePopoverSurfaceStyles.js"],"sourcesContent":["import { shorthands, __styles, mergeClasses } from '@griffel/react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const popoverSurfaceClassNames = {\n root: 'fui-PopoverSurface'\n};\nexport const arrowHeights = {\n small: 6,\n medium: 8,\n large: 8\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f19n0e5\",\n De3pzq: \"fxugw4r\",\n E5pizo: \"f1hg901r\",\n Bbmb7ep: [\"f1aa9q02\", \"f16jpd5f\"],\n Beyfa6y: [\"f16jpd5f\", \"f1aa9q02\"],\n B7oj6ja: [\"f1jar5jt\", \"fyu767a\"],\n Btl43ni: [\"fyu767a\", \"f1jar5jt\"],\n B4j52fo: \"f5ogflp\",\n Bekrc4i: [\"f1hqa2wf\", \"finvdd3\"],\n Bn0qgzm: \"f1f09k3d\",\n ibv6hh: [\"finvdd3\", \"f1hqa2wf\"],\n icvyot: \"fzkkow9\",\n vrafjx: [\"fcdblym\", \"fjik90z\"],\n oivjwe: \"fg706s2\",\n wvpqe5: [\"fjik90z\", \"fcdblym\"],\n g2u3we: \"fghlq4f\",\n h3c5rm: [\"f1gn591s\", \"fjscplz\"],\n B9xav0g: \"fb073pr\",\n zhjwy3: [\"fjscplz\", \"f1gn591s\"],\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n },\n inverted: {\n De3pzq: \"fg3r6xk\",\n sj55zd: \"fonrgv7\"\n },\n brand: {\n De3pzq: \"ffp7eso\",\n sj55zd: \"f1phragk\"\n },\n smallPadding: {\n z8tnut: \"f1kcqot9\",\n z189sj: [\"f11qrl6u\", \"fjlbh76\"],\n Byoj8tv: \"fpe6lb7\",\n uwmqm3: [\"fjlbh76\", \"f11qrl6u\"]\n },\n mediumPadding: {\n z8tnut: \"fqag9an\",\n z189sj: [\"f1gbmcue\", \"f1rh9g5y\"],\n Byoj8tv: \"fp67ikv\",\n uwmqm3: [\"f1rh9g5y\", \"f1gbmcue\"]\n },\n largePadding: {\n z8tnut: \"fc7z3ec\",\n z189sj: [\"fat0sn4\", \"fekwl8i\"],\n Byoj8tv: \"fe2my4m\",\n uwmqm3: [\"fekwl8i\", \"fat0sn4\"]\n },\n smallArrow: {\n a9b677: \"f1ekdpwm\",\n Bqenvij: \"f83vc9z\"\n },\n mediumLargeArrow: {\n a9b677: \"f1kmc0fn\",\n Bqenvij: \"fb6lvc5\"\n },\n arrow: {\n qhf8xq: \"f1euv43f\",\n De3pzq: \"f1u2r49w\",\n Bcdw1i0: \"fd7fpy0\",\n Bj3rh1h: \"f1bsuimh\",\n Ftih45: \"f1wl9k8s\",\n B1puzpu: \"f1wkw4r9\",\n Brfgrao: \"f1j7ml58\",\n Bcvre1j: \"fyl8oag\",\n Ccq8qp: \"frdoeuz\",\n Baz25je: \"fb81m9q\",\n cmx5o7: \"f1ljr5q2\",\n B4f6apu: \"fyfemzf\",\n m598lv: \"focyt6c\",\n Bk5zm6e: \"fnhxbxj\",\n y0oebl: \"fdw6hkg\",\n qa3bma: \"f11yjt3y\",\n Bqjgrrk: \"f1172wan\",\n Budzafs: [\"f9e5op9\", \"f112wvtl\"],\n Hv9wc6: [\"ftj5xct\", \"fyavhwi\"],\n hl6cv3: \"f1773hnp\",\n Bh2vraf: \"f1n8855c\",\n yayu3t: \"f1v7783n\",\n wedwtw: \"fsw6im5\",\n rhl9o9: \"fh2hsk5\",\n Bu8t5uz: \"f159pzir\",\n B6q6orb: \"f11yvu4\",\n Bwwlvwl: \"fm1ycve\"\n }\n}, {\n d: [\".f19n0e5{color:var(--colorNeutralForeground1);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f1hg901r{box-shadow:var(--shadow16);}\", \".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}\", \".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}\", \".f5ogflp{border-top-width:1px;}\", \".f1hqa2wf{border-right-width:1px;}\", \".finvdd3{border-left-width:1px;}\", \".f1f09k3d{border-bottom-width:1px;}\", \".fzkkow9{border-top-style:solid;}\", \".fcdblym{border-right-style:solid;}\", \".fjik90z{border-left-style:solid;}\", \".fg706s2{border-bottom-style:solid;}\", \".fghlq4f{border-top-color:var(--colorTransparentStroke);}\", \".f1gn591s{border-right-color:var(--colorTransparentStroke);}\", \".fjscplz{border-left-color:var(--colorTransparentStroke);}\", \".fb073pr{border-bottom-color:var(--colorTransparentStroke);}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\", \".fg3r6xk{background-color:var(--colorNeutralBackgroundStatic);}\", \".fonrgv7{color:var(--colorNeutralForegroundStaticInverted);}\", \".ffp7eso{background-color:var(--colorBrandBackground);}\", \".f1phragk{color:var(--colorNeutralForegroundOnBrand);}\", \".f1kcqot9{padding-top:12px;}\", \".f11qrl6u{padding-right:12px;}\", \".fjlbh76{padding-left:12px;}\", \".fpe6lb7{padding-bottom:12px;}\", \".fqag9an{padding-top:16px;}\", \".f1gbmcue{padding-right:16px;}\", \".f1rh9g5y{padding-left:16px;}\", \".fp67ikv{padding-bottom:16px;}\", \".fc7z3ec{padding-top:20px;}\", \".fat0sn4{padding-right:20px;}\", \".fekwl8i{padding-left:20px;}\", \".fe2my4m{padding-bottom:20px;}\", \".f1ekdpwm{width:8.484px;}\", \".f83vc9z{height:8.484px;}\", \".f1kmc0fn{width:11.312px;}\", \".fb6lvc5{height:11.312px;}\", \".f1euv43f{position:absolute;}\", \".f1u2r49w{background-color:inherit;}\", \".fd7fpy0{visibility:hidden;}\", \".f1bsuimh{z-index:-1;}\", \".f1wl9k8s::before{content:\\\"\\\";}\", \".f1wkw4r9::before{visibility:visible;}\", \".f1j7ml58::before{position:absolute;}\", \".fyl8oag::before{box-sizing:border-box;}\", \".frdoeuz::before{width:inherit;}\", \".fb81m9q::before{height:inherit;}\", \".f1ljr5q2::before{background-color:inherit;}\", \".fyfemzf::before{border-right-width:1px;}\", \".focyt6c::before{border-right-style:solid;}\", \".fnhxbxj::before{border-right-color:var(--colorTransparentStroke);}\", \".fdw6hkg::before{border-bottom-width:1px;}\", \".f11yjt3y::before{border-bottom-style:solid;}\", \".f1172wan::before{border-bottom-color:var(--colorTransparentStroke);}\", \".f9e5op9::before{border-bottom-right-radius:var(--borderRadiusSmall);}\", \".f112wvtl::before{border-bottom-left-radius:var(--borderRadiusSmall);}\", \".ftj5xct::before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}\", \".fyavhwi::before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);}\", \"[data-popper-placement^=\\\"top\\\"] .f1773hnp{bottom:-1px;}\", \"[data-popper-placement^=\\\"top\\\"] .f1n8855c{--angle:0;}\", \"[data-popper-placement^=\\\"right\\\"] .f1v7783n{left:-1px;}\", \"[data-popper-placement^=\\\"right\\\"] .fsw6im5{--angle:90deg;}\", \"[data-popper-placement^=\\\"bottom\\\"] .fh2hsk5{top:-1px;}\", \"[data-popper-placement^=\\\"bottom\\\"] .f159pzir{--angle:180deg;}\", \"[data-popper-placement^=\\\"left\\\"] .f11yvu4{right:-1px;}\", \"[data-popper-placement^=\\\"left\\\"] .fm1ycve{--angle:270deg;}\"]\n});\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(popoverSurfaceClassNames.root, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);\n state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);\n return state;\n};\n//# sourceMappingURL=usePopoverSurfaceStyles.js.map"],"names":["popoverSurfaceClassNames","arrowHeights","usePopoverSurfaceStyles_unstable","root","small","medium","large","useStyles","__styles","sj55zd","De3pzq","E5pizo","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","inverted","brand","smallPadding","z8tnut","z189sj","Byoj8tv","uwmqm3","mediumPadding","largePadding","smallArrow","a9b677","Bqenvij","mediumLargeArrow","arrow","qhf8xq","Bcdw1i0","Bj3rh1h","Ftih45","B1puzpu","Brfgrao","Bcvre1j","Ccq8qp","Baz25je","cmx5o7","B4f6apu","m598lv","Bk5zm6e","y0oebl","qa3bma","Bqjgrrk","Budzafs","Hv9wc6","hl6cv3","Bh2vraf","yayu3t","wedwtw","rhl9o9","Bu8t5uz","B6q6orb","Bwwlvwl","d","state","styles","className","mergeClasses","size","appearance","arrowClassName"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IAGAC,YAAY,MAAZA;IAuGAC,gCA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