@fluentui/react-popover 9.14.5 → 9.14.6

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 (89) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/dist/index.d.cts +338 -0
  3. package/lib/Popover.js +1 -1
  4. package/lib/Popover.js.map +1 -1
  5. package/lib/PopoverSurface.js +1 -1
  6. package/lib/PopoverSurface.js.map +1 -1
  7. package/lib/PopoverTrigger.js +1 -1
  8. package/lib/PopoverTrigger.js.map +1 -1
  9. package/lib/components/Popover/Popover.js +3 -3
  10. package/lib/components/Popover/Popover.js.map +1 -1
  11. package/lib/components/Popover/PopoverSurfaceMotion.js +3 -3
  12. package/lib/components/Popover/index.js +4 -4
  13. package/lib/components/Popover/index.js.map +1 -1
  14. package/lib/components/Popover/renderPopover.js +4 -4
  15. package/lib/components/Popover/renderPopover.js.map +1 -1
  16. package/lib/components/Popover/usePopover.js +9 -9
  17. package/lib/components/Popover/usePopover.js.map +1 -1
  18. package/lib/components/Popover/usePopoverContextValues.js +1 -1
  19. package/lib/components/PopoverSurface/PopoverSurface.js +5 -5
  20. package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
  21. package/lib/components/PopoverSurface/index.js +4 -4
  22. package/lib/components/PopoverSurface/index.js.map +1 -1
  23. package/lib/components/PopoverSurface/renderPopoverSurface.js +2 -2
  24. package/lib/components/PopoverSurface/usePopoverSurface.js +4 -4
  25. package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  26. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.js +3 -3
  27. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.js.map +1 -1
  28. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.styles.raw.js +3 -3
  29. package/lib/components/PopoverTrigger/PopoverTrigger.js +2 -2
  30. package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  31. package/lib/components/PopoverTrigger/index.js +3 -3
  32. package/lib/components/PopoverTrigger/index.js.map +1 -1
  33. package/lib/components/PopoverTrigger/usePopoverTrigger.js +5 -5
  34. package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  35. package/lib/index.js +4 -4
  36. package/lib/index.js.map +1 -1
  37. package/lib/popoverContext.js +1 -1
  38. package/lib-commonjs/{Popover.js → Popover.cjs} +1 -1
  39. package/lib-commonjs/{Popover.js.map → Popover.cjs.map} +1 -1
  40. package/lib-commonjs/{PopoverSurface.js → PopoverSurface.cjs} +1 -1
  41. package/lib-commonjs/{PopoverSurface.js.map → PopoverSurface.cjs.map} +1 -1
  42. package/lib-commonjs/{PopoverTrigger.js → PopoverTrigger.cjs} +1 -1
  43. package/lib-commonjs/{PopoverTrigger.js.map → PopoverTrigger.cjs.map} +1 -1
  44. package/lib-commonjs/components/Popover/{Popover.js → Popover.cjs} +3 -3
  45. package/lib-commonjs/components/Popover/{Popover.js.map → Popover.cjs.map} +1 -1
  46. package/lib-commonjs/components/Popover/{index.js → index.cjs} +4 -4
  47. package/lib-commonjs/components/Popover/{index.js.map → index.cjs.map} +1 -1
  48. package/lib-commonjs/components/Popover/{renderPopover.js → renderPopover.cjs} +1 -1
  49. package/lib-commonjs/components/Popover/{renderPopover.js.map → renderPopover.cjs.map} +1 -1
  50. package/lib-commonjs/components/Popover/{usePopover.js → usePopover.cjs} +3 -3
  51. package/lib-commonjs/components/Popover/{usePopover.js.map → usePopover.cjs.map} +1 -1
  52. package/lib-commonjs/components/PopoverSurface/{PopoverSurface.js → PopoverSurface.cjs} +3 -3
  53. package/lib-commonjs/components/PopoverSurface/{PopoverSurface.js.map → PopoverSurface.cjs.map} +1 -1
  54. package/lib-commonjs/components/PopoverSurface/{index.js → index.cjs} +4 -4
  55. package/lib-commonjs/components/PopoverSurface/{index.js.map → index.cjs.map} +1 -1
  56. package/lib-commonjs/components/PopoverSurface/{usePopoverSurface.js → usePopoverSurface.cjs} +1 -1
  57. package/lib-commonjs/components/PopoverSurface/{usePopoverSurface.js.map → usePopoverSurface.cjs.map} +1 -1
  58. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.styles.cjs.map +1 -0
  59. package/lib-commonjs/components/PopoverTrigger/{PopoverTrigger.js → PopoverTrigger.cjs} +2 -2
  60. package/lib-commonjs/components/PopoverTrigger/{PopoverTrigger.js.map → PopoverTrigger.cjs.map} +1 -1
  61. package/lib-commonjs/components/PopoverTrigger/{index.js → index.cjs} +3 -3
  62. package/lib-commonjs/components/PopoverTrigger/{index.js.map → index.cjs.map} +1 -1
  63. package/lib-commonjs/components/PopoverTrigger/{usePopoverTrigger.js → usePopoverTrigger.cjs} +1 -1
  64. package/lib-commonjs/components/PopoverTrigger/{usePopoverTrigger.js.map → usePopoverTrigger.cjs.map} +1 -1
  65. package/lib-commonjs/{index.js → index.cjs} +4 -4
  66. package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
  67. package/package.json +25 -19
  68. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.styles.js.map +0 -1
  69. /package/lib-commonjs/components/Popover/{Popover.types.js → Popover.types.cjs} +0 -0
  70. /package/lib-commonjs/components/Popover/{Popover.types.js.map → Popover.types.cjs.map} +0 -0
  71. /package/lib-commonjs/components/Popover/{PopoverSurfaceMotion.js → PopoverSurfaceMotion.cjs} +0 -0
  72. /package/lib-commonjs/components/Popover/{PopoverSurfaceMotion.js.map → PopoverSurfaceMotion.cjs.map} +0 -0
  73. /package/lib-commonjs/components/Popover/{constants.js → constants.cjs} +0 -0
  74. /package/lib-commonjs/components/Popover/{constants.js.map → constants.cjs.map} +0 -0
  75. /package/lib-commonjs/components/Popover/{usePopoverContextValues.js → usePopoverContextValues.cjs} +0 -0
  76. /package/lib-commonjs/components/Popover/{usePopoverContextValues.js.map → usePopoverContextValues.cjs.map} +0 -0
  77. /package/lib-commonjs/components/PopoverSurface/{PopoverSurface.types.js → PopoverSurface.types.cjs} +0 -0
  78. /package/lib-commonjs/components/PopoverSurface/{PopoverSurface.types.js.map → PopoverSurface.types.cjs.map} +0 -0
  79. /package/lib-commonjs/components/PopoverSurface/{renderPopoverSurface.js → renderPopoverSurface.cjs} +0 -0
  80. /package/lib-commonjs/components/PopoverSurface/{renderPopoverSurface.js.map → renderPopoverSurface.cjs.map} +0 -0
  81. /package/lib-commonjs/components/PopoverSurface/{usePopoverSurfaceStyles.styles.js → usePopoverSurfaceStyles.styles.cjs} +0 -0
  82. /package/lib-commonjs/components/PopoverSurface/{usePopoverSurfaceStyles.styles.raw.js → usePopoverSurfaceStyles.styles.raw.cjs} +0 -0
  83. /package/lib-commonjs/components/PopoverSurface/{usePopoverSurfaceStyles.styles.raw.js.map → usePopoverSurfaceStyles.styles.raw.cjs.map} +0 -0
  84. /package/lib-commonjs/components/PopoverTrigger/{PopoverTrigger.types.js → PopoverTrigger.types.cjs} +0 -0
  85. /package/lib-commonjs/components/PopoverTrigger/{PopoverTrigger.types.js.map → PopoverTrigger.types.cjs.map} +0 -0
  86. /package/lib-commonjs/components/PopoverTrigger/{renderPopoverTrigger.js → renderPopoverTrigger.cjs} +0 -0
  87. /package/lib-commonjs/components/PopoverTrigger/{renderPopoverTrigger.js.map → renderPopoverTrigger.cjs.map} +0 -0
  88. /package/lib-commonjs/{popoverContext.js → popoverContext.cjs} +0 -0
  89. /package/lib-commonjs/{popoverContext.js.map → popoverContext.cjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverSurface/PopoverSurface.tsx"],"sourcesContent":["'use client';\n\nimport * 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"],"names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","useCustomStyleHook_unstable","PopoverSurface","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IAEjCL,4BAA4B,oCAAoCK;IAEhE,OAAOP,8BAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/PopoverSurface/PopoverSurface.tsx"],"sourcesContent":["'use client';\n\nimport * 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"],"names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","useCustomStyleHook_unstable","PopoverSurface","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,gCAAgC,QAAQ,sCAAmC;AAGpF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IAEjCL,4BAA4B,oCAAoCK;IAEhE,OAAOP,8BAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
@@ -1,4 +1,4 @@
1
- export { PopoverSurface } from './PopoverSurface';
2
- export { renderPopoverSurface_unstable } from './renderPopoverSurface';
3
- export { usePopoverSurface_unstable } from './usePopoverSurface';
4
- export { arrowHeights, popoverSurfaceClassNames, usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles.styles';
1
+ export { PopoverSurface } from "./PopoverSurface.js";
2
+ export { renderPopoverSurface_unstable } from "./renderPopoverSurface.js";
3
+ export { usePopoverSurface_unstable } from "./usePopoverSurface.js";
4
+ export { arrowHeights, popoverSurfaceClassNames, usePopoverSurfaceStyles_unstable } from "./usePopoverSurfaceStyles.styles.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverSurface/index.ts"],"sourcesContent":["export { PopoverSurface } from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nexport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nexport { usePopoverSurface_unstable } from './usePopoverSurface';\nexport {\n arrowHeights,\n popoverSurfaceClassNames,\n usePopoverSurfaceStyles_unstable,\n} from './usePopoverSurfaceStyles.styles';\n"],"names":["PopoverSurface","renderPopoverSurface_unstable","usePopoverSurface_unstable","arrowHeights","popoverSurfaceClassNames","usePopoverSurfaceStyles_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SACEC,YAAY,EACZC,wBAAwB,EACxBC,gCAAgC,QAC3B,mCAAmC"}
1
+ {"version":3,"sources":["../src/components/PopoverSurface/index.ts"],"sourcesContent":["export { PopoverSurface } from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nexport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nexport { usePopoverSurface_unstable } from './usePopoverSurface';\nexport {\n arrowHeights,\n popoverSurfaceClassNames,\n usePopoverSurfaceStyles_unstable,\n} from './usePopoverSurfaceStyles.styles';\n"],"names":["PopoverSurface","renderPopoverSurface_unstable","usePopoverSurface_unstable","arrowHeights","popoverSurfaceClassNames","usePopoverSurfaceStyles_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,sBAAmB;AAElD,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SACEC,YAAY,EACZC,wBAAwB,EACxBC,gCAAgC,QAC3B,sCAAmC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from '@fluentui/react-utilities';
3
- import { Portal } from '@fluentui/react-portal';
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
+ import { Portal } from "@fluentui/react-portal";
4
4
  /**
5
5
  * Render the final JSX of PopoverSurface
6
6
  */ export const renderPopoverSurface_unstable = (state)=>{
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';
3
- import { useModalAttributes } from '@fluentui/react-tabster';
4
- import { usePopoverContext_unstable } from '../../popoverContext';
5
- import { useMotionForwardedRef } from '@fluentui/react-motion';
2
+ import { getIntrinsicElementProps, useMergedRefs, slot } from "@fluentui/react-utilities";
3
+ import { useModalAttributes } from "@fluentui/react-tabster";
4
+ import { usePopoverContext_unstable } from "../../popoverContext.js";
5
+ import { useMotionForwardedRef } from "@fluentui/react-motion";
6
6
  /**
7
7
  * Create the state required to render PopoverSurface.
8
8
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\nimport { useMotionForwardedRef } from '@fluentui/react-motion';\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 motionForwardedRef = useMotionForwardedRef();\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: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `contentRef` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, contentRef, motionForwardedRef) as React.Ref<HTMLDivElement>,\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n { elementType: 'div' },\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 e.preventDefault();\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state;\n};\n"],"names":["getIntrinsicElementProps","useMergedRefs","slot","useModalAttributes","usePopoverContext_unstable","useMotionForwardedRef","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","motionForwardedRef","modalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","always","role","undefined","elementType","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","key","current","contains","target","preventDefault"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC1F,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,0BAA0B,QAAQ,uBAAuB;AAElE,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,aAAaL,2BAA2BM,CAAAA,UAAWA,QAAQD,UAAU;IAC3E,MAAME,cAAcP,2BAA2BM,CAAAA,UAAWA,QAAQC,WAAW;IAC7E,MAAMC,UAAUR,2BAA2BM,CAAAA,UAAWA,QAAQE,OAAO;IACrE,MAAMC,YAAYT,2BAA2BM,CAAAA,UAAWA,QAAQG,SAAS;IACzE,MAAMC,WAAWV,2BAA2BM,CAAAA,UAAWA,QAAQI,QAAQ;IACvE,MAAMC,OAAOX,2BAA2BM,CAAAA,UAAWA,QAAQK,IAAI;IAC/D,MAAMC,YAAYZ,2BAA2BM,CAAAA,UAAWA,QAAQM,SAAS;IACzE,MAAMC,aAAab,2BAA2BM,CAAAA,UAAWA,QAAQO,UAAU;IAC3E,MAAMC,YAAYd,2BAA2BM,CAAAA,UAAWA,QAAQQ,SAAS;IACzE,MAAMC,iBAAiBf,2BAA2BM,CAAAA,UAAWA,QAAQS,cAAc;IACnF,MAAMC,SAAShB,2BAA2BM,CAAAA,UAAWA,QAAQU,MAAM;IACnE,MAAMC,qBAAqBhB;IAC3B,MAAM,EAAEiB,eAAe,EAAE,GAAGnB,mBAAmB;QAC7Ce;QACAK,iBAAiB,CAACJ;QAClBK,iBAAiB,CAACN;IACpB;IAEA,MAAMO,QAA6B;QACjCL;QACAH;QACAD;QACAD;QACAD;QACAD;QACAa,YAAY;YACVC,MAAM;QACR;QACAA,MAAMzB,KAAK0B,MAAM,CACf5B,yBAAyB,OAAO;YAC9B,SAAS;YACT,mFAAmF;YACnF,4FAA4F;YAC5FQ,KAAKP,cAAcO,KAAKC,YAAYY;YACpCQ,MAAMX,YAAY,WAAW;YAC7B,cAAcA,YAAY,OAAOY;YACjC,GAAGR,eAAe;YAClB,GAAGf,KAAK;QACV,IACA;YAAEwB,aAAa;QAAM;IAEzB;IAEA,MAAM,EACJC,cAAcC,oBAAoB,EAClCC,cAAcC,oBAAoB,EAClCC,WAAWC,iBAAiB,EAC7B,GAAGZ,MAAME,IAAI;IACdF,MAAME,IAAI,CAACK,YAAY,GAAG,CAACM;QACzB,IAAI3B,aAAa;YACfC,QAAQ0B,GAAG;QACb;QAEAL,iCAAAA,2CAAAA,qBAAuBK;IACzB;IAEAb,MAAME,IAAI,CAACO,YAAY,GAAG,CAACI;QACzB,IAAI3B,aAAa;YACfC,QAAQ0B,GAAG;QACb;QAEAH,iCAAAA,2CAAAA,qBAAuBG;IACzB;IAEAb,MAAME,IAAI,CAACS,SAAS,GAAG,CAACE;YAGI7B;QAF1B,8DAA8D;QAC9D,mHAAmH;QACnH,IAAI6B,EAAEC,GAAG,KAAK,cAAY9B,sBAAAA,WAAW+B,OAAO,cAAlB/B,0CAAAA,oBAAoBgC,QAAQ,CAACH,EAAEI,MAAM,IAAqB;YAClFJ,EAAEK,cAAc;YAChB/B,QAAQ0B,GAAG;QACb;QAEAD,8BAAAA,wCAAAA,kBAAoBC;IACtB;IAEA,OAAOb;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\nimport { useMotionForwardedRef } from '@fluentui/react-motion';\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 motionForwardedRef = useMotionForwardedRef();\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: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `contentRef` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, contentRef, motionForwardedRef) as React.Ref<HTMLDivElement>,\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n { elementType: 'div' },\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 e.preventDefault();\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state;\n};\n"],"names":["getIntrinsicElementProps","useMergedRefs","slot","useModalAttributes","usePopoverContext_unstable","useMotionForwardedRef","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","motionForwardedRef","modalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","always","role","undefined","elementType","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","key","current","contains","target","preventDefault"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC1F,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,0BAA0B,QAAQ,0BAAuB;AAElE,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,aAAaL,2BAA2BM,CAAAA,UAAWA,QAAQD,UAAU;IAC3E,MAAME,cAAcP,2BAA2BM,CAAAA,UAAWA,QAAQC,WAAW;IAC7E,MAAMC,UAAUR,2BAA2BM,CAAAA,UAAWA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GAAG,CAACI;QACzB,IAAI3B,aAAa;YACfC,QAAQ0B,GAAG;QACb;QAEAH,iCAAAA,2CAAAA,qBAAuBG;IACzB;IAEAb,MAAME,IAAI,CAACS,SAAS,GAAG,CAACE;YAGI7B;QAF1B,8DAA8D;QAC9D,mHAAmH;QACnH,IAAI6B,EAAEC,GAAG,KAAK,cAAY9B,sBAAAA,WAAW+B,OAAO,cAAlB/B,0CAAAA,oBAAoBgC,QAAQ,CAACH,EAAEI,MAAM,IAAqB;YAClFJ,EAAEK,cAAc;YAChB/B,QAAQ0B,GAAG;QACb;QAEAD,8BAAAA,wCAAAA,kBAAoBC;IACtB;IAEA,OAAOb;AACT,EAAE"}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
- import { __styles, mergeClasses } from '@griffel/react';
4
- import { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';
5
- import { tokens, typographyStyles } from '@fluentui/react-theme';
3
+ import { __styles, mergeClasses } from "@griffel/react";
4
+ import { createArrowHeightStyles, createArrowStyles } from "@fluentui/react-positioning";
5
+ import { tokens, typographyStyles } from "@fluentui/react-theme";
6
6
  export const popoverSurfaceClassNames = {
7
7
  root: 'fui-PopoverSurface'
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","createArrowHeightStyles","createArrowStyles","tokens","typographyStyles","popoverSurfaceClassNames","root","arrowHeights","small","medium","large","useStyles","sj55zd","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bhu2qc9","inline","Bj3rh1h","inverted","brand","smallPadding","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","mediumPadding","largePadding","smallArrow","rhnwrx","Bdy53xb","mediumLargeArrow","arrow","B7ck84d","qhf8xq","B2eet1l","Bz10aip","Bqenvij","a9b677","Ftih45","Br0sdwz","cmx5o7","susq4k","Biibvgv","Bicfajf","qehafq","Brs5u8j","Ccq8qp","Baz25je","Bcgcnre","Bqjgrrk","qa3bma","y0oebl","Biqmznv","Bm6vgfq","Bbv0w2i","uvfttm","eqrjj","Bk5zm6e","m598lv","B4f6apu","ydt019","Bq4z7u6","Bdkvgpv","B0qfbqy","kj8mxx","r59vdv","Bkw5xw4","hl6cv3","aea9ga","yayu3t","Bhsv975","rhl9o9","B7gxrvb","B6q6orb","B0lu1f8","d","p","usePopoverSurfaceStyles_unstable","state","styles","className","size","appearance","arrowClassName"],"sources":["usePopoverSurfaceStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, 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 */ const useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n ...typographyStyles.body1,\n // TODO need to add versions of tokens.alias.shadow.shadow16, etc. that work with filter\n filter: `drop-shadow(0 0 2px ${tokens.colorNeutralShadowAmbient}) ` + `drop-shadow(0 8px 16px ${tokens.colorNeutralShadowKey})`\n },\n inline: {\n // When rendering inline, the PopoverSurface will be rendered under relatively positioned elements such as Input.\n // This is due to the surface being positioned as absolute, therefore zIndex: 1 ensures that won't happen.\n zIndex: 1\n },\n inverted: {\n backgroundColor: tokens.colorNeutralBackgroundStatic,\n color: tokens.colorNeutralForegroundStaticInverted\n },\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand\n },\n smallPadding: {\n padding: '12px'\n },\n mediumPadding: {\n padding: '16px'\n },\n largePadding: {\n padding: '20px'\n },\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({\n arrowHeight: undefined\n })\n});\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */ export const usePopoverSurfaceStyles_unstable = (state)=>{\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(popoverSurfaceClassNames.root, styles.root, state.inline && styles.inline, 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 // eslint-disable-next-line react-hooks/immutability\n state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ,6BAA6B;AACxF,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE;AACV,CAAC;AACD,OAAO,MAAMC,YAAY,GAAG;EACxBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGZ,QAAA;EAAAO,IAAA;IAAAM,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC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OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAqCrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,gCAAgC,GAAIC,KAAK,IAAG;EACzD,MAAMC,MAAM,GAAG9F,SAAS,CAAC,CAAC;EAC1B;EACA6F,KAAK,CAAClG,IAAI,CAACoG,SAAS,GAAG1G,YAAY,CAACK,wBAAwB,CAACC,IAAI,EAAEmG,MAAM,CAACnG,IAAI,EAAEkG,KAAK,CAAC/D,MAAM,IAAIgE,MAAM,CAAChE,MAAM,EAAE+D,KAAK,CAACG,IAAI,KAAK,OAAO,IAAIF,MAAM,CAAC5D,YAAY,EAAE2D,KAAK,CAACG,IAAI,KAAK,QAAQ,IAAIF,MAAM,CAACtD,aAAa,EAAEqD,KAAK,CAACG,IAAI,KAAK,OAAO,IAAIF,MAAM,CAACrD,YAAY,EAAEoD,KAAK,CAACI,UAAU,KAAK,UAAU,IAAIH,MAAM,CAAC9D,QAAQ,EAAE6D,KAAK,CAACI,UAAU,KAAK,OAAO,IAAIH,MAAM,CAAC7D,KAAK,EAAE4D,KAAK,CAAClG,IAAI,CAACoG,SAAS,CAAC;EACrX;EACAF,KAAK,CAACK,cAAc,GAAG7G,YAAY,CAACyG,MAAM,CAAChD,KAAK,EAAE+C,KAAK,CAACG,IAAI,KAAK,OAAO,GAAGF,MAAM,CAACpD,UAAU,GAAGoD,MAAM,CAACjD,gBAAgB,CAAC;EACvH,OAAOgD,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__styles","mergeClasses","createArrowHeightStyles","createArrowStyles","tokens","typographyStyles","popoverSurfaceClassNames","root","arrowHeights","small","medium","large","useStyles","sj55zd","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bhu2qc9","inline","Bj3rh1h","inverted","brand","smallPadding","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","mediumPadding","largePadding","smallArrow","rhnwrx","Bdy53xb","mediumLargeArrow","arrow","B7ck84d","qhf8xq","B2eet1l","Bz10aip","Bqenvij","a9b677","Ftih45","Br0sdwz","cmx5o7","susq4k","Biibvgv","Bicfajf","qehafq","Brs5u8j","Ccq8qp","Baz25je","Bcgcnre","Bqjgrrk","qa3bma","y0oebl","Biqmznv","Bm6vgfq","Bbv0w2i","uvfttm","eqrjj","Bk5zm6e","m598lv","B4f6apu","ydt019","Bq4z7u6","Bdkvgpv","B0qfbqy","kj8mxx","r59vdv","Bkw5xw4","hl6cv3","aea9ga","yayu3t","Bhsv975","rhl9o9","B7gxrvb","B6q6orb","B0lu1f8","d","p","usePopoverSurfaceStyles_unstable","state","styles","className","size","appearance","arrowClassName"],"sources":["usePopoverSurfaceStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, 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 */ const useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n ...typographyStyles.body1,\n // TODO need to add versions of tokens.alias.shadow.shadow16, etc. that work with filter\n filter: `drop-shadow(0 0 2px ${tokens.colorNeutralShadowAmbient}) ` + `drop-shadow(0 8px 16px ${tokens.colorNeutralShadowKey})`\n },\n inline: {\n // When rendering inline, the PopoverSurface will be rendered under relatively positioned elements such as Input.\n // This is due to the surface being positioned as absolute, therefore zIndex: 1 ensures that won't happen.\n zIndex: 1\n },\n inverted: {\n backgroundColor: tokens.colorNeutralBackgroundStatic,\n color: tokens.colorNeutralForegroundStaticInverted\n },\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand\n },\n smallPadding: {\n padding: '12px'\n },\n mediumPadding: {\n padding: '16px'\n },\n largePadding: {\n padding: '20px'\n },\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({\n arrowHeight: undefined\n })\n});\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */ export const usePopoverSurfaceStyles_unstable = (state)=>{\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(popoverSurfaceClassNames.root, styles.root, state.inline && styles.inline, 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 // eslint-disable-next-line react-hooks/immutability\n state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ,6BAA6B;AACxF,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE;AACV,CAAC;AACD,OAAO,MAAMC,YAAY,GAAG;EACxBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC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YAAY,CAACyG,MAAM,CAAChD,KAAK,EAAE+C,KAAK,CAACG,IAAI,KAAK,OAAO,GAAGF,MAAM,CAACpD,UAAU,GAAGoD,MAAM,CAACjD,gBAAgB,CAAC;EACvH,OAAOgD,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import { makeStyles, mergeClasses } from '@griffel/react';
3
- import { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';
4
- import { tokens, typographyStyles } from '@fluentui/react-theme';
2
+ import { makeStyles, mergeClasses } from "@griffel/react";
3
+ import { createArrowHeightStyles, createArrowStyles } from "@fluentui/react-positioning";
4
+ import { tokens, typographyStyles } from "@fluentui/react-theme";
5
5
  export const popoverSurfaceClassNames = {
6
6
  root: 'fui-PopoverSurface'
7
7
  };
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { usePopoverTrigger_unstable } from './usePopoverTrigger';
3
- import { renderPopoverTrigger_unstable } from './renderPopoverTrigger';
2
+ import { usePopoverTrigger_unstable } from "./usePopoverTrigger.js";
3
+ import { renderPopoverTrigger_unstable } from "./renderPopoverTrigger.js";
4
4
  /**
5
5
  * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
6
6
  */ export const PopoverTrigger = (props)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverTrigger/PopoverTrigger.tsx"],"sourcesContent":["'use client';\n\nimport type * 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"],"names":["usePopoverTrigger_unstable","renderPopoverTrigger_unstable","PopoverTrigger","props","state","displayName","isFluentTriggerComponent"],"mappings":"AAAA;AAGA,SAASA,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AAIvE;;CAEC,GACD,OAAO,MAAMC,iBAAgDC,CAAAA;IAC3D,MAAMC,QAAQJ,2BAA2BG;IAEzC,OAAOF,8BAA8BG;AACvC,EAAE;AAEFF,eAAeG,WAAW,GAAG;AAC7B,6FAA6F;AAC5FH,eAA0CI,wBAAwB,GAAG"}
1
+ {"version":3,"sources":["../src/components/PopoverTrigger/PopoverTrigger.tsx"],"sourcesContent":["'use client';\n\nimport type * 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"],"names":["usePopoverTrigger_unstable","renderPopoverTrigger_unstable","PopoverTrigger","props","state","displayName","isFluentTriggerComponent"],"mappings":"AAAA;AAGA,SAASA,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,4BAAyB;AAIvE;;CAEC,GACD,OAAO,MAAMC,iBAAgDC,CAAAA;IAC3D,MAAMC,QAAQJ,2BAA2BG;IAEzC,OAAOF,8BAA8BG;AACvC,EAAE;AAEFF,eAAeG,WAAW,GAAG;AAC7B,6FAA6F;AAC5FH,eAA0CI,wBAAwB,GAAG"}
@@ -1,3 +1,3 @@
1
- export { PopoverTrigger } from './PopoverTrigger';
2
- export { renderPopoverTrigger_unstable } from './renderPopoverTrigger';
3
- export { usePopoverTrigger_unstable } from './usePopoverTrigger';
1
+ export { PopoverTrigger } from "./PopoverTrigger.js";
2
+ export { renderPopoverTrigger_unstable } from "./renderPopoverTrigger.js";
3
+ export { usePopoverTrigger_unstable } from "./usePopoverTrigger.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverTrigger/index.ts"],"sourcesContent":["export { PopoverTrigger } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';\nexport { renderPopoverTrigger_unstable } from './renderPopoverTrigger';\nexport { usePopoverTrigger_unstable } from './usePopoverTrigger';\n"],"names":["PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB"}
1
+ {"version":3,"sources":["../src/components/PopoverTrigger/index.ts"],"sourcesContent":["export { PopoverTrigger } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';\nexport { renderPopoverTrigger_unstable } from './renderPopoverTrigger';\nexport { usePopoverTrigger_unstable } from './usePopoverTrigger';\n"],"names":["PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,sBAAmB;AAElD,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,0BAA0B,QAAQ,yBAAsB"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- import { applyTriggerPropsToChildren, getTriggerChild, getReactElementRef, mergeCallbacks, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';
3
- import { useModalAttributes } from '@fluentui/react-tabster';
4
- import { usePopoverContext_unstable } from '../../popoverContext';
5
- import { useARIAButtonProps } from '@fluentui/react-aria';
6
- import { Escape } from '@fluentui/keyboard-keys';
2
+ import { applyTriggerPropsToChildren, getTriggerChild, getReactElementRef, mergeCallbacks, useMergedRefs, useEventCallback } from "@fluentui/react-utilities";
3
+ import { useModalAttributes } from "@fluentui/react-tabster";
4
+ import { usePopoverContext_unstable } from "../../popoverContext.js";
5
+ import { useARIAButtonProps } from "@fluentui/react-aria";
6
+ import { Escape } from "@fluentui/keyboard-keys";
7
7
  /**
8
8
  * Create the state required to render PopoverTrigger.
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverTrigger/usePopoverTrigger.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n mergeCallbacks,\n useMergedRefs,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render PopoverTrigger.\n *\n * The returned state can be modified with hooks such as usePopoverTriggerStyles,\n * before being passed to renderPopoverTrigger_unstable.\n *\n * @param props - props from this instance of PopoverTrigger\n */\nexport const usePopoverTrigger_unstable = (props: PopoverTriggerProps): PopoverTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const child = getTriggerChild(children);\n\n const open = usePopoverContext_unstable(context => context.open);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const toggleOpen = usePopoverContext_unstable(context => context.toggleOpen);\n const triggerRef = usePopoverContext_unstable(context => context.triggerRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const openOnContext = usePopoverContext_unstable(context => context.openOnContext);\n const { triggerAttributes } = useModalAttributes();\n\n const onContextMenu = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, true);\n }\n };\n\n const onClick = (e: React.MouseEvent<HTMLElement>) => {\n if (!openOnContext) {\n toggleOpen(e);\n }\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === Escape && open && !e.isDefaultPrevented()) {\n setOpen(e, false);\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Popover, Menu and Tooltip\n e.preventDefault();\n }\n };\n\n const onMouseEnter = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n };\n\n const onMouseLeave = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n };\n\n const contextMenuProps = {\n ...triggerAttributes,\n 'aria-expanded': `${open}`,\n ...child?.props,\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n ref: useMergedRefs(triggerRef, getReactElementRef(child)),\n } as const;\n\n const triggerChildProps = {\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n children: applyTriggerPropsToChildren(\n props.children,\n useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n ),\n };\n};\n"],"names":["applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","mergeCallbacks","useMergedRefs","useEventCallback","useModalAttributes","usePopoverContext_unstable","useARIAButtonProps","Escape","usePopoverTrigger_unstable","props","children","disableButtonEnhancement","child","open","context","setOpen","toggleOpen","triggerRef","openOnHover","openOnContext","triggerAttributes","onContextMenu","e","preventDefault","onClick","onKeyDown","key","isDefaultPrevented","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","type"],"mappings":"AAAA;AAGA,SACEA,2BAA2B,EAC3BC,eAAe,EACfC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,gBAAgB,QACX,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,0BAA0B,QAAQ,uBAAuB;AAElE,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD;;;;;;;CAOC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAMG,QAAQb,gBAAgBW;IAE9B,MAAMG,OAAOR,2BAA2BS,CAAAA,UAAWA,QAAQD,IAAI;IAC/D,MAAME,UAAUV,2BAA2BS,CAAAA,UAAWA,QAAQC,OAAO;IACrE,MAAMC,aAAaX,2BAA2BS,CAAAA,UAAWA,QAAQE,UAAU;IAC3E,MAAMC,aAAaZ,2BAA2BS,CAAAA,UAAWA,QAAQG,UAAU;IAC3E,MAAMC,cAAcb,2BAA2BS,CAAAA,UAAWA,QAAQI,WAAW;IAC7E,MAAMC,gBAAgBd,2BAA2BS,CAAAA,UAAWA,QAAQK,aAAa;IACjF,MAAM,EAAEC,iBAAiB,EAAE,GAAGhB;IAE9B,MAAMiB,gBAAgB,CAACC;QACrB,IAAIH,eAAe;YACjBG,EAAEC,cAAc;YAChBR,QAAQO,GAAG;QACb;IACF;IAEA,MAAME,UAAU,CAACF;QACf,IAAI,CAACH,eAAe;YAClBH,WAAWM;QACb;IACF;IAEA,M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CAAAA,kBAAAA,4BAAAA,MAAOsB,IAAI,MAAK,MAAMtB,MAAMsB,IAAI,GAAG,OAC/Df,gBAAgBW,mBAAmBnB,2BAA2BqB,oBAAoBC;IAGxF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/PopoverTrigger/usePopoverTrigger.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n mergeCallbacks,\n useMergedRefs,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render PopoverTrigger.\n *\n * The returned state can be modified with hooks such as usePopoverTriggerStyles,\n * before being passed to renderPopoverTrigger_unstable.\n *\n * @param props - props from this instance of PopoverTrigger\n */\nexport const usePopoverTrigger_unstable = (props: PopoverTriggerProps): PopoverTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const child = getTriggerChild(children);\n\n const open = usePopoverContext_unstable(context => context.open);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const toggleOpen = usePopoverContext_unstable(context => context.toggleOpen);\n const triggerRef = usePopoverContext_unstable(context => context.triggerRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const openOnContext = usePopoverContext_unstable(context => context.openOnContext);\n const { triggerAttributes } = useModalAttributes();\n\n const onContextMenu = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, true);\n }\n };\n\n const onClick = (e: React.MouseEvent<HTMLElement>) => {\n if (!openOnContext) {\n toggleOpen(e);\n }\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === Escape && open && !e.isDefaultPrevented()) {\n setOpen(e, false);\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Popover, Menu and Tooltip\n e.preventDefault();\n }\n };\n\n const onMouseEnter = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n };\n\n const onMouseLeave = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n };\n\n const contextMenuProps = {\n ...triggerAttributes,\n 'aria-expanded': `${open}`,\n ...child?.props,\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n ref: useMergedRefs(triggerRef, getReactElementRef(child)),\n } as const;\n\n const triggerChildProps = {\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n children: applyTriggerPropsToChildren(\n props.children,\n useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n ),\n };\n};\n"],"names":["applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","mergeCallbacks","useMergedRefs","useEventCallback","useModalAttributes","usePopoverContext_unstable","useARIAButtonProps","Escape","usePopoverTrigger_unstable","props","children","disableButtonEnhancement","child","open","context","setOpen","toggleOpen","triggerRef","openOnHover","openOnContext","triggerAttributes","onContextMenu","e","preventDefault","onClick","onKeyDown","key","isDefaultPrevented","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","type"],"mappings":"AAAA;AAGA,S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P;QACpB,IAAIJ,aAAa;YACfH,QAAQO,GAAG;QACb;IACF;IAEA,MAAMQ,mBAAmB;QACvB,GAAGV,iBAAiB;QACpB,iBAAiB,GAAGP,MAAM;WACvBD,kBAAAA,4BAAAA,MAAOH,KAAK,AAAf;QACAmB,cAAczB,iBAAiBF,eAAeW,kBAAAA,4BAAAA,MAAOH,KAAK,CAACmB,YAAY,EAAEA;QACzEC,cAAc1B,iBAAiBF,eAAeW,kBAAAA,4BAAAA,MAAOH,KAAK,CAACoB,YAAY,EAAEA;QACzER,eAAelB,iBAAiBF,eAAeW,kBAAAA,4BAAAA,MAAOH,KAAK,CAACY,aAAa,EAAEA;QAC3EU,KAAK7B,cAAce,YAAYjB,mBAAmBY;IACpD;IAEA,MAAMoB,oBAAoB;QACxB,GAAGF,gBAAgB;QACnBN,SAASrB,iBAAiBF,eAAeW,kBAAAA,4BAAAA,MAAOH,KAAK,CAACe,OAAO,EAAEA;QAC/DC,WAAWtB,iBAAiBF,eAAeW,kBAAAA,4BAAAA,MAAOH,KAAK,CAACgB,SAAS,EAAEA;IACrE;IAEA,MAAMQ,8BAA8B3B,mBAClCM,CAAAA,kBAAAA,4BAAAA,MAAOsB,IAAI,MAAK,YAAYtB,CAAAA,kBAAAA,4BAAAA,MAAOsB,IAAI,MAAK,MAAMtB,MAAMsB,IAAI,GAAG,OAC/DF;IAGF,OAAO;QACLtB,UAAUZ,4BACRW,MAAMC,QAAQ,EACdJ,mBACEM,CAAAA,kBAAAA,4BAAAA,MAAOsB,IAAI,MAAK,YAAYtB,CAAAA,kBAAAA,4BAAAA,MAAOsB,IAAI,MAAK,MAAMtB,MAAMsB,IAAI,GAAG,OAC/Df,gBAAgBW,mBAAmBnB,2BAA2BqB,oBAAoBC;IAGxF;AACF,EAAE"}
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Popover, renderPopover_unstable, usePopover_unstable, usePopoverContextValues_unstable } from './Popover';
2
- export { PopoverSurface, arrowHeights, popoverSurfaceClassNames, renderPopoverSurface_unstable, usePopoverSurfaceStyles_unstable, usePopoverSurface_unstable } from './PopoverSurface';
3
- export { PopoverProvider, usePopoverContext_unstable } from './popoverContext';
4
- export { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';
1
+ export { Popover, renderPopover_unstable, usePopover_unstable, usePopoverContextValues_unstable } from "./Popover.js";
2
+ export { PopoverSurface, arrowHeights, popoverSurfaceClassNames, renderPopoverSurface_unstable, usePopoverSurfaceStyles_unstable, usePopoverSurface_unstable } from "./PopoverSurface.js";
3
+ export { PopoverProvider, usePopoverContext_unstable } from "./popoverContext.js";
4
+ export { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from "./PopoverTrigger.js";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable, usePopoverContextValues_unstable } from './Popover';\nexport type {\n OnOpenChangeData,\n OpenPopoverEvents,\n PopoverContextValues,\n PopoverProps,\n PopoverSize,\n PopoverState,\n} from './Popover';\nexport {\n PopoverSurface,\n arrowHeights,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface';\nexport { PopoverProvider, usePopoverContext_unstable } from './popoverContext';\nexport type { PopoverContextValue } from './popoverContext';\nexport { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger';\n"],"names":["Popover","renderPopover_unstable","usePopover_unstable","usePopoverContextValues_unstable","PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable","PopoverProvider","usePopoverContext_unstable","PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"mappings":"AAAA,SAASA,OAAO,EAAEC,sBAAsB,EAAEC,mBAAmB,EAAEC,gCAAgC,QAAQ,YAAY;AASnH,SACEC,cAAc,EACdC,YAAY,EACZC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAE1B,SAASC,eAAe,EAAEC,0BAA0B,QAAQ,mBAAmB;AAE/E,SAASC,cAAc,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ,mBAAmB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable, usePopoverContextValues_unstable } from './Popover';\nexport type {\n OnOpenChangeData,\n OpenPopoverEvents,\n PopoverContextValues,\n PopoverProps,\n PopoverSize,\n PopoverState,\n} from './Popover';\nexport {\n PopoverSurface,\n arrowHeights,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface';\nexport { PopoverProvider, usePopoverContext_unstable } from './popoverContext';\nexport type { PopoverContextValue } from './popoverContext';\nexport { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger';\n"],"names":["Popover","renderPopover_unstable","usePopover_unstable","usePopoverContextValues_unstable","PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable","PopoverProvider","usePopoverContext_unstable","PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"mappings":"AAAA,SAASA,OAAO,EAAEC,sBAAsB,EAAEC,mBAAmB,EAAEC,gCAAgC,QAAQ,eAAY;AASnH,SACEC,cAAc,EACdC,YAAY,EACZC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,sBAAmB;AAE1B,SAASC,eAAe,EAAEC,0BAA0B,QAAQ,sBAAmB;AAE/E,SAASC,cAAc,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ,sBAAmB"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
+ import { createContext, useContextSelector } from "@fluentui/react-context-selector";
3
3
  export const PopoverContext = createContext(undefined);
4
4
  export const popoverContextDefaultValue = {
5
5
  open: false,
@@ -22,4 +22,4 @@ _export(exports, {
22
22
  return _index.usePopover_unstable;
23
23
  }
24
24
  });
25
- const _index = require("./components/Popover/index");
25
+ const _index = require("./components/Popover/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Popover.ts"],"sourcesContent":["export type {\n OnOpenChangeData,\n OpenPopoverEvents,\n PopoverContextValues,\n PopoverProps,\n PopoverSize,\n PopoverState,\n} from './components/Popover/index';\nexport {\n Popover,\n renderPopover_unstable,\n usePopover_unstable,\n usePopoverContextValues_unstable,\n} from './components/Popover/index';\n"],"names":["Popover","renderPopover_unstable","usePopover_unstable","usePopoverContextValues_unstable"],"mappings":";;;;;;;;;;;;eASEA,cAAO;;;eACPC,6BAAsB;;;eAEtBE,uCAAgC;;;eADhCD,0BAAmB;;;uBAEd,6BAA6B"}
1
+ {"version":3,"sources":["../src/Popover.ts"],"sourcesContent":["export type {\n OnOpenChangeData,\n OpenPopoverEvents,\n PopoverContextValues,\n PopoverProps,\n PopoverSize,\n PopoverState,\n} from './components/Popover/index';\nexport {\n Popover,\n renderPopover_unstable,\n usePopover_unstable,\n usePopoverContextValues_unstable,\n} from './components/Popover/index';\n"],"names":["Popover","renderPopover_unstable","usePopover_unstable","usePopoverContextValues_unstable"],"mappings":";;;;;;;;;;;;eASEA,cAAO;;;eACPC,6BAAsB;;;eAEtBE,uCAAgC;;;eADhCD,0BAAmB;;;uBAEd,gCAA6B"}
@@ -28,4 +28,4 @@ _export(exports, {
28
28
  return _index.usePopoverSurface_unstable;
29
29
  }
30
30
  });
31
- const _index = require("./components/PopoverSurface/index");
31
+ const _index = require("./components/PopoverSurface/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/PopoverSurface.ts"],"sourcesContent":["export type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './components/PopoverSurface/index';\nexport {\n PopoverSurface,\n arrowHeights,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './components/PopoverSurface/index';\n"],"names":["PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable"],"mappings":";;;;;;;;;;;;eAEEA,qBAAc;;;eACdC,mBAAY;;;eACZC,+BAAwB;;;eACxBC,oCAA6B;;;eAC7BC,uCAAgC;;;eAChCC,iCAA0B;;;uBACrB,oCAAoC"}
1
+ {"version":3,"sources":["../src/PopoverSurface.ts"],"sourcesContent":["export type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './components/PopoverSurface/index';\nexport {\n PopoverSurface,\n arrowHeights,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './components/PopoverSurface/index';\n"],"names":["PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable"],"mappings":";;;;;;;;;;;;eAEEA,qBAAc;;;eACdC,mBAAY;;;eACZC,+BAAwB;;;eACxBC,oCAA6B;;;eAC7BC,uCAAgC;;;eAChCC,iCAA0B;;;uBACrB,uCAAoC"}
@@ -19,4 +19,4 @@ _export(exports, {
19
19
  return _index.usePopoverTrigger_unstable;
20
20
  }
21
21
  });
22
- const _index = require("./components/PopoverTrigger/index");
22
+ const _index = require("./components/PopoverTrigger/index.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/PopoverTrigger.ts"],"sourcesContent":["export type {\n PopoverTriggerChildProps,\n PopoverTriggerProps,\n PopoverTriggerState,\n} from './components/PopoverTrigger/index';\nexport {\n PopoverTrigger,\n renderPopoverTrigger_unstable,\n usePopoverTrigger_unstable,\n} from './components/PopoverTrigger/index';\n"],"names":["PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"mappings":";;;;;;;;;;;;eAMEA,qBAAc;;;eACdC,oCAA6B;;;eAC7BC,iCAA0B;;;uBACrB,oCAAoC"}
1
+ {"version":3,"sources":["../src/PopoverTrigger.ts"],"sourcesContent":["export type {\n PopoverTriggerChildProps,\n PopoverTriggerProps,\n PopoverTriggerState,\n} from './components/PopoverTrigger/index';\nexport {\n PopoverTrigger,\n renderPopoverTrigger_unstable,\n usePopoverTrigger_unstable,\n} from './components/PopoverTrigger/index';\n"],"names":["PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"mappings":";;;;;;;;;;;;eAMEA,qBAAc;;;eACdC,oCAA6B;;;eAC7BC,iCAA0B;;;uBACrB,uCAAoC"}
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "Popover", {
9
9
  return Popover;
10
10
  }
11
11
  });
12
- const _usePopover = require("./usePopover");
13
- const _usePopoverContextValues = require("./usePopoverContextValues");
14
- const _renderPopover = require("./renderPopover");
12
+ const _usePopover = require("./usePopover.cjs");
13
+ const _usePopoverContextValues = require("./usePopoverContextValues.cjs");
14
+ const _renderPopover = require("./renderPopover.cjs");
15
15
  const Popover = (props)=>{
16
16
  const state = (0, _usePopover.usePopover_unstable)(props);
17
17
  const contextValues = (0, _usePopoverContextValues.usePopoverContextValues_unstable)(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { usePopoverContextValues_unstable } from './usePopoverContextValues';\nimport { renderPopover_unstable } from './renderPopover';\nimport type { PopoverProps } from './Popover.types';\n\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover: React.FC<PopoverProps> = props => {\n const state = usePopover_unstable(props);\n const contextValues = usePopoverContextValues_unstable(state);\n\n return renderPopover_unstable(state, contextValues);\n};\n\nPopover.displayName = 'Popover';\n"],"names":["usePopover_unstable","usePopoverContextValues_unstable","renderPopover_unstable","Popover","props","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;4BAGoC,eAAe;yCACF,4BAA4B;+BACtC,kBAAkB;AAMlD,MAAMG,UAAkCC,CAAAA;IAC7C,MAAMC,YAAQL,+BAAAA,EAAoBI;IAClC,MAAME,oBAAgBL,yDAAAA,EAAiCI;IAEvD,WAAOH,qCAAAA,EAAuBG,OAAOC;AACvC,EAAE;AAEFH,QAAQI,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { usePopoverContextValues_unstable } from './usePopoverContextValues';\nimport { renderPopover_unstable } from './renderPopover';\nimport type { PopoverProps } from './Popover.types';\n\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover: React.FC<PopoverProps> = props => {\n const state = usePopover_unstable(props);\n const contextValues = usePopoverContextValues_unstable(state);\n\n return renderPopover_unstable(state, contextValues);\n};\n\nPopover.displayName = 'Popover';\n"],"names":["usePopover_unstable","usePopoverContextValues_unstable","renderPopover_unstable","Popover","props","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;4BAGoC,kBAAe;yCACF,+BAA4B;+BACtC,qBAAkB;AAMlD,MAAMG,UAAkCC,CAAAA;IAC7C,MAAMC,YAAQL,+BAAAA,EAAoBI;IAClC,MAAME,oBAAgBL,yDAAAA,EAAiCI;IAEvD,WAAOH,qCAAAA,EAAuBG,OAAOC;AACvC,EAAE;AAEFH,QAAQI,WAAW,GAAG"}
@@ -22,7 +22,7 @@ _export(exports, {
22
22
  return _usePopover.usePopover_unstable;
23
23
  }
24
24
  });
25
- const _Popover = require("./Popover");
26
- const _renderPopover = require("./renderPopover");
27
- const _usePopover = require("./usePopover");
28
- const _usePopoverContextValues = require("./usePopoverContextValues");
25
+ const _Popover = require("./Popover.cjs");
26
+ const _renderPopover = require("./renderPopover.cjs");
27
+ const _usePopover = require("./usePopover.cjs");
28
+ const _usePopoverContextValues = require("./usePopoverContextValues.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Popover/index.ts"],"sourcesContent":["export { Popover } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } from './Popover.types';\nexport { renderPopover_unstable } from './renderPopover';\nexport { usePopover_unstable } from './usePopover';\nexport { usePopoverContextValues_unstable } from './usePopoverContextValues';\nexport type { PopoverContextValues } from './usePopoverContextValues';\n"],"names":["Popover","renderPopover_unstable","usePopover_unstable","usePopoverContextValues_unstable"],"mappings":";;;;;;;;;;;;eAASA,gBAAO;;;eAEPC,qCAAsB;;;eAEtBE,yDAAgC;;;eADhCD,+BAAmB;;;yBAHJ,YAAY;+BAEG,kBAAkB;4BACrB,eAAe;yCACF,4BAA4B"}
1
+ {"version":3,"sources":["../src/components/Popover/index.ts"],"sourcesContent":["export { Popover } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } from './Popover.types';\nexport { renderPopover_unstable } from './renderPopover';\nexport { usePopover_unstable } from './usePopover';\nexport { usePopoverContextValues_unstable } from './usePopoverContextValues';\nexport type { PopoverContextValues } from './usePopoverContextValues';\n"],"names":["Popover","renderPopover_unstable","usePopover_unstable","usePopoverContextValues_unstable"],"mappings":";;;;;;;;;;;;eAASA,gBAAO;;;eAEPC,qCAAsB;;;eAEtBE,yDAAgC;;;eADhCD,+BAAmB;;;yBAHJ,eAAY;+BAEG,qBAAkB;4BACrB,kBAAe;yCACF,+BAA4B"}
@@ -13,7 +13,7 @@ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
13
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
14
  const _reactutilities = require("@fluentui/react-utilities");
15
15
  const _reactmotion = require("@fluentui/react-motion");
16
- const _popoverContext = require("../../popoverContext");
16
+ const _popoverContext = require("../../popoverContext.cjs");
17
17
  const renderPopover_unstable = (state, contextValues)=>{
18
18
  (0, _reactutilities.assertSlots)(state);
19
19
  var _contextValues_popover;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Popover/renderPopover.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport { assertSlots, type JSXElement } from '@fluentui/react-utilities';\nimport { MotionRefForwarder } from '@fluentui/react-motion';\nimport { PopoverContext, popoverContextDefaultValue } from '../../popoverContext';\nimport type { InternalPopoverSlots, PopoverState } from './Popover.types';\nimport type { PopoverContextValues } from './usePopoverContextValues';\n\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover_unstable = (state: PopoverState, contextValues?: PopoverContextValues): JSXElement => {\n assertSlots<InternalPopoverSlots>(state);\n\n return (\n <PopoverContext.Provider value={contextValues?.popover ?? popoverContextDefaultValue}>\n {state.popoverTrigger}\n {state.popoverSurface && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <PopoverSurface /> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.popoverSurface as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </PopoverContext.Provider>\n );\n};\n"],"names":["React","assertSlots","MotionRefForwarder","PopoverContext","popoverContextDefaultValue","renderPopover_unstable","state","contextValues","Provider","value","popover","popoverTrigger","popoverSurface","surfaceMotion"],"mappings":";;;;+BAaaK;;;;;;;4BAZb,iCAAiD;iEAE1B,QAAQ;gCACc,4BAA4B;6BACtC,yBAAyB;gCACD,uBAAuB;AAO3E,+BAA+B,CAACC,OAAqBC;QAC1DN,2BAAAA,EAAkCK;QAGAC;IADlC,OAAA,WAAA,OACE,gBAAA,EAACJ,8BAAAA,CAAeK,QAAQ,EAAA;QAACC,OAAOF,CAAAA,yBAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeG,OAAO,AAAPA,MAAO,QAAtBH,2BAAAA,KAAAA,IAAAA,yBAA0BH,0CAAAA;;YACvDE,MAAMK,cAAc;YACpBL,MAAMM,cAAc,IAAA,WAAA,OACnB,eAAA,EAACN,MAAMO,aAAa,EAAA;0BAClB,WAAA,OAAA,eAAA,EAACX,+BAAAA,EAAAA;8BAGEI,MAAMM,cAAc;;;;;AAMjC,EAAE"}
1
+ {"version":3,"sources":["../src/components/Popover/renderPopover.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport { assertSlots, type JSXElement } from '@fluentui/react-utilities';\nimport { MotionRefForwarder } from '@fluentui/react-motion';\nimport { PopoverContext, popoverContextDefaultValue } from '../../popoverContext';\nimport type { InternalPopoverSlots, PopoverState } from './Popover.types';\nimport type { PopoverContextValues } from './usePopoverContextValues';\n\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover_unstable = (state: PopoverState, contextValues?: PopoverContextValues): JSXElement => {\n assertSlots<InternalPopoverSlots>(state);\n\n return (\n <PopoverContext.Provider value={contextValues?.popover ?? popoverContextDefaultValue}>\n {state.popoverTrigger}\n {state.popoverSurface && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <PopoverSurface /> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.popoverSurface as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </PopoverContext.Provider>\n );\n};\n"],"names":["React","assertSlots","MotionRefForwarder","PopoverContext","popoverContextDefaultValue","renderPopover_unstable","state","contextValues","Provider","value","popover","popoverTrigger","popoverSurface","surfaceMotion"],"mappings":";;;;+BAaaK;;;;;;;4BAZb,iCAAiD;iEAE1B,QAAQ;gCACc,4BAA4B;6BACtC,yBAAyB;gCACD,0BAAuB;AAO3E,+BAA+B,CAACC,OAAqBC;QAC1DN,2BAAAA,EAAkCK;QAGAC;IADlC,OAAA,WAAA,OACE,gBAAA,EAACJ,8BAAAA,CAAeK,QAAQ,EAAA;QAACC,OAAOF,CAAAA,yBAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeG,OAAO,AAAPA,MAAO,QAAtBH,2BAAAA,KAAAA,IAAAA,yBAA0BH,0CAAAA;;YACvDE,MAAMK,cAAc;YACpBL,MAAMM,cAAc,IAAA,WAAA,OACnB,eAAA,EAACN,MAAMO,aAAa,EAAA;0BAClB,WAAA,OAAA,eAAA,EAACX,+BAAAA,EAAAA;8BAGEI,MAAMM,cAAc;;;;;AAMjC,EAAE"}
@@ -15,10 +15,10 @@ const _reactutilities = require("@fluentui/react-utilities");
15
15
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
16
16
  const _reactpositioning = require("@fluentui/react-positioning");
17
17
  const _reacttabster = require("@fluentui/react-tabster");
18
- const _index = require("../PopoverSurface/index");
19
- const _constants = require("./constants");
18
+ const _index = require("../PopoverSurface/index.cjs");
19
+ const _constants = require("./constants.cjs");
20
20
  const _reactmotion = require("@fluentui/react-motion");
21
- const _PopoverSurfaceMotion = require("./PopoverSurfaceMotion");
21
+ const _PopoverSurfaceMotion = require("./PopoverSurfaceMotion.cjs");
22
22
  const usePopover_unstable = (props)=>{
23
23
  const [contextTarget, setContextTarget] = (0, _reactpositioning.usePositioningMouseTarget)();
24
24
  const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Popover/usePopover.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useOnClickOutside,\n useOnScrollOutside,\n elementContains,\n useTimeout,\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 usePositioningSlideDirection,\n} from '@fluentui/react-positioning';\nimport { useFocusFinders, useActivateModal } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { PopoverSurfaceMotion } from './PopoverSurfaceMotion';\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 { targetDocument } = useFluent();\n\n const positioning = resolvePositioningShorthand(props.positioning);\n const handlePositionEnd = usePositioningSlideDirection({\n targetDocument,\n onPositioningEnd: positioning.onPositioningEnd,\n });\n\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props,\n positioning: {\n ...positioning,\n onPositioningEnd: handlePositionEnd,\n },\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 [setOpenTimeout, clearOpenTimeout] = useTimeout();\n const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n clearOpenTimeout();\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 setOpenTimeout(() => {\n setOpenState(e, shouldOpen);\n }, props.mouseLeaveDelay ?? 500);\n } else {\n setOpenState(e, shouldOpen);\n }\n });\n\n const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n (e: OpenPopoverEvents) => {\n setOpen(e, !open);\n },\n [setOpen, open],\n );\n\n const positioningRefs = usePopoverRefs(initialState);\n\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open,\n disabledFocusOnIframe: !(props.closeOnIframeFocus ?? true),\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 // When trapFocus is enabled, dismiss the popover only on a genuine inside -> outside focus\n // transition. Focus that was never inside - e.g. a consumer keeping focus on an external element\n // via `unstable_disableAutoFocus` - must not dismiss it on an outside -> outside focus change.\n // Internal `closeOnFocusOutside` prop allows consumers to opt out during gradual rollout.\n const closeOnFocusOutside = (props as PopoverProps & { closeOnFocusOutside?: boolean }).closeOnFocusOutside ?? true;\n\n const focusWasInsideRef = React.useRef(false);\n\n const closeOnFocusOutCallback = useEventCallback((ev: FocusEvent) => {\n const target = (ev.composedPath()[0] ?? ev.target) as HTMLElement | null;\n const contentElement = positioningRefs.contentRef.current;\n const triggerElement = positioningRefs.triggerRef.current ?? null;\n\n if (!contentElement) {\n return;\n }\n\n const isInside = elementContains(contentElement, target) || elementContains(triggerElement, target);\n\n if (isInside) {\n focusWasInsideRef.current = true;\n return;\n }\n\n // Only dismiss if focus previously lived inside the popover.\n if (focusWasInsideRef.current) {\n focusWasInsideRef.current = false;\n setOpen(ev, false);\n }\n });\n\n React.useEffect(() => {\n if (!open || !props.trapFocus || !closeOnFocusOutside) {\n return;\n }\n\n focusWasInsideRef.current = false;\n targetDocument?.addEventListener('focusin', closeOnFocusOutCallback, true);\n return () => {\n targetDocument?.removeEventListener('focusin', closeOnFocusOutCallback, true);\n };\n }, [open, props.trapFocus, closeOnFocusOutside, targetDocument, closeOnFocusOutCallback]);\n\n const { findFirstFocusable } = useFocusFinders();\n const activateModal = useActivateModal();\n\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n\n const contentElement = positioningRefs.contentRef.current;\n\n if (open && contentElement) {\n const shouldFocusContainer = !isNaN(contentElement.getAttribute('tabIndex') ?? undefined);\n const firstFocusable = shouldFocusContainer ? contentElement : findFirstFocusable(contentElement);\n\n firstFocusable?.focus();\n\n if (shouldFocusContainer) {\n // Modal activation happens automatically when something inside the modal is focused programmatically.\n // When the container is focused, we need to activate the modal manually.\n activateModal(contentElement);\n }\n }\n }, [findFirstFocusable, activateModal, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n return {\n components: {\n surfaceMotion: PopoverSurfaceMotion,\n },\n ...initialState,\n ...positioningRefs,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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 surfaceMotion: presenceMotionSlot(props.surfaceMotion, {\n elementType: PopoverSurfaceMotion,\n defaultProps: {\n visible: open,\n appear: true,\n unmountOnExit: true,\n },\n }),\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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"],"names":["React","useControllableState","useEventCallback","useOnClickOutside","useOnScrollOutside","elementContains","useTimeout","useFluent_unstable","useFluent","usePositioning","resolvePositioningShorthand","mergeArrowOffset","usePositioningMouseTarget","usePositioningSlideDirection","useFocusFinders","useActivateModal","arrowHeights","popoverSurfaceBorderRadius","presenceMotionSlot","PopoverSurfaceMotion","usePopover_unstable","props","contextTarget","setContextTarget","targetDocument","positioning","handlePositionEnd","onPositioningEnd","initialState","size","children","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeout","clearOpenTimeout","setOpen","e","shouldOpen","Event","persist","type","mouseLeaveDelay","toggleOpen","useCallback","positioningRefs","usePopoverRefs","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","disabledFocusOnIframe","closeOnIframeFocus","closeOnScroll","openOnContext","closeOnFocusOutside","focusWasInsideRef","useRef","closeOnFocusOutCallback","target","composedPath","contentElement","current","triggerElement","isInside","useEffect","trapFocus","addEventListener","removeEventListener","findFirstFocusable","activateModal","unstable_disableAutoFocus","shouldFocusContainer","isNaN","getAttribute","firstFocusable","focus","components","surfaceMotion","inertTrapFocus","legacyTrapFocus","inline","elementType","defaultProps","visible","appear","unmountOnExit","state","onOpenChange","data","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","coverTarget","withArrow","offset","targetRef","containerRef","arrowRef"],"mappings":"AAAA;;;;;+BAkCaoB;;;;;;;iEAhCU,QAAQ;gCAQxB,4BAA4B;qCACa,kCAAkC;kCAO3E,8BAA8B;8BACa,0BAA0B;uBAC/C,0BAA0B;2BAEZ,cAAc;6BACtB,yBAAyB;sCACvB,yBAAyB;AAUvD,4BAA4B,CAACC;IAClC,MAAM,CAACC,eAAeC,iBAAiB,OAAGX,2CAAAA;IAC1C,MAAM,EAAEY,cAAc,EAAE,OAAGhB,uCAAAA;IAE3B,MAAMiB,cAAcf,iDAAAA,EAA4BW,MAAMI,WAAW;IACjE,MAAMC,wBAAoBb,8CAAAA,EAA6B;QACrDW;QACAG,kBAAkBF,YAAYE,gBAAgB;I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AAc;IAChB;IACA,oDAAoD;IACpD0E,MAAM5D,IAAI,GAAGA,SAASF,YAAYE,OAAO4D,MAAM5D,IAAI;IACnD,MAAMnB,mBAAmB+E,MAAM/E,gBAAgB;IAE/C,MAAMwB,UAAU/C,OAAMuD,WAAW,CAC/B,CAACP,GAAsBC;QACrB,IAAIA,cAAcD,EAAEI,IAAI,KAAK,eAAe;YAC1C7B,iBAAiByB;QACnB;QAEA,IAAI,CAACC,YAAY;YACf1B,iBAAiBiB;QACnB;QAEAG,aAAaM;QACbsD,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,aAAevD,GAAG;YAAEN,MAAMO;QAAW;IACvC,GACA;QAACN;QAAc4D;QAAchF;KAAiB;IAGhD,OAAO;QAACmB;QAAMK;KAAQ;AACxB;AAEA;;CAEC,GACD,SAASU,eACP6C,KACmE;IAEnE,MAAMK,qBAAqB;QACzBC,UAAU;QACVC,OAAO;QACPC,cAAc,IAAI7F,qCAAAA;QAClByD,QAAQ4B,MAAMjC,aAAa,GAAGiC,MAAMhF,aAAa,GAAGkB;QACpD,OAAG9B,6CAAAA,EAA4B4F,MAAM7E,WAAW,CAAC;IACnD;IAEA,qDAAqD;IACrD,IAAIkF,mBAAmBI,WAAW,EAAE;QAClC,oDAAoD;QACpDT,MAAMU,SAAS,GAAG;IACpB;IAEA,IAAIV,MAAMU,SAAS,EAAE;QACnBL,mBAAmBM,MAAM,OAAGtG,kCAAAA,EAAiBgG,mBAAmBM,MAAM,EAAEjG,mBAAY,CAACsF,MAAMzE,IAAI,CAAC;IAClG;IAEA,MAAM,EAAEqF,WAAWnD,UAAU,EAAEoD,cAAcnD,UAAU,EAAEoD,QAAQ,EAAE,OAAG3G,gCAAAA,EAAekG;IAErF,OAAO;QACL5C;QACAC;QACAoD;IACF;AACF"}
1
+ {"version":3,"sources":["../src/components/Popover/usePopover.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useOnClickOutside,\n useOnScrollOutside,\n elementContains,\n useTimeout,\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 usePositioningSlideDirection,\n} from '@fluentui/react-positioning';\nimport { useFocusFinders, useActivateModal } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { PopoverSurfaceMotion } from './PopoverSurfaceMotion';\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 { targetDocument } = useFluent();\n\n const positioning = resolvePositioningShorthand(props.positioning);\n const handlePositionEnd = usePositioningSlideDirection({\n targetDocument,\n onPositioningEnd: positioning.onPositioningEnd,\n });\n\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props,\n positioning: {\n ...positioning,\n onPositioningEnd: handlePositionEnd,\n },\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 [setOpenTimeout, clearOpenTimeout] = useTimeout();\n const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n clearOpenTimeout();\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 setOpenTimeout(() => {\n setOpenState(e, shouldOpen);\n }, props.mouseLeaveDelay ?? 500);\n } else {\n setOpenState(e, shouldOpen);\n }\n });\n\n const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n (e: OpenPopoverEvents) => {\n setOpen(e, !open);\n },\n [setOpen, open],\n );\n\n const positioningRefs = usePopoverRefs(initialState);\n\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open,\n disabledFocusOnIframe: !(props.closeOnIframeFocus ?? true),\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 // When trapFocus is enabled, dismiss the popover only on a genuine inside -> outside focus\n // transition. Focus that was never inside - e.g. a consumer keeping focus on an external element\n // via `unstable_disableAutoFocus` - must not dismiss it on an outside -> outside focus change.\n // Internal `closeOnFocusOutside` prop allows consumers to opt out during gradual rollout.\n const closeOnFocusOutside = (props as PopoverProps & { closeOnFocusOutside?: boolean }).closeOnFocusOutside ?? true;\n\n const focusWasInsideRef = React.useRef(false);\n\n const closeOnFocusOutCallback = useEventCallback((ev: FocusEvent) => {\n const target = (ev.composedPath()[0] ?? ev.target) as HTMLElement | null;\n const contentElement = positioningRefs.contentRef.current;\n const triggerElement = positioningRefs.triggerRef.current ?? null;\n\n if (!contentElement) {\n return;\n }\n\n const isInside = elementContains(contentElement, target) || elementContains(triggerElement, target);\n\n if (isInside) {\n focusWasInsideRef.current = true;\n return;\n }\n\n // Only dismiss if focus previously lived inside the popover.\n if (focusWasInsideRef.current) {\n focusWasInsideRef.current = false;\n setOpen(ev, false);\n }\n });\n\n React.useEffect(() => {\n if (!open || !props.trapFocus || !closeOnFocusOutside) {\n return;\n }\n\n focusWasInsideRef.current = false;\n targetDocument?.addEventListener('focusin', closeOnFocusOutCallback, true);\n return () => {\n targetDocument?.removeEventListener('focusin', closeOnFocusOutCallback, true);\n };\n }, [open, props.trapFocus, closeOnFocusOutside, targetDocument, closeOnFocusOutCallback]);\n\n const { findFirstFocusable } = useFocusFinders();\n const activateModal = useActivateModal();\n\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n\n const contentElement = positioningRefs.contentRef.current;\n\n if (open && contentElement) {\n const shouldFocusContainer = !isNaN(contentElement.getAttribute('tabIndex') ?? undefined);\n const firstFocusable = shouldFocusContainer ? contentElement : findFirstFocusable(contentElement);\n\n firstFocusable?.focus();\n\n if (shouldFocusContainer) {\n // Modal activation happens automatically when something inside the modal is focused programmatically.\n // When the container is focused, we need to activate the modal manually.\n activateModal(contentElement);\n }\n }\n }, [findFirstFocusable, activateModal, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n return {\n components: {\n surfaceMotion: PopoverSurfaceMotion,\n },\n ...initialState,\n ...positioningRefs,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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 surfaceMotion: presenceMotionSlot(props.surfaceMotion, {\n elementType: PopoverSurfaceMotion,\n defaultProps: {\n visible: open,\n appear: true,\n unmountOnExit: true,\n },\n }),\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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"],"names":["React","useControllableState","useEventCallback","useOnClickOutside","useOnScrollOutside","elementContains","useTimeout","useFluent_unstable","useFluent","usePositioning","resolvePositioningShorthand","mergeArrowOffset","usePositioningMouseTarget","usePositioningSlideDirection","useFocusFinders","useActivateModal","arrowHeights","popoverSurfaceBorderRadius","presenceMotionSlot","PopoverSurfaceMotion","usePopover_unstable","props","contextTarget","setContextTarget","targetDocument","positioning","handlePositionEnd","onPositioningEnd","initialState","size","children","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeout","clearOpenTimeout","setOpen","e","shouldOpen","Event","persist","type","mouseLeaveDelay","toggleOpen","useCallback","positioningRefs","usePopoverRefs","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","disabledFocusOnIframe","closeOnIframeFocus","closeOnScroll","openOnContext","closeOnFocusOutside","focusWasInsideRef","useRef","closeOnFocusOutCallback","target","composedPath","contentElement","current","triggerElement","isInside","useEffect","trapFocus","addEventListener","removeEventListener","findFirstFocusable","activateModal","unstable_disableAutoFocus","shouldFocusContainer","isNaN","getAttribute","firstFocusable","focus","components","surfaceMotion","inertTrapFocus","legacyTrapFocus","inline","elementType","defaultProps","visible","appear","unmountOnExit","state","onOpenChange","data","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","coverTarget","withArrow","offset","targetRef","containerRef","arrowRef"],"mappings":"AAAA;;;;;+BAkCaoB;;;;;;;iEAhCU,QAAQ;gCAQxB,4BAA4B;qCACa,kCAAkC;kCAO3E,8BAA8B;8BACa,0BAA0B;uBAC/C,6BAA0B;2BAEZ,iBAAc;6BACtB,yBAAyB;sCACvB,4BAAyB;AAUvD,4BAA4B,CAACC;IAClC,MAAM,CAACC,eAAeC,iBAAiB,OAAGX,2CAAAA;IAC1C,MAAM,EAAEY,cAAc,EAAE,OAAGhB,uCAAAA;IAE3B,MAAMiB,cAAcf,iDAAAA,EAA4BW,MAAMI,WAAW;IACjE,MAAMC,wBAAoBb,8CAAAA,EAA6B;QACrDW;QACAG,kBAAkBF,YAAYE,gBAAgB;IAChD;IAEA,MAAMC,eAAe;QACnBC,MAAM;QACNP;QACAC;QACA,GAAGF,KAAK;QACRI,aAAa;YACX,GAA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I;IACnD,MAAMnB,mBAAmB+E,MAAM/E,gBAAgB;IAE/C,MAAMwB,UAAU/C,OAAMuD,WAAW,CAC/B,CAACP,GAAsBC;QACrB,IAAIA,cAAcD,EAAEI,IAAI,KAAK,eAAe;YAC1C7B,iBAAiByB;QACnB;QAEA,IAAI,CAACC,YAAY;YACf1B,iBAAiBiB;QACnB;QAEAG,aAAaM;QACbsD,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,aAAevD,GAAG;YAAEN,MAAMO;QAAW;IACvC,GACA;QAACN;QAAc4D;QAAchF;KAAiB;IAGhD,OAAO;QAACmB;QAAMK;KAAQ;AACxB;AAEA;;CAEC,GACD,SAASU,eACP6C,KACmE;IAEnE,MAAMK,qBAAqB;QACzBC,UAAU;QACVC,OAAO;QACPC,cAAc,IAAI7F,qCAAAA;QAClByD,QAAQ4B,MAAMjC,aAAa,GAAGiC,MAAMhF,aAAa,GAAGkB;QACpD,OAAG9B,6CAAAA,EAA4B4F,MAAM7E,WAAW,CAAC;IACnD;IAEA,qDAAqD;IACrD,IAAIkF,mBAAmBI,WAAW,EAAE;QAClC,oDAAoD;QACpDT,MAAMU,SAAS,GAAG;IACpB;IAEA,IAAIV,MAAMU,SAAS,EAAE;QACnBL,mBAAmBM,MAAM,OAAGtG,kCAAAA,EAAiBgG,mBAAmBM,MAAM,EAAEjG,mBAAY,CAACsF,MAAMzE,IAAI,CAAC;IAClG;IAEA,MAAM,EAAEqF,WAAWnD,UAAU,EAAEoD,cAAcnD,UAAU,EAAEoD,QAAQ,EAAE,OAAG3G,gCAAAA,EAAekG;IAErF,OAAO;QACL5C;QACAC;QACAoD;IACF;AACF"}
@@ -11,9 +11,9 @@ Object.defineProperty(exports, "PopoverSurface", {
11
11
  });
12
12
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const _usePopoverSurface = require("./usePopoverSurface");
15
- const _renderPopoverSurface = require("./renderPopoverSurface");
16
- const _usePopoverSurfaceStylesstyles = require("./usePopoverSurfaceStyles.styles");
14
+ const _usePopoverSurface = require("./usePopoverSurface.cjs");
15
+ const _renderPopoverSurface = require("./renderPopoverSurface.cjs");
16
+ const _usePopoverSurfaceStylesstyles = require("./usePopoverSurfaceStyles.styles.cjs");
17
17
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
18
18
  const PopoverSurface = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
19
19
  const state = (0, _usePopoverSurface.usePopoverSurface_unstable)(props, ref);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverSurface/PopoverSurface.tsx"],"sourcesContent":["'use client';\n\nimport * 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"],"names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","useCustomStyleHook_unstable","PopoverSurface","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;mCACY,sBAAsB;sCACnB,yBAAyB;+CACtB,mCAAmC;qCAGxC,kCAAkC;AAKvE,MAAMK,iBAAAA,WAAAA,GAA2DL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,YAAQR,6CAAAA,EAA2BM,OAAOC;QAEhDL,+DAAAA,EAAiCM;QAEjCL,gDAAAA,EAA4B,oCAAoCK;IAEhE,WAAOP,mDAAAA,EAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/PopoverSurface/PopoverSurface.tsx"],"sourcesContent":["'use client';\n\nimport * 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"],"names":["React","usePopoverSurface_unstable","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","useCustomStyleHook_unstable","PopoverSurface","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;mCACY,yBAAsB;sCACnB,4BAAyB;+CACtB,sCAAmC;qCAGxC,kCAAkC;AAKvE,MAAMK,iBAAAA,WAAAA,GAA2DL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,YAAQR,6CAAAA,EAA2BM,OAAOC;QAEhDL,+DAAAA,EAAiCM;QAEjCL,gDAAAA,EAA4B,oCAAoCK;IAEhE,WAAOP,mDAAAA,EAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
@@ -28,7 +28,7 @@ _export(exports, {
28
28
  return _usePopoverSurface.usePopoverSurface_unstable;
29
29
  }
30
30
  });
31
- const _PopoverSurface = require("./PopoverSurface");
32
- const _renderPopoverSurface = require("./renderPopoverSurface");
33
- const _usePopoverSurface = require("./usePopoverSurface");
34
- const _usePopoverSurfaceStylesstyles = require("./usePopoverSurfaceStyles.styles");
31
+ const _PopoverSurface = require("./PopoverSurface.cjs");
32
+ const _renderPopoverSurface = require("./renderPopoverSurface.cjs");
33
+ const _usePopoverSurface = require("./usePopoverSurface.cjs");
34
+ const _usePopoverSurfaceStylesstyles = require("./usePopoverSurfaceStyles.styles.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/PopoverSurface/index.ts"],"sourcesContent":["export { PopoverSurface } from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nexport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nexport { usePopoverSurface_unstable } from './usePopoverSurface';\nexport {\n arrowHeights,\n popoverSurfaceClassNames,\n usePopoverSurfaceStyles_unstable,\n} from './usePopoverSurfaceStyles.styles';\n"],"names":["PopoverSurface","renderPopoverSurface_unstable","usePopoverSurface_unstable","arrowHeights","popoverSurfaceClassNames","usePopoverSurfaceStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,8BAAc;;;eAKrBG,2CAAY;;;eACZC,uDAAwB;;;eAJjBH,mDAA6B;;;eAKpCI,+DAAgC;;;eAJzBH,6CAA0B;;;gCAHJ,mBAAmB;sCAEJ,yBAAyB;mCAC5B,sBAAsB;+CAK1D,mCAAmC"}
1
+ {"version":3,"sources":["../src/components/PopoverSurface/index.ts"],"sourcesContent":["export { PopoverSurface } from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nexport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nexport { usePopoverSurface_unstable } from './usePopoverSurface';\nexport {\n arrowHeights,\n popoverSurfaceClassNames,\n usePopoverSurfaceStyles_unstable,\n} from './usePopoverSurfaceStyles.styles';\n"],"names":["PopoverSurface","renderPopoverSurface_unstable","usePopoverSurface_unstable","arrowHeights","popoverSurfaceClassNames","usePopoverSurfaceStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,8BAAc;;;eAKrBG,2CAAY;;;eACZC,uDAAwB;;;eAJjBH,mDAA6B;;;eAKpCI,+DAAgC;;;eAJzBH,6CAA0B;;;gCAHJ,sBAAmB;sCAEJ,4BAAyB;mCAC5B,yBAAsB;+CAK1D,sCAAmC"}
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "usePopoverSurface_unstable", {
11
11
  });
12
12
  const _reactutilities = require("@fluentui/react-utilities");
13
13
  const _reacttabster = require("@fluentui/react-tabster");
14
- const _popoverContext = require("../../popoverContext");
14
+ const _popoverContext = require("../../popoverContext.cjs");
15
15
  const _reactmotion = require("@fluentui/react-motion");
16
16
  const usePopoverSurface_unstable = (props, ref)=>{
17
17
  const contentRef = (0, _popoverContext.usePopoverContext_unstable)((context)=>context.contentRef);