@fluentui/react-popover 9.0.0-nightly.b5b7401007.0 → 9.0.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/CHANGELOG.json +425 -29
  2. package/CHANGELOG.md +104 -20
  3. package/dist/react-popover.d.ts +31 -20
  4. package/lib/Popover.js.map +1 -1
  5. package/lib/PopoverSurface.js.map +1 -1
  6. package/lib/PopoverTrigger.js.map +1 -1
  7. package/lib/components/Popover/Popover.js +5 -5
  8. package/lib/components/Popover/Popover.js.map +1 -1
  9. package/lib/components/Popover/Popover.types.d.ts +2 -1
  10. package/lib/components/Popover/Popover.types.js.map +1 -1
  11. package/lib/components/Popover/index.js.map +1 -1
  12. package/lib/components/Popover/renderPopover.d.ts +1 -1
  13. package/lib/components/Popover/renderPopover.js +27 -25
  14. package/lib/components/Popover/renderPopover.js.map +1 -1
  15. package/lib/components/Popover/usePopover.d.ts +2 -2
  16. package/lib/components/Popover/usePopover.js +42 -53
  17. package/lib/components/Popover/usePopover.js.map +1 -1
  18. package/lib/components/PopoverSurface/PopoverSurface.js +7 -7
  19. package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
  20. package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +2 -2
  21. package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  22. package/lib/components/PopoverSurface/index.js.map +1 -1
  23. package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
  24. package/lib/components/PopoverSurface/renderPopoverSurface.js +7 -8
  25. package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  26. package/lib/components/PopoverSurface/usePopoverSurface.d.ts +4 -5
  27. package/lib/components/PopoverSurface/usePopoverSurface.js +44 -58
  28. package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  29. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -1
  30. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +34 -22
  31. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  32. package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +2 -1
  33. package/lib/components/PopoverTrigger/PopoverTrigger.js +6 -5
  34. package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  35. package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +9 -2
  36. package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  37. package/lib/components/PopoverTrigger/index.js.map +1 -1
  38. package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
  39. package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
  40. package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  41. package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -2
  42. package/lib/components/PopoverTrigger/usePopoverTrigger.js +39 -54
  43. package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/popoverContext.d.ts +1 -1
  46. package/lib/popoverContext.js +3 -7
  47. package/lib/popoverContext.js.map +1 -1
  48. package/lib-commonjs/Popover.js +1 -1
  49. package/lib-commonjs/Popover.js.map +1 -1
  50. package/lib-commonjs/PopoverSurface.js +1 -1
  51. package/lib-commonjs/PopoverSurface.js.map +1 -1
  52. package/lib-commonjs/PopoverTrigger.js +1 -1
  53. package/lib-commonjs/PopoverTrigger.js.map +1 -1
  54. package/lib-commonjs/components/Popover/Popover.js +5 -5
  55. package/lib-commonjs/components/Popover/Popover.js.map +1 -1
  56. package/lib-commonjs/components/Popover/Popover.types.d.ts +2 -1
  57. package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
  58. package/lib-commonjs/components/Popover/index.js +1 -1
  59. package/lib-commonjs/components/Popover/index.js.map +1 -1
  60. package/lib-commonjs/components/Popover/renderPopover.d.ts +1 -1
  61. package/lib-commonjs/components/Popover/renderPopover.js +31 -29
  62. package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
  63. package/lib-commonjs/components/Popover/usePopover.d.ts +2 -2
  64. package/lib-commonjs/components/Popover/usePopover.js +50 -62
  65. package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
  66. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +8 -8
  67. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
  68. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +2 -2
  69. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  70. package/lib-commonjs/components/PopoverSurface/index.js +1 -1
  71. package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
  72. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
  73. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +12 -15
  74. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  75. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +4 -5
  76. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +50 -65
  77. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  78. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -1
  79. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +38 -24
  80. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  81. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +2 -1
  82. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +6 -5
  83. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  84. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +9 -2
  85. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  86. package/lib-commonjs/components/PopoverTrigger/index.js +1 -1
  87. package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
  88. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
  89. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +3 -3
  90. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  91. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -2
  92. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +44 -60
  93. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  94. package/lib-commonjs/index.js +1 -1
  95. package/lib-commonjs/index.js.map +1 -1
  96. package/lib-commonjs/popoverContext.d.ts +1 -1
  97. package/lib-commonjs/popoverContext.js +5 -9
  98. package/lib-commonjs/popoverContext.js.map +1 -1
  99. package/package.json +13 -15
  100. package/lib/common/isConformant.d.ts +0 -4
  101. package/lib/common/isConformant.js +0 -13
  102. package/lib/common/isConformant.js.map +0 -1
  103. package/lib/common/mockUsePopoverContext.d.ts +0 -7
  104. package/lib/common/mockUsePopoverContext.js +0 -38
  105. package/lib/common/mockUsePopoverContext.js.map +0 -1
  106. package/lib-commonjs/common/isConformant.d.ts +0 -4
  107. package/lib-commonjs/common/isConformant.js +0 -24
  108. package/lib-commonjs/common/isConformant.js.map +0 -1
  109. package/lib-commonjs/common/mockUsePopoverContext.d.ts +0 -7
  110. package/lib-commonjs/common/mockUsePopoverContext.js +0 -49
  111. package/lib-commonjs/common/mockUsePopoverContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Popover/usePopover.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAMA,IAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAMA,IAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;;;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;;AACA,MAAI,aAAa,CAAC,WAAlB,EAA+B;AAC7B,IAAA,KAAK,CAAC,OAAN,GAAgB,IAAhB;AACD;;AAED,MAAI,CAAC,KAAK,CAAC,OAAX,EAAoB;AAClB,IAAA,aAAa,CAAC,MAAd,GAAuB,mBAAA,CAAA,gBAAA,CAAiB,aAAa,CAAC,MAA/B,EAAuC,OAAA,CAAA,YAAA,CAAa,KAAK,CAAC,IAAnB,CAAvC,CAAvB;AACD;;AAED,QAAM;AAAE,IAAA,SAAS,EAAE,UAAb;AAAyB,IAAA,YAAY,EAAE,UAAvC;AAAmD,IAAA;AAAnD,MAAgE,mBAAA,CAAA,SAAA,CAAU,aAAV,CAAtE;AAEA,SAAO;AACL,IAAA,UADK;AAEL,IAAA,UAFK;AAGL,IAAA;AAHK,GAAP;AAKD","sourcesContent":["import * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useOnClickOutside,\n useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFluent } from '@fluentui/react-shared-contexts';\nimport {\n usePopper,\n resolvePositioningShorthand,\n mergeArrowOffset,\n usePopperMouseTarget,\n} from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\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] = usePopperMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props,\n } as const;\n\n const [open, setOpen] = useOpenState(initialState);\n const popperRefs = usePopoverRefs(initialState);\n\n const { targetDocument } = useFluent();\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [popperRefs.triggerRef, popperRefs.contentRef],\n disabled: !open,\n });\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [popperRefs.triggerRef, popperRefs.contentRef],\n disabled: !open || !initialState.openOnContext, // only close on scroll for context\n });\n\n return {\n ...initialState,\n ...popperRefs,\n open,\n setOpen,\n setContextTarget,\n contextTarget,\n };\n};\n\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(\n state: Pick<PopoverState, 'setContextTarget' | 'onOpenChange'> & Pick<PopoverProps, 'open' | 'defaultOpen'>,\n) {\n const onOpenChange: PopoverState['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false,\n });\n state.open = open !== undefined ? open : state.open;\n const setContextTarget = state.setContextTarget;\n\n const setOpen = React.useCallback(\n (e: OpenPopoverEvents, shouldOpen: boolean) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e as React.MouseEvent);\n }\n\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n\n setOpenState(prevOpen => {\n // More than one event (mouse, focus, keyboard) can request the Popover to close\n // We assume the first event is the correct one\n if (prevOpen !== shouldOpen) {\n onOpenChange?.(e, { open: shouldOpen });\n }\n\n return shouldOpen;\n });\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'> & Pick<PopoverProps, 'positioning' | 'openOnContext' | 'noArrow'>,\n) {\n const popperOptions = {\n position: 'above' as const,\n align: 'center' as const,\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 (popperOptions.coverTarget) {\n state.noArrow = true;\n }\n\n if (!state.noArrow) {\n popperOptions.offset = mergeArrowOffset(popperOptions.offset, arrowHeights[state.size]);\n }\n\n const { targetRef: triggerRef, containerRef: contentRef, arrowRef } = usePopper(popperOptions);\n\n return {\n triggerRef,\n contentRef,\n arrowRef,\n } as const;\n}\n"],"sourceRoot":"../src/"}
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PopoverSurface = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var usePopoverSurface_1 = /*#__PURE__*/require("./usePopoverSurface");
10
+ const usePopoverSurface_1 = /*#__PURE__*/require("./usePopoverSurface");
11
11
 
12
- var renderPopoverSurface_1 = /*#__PURE__*/require("./renderPopoverSurface");
12
+ const renderPopoverSurface_1 = /*#__PURE__*/require("./renderPopoverSurface");
13
13
 
14
- var usePopoverSurfaceStyles_1 = /*#__PURE__*/require("./usePopoverSurfaceStyles");
14
+ const usePopoverSurfaceStyles_1 = /*#__PURE__*/require("./usePopoverSurfaceStyles");
15
15
  /**
16
16
  * PopoverSurface component renders react children in a positioned box
17
17
  */
18
18
 
19
19
 
20
- exports.PopoverSurface = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = usePopoverSurface_1.usePopoverSurface(props, ref);
22
- usePopoverSurfaceStyles_1.usePopoverSurfaceStyles(state);
23
- return renderPopoverSurface_1.renderPopoverSurface(state);
20
+ exports.PopoverSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = usePopoverSurface_1.usePopoverSurface_unstable(props, ref);
22
+ usePopoverSurfaceStyles_1.usePopoverSurfaceStyles_unstable(state);
23
+ return renderPopoverSurface_1.renderPopoverSurface_unstable(state);
24
24
  });
25
25
  exports.PopoverSurface.displayName = 'PopoverSurface';
26
26
  //# sourceMappingURL=PopoverSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/PopoverSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAClG,MAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AAEA,EAAA,yBAAA,CAAA,uBAAA,CAAwB,KAAxB;AACA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALuE,CAA3D;AAOb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverSurface/PopoverSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,EAAkC,GAAlC,CAAd;AAEA,EAAA,yBAAA,CAAA,gCAAA,CAAiC,KAAjC;AACA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP;AACD,CALuE,CAA3D;AAOb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourcesContent":["import * as React from 'react';\nimport { usePopoverSurface_unstable } from './usePopoverSurface';\nimport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nimport { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles';\nimport type { PopoverSurfaceProps } from './PopoverSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * PopoverSurface component renders react children in a positioned box\n */\nexport const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps> = React.forwardRef((props, ref) => {\n const state = usePopoverSurface_unstable(props, ref);\n\n usePopoverSurfaceStyles_unstable(state);\n return renderPopoverSurface_unstable(state);\n});\n\nPopoverSurface.displayName = 'PopoverSurface';\n"],"sourceRoot":"../src/"}
@@ -1,4 +1,4 @@
1
- import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
2
  import type { PopoverContextValue } from '../../popoverContext';
3
3
  /**
4
4
  * PopoverSurface Props
@@ -8,7 +8,7 @@ export declare type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
8
8
  * Names of the slots in PopoverSurfaceProps
9
9
  */
10
10
  export declare type PopoverSurfaceSlots = {
11
- root: IntrinsicShorthandProps<'div'>;
11
+ root: Slot<'div'>;
12
12
  };
13
13
  /**
14
14
  * PopoverSurface State
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./PopoverSurface"), exports);
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverSurface/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles';\n"],"sourceRoot":"../src/"}
@@ -2,4 +2,4 @@ import type { PopoverSurfaceState } from './PopoverSurface.types';
2
2
  /**
3
3
  * Render the final JSX of PopoverSurface
4
4
  */
5
- export declare const renderPopoverSurface: (state: PopoverSurfaceState) => JSX.Element | null;
5
+ export declare const renderPopoverSurface_unstable: (state: PopoverSurfaceState) => JSX.Element | null;
@@ -3,27 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderPopoverSurface = void 0;
6
+ exports.renderPopoverSurface_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
11
11
 
12
- var react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
13
-
14
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
-
16
- var usePopoverSurface_1 = /*#__PURE__*/require("./usePopoverSurface");
12
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
17
13
  /**
18
14
  * Render the final JSX of PopoverSurface
19
15
  */
20
16
 
21
17
 
22
- var renderPopoverSurface = function (state) {
23
- var _a = react_utilities_1.getSlots(state, usePopoverSurface_1.popoverSurfaceSlots),
24
- slots = _a.slots,
25
- slotProps = _a.slotProps; // TODO should hidden Popovers be supported ?
26
-
18
+ const renderPopoverSurface_unstable = state => {
19
+ const {
20
+ slots,
21
+ slotProps
22
+ } = react_utilities_1.getSlots(state); // TODO should hidden Popovers be supported ?
27
23
 
28
24
  if (!state.open) {
29
25
  return null;
@@ -31,11 +27,12 @@ var renderPopoverSurface = function (state) {
31
27
 
32
28
  return React.createElement(react_portal_1.Portal, {
33
29
  mountNode: state.mountNode
34
- }, React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), !state.noArrow && React.createElement("div", {
30
+ }, React.createElement(slots.root, { ...slotProps.root
31
+ }, !state.noArrow && React.createElement("div", {
35
32
  ref: state.arrowRef,
36
33
  className: state.arrowClassName
37
34
  }), slotProps.root.children));
38
35
  };
39
36
 
40
- exports.renderPopoverSurface = renderPopoverSurface;
37
+ exports.renderPopoverSurface_unstable = renderPopoverSurface_unstable;
41
38
  //# sourceMappingURL=renderPopoverSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/renderPopoverSurface.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,mBAAA,gBAAA,OAAA,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AACA,MAAI,CAAC,KAAK,CAAC,IAAX,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,SACE,KAAA,CAAA,aAAA,CAAC,cAAA,CAAA,MAAD,EAAO;AAAC,IAAA,SAAS,EAAE,KAAK,CAAC;AAAlB,GAAP,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,CAAC,KAAK,CAAC,OAAP,IAAkB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,GAAG,EAAE,KAAK,CAAC,QAAhB;AAA0B,IAAA,SAAS,EAAE,KAAK,CAAC;AAA3C,GAAA,CADrB,EAEG,SAAS,CAAC,IAAV,CAAe,QAFlB,CADF,CADF;AAQD,CAhBM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import * as React from 'react';\nimport { Portal } from '@fluentui/react-portal';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = (state: PopoverSurfaceState) => {\n const { slots, slotProps } = getSlots<PopoverSurfaceSlots>(state);\n\n // TODO should hidden Popovers be supported ?\n if (!state.open) {\n return null;\n }\n\n return (\n <Portal mountNode={state.mountNode}>\n <slots.root {...slotProps.root}>\n {!state.noArrow && <div ref={state.arrowRef} className={state.arrowClassName} />}\n {slotProps.root.children}\n </slots.root>\n </Portal>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,13 +1,12 @@
1
1
  import * as React from 'react';
2
- import type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';
3
- export declare const popoverSurfaceSlots: Array<keyof PopoverSurfaceSlots>;
2
+ import type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';
4
3
  /**
5
4
  * Create the state required to render PopoverSurface.
6
5
  *
7
- * The returned state can be modified with hooks such as usePopoverSurfaceStyles,
8
- * before being passed to renderPopoverSurface.
6
+ * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
7
+ * before being passed to renderPopoverSurface_unstable.
9
8
  *
10
9
  * @param props - props from this instance of PopoverSurface
11
10
  * @param ref - reference to root HTMLDivElement of PopoverSurface
12
11
  */
13
- export declare const usePopoverSurface: (props: PopoverSurfaceProps, ref: React.Ref<HTMLDivElement>) => PopoverSurfaceState;
12
+ export declare const usePopoverSurface_unstable: (props: PopoverSurfaceProps, ref: React.Ref<HTMLDivElement>) => PopoverSurfaceState;
@@ -3,84 +3,67 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePopoverSurface = exports.popoverSurfaceSlots = void 0;
6
+ exports.usePopoverSurface_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
13
 
14
- var react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
15
-
16
- var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
17
-
18
- exports.popoverSurfaceSlots = ['root'];
14
+ const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
19
15
  /**
20
16
  * Create the state required to render PopoverSurface.
21
17
  *
22
- * The returned state can be modified with hooks such as usePopoverSurfaceStyles,
23
- * before being passed to renderPopoverSurface.
18
+ * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
19
+ * before being passed to renderPopoverSurface_unstable.
24
20
  *
25
21
  * @param props - props from this instance of PopoverSurface
26
22
  * @param ref - reference to root HTMLDivElement of PopoverSurface
27
23
  */
28
24
 
29
- var usePopoverSurface = function (props, ref) {
30
- var contentRef = popoverContext_1.usePopoverContext(function (context) {
31
- return context.contentRef;
32
- });
33
- var open = popoverContext_1.usePopoverContext(function (context) {
34
- return context.open;
35
- });
36
- var openOnHover = popoverContext_1.usePopoverContext(function (context) {
37
- return context.openOnHover;
38
- });
39
- var setOpen = popoverContext_1.usePopoverContext(function (context) {
40
- return context.setOpen;
41
- });
42
- var mountNode = popoverContext_1.usePopoverContext(function (context) {
43
- return context.mountNode;
44
- });
45
- var arrowRef = popoverContext_1.usePopoverContext(function (context) {
46
- return context.arrowRef;
47
- });
48
- var size = popoverContext_1.usePopoverContext(function (context) {
49
- return context.size;
50
- });
51
- var noArrow = popoverContext_1.usePopoverContext(function (context) {
52
- return context.noArrow;
53
- });
54
- var appearance = popoverContext_1.usePopoverContext(function (context) {
55
- return context.appearance;
56
- });
57
- var trapFocus = popoverContext_1.usePopoverContext(function (context) {
58
- return context.trapFocus;
25
+
26
+ const usePopoverSurface_unstable = (props, ref) => {
27
+ const contentRef = popoverContext_1.usePopoverContext_unstable(context => context.contentRef);
28
+ const open = popoverContext_1.usePopoverContext_unstable(context => context.open);
29
+ const openOnHover = popoverContext_1.usePopoverContext_unstable(context => context.openOnHover);
30
+ const setOpen = popoverContext_1.usePopoverContext_unstable(context => context.setOpen);
31
+ const mountNode = popoverContext_1.usePopoverContext_unstable(context => context.mountNode);
32
+ const arrowRef = popoverContext_1.usePopoverContext_unstable(context => context.arrowRef);
33
+ const size = popoverContext_1.usePopoverContext_unstable(context => context.size);
34
+ const noArrow = popoverContext_1.usePopoverContext_unstable(context => context.noArrow);
35
+ const appearance = popoverContext_1.usePopoverContext_unstable(context => context.appearance);
36
+ const trapFocus = popoverContext_1.usePopoverContext_unstable(context => context.trapFocus);
37
+ const {
38
+ modalAttributes
39
+ } = react_tabster_1.useModalAttributes({
40
+ trapFocus
59
41
  });
60
- var modalAttributes = react_tabster_1.useModalAttributes({
61
- trapFocus: trapFocus
62
- }).modalAttributes;
63
- var state = {
64
- appearance: appearance,
65
- noArrow: noArrow,
66
- size: size,
67
- arrowRef: arrowRef,
68
- open: open,
69
- mountNode: mountNode,
42
+ const state = {
43
+ appearance,
44
+ noArrow,
45
+ size,
46
+ arrowRef,
47
+ open,
48
+ mountNode,
70
49
  components: {
71
50
  root: 'div'
72
51
  },
73
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({
52
+ root: react_utilities_1.getNativeElementProps('div', {
74
53
  ref: react_utilities_1.useMergedRefs(ref, contentRef),
75
- role: 'dialog'
76
- }, modalAttributes), props))
54
+ role: trapFocus ? 'dialog' : 'complementary',
55
+ 'aria-modal': trapFocus ? true : undefined,
56
+ ...modalAttributes,
57
+ ...props
58
+ })
77
59
  };
78
- var _a = state.root,
79
- onMouseEnterOriginal = _a.onMouseEnter,
80
- onMouseLeaveOriginal = _a.onMouseLeave,
81
- onKeyDownOriginal = _a.onKeyDown;
60
+ const {
61
+ onMouseEnter: onMouseEnterOriginal,
62
+ onMouseLeave: onMouseLeaveOriginal,
63
+ onKeyDown: onKeyDownOriginal
64
+ } = state.root;
82
65
 
83
- state.root.onMouseEnter = function (e) {
66
+ state.root.onMouseEnter = e => {
84
67
  if (openOnHover) {
85
68
  setOpen(e, true);
86
69
  }
@@ -88,7 +71,7 @@ var usePopoverSurface = function (props, ref) {
88
71
  onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
89
72
  };
90
73
 
91
- state.root.onMouseLeave = function (e) {
74
+ state.root.onMouseLeave = e => {
92
75
  if (openOnHover) {
93
76
  setOpen(e, false);
94
77
  }
@@ -96,7 +79,7 @@ var usePopoverSurface = function (props, ref) {
96
79
  onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
97
80
  };
98
81
 
99
- state.root.onKeyDown = function (e) {
82
+ state.root.onKeyDown = e => {
100
83
  var _a; // only close if the event happened inside the current popover
101
84
  // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
102
85
 
@@ -108,15 +91,17 @@ var usePopoverSurface = function (props, ref) {
108
91
  onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
109
92
  };
110
93
 
111
- var findFirstFocusable = react_tabster_1.useFocusFinders().findFirstFocusable;
112
- React.useEffect(function () {
94
+ const {
95
+ findFirstFocusable
96
+ } = react_tabster_1.useFocusFinders();
97
+ React.useEffect(() => {
113
98
  if (state.open && contentRef.current) {
114
- var firstFocusable = findFirstFocusable(contentRef.current);
99
+ const firstFocusable = findFirstFocusable(contentRef.current);
115
100
  firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
116
101
  }
117
102
  }, [contentRef, findFirstFocusable, state.open]);
118
103
  return state;
119
104
  };
120
105
 
121
- exports.usePopoverSurface = usePopoverSurface;
106
+ exports.usePopoverSurface_unstable = usePopoverSurface_unstable;
122
107
  //# sourceMappingURL=usePopoverSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AAGa,OAAA,CAAA,mBAAA,GAAwD,CAAC,MAAD,CAAxD;AAEb;;;;;;;;AAQG;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAA6B,GAA7B,EAA2D;AAC1F,MAAM,UAAU,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,UAAA;AAAkB,GAA/C,CAAnB;AACA,MAAM,IAAI,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WA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CAAE,QAAF,CAAW,CAAC,CAAC,MAAb,CAAxC,CAAJ,EAAoF;AAClF,MAAA,OAAO,CAAC,CAAD,EAAI,KAAJ,CAAP;AACD;;AAED,IAAA,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,GAAiB,KAAA,CAAjB,GAAA,iBAAiB,CAAG,CAAH,CAAjB;AACD,GARD;;AAUA,QAAM;AAAE,IAAA;AAAF,MAAyB,eAAA,CAAA,eAAA,EAA/B;AAEA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,QAAI,KAAK,CAAC,IAAN,IAAc,UAAU,CAAC,OAA7B,EAAsC;AACpC,YAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,OAAZ,CAAzC;AACA,MAAA,cAAc,KAAA,IAAd,IAAA,cAAc,KAAA,KAAA,CAAd,GAAc,KAAA,CAAd,GAAA,cAAc,CAAE,KAAhB,EAAA;AACD;AACF,GALD,EAKG,CAAC,UAAD,EAAa,kBAAb,EAAiC,KAAK,CAAC,IAAvC,CALH;AAMA,SAAO,KAAP;AACD,CA3EM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusFinders, useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const open = usePopoverContext_unstable(context => context.open);\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 noArrow = usePopoverContext_unstable(context => context.noArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const { modalAttributes } = useModalAttributes({ trapFocus });\n\n const state: PopoverSurfaceState = {\n appearance,\n noArrow,\n size,\n arrowRef,\n open,\n mountNode,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'complementary',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n };\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state.root;\n state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n const { findFirstFocusable } = useFocusFinders();\n\n React.useEffect(() => {\n if (state.open && contentRef.current) {\n const firstFocusable = findFirstFocusable(contentRef.current);\n firstFocusable?.focus();\n }\n }, [contentRef, findFirstFocusable, state.open]);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,7 +1,8 @@
1
1
  import type { PopoverSize } from '../Popover/Popover.types';
2
2
  import type { PopoverSurfaceState } from './PopoverSurface.types';
3
+ export declare const popoverSurfaceClassName = "fui-PopoverSurface";
3
4
  export declare const arrowHeights: Record<PopoverSize, number>;
4
5
  /**
5
6
  * Apply styling to the PopoverSurface slots based on the state
6
7
  */
7
- export declare const usePopoverSurfaceStyles: (state: PopoverSurfaceState) => PopoverSurfaceState;
8
+ export declare const usePopoverSurfaceStyles_unstable: (state: PopoverSurfaceState) => PopoverSurfaceState;
@@ -3,10 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePopoverSurfaceStyles = exports.arrowHeights = void 0;
6
+ exports.usePopoverSurfaceStyles_unstable = exports.arrowHeights = exports.popoverSurfaceClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
+ const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
11
+
12
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
13
+
14
+ exports.popoverSurfaceClassName = 'fui-PopoverSurface';
10
15
  exports.arrowHeights = {
11
16
  small: 6,
12
17
  medium: 8,
@@ -16,11 +21,14 @@ exports.arrowHeights = {
16
21
  * Styles for the root slot
17
22
  */
18
23
 
19
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
24
+ const useStyles = /*#__PURE__*/react_1.__styles({
20
25
  "root": {
21
26
  "De3pzq": "fxugw4r",
22
- "E5pizo": ["f1hg901r", "f136t921"],
23
- "Dimara": "ff3glw6",
27
+ "E5pizo": "f1hg901r",
28
+ "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
29
+ "Beyfa6y": ["f1bjk9e1", "fff7au0"],
30
+ "B7oj6ja": ["fwsfkhu", "f8wkphi"],
31
+ "Btl43ni": ["f8wkphi", "fwsfkhu"],
24
32
  "B4j52fo": "f5ogflp",
25
33
  "Bekrc4i": ["f1hqa2wf", "finvdd3"],
26
34
  "Bn0qgzm": "f1f09k3d",
@@ -61,50 +69,56 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
61
69
  "uwmqm3": ["fekwl8i", "fat0sn4"]
62
70
  },
63
71
  "smallArrow": {
64
- "a9b677": "f1smug5u",
65
- "Bqenvij": "f11ci07v"
72
+ "a9b677": "f1ekdpwm",
73
+ "Bqenvij": "f83vc9z"
66
74
  },
67
75
  "mediumLargeArrow": {
68
- "a9b677": "ftmg478",
69
- "Bqenvij": "f7bsbfx"
76
+ "a9b677": "f1kmc0fn",
77
+ "Bqenvij": "fb6lvc5"
70
78
  },
71
79
  "arrow": {
72
80
  "qhf8xq": "f1euv43f",
73
- "ayd6f0": "f1uo6wrk",
81
+ "De3pzq": "f1u2r49w",
74
82
  "Bcdw1i0": "fd7fpy0",
75
83
  "Bj3rh1h": "f1bsuimh",
76
84
  "rurcny": "fuzzvh5",
77
- "zf3lio": "f1qudtws",
85
+ "Bex5imi": "fkk33zh",
78
86
  "xx9plb": "fxf9f1y",
87
+ "Bmqnesq": "f170vdtw",
79
88
  "Bdn98qo": "f103af6e",
80
89
  "Bbc2r3f": "f15umuo5",
81
- "B4zgs9e": "ffo048g",
82
- "Bex5imi": "fkk33zh",
90
+ "B1dvbpk": "f3wpjpt",
91
+ "D4ky5z": "f1k3tce7",
92
+ "cqycoz": "f1dkdgqi",
93
+ "I89eb": "f5ghsz",
94
+ "k1i1uq": "fyqop9u",
95
+ "Epwjcz": "f1m5ya7j",
96
+ "Bp1vogq": "f3sp63x",
83
97
  "px8gyy": ["f5bg3dr", "f1rfdd74"],
84
- "h6z6rw": ["fzd2j21", "f2549he"],
85
- "hl6cv3": "fotnskf",
98
+ "h6z6rw": "fzd2j21",
99
+ "hl6cv3": "f1773hnp",
86
100
  "Bh2vraf": "f1n8855c",
87
- "yayu3t": ["f1nq055x", "f13ohf3"],
101
+ "yayu3t": "f1v7783n",
88
102
  "wedwtw": "fsw6im5",
89
- "rhl9o9": "ftghsr9",
103
+ "rhl9o9": "fh2hsk5",
90
104
  "Bu8t5uz": "f159pzir",
91
- "B6q6orb": ["f1l8vbt4", "fsxzh25"],
105
+ "B6q6orb": "f11yvu4",
92
106
  "Bwwlvwl": "fm1ycve"
93
107
  }
94
108
  }, {
95
- "d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".f136t921{box-shadow:var(--shadow-16);}", ".ff3glw6{border-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1smug5u{width:8.485281374238571px;}", ".f11ci07v{height:8.485281374238571px;}", ".ftmg478{width:11.313708498984761px;}", ".f7bsbfx{height:11.313708498984761px;}", ".f1euv43f{position:absolute;}", ".f1uo6wrk{background:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".f1qudtws:before{border-radius:4px;}", ".fxf9f1y:before{position:absolute;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".ffo048g:before{background:inherit;}", ".fkk33zh:before{visibility:visible;}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", ".f2549he:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);}", "[data-popper-placement^=\"top\"] .fotnskf{bottom:0;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1nq055x{left:0;}", "[data-popper-placement^=\"right\"] .f13ohf3{right:0;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .ftghsr9{top:0;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f1l8vbt4{right:0;}", "[data-popper-placement^=\"left\"] .fsxzh25{left:0;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
109
+ "d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".fff7au0{border-bottom-right-radius:4px;}", ".f1bjk9e1{border-bottom-left-radius:4px;}", ".fwsfkhu{border-top-right-radius:4px;}", ".f8wkphi{border-top-left-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1ekdpwm{width:8.484px;}", ".f83vc9z{height:8.484px;}", ".f1kmc0fn{width:11.312px;}", ".fb6lvc5{height:11.312px;}", ".f1euv43f{position:absolute;}", ".f1u2r49w{background-color:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".fkk33zh:before{visibility:visible;}", ".fxf9f1y:before{position:absolute;}", ".f170vdtw:before{box-sizing:border-box;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".f3wpjpt:before{background-color:inherit;}", ".f1k3tce7:before{border-right-width:1px;}", ".f1dkdgqi:before{border-right-style:solid;}", ".f5ghsz:before{border-right-color:var(--colorTransparentStroke);}", ".fyqop9u:before{border-bottom-width:1px;}", ".f1m5ya7j:before{border-bottom-style:solid;}", ".f3sp63x:before{border-bottom-color:var(--colorTransparentStroke);}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", "[data-popper-placement^=\"top\"] .f1773hnp{bottom:-1px;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1v7783n{left:-1px;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .fh2hsk5{top:-1px;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f11yvu4{right:-1px;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
96
110
  });
97
111
  /**
98
112
  * Apply styling to the PopoverSurface slots based on the state
99
113
  */
100
114
 
101
115
 
102
- var usePopoverSurfaceStyles = function (state) {
103
- var styles = useStyles();
104
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
105
- state.arrowClassName = react_make_styles_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
116
+ const usePopoverSurfaceStyles_unstable = state => {
117
+ const styles = useStyles();
118
+ state.root.className = react_1.mergeClasses(exports.popoverSurfaceClassName, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
119
+ state.arrowClassName = react_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
106
120
  return state;
107
121
  };
108
122
 
109
- exports.usePopoverSurfaceStyles = usePopoverSurfaceStyles;
123
+ exports.usePopoverSurfaceStyles_unstable = usePopoverSurfaceStyles_unstable;
110
124
  //# sourceMappingURL=usePopoverSurfaceStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAIa,OAAA,CAAA,YAAA,GAA4C;AACvD,EAAA,KAAK,EAAE,CADgD;AAEvD,EAAA,MAAM,EAAE,CAF+C;AAGvD,EAAA,KAAK,EAAE;AAHgD,CAA5C;AAMb;;AAEG;;AACH,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqEA;;AAEG;;;AACI,IAAM,uBAAuB,GAAG,UAAC,KAAD,EAA2B;AAChE,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CACrB,MAAM,CAA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react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens } from '@fluentui/react-theme';\nimport type { PopoverSize } from '../Popover/Popover.types';\nimport type { PopoverSurfaceState } from './PopoverSurface.types';\n\nexport const popoverSurfaceClassName = 'fui-PopoverSurface';\n\nexport const arrowHeights: Record<PopoverSize, number> = {\n small: 6,\n medium: 8,\n large: 8,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n ...shorthands.borderRadius('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n },\n\n inverted: {\n // TODO: neutral background inverted missing from superset and theme\n backgroundColor: tokens.colorNeutralForeground1,\n color: tokens.colorNeutralForegroundInverted,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n // TODO: clarify with designers what foreground color should be with brand background,\n color: tokens.colorNeutralForegroundInverted,\n },\n\n smallPadding: {\n ...shorthands.padding('12px'),\n },\n\n mediumPadding: {\n ...shorthands.padding('16px'),\n },\n\n largePadding: {\n ...shorthands.padding('20px'),\n },\n\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({ arrowHeight: undefined }),\n});\n\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = (state: PopoverSurfaceState): PopoverSurfaceState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n popoverSurfaceClassName,\n styles.root,\n state.size === 'small' && styles.smallPadding,\n state.size === 'medium' && styles.mediumPadding,\n state.size === 'large' && styles.largePadding,\n state.appearance === 'inverted' && styles.inverted,\n state.appearance === 'brand' && styles.brand,\n state.root.className,\n );\n\n state.arrowClassName = mergeClasses(\n styles.arrow,\n state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
+ import type { FluentTriggerComponent } from '@fluentui/react-utilities';
2
3
  import type { PopoverTriggerProps } from './PopoverTrigger.types';
3
4
  /**
4
5
  * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
5
6
  */
6
- export declare const PopoverTrigger: React.FC<PopoverTriggerProps>;
7
+ export declare const PopoverTrigger: React.FC<PopoverTriggerProps> & FluentTriggerComponent;
@@ -5,19 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PopoverTrigger = void 0;
7
7
 
8
- var usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
8
+ const usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
9
9
 
10
- var renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
10
+ const renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
11
11
  /**
12
12
  * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
13
13
  */
14
14
 
15
15
 
16
- var PopoverTrigger = function (props) {
17
- var state = usePopoverTrigger_1.usePopoverTrigger(props);
18
- return renderPopoverTrigger_1.renderPopoverTrigger(state);
16
+ const PopoverTrigger = props => {
17
+ const state = usePopoverTrigger_1.usePopoverTrigger_unstable(props);
18
+ return renderPopoverTrigger_1.renderPopoverTrigger_unstable(state);
19
19
  };
20
20
 
21
21
  exports.PopoverTrigger = PopoverTrigger;
22
22
  exports.PopoverTrigger.displayName = 'PopoverTrigger';
23
+ exports.PopoverTrigger.isFluentTriggerComponent = true;
23
24
  //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,cAAc,GAAkC,UAAA,KAAA,EAAK;AAChE,MAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAd;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;AAEG;;;AACI,MAAM,cAAc,GAA2D,KAAK,IAAG;AAC5F,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAd;AAEA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B;AACA,OAAA,CAAA,cAAA,CAAe,wBAAf,GAA0C,IAA1C","sourcesContent":["import * as React from 'react';\nimport { usePopoverTrigger_unstable } from './usePopoverTrigger';\nimport { renderPopoverTrigger_unstable } from './renderPopoverTrigger';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\nimport type { PopoverTriggerProps } from './PopoverTrigger.types';\n\n/**\n * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.\n */\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> & FluentTriggerComponent = props => {\n const state = usePopoverTrigger_unstable(props);\n\n return renderPopoverTrigger_unstable(state);\n};\n\nPopoverTrigger.displayName = 'PopoverTrigger';\nPopoverTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}