@fluentui/react-popover 0.0.0-nightly-20230427-0418.1 → 0.0.0-nightly-20230428-0419.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
@@ -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"}
@@ -1,182 +0,0 @@
1
- import * as React from 'react';
2
- import { useControllableState, useEventCallback, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';
3
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
4
- import { usePositioning, resolvePositioningShorthand, mergeArrowOffset, usePositioningMouseTarget } from '@fluentui/react-positioning';
5
- import { elementContains } from '@fluentui/react-portal';
6
- import { useFocusFinders } from '@fluentui/react-tabster';
7
- import { arrowHeights } from '../PopoverSurface/index';
8
- import { popoverSurfaceBorderRadius } from './constants';
9
- /**
10
- * Create the state required to render Popover.
11
- *
12
- * The returned state can be modified with hooks such as usePopoverStyles,
13
- * before being passed to renderPopover_unstable.
14
- *
15
- * @param props - props from this instance of Popover
16
- */
17
- export const usePopover_unstable = props => {
18
- const [contextTarget, setContextTarget] = usePositioningMouseTarget();
19
- const initialState = {
20
- size: 'medium',
21
- contextTarget,
22
- setContextTarget,
23
- ...props
24
- };
25
- const children = React.Children.toArray(props.children);
26
- if (process.env.NODE_ENV !== 'production') {
27
- if (children.length === 0) {
28
- // eslint-disable-next-line no-console
29
- console.warn('Popover must contain at least one child');
30
- }
31
- if (children.length > 2) {
32
- // eslint-disable-next-line no-console
33
- console.warn('Popover must contain at most two children');
34
- }
35
- }
36
- let popoverTrigger = undefined;
37
- let popoverSurface = undefined;
38
- if (children.length === 2) {
39
- popoverTrigger = children[0];
40
- popoverSurface = children[1];
41
- } else if (children.length === 1) {
42
- popoverSurface = children[0];
43
- }
44
- const [open, setOpenState] = useOpenState(initialState);
45
- const setOpenTimeoutRef = React.useRef(0);
46
- const setOpen = useEventCallback((e, shouldOpen) => {
47
- clearTimeout(setOpenTimeoutRef.current);
48
- if (!(e instanceof Event) && e.persist) {
49
- // < React 17 still uses pooled synthetic events
50
- e.persist();
51
- }
52
- if (e.type === 'mouseleave') {
53
- var _props_mouseLeaveDelay;
54
- // FIXME leaking Node timeout type
55
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
56
- // @ts-ignore
57
- setOpenTimeoutRef.current = setTimeout(() => {
58
- setOpenState(e, shouldOpen);
59
- }, (_props_mouseLeaveDelay = props.mouseLeaveDelay) !== null && _props_mouseLeaveDelay !== void 0 ? _props_mouseLeaveDelay : 500);
60
- } else {
61
- setOpenState(e, shouldOpen);
62
- }
63
- });
64
- // Clear timeout on unmount
65
- // Setting state after a component unmounts can cause memory leaks
66
- React.useEffect(() => {
67
- return () => {
68
- clearTimeout(setOpenTimeoutRef.current);
69
- };
70
- }, []);
71
- const toggleOpen = React.useCallback(e => {
72
- setOpen(e, !open);
73
- }, [setOpen, open]);
74
- const positioningRefs = usePopoverRefs(initialState);
75
- const {
76
- targetDocument
77
- } = useFluent();
78
- useOnClickOutside({
79
- contains: elementContains,
80
- element: targetDocument,
81
- callback: ev => setOpen(ev, false),
82
- refs: [positioningRefs.triggerRef, positioningRefs.contentRef],
83
- disabled: !open
84
- });
85
- // only close on scroll for context, or when closeOnScroll is specified
86
- const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;
87
- useOnScrollOutside({
88
- contains: elementContains,
89
- element: targetDocument,
90
- callback: ev => setOpen(ev, false),
91
- refs: [positioningRefs.triggerRef, positioningRefs.contentRef],
92
- disabled: !open || !closeOnScroll
93
- });
94
- const {
95
- findFirstFocusable
96
- } = useFocusFinders();
97
- React.useEffect(() => {
98
- if (props.unstable_disableAutoFocus) {
99
- return;
100
- }
101
- if (open && positioningRefs.contentRef.current) {
102
- var _positioningRefs_contentRef_current_getAttribute;
103
- const containerTabIndex = (_positioningRefs_contentRef_current_getAttribute = positioningRefs.contentRef.current.getAttribute('tabIndex')) !== null && _positioningRefs_contentRef_current_getAttribute !== void 0 ? _positioningRefs_contentRef_current_getAttribute : undefined;
104
- const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;
105
- firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
106
- }
107
- }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);
108
- var _props_inertTrapFocus, _props_inline;
109
- return {
110
- ...initialState,
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,
114
- popoverTrigger,
115
- popoverSurface,
116
- open,
117
- setOpen,
118
- toggleOpen,
119
- setContextTarget,
120
- contextTarget,
121
- inline: (_props_inline = props.inline) !== null && _props_inline !== void 0 ? _props_inline : false
122
- };
123
- };
124
- /**
125
- * Creates and manages the Popover open state
126
- */
127
- function useOpenState(state) {
128
- const onOpenChange = useEventCallback((e, data) => {
129
- var _state_onOpenChange;
130
- return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);
131
- });
132
- const [open, setOpenState] = useControllableState({
133
- state: state.open,
134
- defaultState: state.defaultOpen,
135
- initialState: false
136
- });
137
- state.open = open !== undefined ? open : state.open;
138
- const setContextTarget = state.setContextTarget;
139
- const setOpen = React.useCallback((e, shouldOpen) => {
140
- if (shouldOpen && e.type === 'contextmenu') {
141
- setContextTarget(e);
142
- }
143
- if (!shouldOpen) {
144
- setContextTarget(undefined);
145
- }
146
- setOpenState(shouldOpen);
147
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {
148
- open: shouldOpen
149
- });
150
- }, [setOpenState, onOpenChange, setContextTarget]);
151
- return [open, setOpen];
152
- }
153
- /**
154
- * Creates and sets the necessary trigger, target and content refs used by Popover
155
- */
156
- function usePopoverRefs(state) {
157
- const positioningOptions = {
158
- position: 'above',
159
- align: 'center',
160
- arrowPadding: 2 * popoverSurfaceBorderRadius,
161
- target: state.openOnContext ? state.contextTarget : undefined,
162
- ...resolvePositioningShorthand(state.positioning)
163
- };
164
- // no reason to render arrow when covering the target
165
- if (positioningOptions.coverTarget) {
166
- state.withArrow = false;
167
- }
168
- if (state.withArrow) {
169
- positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);
170
- }
171
- const {
172
- targetRef: triggerRef,
173
- containerRef: contentRef,
174
- arrowRef
175
- } = usePositioning(positioningOptions);
176
- return {
177
- triggerRef,
178
- contentRef,
179
- arrowRef
180
- };
181
- }
182
- //# sourceMappingURL=usePopover.js.map
@@ -1 +0,0 @@
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,QAAQ;EAEtD,IAAIG,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzC,IAAIL,QAAA,CAASM,MAAM,KAAK,GAAG;MACzB;MACAC,OAAA,CAAQC,IAAI,CAAC;IACf;IAEA,IAAIR,QAAA,CAASM,MAAM,GAAG,GAAG;MACvB;MACAC,OAAA,CAAQC,IAAI,CAAC;IACf;EACF;EAEA,IAAIC,cAAA,GAA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as React from 'react';
2
- import { usePopoverSurface_unstable } from './usePopoverSurface';
3
- import { renderPopoverSurface_unstable } from './renderPopoverSurface';
4
- import { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles.styles';
5
- import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
6
- /**
7
- * PopoverSurface component renders react children in a positioned box
8
- */
9
- export const PopoverSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const state = usePopoverSurface_unstable(props, ref);
11
- usePopoverSurfaceStyles_unstable(state);
12
- useCustomStyleHook_unstable('usePopoverSurfaceStyles_unstable')(state);
13
- return renderPopoverSurface_unstable(state);
14
- });
15
- PopoverSurface.displayName = 'PopoverSurface';
16
- //# sourceMappingURL=PopoverSurface.js.map
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PopoverSurface.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/PopoverSurface/PopoverSurface.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverContextValue } from '../../popoverContext';\n\n/**\n * PopoverSurface Props\n */\nexport type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;\n\n/**\n * Names of the slots in PopoverSurfaceProps\n */\nexport type PopoverSurfaceSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * PopoverSurface State\n */\nexport type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> &\n Pick<PopoverContextValue, 'appearance' | 'arrowRef' | 'inline' | 'mountNode' | 'size' | 'withArrow'> & {\n /**\n * CSS class for the arrow element\n */\n arrowClassName?: string;\n };\n"],"mappings":"AAAA"}
@@ -1,6 +0,0 @@
1
- export * from './PopoverSurface';
2
- export * from './PopoverSurface.types';
3
- export * from './renderPopoverSurface';
4
- export * from './usePopoverSurface';
5
- export * from './usePopoverSurfaceStyles.styles';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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"}
@@ -1,23 +0,0 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
2
- import { getSlotsNext } from '@fluentui/react-utilities';
3
- import { Portal } from '@fluentui/react-portal';
4
- /**
5
- * Render the final JSX of PopoverSurface
6
- */
7
- export const renderPopoverSurface_unstable = state => {
8
- const {
9
- slots,
10
- slotProps
11
- } = getSlotsNext(state);
12
- const surface = /*#__PURE__*/createElement(slots.root, slotProps.root, state.withArrow && /*#__PURE__*/createElement("div", {
13
- ref: state.arrowRef,
14
- className: state.arrowClassName
15
- }), slotProps.root.children);
16
- if (state.inline) {
17
- return surface;
18
- }
19
- return /*#__PURE__*/createElement(Portal, {
20
- mountNode: state.mountNode
21
- }, surface);
22
- };
23
- //# sourceMappingURL=renderPopoverSurface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createElement","getSlotsNext","Portal","renderPopoverSurface_unstable","state","slots","slotProps","surface","root","withArrow","ref","arrowRef","className","arrowClassName","children","inline","mountNode"],"sources":["../../../src/components/PopoverSurface/renderPopoverSurface.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = (state: PopoverSurfaceState) => {\n const { slots, slotProps } = getSlotsNext<PopoverSurfaceSlots>(state);\n\n const surface = (\n <slots.root {...slotProps.root}>\n {state.withArrow && <div ref={state.arrowRef} className={state.arrowClassName} />}\n {slotProps.root.children}\n </slots.root>\n );\n\n if (state.inline) {\n return surface;\n }\n\n return <Portal mountNode={state.mountNode}>{surface}</Portal>;\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAC9B,SAASC,YAAY,QAAQ;AAC7B,SAASC,MAAM,QAAQ;AAGvB;;;AAGA,OAAO,MAAMC,6BAAA,GAAiCC,KAAA,IAA+B;EAC3E,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGL,YAAA,CAAkCG,KAAA;EAE/D,MAAMG,OAAA,gBACJP,aAdJ,CAcKK,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,EAC3BJ,KAAA,CAAMK,SAAS,iBAAIT,aAf1B,CAe2B;IAAIU,GAAA,EAAKN,KAAA,CAAMO,QAAQ;IAAEC,SAAA,EAAWR,KAAA,CAAMS;MAC9DP,SAAA,CAAUE,IAAI,CAACM,QAAQ;EAI5B,IAAIV,KAAA,CAAMW,MAAM,EAAE;IAChB,OAAOR,OAAA;EACT;EAEA,oBAAOP,aAxBT,CAwBUE,MAAA;IAAOc,SAAA,EAAWZ,KAAA,CAAMY;KAAYT,OAAA;AAC9C"}
@@ -1,79 +0,0 @@
1
- import * as React from 'react';
2
- import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
3
- import { useModalAttributes } from '@fluentui/react-tabster';
4
- import { usePopoverContext_unstable } from '../../popoverContext';
5
- /**
6
- * Create the state required to render PopoverSurface.
7
- *
8
- * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
9
- * before being passed to renderPopoverSurface_unstable.
10
- *
11
- * @param props - props from this instance of PopoverSurface
12
- * @param ref - reference to root HTMLDivElement of PopoverSurface
13
- */
14
- export const usePopoverSurface_unstable = (props, ref) => {
15
- const contentRef = usePopoverContext_unstable(context => context.contentRef);
16
- const openOnHover = usePopoverContext_unstable(context => context.openOnHover);
17
- const setOpen = usePopoverContext_unstable(context => context.setOpen);
18
- const mountNode = usePopoverContext_unstable(context => context.mountNode);
19
- const arrowRef = usePopoverContext_unstable(context => context.arrowRef);
20
- const size = usePopoverContext_unstable(context => context.size);
21
- const withArrow = usePopoverContext_unstable(context => context.withArrow);
22
- const appearance = usePopoverContext_unstable(context => context.appearance);
23
- const trapFocus = usePopoverContext_unstable(context => context.trapFocus);
24
- const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);
25
- const inline = usePopoverContext_unstable(context => context.inline);
26
- const {
27
- modalAttributes
28
- } = useModalAttributes({
29
- trapFocus,
30
- legacyTrapFocus: !inertTrapFocus,
31
- alwaysFocusable: !trapFocus
32
- });
33
- const state = {
34
- inline,
35
- appearance,
36
- withArrow,
37
- size,
38
- arrowRef,
39
- mountNode,
40
- components: {
41
- root: 'div'
42
- },
43
- root: getNativeElementProps('div', {
44
- ref: useMergedRefs(ref, contentRef),
45
- role: trapFocus ? 'dialog' : 'group',
46
- 'aria-modal': trapFocus ? true : undefined,
47
- ...modalAttributes,
48
- ...props
49
- })
50
- };
51
- const {
52
- onMouseEnter: onMouseEnterOriginal,
53
- onMouseLeave: onMouseLeaveOriginal,
54
- onKeyDown: onKeyDownOriginal
55
- } = state.root;
56
- state.root.onMouseEnter = e => {
57
- if (openOnHover) {
58
- setOpen(e, true);
59
- }
60
- onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
61
- };
62
- state.root.onMouseLeave = e => {
63
- if (openOnHover) {
64
- setOpen(e, false);
65
- }
66
- onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
67
- };
68
- state.root.onKeyDown = e => {
69
- var _contentRef_current;
70
- // only close if the event happened inside the current popover
71
- // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
72
- if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {
73
- setOpen(e, false);
74
- }
75
- onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
76
- };
77
- return state;
78
- };
79
- //# sourceMappingURL=usePopoverSurface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","getNativeElementProps","useMergedRefs","useModalAttributes","usePopoverContext_unstable","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","_contentRef_current","key","current","contains","target"],"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const { modalAttributes } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus,\n });\n\n const state: PopoverSurfaceState = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n };\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state.root;\n state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,aAAa,QAAQ;AACrD,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAG3C;;;;;;;;;AASA,OAAO,MAAMC,0BAAA,GAA6BA,CACxCC,KAAA,EACAC,GAAA,KACwB;EACxB,MAAMC,UAAA,GAAaJ,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQD,UAAU;EAC3E,MAAME,WAAA,GAAcN,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQC,WAAW;EAC7E,MAAMC,OAAA,GAAUP,0BAAA,CAA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iB,CAC7B,GAAGV,KAAA,CAAME,IAAI;EACdF,KAAA,CAAME,IAAI,CAACG,YAAY,GAAIM,CAAA,IAAwC;IACjE,IAAIxB,WAAA,EAAa;MACfC,OAAA,CAAQuB,CAAA,EAAG,IAAI;IACjB;IAEAL,oBAAA,aAAAA,oBAAA,uBAAAA,oBAAA,CAAuBK,CAAA;EACzB;EAEAX,KAAA,CAAME,IAAI,CAACK,YAAY,GAAII,CAAA,IAAwC;IACjE,IAAIxB,WAAA,EAAa;MACfC,OAAA,CAAQuB,CAAA,EAAG,KAAK;IAClB;IAEAH,oBAAA,aAAAA,oBAAA,uBAAAA,oBAAA,CAAuBG,CAAA;EACzB;EAEAX,KAAA,CAAME,IAAI,CAACO,SAAS,GAAIE,CAAA,IAA2C;QAGvCC,mBAAA;IAF1B;IACA;IACA,IAAID,CAAA,CAAEE,GAAG,KAAK,aAAY,CAAAD,mBAAA,GAAA3B,UAAA,CAAW6B,OAAO,cAAlBF,mBAAA,uBAAAA,mBAAA,CAAoBG,QAAA,CAASJ,CAAA,CAAEK,MAAM,IAAqB;MAClF5B,OAAA,CAAQuB,CAAA,EAAG,KAAK;IAClB;IAEAD,iBAAA,aAAAA,iBAAA,uBAAAA,iBAAA,CAAoBC,CAAA;EACtB;EAEA,OAAOX,KAAA;AACT"}
@@ -1,116 +0,0 @@
1
- import { shorthands, __styles, mergeClasses } from '@griffel/react';
2
- import { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';
3
- import { tokens, typographyStyles } from '@fluentui/react-theme';
4
- export const popoverSurfaceClassNames = {
5
- root: 'fui-PopoverSurface'
6
- };
7
- export const arrowHeights = {
8
- small: 6,
9
- medium: 8,
10
- large: 8
11
- };
12
- /**
13
- * Styles for the root slot
14
- */
15
- const useStyles = /*#__PURE__*/__styles({
16
- root: {
17
- sj55zd: "f19n0e5",
18
- De3pzq: "fxugw4r",
19
- E5pizo: "f1hg901r",
20
- Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
21
- Beyfa6y: ["f16jpd5f", "f1aa9q02"],
22
- B7oj6ja: ["f1jar5jt", "fyu767a"],
23
- Btl43ni: ["fyu767a", "f1jar5jt"],
24
- B4j52fo: "f5ogflp",
25
- Bekrc4i: ["f1hqa2wf", "finvdd3"],
26
- Bn0qgzm: "f1f09k3d",
27
- ibv6hh: ["finvdd3", "f1hqa2wf"],
28
- icvyot: "fzkkow9",
29
- vrafjx: ["fcdblym", "fjik90z"],
30
- oivjwe: "fg706s2",
31
- wvpqe5: ["fjik90z", "fcdblym"],
32
- g2u3we: "fghlq4f",
33
- h3c5rm: ["f1gn591s", "fjscplz"],
34
- B9xav0g: "fb073pr",
35
- zhjwy3: ["fjscplz", "f1gn591s"],
36
- Bahqtrf: "fk6fouc",
37
- Be2twd7: "fkhj508",
38
- Bhrd7zp: "figsok6",
39
- Bg96gwp: "f1i3iumi"
40
- },
41
- inverted: {
42
- De3pzq: "fg3r6xk",
43
- sj55zd: "fonrgv7"
44
- },
45
- brand: {
46
- De3pzq: "ffp7eso",
47
- sj55zd: "f1phragk"
48
- },
49
- smallPadding: {
50
- z8tnut: "f1kcqot9",
51
- z189sj: ["f11qrl6u", "fjlbh76"],
52
- Byoj8tv: "fpe6lb7",
53
- uwmqm3: ["fjlbh76", "f11qrl6u"]
54
- },
55
- mediumPadding: {
56
- z8tnut: "fqag9an",
57
- z189sj: ["f1gbmcue", "f1rh9g5y"],
58
- Byoj8tv: "fp67ikv",
59
- uwmqm3: ["f1rh9g5y", "f1gbmcue"]
60
- },
61
- largePadding: {
62
- z8tnut: "fc7z3ec",
63
- z189sj: ["fat0sn4", "fekwl8i"],
64
- Byoj8tv: "fe2my4m",
65
- uwmqm3: ["fekwl8i", "fat0sn4"]
66
- },
67
- smallArrow: {
68
- a9b677: "f1ekdpwm",
69
- Bqenvij: "f83vc9z"
70
- },
71
- mediumLargeArrow: {
72
- a9b677: "f1kmc0fn",
73
- Bqenvij: "fb6lvc5"
74
- },
75
- arrow: {
76
- qhf8xq: "f1euv43f",
77
- De3pzq: "f1u2r49w",
78
- Bcdw1i0: "fd7fpy0",
79
- Bj3rh1h: "f1bsuimh",
80
- Ftih45: "f1wl9k8s",
81
- B1puzpu: "f1wkw4r9",
82
- Brfgrao: "f1j7ml58",
83
- Bcvre1j: "fyl8oag",
84
- Ccq8qp: "frdoeuz",
85
- Baz25je: "fb81m9q",
86
- cmx5o7: "f1ljr5q2",
87
- B4f6apu: "fyfemzf",
88
- m598lv: "focyt6c",
89
- Bk5zm6e: "fnhxbxj",
90
- y0oebl: "fdw6hkg",
91
- qa3bma: "f11yjt3y",
92
- Bqjgrrk: "f1172wan",
93
- Budzafs: ["f9e5op9", "f112wvtl"],
94
- Hv9wc6: ["ftj5xct", "fyavhwi"],
95
- hl6cv3: "f1773hnp",
96
- Bh2vraf: "f1n8855c",
97
- yayu3t: "f1v7783n",
98
- wedwtw: "fsw6im5",
99
- rhl9o9: "fh2hsk5",
100
- Bu8t5uz: "f159pzir",
101
- B6q6orb: "f11yvu4",
102
- Bwwlvwl: "fm1ycve"
103
- }
104
- }, {
105
- 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;}"]
106
- });
107
- /**
108
- * Apply styling to the PopoverSurface slots based on the state
109
- */
110
- export const usePopoverSurfaceStyles_unstable = state => {
111
- const styles = useStyles();
112
- 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);
113
- state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
114
- return state;
115
- };
116
- //# sourceMappingURL=usePopoverSurfaceStyles.styles.js.map
@@ -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.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,O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AK,WAAWF,MAAA,CAAOzC,YAAY,EAC7CwC,KAAA,CAAMG,IAAI,KAAK,YAAYF,MAAA,CAAOpC,aAAa,EAC/CmC,KAAA,CAAMG,IAAI,KAAK,WAAWF,MAAA,CAAOnC,YAAY,EAC7CkC,KAAA,CAAMI,UAAU,KAAK,cAAcH,MAAA,CAAO3C,QAAQ,EAClD0C,KAAA,CAAMI,UAAU,KAAK,WAAWH,MAAA,CAAO1C,KAAK,EAC5CyC,KAAA,CAAMvE,IAAI,CAACyE,SAAS;EAGtBF,KAAA,CAAMK,cAAc,GAAGlF,YAAA,CACrB8E,MAAA,CAAO9B,KAAK,EACZ6B,KAAA,CAAMG,IAAI,KAAK,UAAUF,MAAA,CAAOlC,UAAU,GAAGkC,MAAA,CAAO/B,gBAAgB;EAGtE,OAAO8B,KAAA;AACT"}
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import { usePopoverTrigger_unstable } from './usePopoverTrigger';
3
- import { renderPopoverTrigger_unstable } from './renderPopoverTrigger';
4
- /**
5
- * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
6
- */
7
- export const PopoverTrigger = props => {
8
- const state = usePopoverTrigger_unstable(props);
9
- return renderPopoverTrigger_unstable(state);
10
- };
11
- PopoverTrigger.displayName = 'PopoverTrigger';
12
- // type casting here is required to ensure internal type FluentTriggerComponent is not leaked
13
- PopoverTrigger.isFluentTriggerComponent = true;
14
- //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","usePopoverTrigger_unstable","renderPopoverTrigger_unstable","PopoverTrigger","props","state","displayName","isFluentTriggerComponent"],"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePopoverTrigger_unstable } from './usePopoverTrigger';\nimport { renderPopoverTrigger_unstable } from './renderPopoverTrigger';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\nimport type { PopoverTriggerProps } from './PopoverTrigger.types';\n\n/**\n * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.\n */\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = props => {\n const state = usePopoverTrigger_unstable(props);\n\n return renderPopoverTrigger_unstable(state);\n};\n\nPopoverTrigger.displayName = 'PopoverTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(PopoverTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAI9C;;;AAGA,OAAO,MAAMC,cAAA,GAAgDC,KAAA,IAAS;EACpE,MAAMC,KAAA,GAAQJ,0BAAA,CAA2BG,KAAA;EAEzC,OAAOF,6BAAA,CAA8BG,KAAA;AACvC;AAEAF,cAAA,CAAeG,WAAW,GAAG;AAC7B;AACCH,cAAA,CAA0CI,wBAAwB,GAAG,IAAI"}
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- //# sourceMappingURL=PopoverTrigger.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React"],"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\n/**\n * PopoverTrigger Props\n */\nexport type PopoverTriggerProps = TriggerProps<PopoverTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * PopoverTrigger State\n */\nexport type PopoverTriggerState = {\n children: React.ReactElement | null;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type PopoverTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-expanded'?: 'true' | 'false';\n ref: React.Ref<unknown>;\n onMouseEnter: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseLeave: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onContextMenu: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n }\n>;\n"],"mappings":"AAEA,YAAYA,KAAA,MAAW"}
@@ -1,5 +0,0 @@
1
- export * from './PopoverTrigger';
2
- export * from './PopoverTrigger.types';
3
- export * from './renderPopoverTrigger';
4
- export * from './usePopoverTrigger';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/PopoverTrigger/index.ts"],"sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Render the final JSX of PopoverTrigger
3
- */export const renderPopoverTrigger_unstable = state => {
4
- return state.children;
5
- };
6
- //# sourceMappingURL=renderPopoverTrigger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["renderPopoverTrigger_unstable","state","children"],"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"sourcesContent":["import type { PopoverTriggerState } from './PopoverTrigger.types';\n\n/**\n * Render the final JSX of PopoverTrigger\n */\nexport const renderPopoverTrigger_unstable = (state: PopoverTriggerState) => {\n return state.children;\n};\n"],"mappings":"AAEA;;GAGA,OAAO,MAAMA,6BAAA,GAAiCC,KAAA,IAA+B;EAC3E,OAAOA,KAAA,CAAMC,QAAQ;AACvB"}