@fluentui/react-popover 9.5.4 → 9.5.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +82 -1
- package/CHANGELOG.md +22 -2
- package/lib/Popover.js.map +1 -1
- package/lib/PopoverSurface.js.map +1 -1
- package/lib/PopoverTrigger.js.map +1 -1
- package/lib/components/Popover/Popover.js +1 -0
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.js +1 -1
- package/lib/components/Popover/Popover.types.js.map +1 -1
- package/lib/components/Popover/constants.js +1 -2
- package/lib/components/Popover/constants.js.map +1 -1
- package/lib/components/Popover/index.js.map +1 -1
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.js +8 -8
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib/components/PopoverSurface/index.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +1 -3
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.js +3 -2
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js +1 -0
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.js +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib/components/PopoverTrigger/index.js.map +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -2
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +1 -0
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/Popover.js +5 -4
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/PopoverSurface.js +5 -4
- package/lib-commonjs/PopoverSurface.js.map +1 -1
- package/lib-commonjs/PopoverTrigger.js +5 -4
- package/lib-commonjs/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.js +14 -13
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.js +5 -2
- package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
- package/lib-commonjs/components/Popover/constants.js +10 -8
- package/lib-commonjs/components/Popover/constants.js.map +1 -1
- package/lib-commonjs/components/Popover/index.js +8 -7
- package/lib-commonjs/components/Popover/index.js.map +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +31 -47
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +179 -173
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +19 -20
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +3 -2
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js +9 -8
- package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +23 -28
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +70 -81
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +243 -113
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +15 -14
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +5 -2
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/index.js +8 -7
- package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +12 -11
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +71 -80
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +30 -92
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/popoverContext.js +34 -25
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +14 -13
- package/lib-amd/Popover.js +0 -6
- package/lib-amd/Popover.js.map +0 -1
- package/lib-amd/PopoverSurface.js +0 -6
- package/lib-amd/PopoverSurface.js.map +0 -1
- package/lib-amd/PopoverTrigger.js +0 -6
- package/lib-amd/PopoverTrigger.js.map +0 -1
- package/lib-amd/components/Popover/Popover.js +0 -15
- package/lib-amd/components/Popover/Popover.js.map +0 -1
- package/lib-amd/components/Popover/Popover.types.js +0 -5
- package/lib-amd/components/Popover/Popover.types.js.map +0 -1
- package/lib-amd/components/Popover/constants.js +0 -15
- package/lib-amd/components/Popover/constants.js.map +0 -1
- package/lib-amd/components/Popover/index.js +0 -9
- package/lib-amd/components/Popover/index.js.map +0 -1
- package/lib-amd/components/Popover/renderPopover.js +0 -32
- package/lib-amd/components/Popover/renderPopover.js.map +0 -1
- package/lib-amd/components/Popover/usePopover.js +0 -147
- package/lib-amd/components/Popover/usePopover.js.map +0 -1
- package/lib-amd/components/PopoverSurface/PopoverSurface.js +0 -17
- package/lib-amd/components/PopoverSurface/PopoverSurface.js.map +0 -1
- package/lib-amd/components/PopoverSurface/PopoverSurface.types.js +0 -5
- package/lib-amd/components/PopoverSurface/PopoverSurface.types.js.map +0 -1
- package/lib-amd/components/PopoverSurface/index.js +0 -10
- package/lib-amd/components/PopoverSurface/index.js.map +0 -1
- package/lib-amd/components/PopoverSurface/renderPopoverSurface.js +0 -20
- package/lib-amd/components/PopoverSurface/renderPopoverSurface.js.map +0 -1
- package/lib-amd/components/PopoverSurface/usePopoverSurface.js +0 -69
- package/lib-amd/components/PopoverSurface/usePopoverSurface.js.map +0 -1
- package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js +0 -44
- package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.js +0 -17
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js +0 -5
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/index.js +0 -9
- package/lib-amd/components/PopoverTrigger/index.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js +0 -13
- package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js +0 -61
- package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js.map +0 -1
- package/lib-amd/index.js +0 -20
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/popoverContext.js +0 -28
- package/lib-amd/popoverContext.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["React"],"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\n/**\n * PopoverTrigger Props\n */\nexport type PopoverTriggerProps = TriggerProps<PopoverTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * PopoverTrigger State\n */\nexport type PopoverTriggerState = {\n children: React.ReactElement | null;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type PopoverTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-expanded'?: 'true' | 'false';\n ref: React.Ref<unknown>;\n onMouseEnter: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseLeave: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onContextMenu: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n }\n>;\n"],"mappings":"AAEA,YAAYA,KAAA,MAAW"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/PopoverTrigger/index.ts"],"sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["renderPopoverTrigger_unstable","state","children"],"sources":["
|
1
|
+
{"version":3,"names":["renderPopoverTrigger_unstable","state","children"],"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"sourcesContent":["import type { PopoverTriggerState } from './PopoverTrigger.types';\n\n/**\n * Render the final JSX of PopoverTrigger\n */\nexport const renderPopoverTrigger_unstable = (state: PopoverTriggerState) => {\n return state.children;\n};\n"],"mappings":"AAEA;;GAGA,OAAO,MAAMA,6BAAA,GAAiCC,KAAA,IAA+B;EAC3E,OAAOA,KAAA,CAAMC,QAAQ;AACvB"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
import { applyTriggerPropsToChildren, getTriggerChild, mergeCallbacks, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';
|
2
3
|
import { useModalAttributes } from '@fluentui/react-tabster';
|
3
4
|
import { usePopoverContext_unstable } from '../../popoverContext';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["applyTriggerPropsToChildren","getTriggerChild","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","stopPropagation","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","type"],"sources":["
|
1
|
+
{"version":3,"names":["React","applyTriggerPropsToChildren","getTriggerChild","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","stopPropagation","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","type"],"sources":["../../../src/components/PopoverTrigger/usePopoverTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\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) {\n setOpen(e, false);\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Menu\n e.stopPropagation();\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, child?.ref),\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"],"mappings":"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"}
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Popover","renderPopover_unstable","usePopover_unstable","PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable","PopoverProvider","usePopoverContext_unstable","PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"sources":["../src/
|
1
|
+
{"version":3,"names":["Popover","renderPopover_unstable","usePopover_unstable","PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable","PopoverProvider","usePopoverContext_unstable","PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } 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"],"mappings":"AAAA,SAASA,OAAO,EAAEC,sBAAsB,EAAEC,mBAAmB,QAAQ;AAErE,SACEC,cAAc,EACdC,YAAY,EACZC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB;AAEP,SAASC,eAAe,EAAEC,0BAA0B,QAAQ;AAE5D,SAASC,cAAc,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createContext","useContextSelector","PopoverContext","undefined","popoverContextDefaultValue","open","setOpen","toggleOpen","triggerRef","current","contentRef","arrowRef","openOnContext","openOnHover","size","trapFocus","inline","PopoverProvider","Provider","usePopoverContext_unstable","selector","ctx"],"sources":["../src/
|
1
|
+
{"version":3,"names":["createContext","useContextSelector","PopoverContext","undefined","popoverContextDefaultValue","open","setOpen","toggleOpen","triggerRef","current","contentRef","arrowRef","openOnContext","openOnHover","size","trapFocus","inline","PopoverProvider","Provider","usePopoverContext_unstable","selector","ctx"],"sources":["../src/popoverContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { PopoverState } from './components/Popover/index';\n\nexport const PopoverContext: Context<PopoverContextValue> = createContext<PopoverContextValue | undefined>(\n undefined,\n) as Context<PopoverContextValue>;\nconst popoverContextDefaultValue: PopoverContextValue = {\n open: false,\n setOpen: () => null,\n toggleOpen: () => null,\n triggerRef: { current: null },\n contentRef: { current: null },\n arrowRef: { current: null },\n openOnContext: false,\n openOnHover: false,\n size: 'medium' as const,\n trapFocus: false,\n inline: false,\n};\n\nexport const PopoverProvider = PopoverContext.Provider;\n\n/**\n * Context shared between Popover and its children components\n */\nexport type PopoverContextValue = Pick<\n PopoverState,\n | 'open'\n | 'toggleOpen'\n | 'setOpen'\n | 'triggerRef'\n | 'contentRef'\n | 'openOnHover'\n | 'openOnContext'\n | 'mountNode'\n | 'withArrow'\n | 'arrowRef'\n | 'size'\n | 'appearance'\n | 'trapFocus'\n | 'inertTrapFocus'\n | 'inline'\n>;\n\nexport const usePopoverContext_unstable = <T>(selector: ContextSelector<PopoverContextValue, T>): T =>\n useContextSelector(PopoverContext, (ctx = popoverContextDefaultValue) => selector(ctx));\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ;AAIlD,OAAO,MAAMC,cAAA,gBAA+CF,aAAA,CAC1DG,SAAA;AAEF,MAAMC,0BAAA,GAAkD;EACtDC,IAAA,EAAM,KAAK;EACXC,OAAA,EAASA,CAAA,KAAM,IAAI;EACnBC,UAAA,EAAYA,CAAA,KAAM,IAAI;EACtBC,UAAA,EAAY;IAAEC,OAAA,EAAS;EAAK;EAC5BC,UAAA,EAAY;IAAED,OAAA,EAAS;EAAK;EAC5BE,QAAA,EAAU;IAAEF,OAAA,EAAS;EAAK;EAC1BG,aAAA,EAAe,KAAK;EACpBC,WAAA,EAAa,KAAK;EAClBC,IAAA,EAAM;EACNC,SAAA,EAAW,KAAK;EAChBC,MAAA,EAAQ;AACV;AAEA,OAAO,MAAMC,eAAA,GAAkBf,cAAA,CAAegB,QAAQ;AAwBtD,OAAO,MAAMC,0BAAA,GAAiCC,QAAA,IAC5CnB,kBAAA,CAAmBC,cAAA,EAAgB,CAACmB,GAAA,GAAMjB,0BAA0B,KAAKgB,QAAA,CAASC,GAAA"}
|
package/lib-commonjs/Popover.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./components/Popover/index"), exports);
|
7
|
+
//# sourceMappingURL=Popover.js.map
|
8
|
+
|
8
9
|
//# sourceMappingURL=Popover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/Popover.js"],"sourcesContent":["export * from './components/Popover/index';\n//# sourceMappingURL=Popover.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,mCAAmC"}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./components/PopoverSurface/index"), exports);
|
7
|
+
//# sourceMappingURL=PopoverSurface.js.map
|
8
|
+
|
8
9
|
//# sourceMappingURL=PopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/PopoverSurface.js"],"sourcesContent":["export * from './components/PopoverSurface/index';\n//# sourceMappingURL=PopoverSurface.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,0CAA0C"}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./components/PopoverTrigger/index"), exports);
|
7
|
+
//# sourceMappingURL=PopoverTrigger.js.map
|
8
|
+
|
8
9
|
//# sourceMappingURL=PopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/PopoverTrigger.js"],"sourcesContent":["export * from './components/PopoverTrigger/index';\n//# sourceMappingURL=PopoverTrigger.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,0CAA0C"}
|
@@ -1,18 +1,19 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "Popover", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>Popover
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
const state = usePopover_1.usePopover_unstable(props);
|
14
|
-
return renderPopover_1.renderPopover_unstable(state);
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _usePopover = require("./usePopover");
|
12
|
+
const _renderPopover = require("./renderPopover");
|
13
|
+
const Popover = (props)=>{
|
14
|
+
const state = (0, _usePopover.usePopover_unstable)(props);
|
15
|
+
return (0, _renderPopover.renderPopover_unstable)(state);
|
15
16
|
};
|
16
|
-
|
17
|
-
|
17
|
+
Popover.displayName = 'Popover'; //# sourceMappingURL=Popover.js.map
|
18
|
+
|
18
19
|
//# sourceMappingURL=Popover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/Popover.js"],"sourcesContent":["import * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { renderPopover_unstable } from './renderPopover';\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover = props => {\n const state = usePopover_unstable(props);\n return renderPopover_unstable(state);\n};\nPopover.displayName = 'Popover';\n//# sourceMappingURL=Popover.js.map"],"names":["Popover","props","state","usePopover_unstable","renderPopover_unstable","displayName"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;4BACa;+BACG;AAIhC,MAAMA,UAAUC,CAAAA,QAAS;IAC9B,MAAMC,QAAQC,IAAAA,+BAAmB,EAACF;IAClC,OAAOG,IAAAA,qCAAsB,EAACF;AAChC;AACAF,QAAQK,WAAW,GAAG,WACtB,mCAAmC"}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
7
|
+
//# sourceMappingURL=Popover.types.js.map
|
8
|
+
|
6
9
|
//# sourceMappingURL=Popover.types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/Popover.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Popover.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,yCAAyC"}
|
@@ -1,9 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.popoverSurfaceBorderRadius = void 0;
|
7
1
|
/**
|
8
2
|
* @internal
|
9
3
|
* The default value of the tooltip's border radius (borderRadiusMedium).
|
@@ -11,6 +5,14 @@ exports.popoverSurfaceBorderRadius = void 0;
|
|
11
5
|
* Unfortunately, Popper requires it to be specified as a variable instead of using CSS.
|
12
6
|
* While we could use getComputedStyle, that adds a performance penalty for something that
|
13
7
|
* will likely never change.
|
14
|
-
*/
|
15
|
-
exports
|
8
|
+
*/ "use strict";
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
10
|
+
value: true
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "popoverSurfaceBorderRadius", {
|
13
|
+
enumerable: true,
|
14
|
+
get: ()=>popoverSurfaceBorderRadius
|
15
|
+
});
|
16
|
+
const popoverSurfaceBorderRadius = 4; //# sourceMappingURL=constants.js.map
|
17
|
+
|
16
18
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/constants.js"],"sourcesContent":["/**\n * @internal\n * The default value of the tooltip's border radius (borderRadiusMedium).\n *\n * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.\n * While we could use getComputedStyle, that adds a performance penalty for something that\n * will likely never change.\n */export const popoverSurfaceBorderRadius = 4;\n//# sourceMappingURL=constants.js.map"],"names":["popoverSurfaceBorderRadius"],"mappings":"AAAA;;;;;;;CAOC;;;;+BAAeA;;aAAAA;;AAAN,MAAMA,6BAA6B,GAC7C,qCAAqC"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./Popover"), exports);
|
7
|
+
_exportStar(require("./Popover.types"), exports);
|
8
|
+
_exportStar(require("./renderPopover"), exports);
|
9
|
+
_exportStar(require("./usePopover"), exports);
|
10
|
+
//# sourceMappingURL=index.js.map
|
11
|
+
|
11
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/index.js"],"sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
@@ -1,51 +1,35 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "renderPopover_unstable", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>renderPopover_unstable
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
*/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
appearance,
|
33
|
-
arrowRef,
|
34
|
-
contentRef,
|
35
|
-
inline,
|
36
|
-
mountNode,
|
37
|
-
open,
|
38
|
-
openOnContext,
|
39
|
-
openOnHover,
|
40
|
-
setOpen,
|
41
|
-
toggleOpen,
|
42
|
-
triggerRef,
|
43
|
-
size,
|
44
|
-
trapFocus,
|
45
|
-
inertTrapFocus,
|
46
|
-
withArrow
|
47
|
-
}
|
48
|
-
}, state.popoverTrigger, state.open && state.popoverSurface);
|
49
|
-
};
|
50
|
-
exports.renderPopover_unstable = renderPopover_unstable;
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _popoverContext = require("../../popoverContext");
|
12
|
+
const renderPopover_unstable = (state)=>{
|
13
|
+
const { appearance , arrowRef , contentRef , inline , mountNode , open , openOnContext , openOnHover , setOpen , size , toggleOpen , trapFocus , triggerRef , withArrow , inertTrapFocus } = state;
|
14
|
+
return /*#__PURE__*/ _react.createElement(_popoverContext.PopoverContext.Provider, {
|
15
|
+
value: {
|
16
|
+
appearance,
|
17
|
+
arrowRef,
|
18
|
+
contentRef,
|
19
|
+
inline,
|
20
|
+
mountNode,
|
21
|
+
open,
|
22
|
+
openOnContext,
|
23
|
+
openOnHover,
|
24
|
+
setOpen,
|
25
|
+
toggleOpen,
|
26
|
+
triggerRef,
|
27
|
+
size,
|
28
|
+
trapFocus,
|
29
|
+
inertTrapFocus,
|
30
|
+
withArrow
|
31
|
+
}
|
32
|
+
}, state.popoverTrigger, state.open && state.popoverSurface);
|
33
|
+
}; //# sourceMappingURL=renderPopover.js.map
|
34
|
+
|
51
35
|
//# sourceMappingURL=renderPopover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/renderPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { PopoverContext } from '../../popoverContext';\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover_unstable = state => {\n const {\n appearance,\n arrowRef,\n contentRef,\n inline,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n inertTrapFocus\n } = state;\n return /*#__PURE__*/React.createElement(PopoverContext.Provider, {\n value: {\n appearance,\n arrowRef,\n contentRef,\n inline,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n toggleOpen,\n triggerRef,\n size,\n trapFocus,\n inertTrapFocus,\n withArrow\n }\n }, state.popoverTrigger, state.open && state.popoverSurface);\n};\n//# sourceMappingURL=renderPopover.js.map"],"names":["renderPopover_unstable","state","appearance","arrowRef","contentRef","inline","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","inertTrapFocus","React","createElement","PopoverContext","Provider","value","popoverTrigger","popoverSurface"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACQ;AAIxB,MAAMA,yBAAyBC,CAAAA,QAAS;IAC7C,MAAM,EACJC,WAAU,EACVC,SAAQ,EACRC,WAAU,EACVC,OAAM,EACNC,UAAS,EACTC,KAAI,EACJC,cAAa,EACbC,YAAW,EACXC,QAAO,EACPC,KAAI,EACJC,WAAU,EACVC,UAAS,EACTC,WAAU,EACVC,UAAS,EACTC,eAAc,EACf,GAAGf;IACJ,OAAO,WAAW,GAAEgB,OAAMC,aAAa,CAACC,8BAAc,CAACC,QAAQ,EAAE;QAC/DC,OAAO;YACLnB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAE;YACAE;YACAH;YACAE;YACAG;YACAD;QACF;IACF,GAAGd,MAAMqB,cAAc,EAAErB,MAAMM,IAAI,IAAIN,MAAMsB,cAAc;AAC7D,GACA,yCAAyC"}
|