@wordpress/components 29.7.0 → 29.8.0

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 29.8.0 (2025-04-11)
6
+
7
+ ### Documentation
8
+
9
+ - `Popover`: Expose Popover TypeScript types for subcomponents. ([#69619](https://github.com/WordPress/gutenberg/pull/69619))
10
+
11
+ ### Internal
12
+
13
+ - Update `gradient-parser` to version `1.0.2` ([#69783](https://github.com/WordPress/gutenberg/pull/69783)).
14
+
15
+ ### Bug Fixes
16
+
17
+ - `Button`: Fix tertiary variant displaying incorrect text color in pressed and hover states ([#68542](https://github.com/WordPress/gutenberg/pull/68542)).
18
+
19
+ ### Enhancement
20
+
21
+ - `Popover`: improve Storybook examples around onClose and onFocusOutside props. ([#69688](https://github.com/WordPress/gutenberg/pull/69688))
22
+ - `FormTokenField`: Add theming support ([#69638](https://github.com/WordPress/gutenberg/pull/69638)).
23
+ - `ComboboxControl`: Add theming support ([#69638](https://github.com/WordPress/gutenberg/pull/69638)).
24
+
5
25
  ## 29.7.0 (2025-03-27)
6
26
 
7
27
  ### Bug Fixes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.SLOT_NAME = exports.Popover = void 0;
7
+ exports.default = exports.SLOT_NAME = exports.PopoverSlot = exports.Popover = void 0;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _reactDom = require("@floating-ui/react-dom");
10
10
  var _framerMotion = require("framer-motion");
@@ -338,6 +338,18 @@ const UnforwardedPopover = (props, forwardedRef) => {
338
338
  });
339
339
  };
340
340
 
341
+ // Export the PopoverSlot individually to allow typescript to pick the types up.
342
+ const PopoverSlot = exports.PopoverSlot = (0, _element.forwardRef)(({
343
+ name = SLOT_NAME
344
+ }, ref) => {
345
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_slotFill.Slot, {
346
+ bubblesVirtually: true,
347
+ name: name,
348
+ className: "popover-slot",
349
+ ref: ref
350
+ });
351
+ });
352
+
341
353
  /**
342
354
  * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.
343
355
  *
@@ -361,21 +373,21 @@ const UnforwardedPopover = (props, forwardedRef) => {
361
373
  * ```
362
374
  *
363
375
  */
364
- const Popover = exports.Popover = (0, _context.contextConnect)(UnforwardedPopover, 'Popover');
365
- function PopoverSlot({
366
- name = SLOT_NAME
367
- }, ref) {
368
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_slotFill.Slot, {
369
- bubblesVirtually: true,
370
- name: name,
371
- className: "popover-slot",
372
- ref: ref
373
- });
374
- }
375
-
376
- // @ts-expect-error For Legacy Reasons
377
- Popover.Slot = (0, _element.forwardRef)(PopoverSlot);
378
- // @ts-expect-error For Legacy Reasons
379
- Popover.__unstableSlotNameProvider = slotNameContext.Provider;
376
+ const Popover = exports.Popover = Object.assign((0, _context.contextConnect)(UnforwardedPopover, 'Popover'), {
377
+ /**
378
+ * Renders a slot that is used internally by Popover for rendering content.
379
+ */
380
+ Slot: Object.assign(PopoverSlot, {
381
+ displayName: 'Popover.Slot'
382
+ }),
383
+ /**
384
+ * Provides a context to manage popover slot names.
385
+ *
386
+ * This is marked as unstable and should not be used directly.
387
+ */
388
+ __unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {
389
+ displayName: 'Popover.__unstableSlotNameProvider'
390
+ })
391
+ });
380
392
  var _default = exports.default = Popover;
381
393
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_i18n","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","_jsxRuntime","SLOT_NAME","exports","ArrowTriangle","jsxs","SVG","xmlns","viewBox","className","role","children","jsx","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","clsx","ref","tabIndex","default","icon","close","onClick","label","__","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","Popover","contextConnect","PopoverSlot","Slot","bubblesVirtually","forwardRef","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAWA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAMA,IAAAa,QAAA,GAAAb,OAAA;AAOA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AAAkD,IAAAgB,WAAA,GAAAhB,OAAA;AA/DlD;AACA;AACA;;AAgBA;AACA;AACA;;AAuBA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACO,MAAMiB,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAS;;AAElC;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGA,CAAA,kBACrB,IAAAH,WAAA,CAAAI,IAAA,EAACb,WAAA,CAAAc,GAAG;EACHC,KAAK,EAAC,4BAA4B;EAClCC,OAAO,EAAC,aAAa;EACrBC,SAAS,EAAC,8BAA8B;EACxCC,IAAI,EAAC,cA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ACvB;EACD,oBACC,IAAAnK,WAAA,CAAAW,GAAA,EAAChB,SAAA,CAAA8L,IAAI;IACJC,gBAAgB;IAChBR,IAAI,EAAGA,IAAM;IACb1K,SAAS,EAAC,cAAc;IACxB2J,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAmB,OAAO,CAACG,IAAI,GAAG,IAAAE,mBAAU,EAAEH,WAAY,CAAC;AACxC;AACAF,OAAO,CAACM,0BAA0B,GAAG7K,eAAe,CAAC8K,QAAQ;AAAC,IAAAC,QAAA,GAAA5L,OAAA,CAAAmK,OAAA,GAE/CiB,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_i18n","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","_jsxRuntime","SLOT_NAME","exports","ArrowTriangle","jsxs","SVG","xmlns","viewBox","className","role","children","jsx","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","clsx","ref","tabIndex","default","icon","close","onClick","label","__","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","PopoverSlot","forwardRef","Slot","bubblesVirtually","Popover","contextConnect","displayName","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n\tPopoverSlotProps,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n// Export the PopoverSlot individually to allow typescript to pick the types up.\nexport const PopoverSlot = forwardRef< HTMLDivElement, PopoverSlotProps >(\n\t( { name = SLOT_NAME }, ref ) => {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tbubblesVirtually\n\t\t\t\tname={ name }\n\t\t\t\tclassName=\"popover-slot\"\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t);\n\t}\n);\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = Object.assign(\n\tcontextConnect( UnforwardedPopover, 'Popover' ),\n\t{\n\t\t/**\n\t\t * Renders a slot that is used internally by Popover for rendering content.\n\t\t */\n\t\tSlot: Object.assign( PopoverSlot, {\n\t\t\tdisplayName: 'Popover.Slot',\n\t\t} ),\n\t\t/**\n\t\t * Provides a context to manage popover slot names.\n\t\t *\n\t\t * This is marked as unstable and should not be used directly.\n\t\t */\n\t\t__unstableSlotNameProvider: Object.assign( slotNameContext.Provider, {\n\t\t\tdisplayName: 'Popover.__unstableSlotNameProvider',\n\t\t} ),\n\t}\n);\n\nexport default Popover;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,G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,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;EACEC,0BAA0B,EAAEjG,MAAM,CAACC,MAAM,CAAE9E,eAAe,CAAC+K,QAAQ,EAAE;IACpEF,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAAC,IAAAG,QAAA,GAAA7L,OAAA,CAAAmK,OAAA,GAEaqB,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/popover/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';\nimport type { Placement } from '@floating-ui/react-dom';\n\ntype PositionYAxis = 'top' | 'middle' | 'bottom';\ntype PositionXAxis = 'left' | 'center' | 'right';\ntype PositionCorner = 'top' | 'right' | 'bottom' | 'left';\n\ntype DomRectWithOwnerDocument = DOMRect & {\n\townerDocument?: Document;\n};\n\ntype PopoverPlacement = Placement | 'overlay';\n\nexport type PopoverAnchorRefReference = MutableRefObject<\n\tElement | null | undefined\n>;\nexport type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };\n\nexport type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {\n\townerDocument?: Document;\n};\n\nexport type PopoverProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\t__unstableSlotName?: string;\n\t/**\n\t * The element that should be used by the popover as its anchor. It can either\n\t * be an `Element` or, alternatively, a `VirtualElement` — ie. an object with\n\t * the `getBoundingClientRect()` and the `ownerDocument` properties defined.\n\t *\n\t * **The anchor element should be stored in local state** rather than a\n\t * plain React ref to ensure reactive updating when it changes.\n\t */\n\tanchor?: Element | VirtualElement | null;\n\t/**\n\t * Whether the popover should animate when opening.\n\t *\n\t * @default true\n\t */\n\tanimate?: boolean;\n\t/**\n\t * The `children` elements rendered as the popover's content.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Show the popover fullscreen on mobile viewports.\n\t */\n\texpandOnMobile?: boolean;\n\t/**\n\t * Specifies whether the popover should flip across its axis if there isn't\n\t * space for it in the normal placement.\n\t * When the using a 'top' placement, the popover will switch to a 'bottom'\n\t * placement. When using a 'left' placement, the popover will switch to a\n\t * `right' placement.\n\t * The popover will retain its alignment of 'start' or 'end' when flipping.\n\t *\n\t * @default true\n\t */\n\tflip?: boolean;\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elswhere, or whether the popover remains part of the wider\n\t * tab order. If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\t/**\n\t * By default, the _first tabbable element_ in the popover will receive focus\n\t * when it mounts. This is the same as setting this prop to `\"firstElement\"`.\n\t * Specifying a `false` value disables the focus handling entirely (this\n\t * should only be done when an appropriately accessible substitute behavior\n\t * exists).\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: 'firstElement' | boolean;\n\t/**\n\t * A callback invoked when the focus leaves the opened popover. This should\n\t * only be provided in advanced use-cases when a popover should close under\n\t * specific circumstances (for example, if the new `document.activeElement`\n\t * is content of or otherwise controlling popover visibility).\n\t *\n\t * When not provided, the `onClose` callback will be called instead.\n\t */\n\tonFocusOutside?: ( event: SyntheticEvent ) => void;\n\t/**\n\t * Used to customize the header text shown when the popover is toggled to\n\t * fullscreen on mobile viewports (see the `expandOnMobile` prop).\n\t */\n\theaderTitle?: string;\n\t/**\n\t * Used to show/hide the arrow that points at the popover's anchor.\n\t *\n\t * @default true\n\t */\n\tnoArrow?: boolean;\n\t/**\n\t * The distance (in px) between the anchor and the popover.\n\t */\n\toffset?: number;\n\t/**\n\t * A callback invoked when the popover should be closed.\n\t */\n\tonClose?: () => void;\n\t/**\n\t * Used to specify the popover's position with respect to its anchor.\n\t *\n\t * @default 'bottom-start'\n\t */\n\tplacement?: PopoverPlacement;\n\t/**\n\t * Legacy way to specify the popover's position with respect to its anchor.\n\t * _Note: this prop is deprecated. Use the `placement` prop instead._\n\t */\n\tposition?:\n\t\t| `${ PositionYAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis } ${ PositionCorner }`;\n\t/**\n\t * Adjusts the size of the popover to prevent its contents from going out of\n\t * view when meeting the viewport edges.\n\t *\n\t * @default true\n\t */\n\tresize?: boolean;\n\t/**\n\t * Enables the `Popover` to shift in order to stay in view when meeting the\n\t * viewport edges.\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\t/**\n\t * Specifies the popover's style.\n\t *\n\t * Leave undefined for the default style. Other values are:\n\t * - 'unstyled': The popover is essentially without any visible style, it\n\t * has no background, border, outline or drop shadow, but\n\t * the popover contents are still displayed.\n\t * - 'toolbar': A style that has no elevation, but a high contrast with\n\t * other elements. This is matches the style of the\n\t * `Toolbar` component.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | 'toolbar';\n\t/**\n\t * Whether to render the popover inline or within the slot.\n\t *\n\t * @default false\n\t */\n\tinline?: boolean;\n\t// Deprecated props\n\t/**\n\t * Prevent the popover from flipping and resizing when meeting the viewport\n\t * edges. _Note: this prop is deprecated. Instead, provide use the individual\n\t * `flip` and `resize` props._\n\t *\n\t * @deprecated\n\t */\n\t__unstableForcePosition?: boolean;\n\t/**\n\t * An object extending a `DOMRect` with an additional optional `ownerDocument`\n\t * property, used to specify a fixed popover position.\n\t *\n\t * @deprecated\n\t */\n\tanchorRect?: DomRectWithOwnerDocument;\n\t/**\n\t * Used to specify a fixed popover position. It can be an `Element`, a React\n\t * reference to an `element`, an object with a `top` and a `bottom` properties\n\t * (both pointing to elements), or a `range`.\n\t *\n\t * @deprecated\n\t */\n\tanchorRef?:\n\t\t| Element\n\t\t| PopoverAnchorRefReference\n\t\t| PopoverAnchorRefTopBottom\n\t\t| Range;\n\t/**\n\t * A function returning the same value as the one expected by the `anchorRect`\n\t * prop, used to specify a dynamic popover position.\n\t *\n\t * @deprecated\n\t */\n\tgetAnchorRect?: (\n\t\tfallbackReferenceElement: Element | null\n\t) => DomRectWithOwnerDocument;\n\t/**\n\t * Used to enable a different visual style for the popover.\n\t * _Note: this prop is deprecated. Use the `variant` prop with the\n\t * 'toolbar' value instead._\n\t *\n\t * @deprecated\n\t */\n\tisAlternate?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/popover/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';\nimport type { Placement } from '@floating-ui/react-dom';\n\ntype PositionYAxis = 'top' | 'middle' | 'bottom';\ntype PositionXAxis = 'left' | 'center' | 'right';\ntype PositionCorner = 'top' | 'right' | 'bottom' | 'left';\n\ntype DomRectWithOwnerDocument = DOMRect & {\n\townerDocument?: Document;\n};\n\ntype PopoverPlacement = Placement | 'overlay';\n\nexport type PopoverAnchorRefReference = MutableRefObject<\n\tElement | null | undefined\n>;\nexport type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };\n\nexport type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {\n\townerDocument?: Document;\n};\n\nexport type PopoverProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\t__unstableSlotName?: string;\n\t/**\n\t * The element that should be used by the popover as its anchor. It can either\n\t * be an `Element` or, alternatively, a `VirtualElement` — ie. an object with\n\t * the `getBoundingClientRect()` and the `ownerDocument` properties defined.\n\t *\n\t * **The anchor element should be stored in local state** rather than a\n\t * plain React ref to ensure reactive updating when it changes.\n\t */\n\tanchor?: Element | VirtualElement | null;\n\t/**\n\t * Whether the popover should animate when opening.\n\t *\n\t * @default true\n\t */\n\tanimate?: boolean;\n\t/**\n\t * The `children` elements rendered as the popover's content.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Show the popover fullscreen on mobile viewports.\n\t */\n\texpandOnMobile?: boolean;\n\t/**\n\t * Specifies whether the popover should flip across its axis if there isn't\n\t * space for it in the normal placement.\n\t * When the using a 'top' placement, the popover will switch to a 'bottom'\n\t * placement. When using a 'left' placement, the popover will switch to a\n\t * `right' placement.\n\t * The popover will retain its alignment of 'start' or 'end' when flipping.\n\t *\n\t * @default true\n\t */\n\tflip?: boolean;\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elswhere, or whether the popover remains part of the wider\n\t * tab order. If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\t/**\n\t * By default, the _first tabbable element_ in the popover will receive focus\n\t * when it mounts. This is the same as setting this prop to `\"firstElement\"`.\n\t * Specifying a `false` value disables the focus handling entirely (this\n\t * should only be done when an appropriately accessible substitute behavior\n\t * exists).\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: 'firstElement' | boolean;\n\t/**\n\t * A callback invoked when the focus leaves the opened popover. This should\n\t * only be provided in advanced use-cases when a popover should close under\n\t * specific circumstances (for example, if the new `document.activeElement`\n\t * is content of or otherwise controlling popover visibility).\n\t *\n\t * When not provided, the `onClose` callback will be called instead.\n\t */\n\tonFocusOutside?: ( event: SyntheticEvent ) => void;\n\t/**\n\t * Used to customize the header text shown when the popover is toggled to\n\t * fullscreen on mobile viewports (see the `expandOnMobile` prop).\n\t */\n\theaderTitle?: string;\n\t/**\n\t * Used to show/hide the arrow that points at the popover's anchor.\n\t *\n\t * @default true\n\t */\n\tnoArrow?: boolean;\n\t/**\n\t * The distance (in px) between the anchor and the popover.\n\t */\n\toffset?: number;\n\t/**\n\t * A callback invoked when the popover should be closed.\n\t */\n\tonClose?: () => void;\n\t/**\n\t * Used to specify the popover's position with respect to its anchor.\n\t *\n\t * @default 'bottom-start'\n\t */\n\tplacement?: PopoverPlacement;\n\t/**\n\t * Legacy way to specify the popover's position with respect to its anchor.\n\t * _Note: this prop is deprecated. Use the `placement` prop instead._\n\t */\n\tposition?:\n\t\t| `${ PositionYAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis } ${ PositionCorner }`;\n\t/**\n\t * Adjusts the size of the popover to prevent its contents from going out of\n\t * view when meeting the viewport edges.\n\t *\n\t * @default true\n\t */\n\tresize?: boolean;\n\t/**\n\t * Enables the `Popover` to shift in order to stay in view when meeting the\n\t * viewport edges.\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\t/**\n\t * Specifies the popover's style.\n\t *\n\t * Leave undefined for the default style. Other values are:\n\t * - 'unstyled': The popover is essentially without any visible style, it\n\t * has no background, border, outline or drop shadow, but\n\t * the popover contents are still displayed.\n\t * - 'toolbar': A style that has no elevation, but a high contrast with\n\t * other elements. This is matches the style of the\n\t * `Toolbar` component.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | 'toolbar';\n\t/**\n\t * Whether to render the popover inline or within the slot.\n\t *\n\t * @default false\n\t */\n\tinline?: boolean;\n\t// Deprecated props\n\t/**\n\t * Prevent the popover from flipping and resizing when meeting the viewport\n\t * edges. _Note: this prop is deprecated. Instead, provide use the individual\n\t * `flip` and `resize` props._\n\t *\n\t * @deprecated\n\t */\n\t__unstableForcePosition?: boolean;\n\t/**\n\t * An object extending a `DOMRect` with an additional optional `ownerDocument`\n\t * property, used to specify a fixed popover position.\n\t *\n\t * @deprecated\n\t */\n\tanchorRect?: DomRectWithOwnerDocument;\n\t/**\n\t * Used to specify a fixed popover position. It can be an `Element`, a React\n\t * reference to an `element`, an object with a `top` and a `bottom` properties\n\t * (both pointing to elements), or a `range`.\n\t *\n\t * @deprecated\n\t */\n\tanchorRef?:\n\t\t| Element\n\t\t| PopoverAnchorRefReference\n\t\t| PopoverAnchorRefTopBottom\n\t\t| Range;\n\t/**\n\t * A function returning the same value as the one expected by the `anchorRect`\n\t * prop, used to specify a dynamic popover position.\n\t *\n\t * @deprecated\n\t */\n\tgetAnchorRect?: (\n\t\tfallbackReferenceElement: Element | null\n\t) => DomRectWithOwnerDocument;\n\t/**\n\t * Used to enable a different visual style for the popover.\n\t * _Note: this prop is deprecated. Use the `variant` prop with the\n\t * 'toolbar' value instead._\n\t *\n\t * @deprecated\n\t */\n\tisAlternate?: boolean;\n};\n\nexport type PopoverSlotProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\tname?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -332,6 +332,18 @@ const UnforwardedPopover = (props, forwardedRef) => {
332
332
  });
333
333
  };
334
334
 
335
+ // Export the PopoverSlot individually to allow typescript to pick the types up.
336
+ export const PopoverSlot = forwardRef(({
337
+ name = SLOT_NAME
338
+ }, ref) => {
339
+ return /*#__PURE__*/_jsx(Slot, {
340
+ bubblesVirtually: true,
341
+ name: name,
342
+ className: "popover-slot",
343
+ ref: ref
344
+ });
345
+ });
346
+
335
347
  /**
336
348
  * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.
337
349
  *
@@ -355,21 +367,21 @@ const UnforwardedPopover = (props, forwardedRef) => {
355
367
  * ```
356
368
  *
357
369
  */
358
- export const Popover = contextConnect(UnforwardedPopover, 'Popover');
359
- function PopoverSlot({
360
- name = SLOT_NAME
361
- }, ref) {
362
- return /*#__PURE__*/_jsx(Slot, {
363
- bubblesVirtually: true,
364
- name: name,
365
- className: "popover-slot",
366
- ref: ref
367
- });
368
- }
369
-
370
- // @ts-expect-error For Legacy Reasons
371
- Popover.Slot = forwardRef(PopoverSlot);
372
- // @ts-expect-error For Legacy Reasons
373
- Popover.__unstableSlotNameProvider = slotNameContext.Provider;
370
+ export const Popover = Object.assign(contextConnect(UnforwardedPopover, 'Popover'), {
371
+ /**
372
+ * Renders a slot that is used internally by Popover for rendering content.
373
+ */
374
+ Slot: Object.assign(PopoverSlot, {
375
+ displayName: 'Popover.Slot'
376
+ }),
377
+ /**
378
+ * Provides a context to manage popover slot names.
379
+ *
380
+ * This is marked as unstable and should not be used directly.
381
+ */
382
+ __unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {
383
+ displayName: 'Popover.__unstableSlotNameProvider'
384
+ })
385
+ });
374
386
  export default Popover;
375
387
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useFloating","flip","flipMiddleware","shift","shiftMiddleware","limitShift","autoUpdate","arrow","offset","offsetMiddleware","size","motion","useRef","useLayoutEffect","forwardRef","createContext","useContext","useMemo","useState","useCallback","createPortal","useReducedMotion","useViewportMatch","useMergeRefs","__experimentalUseDialog","useDialog","close","deprecated","Path","SVG","__","Button","ScrollLock","Slot","Fill","useSlot","computePopoverPosition","positionToPlacement","placementToMotionAnimationProps","getReferenceElement","contextConnect","useContextSystem","overlayMiddlewares","StyleProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_NAME","ArrowTriangle","xmlns","viewBox","className","role","children","d","vectorEffect","slotNameContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","resize","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","middleware","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","resultingReferenceElement","setReference","mergedFloatingRef","setFloating","left","shouldReduceMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","animationProps","onAnimationComplete","isPositioned","content","div","ref","tabIndex","icon","onClick","label","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","name","Popover","PopoverSlot","bubblesVirtually","__unstableSlotNameProvider","Provider"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SACCC,WAAW,EACXC,IAAI,IAAIC,cAAc,EACtBC,KAAK,IAAIC,eAAe,EACxBC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,MAAM,IAAIC,gBAAgB,EAC1BC,IAAI,QACE,wBAAwB;AAE/B,SAASC,MAAM,QAAQ,eAAe;;AAEtC;AACA;AACA;AACA,SACCC,MAAM,EACNC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,YAAY,QACN,oBAAoB;AAC3B,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,YAAY,EACZC,uBAAuB,IAAIC,SAAS,QAC9B,oBAAoB;AAC3B,SAASC,KAAK,QAAQ,kBAAkB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,GAAG,QAAQ,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CAAE6B,kBAAkB,EAAE,SAAU,CAAC;AAEtE,SAASuH,WAAWA,CACnB;EAAEF,IAAI,GAAGxI;AAA6B,CAAC,EACvC6H,GAAwB,EACvB;EACD,oBACClI,IAAA,CAACZ,IAAI;IACJ4J,gBAAgB;IAChBH,IAAI,EAAGA,IAAM;IACbpI,SAAS,EAAC,cAAc;IACxByH,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAY,OAAO,CAAC1J,IAAI,GAAGnB,UAAU,CAAE8K,WAAY,CAAC;AACxC;AACAD,OAAO,CAACG,0BAA0B,GAAGnI,eAAe,CAACoI,QAAQ;AAE7D,eAAeJ,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useFloating","flip","flipMiddleware","shift","shiftMiddleware","limitShift","autoUpdate","arrow","offset","offsetMiddleware","size","motion","useRef","useLayoutEffect","forwardRef","createContext","useContext","useMemo","useState","useCallback","createPortal","useReducedMotion","useViewportMatch","useMergeRefs","__experimentalUseDialog","useDialog","close","deprecated","Path","SVG","__","Button","ScrollLock","Slot","Fill","useSlot","computePopoverPosition","positionToPlacement","placementToMotionAnimationProps","getReferenceElement","contextConnect","useContextSystem","overlayMiddlewares","StyleProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_NAME","ArrowTriangle","xmlns","viewBox","className","role","children","d","vectorEffect","slotNameContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","resize","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","middleware","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","resultingReferenceElement","setReference","mergedFloatingRef","setFloating","left","shouldReduceMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","animationProps","onAnimationComplete","isPositioned","content","div","ref","tabIndex","icon","onClick","label","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","name","PopoverSlot","bubblesVirtually","Popover","displayName","__unstableSlotNameProvider","Provider"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n\tPopoverSlotProps,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n// Export the PopoverSlot individually to allow typescript to pick the types up.\nexport const PopoverSlot = forwardRef< HTMLDivElement, PopoverSlotProps >(\n\t( { name = SLOT_NAME }, ref ) => {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tbubblesVirtually\n\t\t\t\tname={ name }\n\t\t\t\tclassName=\"popover-slot\"\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t);\n\t}\n);\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = Object.assign(\n\tcontextConnect( UnforwardedPopover, 'Popover' ),\n\t{\n\t\t/**\n\t\t * Renders a slot that is used internally by Popover for rendering content.\n\t\t */\n\t\tSlot: Object.assign( PopoverSlot, {\n\t\t\tdisplayName: 'Popover.Slot',\n\t\t} ),\n\t\t/**\n\t\t * Provides a context to manage popover slot names.\n\t\t *\n\t\t * This is marked as unstable and should not be used directly.\n\t\t */\n\t\t__unstableSlotNameProvider: Object.assign( slotNameContext.Provider, {\n\t\t\tdisplayName: 'Popover.__unstableSlotNameProvider',\n\t\t} ),\n\t}\n);\n\nexport default Popover;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SACCC,WAAW,EACXC,IAAI,IAAIC,cAAc,EACtBC,KAAK,IAAIC,eAAe,EACxBC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,MAA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AR,QAAA,EAAGqH;IAAO,CAAiB,CAAC,EAChE/G,2BAA2B,CAAC,CAC7B,CAAC;EACF;EAEA,IAAK2H,SAAS,EAAG;IAChB,OAAOZ,OAAO;EACf;EAEA,oBACC9H,KAAA,CAAAE,SAAA;IAAAO,QAAA,gBACCX,IAAA;MAAMkI,GAAG,EAAGrE;IAAmB,CAAE,CAAC,EAChCmE,OAAO;EAAA,CACR,CAAC;AAEL,CAAC;;AAED;AACA,OAAO,MAAMc,WAAW,GAAG7K,UAAU,CACpC,CAAE;EAAE4K,IAAI,GAAGxI;AAAU,CAAC,EAAE6H,GAAG,KAAM;EAChC,oBACClI,IAAA,CAACZ,IAAI;IACJ2J,gBAAgB;IAChBF,IAAI,EAAGA,IAAM;IACbpI,SAAS,EAAC,cAAc;IACxByH,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMc,OAAO,GAAGpE,MAAM,CAACC,MAAM,CACnClF,cAAc,CAAE6B,kBAAkB,EAAE,SAAU,CAAC,EAC/C;EACC;AACF;AACA;EACEpC,IAAI,EAAEwF,MAAM,CAACC,MAAM,CAAEiE,WAAW,EAAE;IACjCG,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;EACEC,0BAA0B,EAAEtE,MAAM,CAACC,MAAM,CAAE/D,eAAe,CAACqI,QAAQ,EAAE;IACpEF,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAED,eAAeD,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/popover/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';\nimport type { Placement } from '@floating-ui/react-dom';\n\ntype PositionYAxis = 'top' | 'middle' | 'bottom';\ntype PositionXAxis = 'left' | 'center' | 'right';\ntype PositionCorner = 'top' | 'right' | 'bottom' | 'left';\n\ntype DomRectWithOwnerDocument = DOMRect & {\n\townerDocument?: Document;\n};\n\ntype PopoverPlacement = Placement | 'overlay';\n\nexport type PopoverAnchorRefReference = MutableRefObject<\n\tElement | null | undefined\n>;\nexport type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };\n\nexport type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {\n\townerDocument?: Document;\n};\n\nexport type PopoverProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\t__unstableSlotName?: string;\n\t/**\n\t * The element that should be used by the popover as its anchor. It can either\n\t * be an `Element` or, alternatively, a `VirtualElement` — ie. an object with\n\t * the `getBoundingClientRect()` and the `ownerDocument` properties defined.\n\t *\n\t * **The anchor element should be stored in local state** rather than a\n\t * plain React ref to ensure reactive updating when it changes.\n\t */\n\tanchor?: Element | VirtualElement | null;\n\t/**\n\t * Whether the popover should animate when opening.\n\t *\n\t * @default true\n\t */\n\tanimate?: boolean;\n\t/**\n\t * The `children` elements rendered as the popover's content.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Show the popover fullscreen on mobile viewports.\n\t */\n\texpandOnMobile?: boolean;\n\t/**\n\t * Specifies whether the popover should flip across its axis if there isn't\n\t * space for it in the normal placement.\n\t * When the using a 'top' placement, the popover will switch to a 'bottom'\n\t * placement. When using a 'left' placement, the popover will switch to a\n\t * `right' placement.\n\t * The popover will retain its alignment of 'start' or 'end' when flipping.\n\t *\n\t * @default true\n\t */\n\tflip?: boolean;\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elswhere, or whether the popover remains part of the wider\n\t * tab order. If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\t/**\n\t * By default, the _first tabbable element_ in the popover will receive focus\n\t * when it mounts. This is the same as setting this prop to `\"firstElement\"`.\n\t * Specifying a `false` value disables the focus handling entirely (this\n\t * should only be done when an appropriately accessible substitute behavior\n\t * exists).\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: 'firstElement' | boolean;\n\t/**\n\t * A callback invoked when the focus leaves the opened popover. This should\n\t * only be provided in advanced use-cases when a popover should close under\n\t * specific circumstances (for example, if the new `document.activeElement`\n\t * is content of or otherwise controlling popover visibility).\n\t *\n\t * When not provided, the `onClose` callback will be called instead.\n\t */\n\tonFocusOutside?: ( event: SyntheticEvent ) => void;\n\t/**\n\t * Used to customize the header text shown when the popover is toggled to\n\t * fullscreen on mobile viewports (see the `expandOnMobile` prop).\n\t */\n\theaderTitle?: string;\n\t/**\n\t * Used to show/hide the arrow that points at the popover's anchor.\n\t *\n\t * @default true\n\t */\n\tnoArrow?: boolean;\n\t/**\n\t * The distance (in px) between the anchor and the popover.\n\t */\n\toffset?: number;\n\t/**\n\t * A callback invoked when the popover should be closed.\n\t */\n\tonClose?: () => void;\n\t/**\n\t * Used to specify the popover's position with respect to its anchor.\n\t *\n\t * @default 'bottom-start'\n\t */\n\tplacement?: PopoverPlacement;\n\t/**\n\t * Legacy way to specify the popover's position with respect to its anchor.\n\t * _Note: this prop is deprecated. Use the `placement` prop instead._\n\t */\n\tposition?:\n\t\t| `${ PositionYAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis } ${ PositionCorner }`;\n\t/**\n\t * Adjusts the size of the popover to prevent its contents from going out of\n\t * view when meeting the viewport edges.\n\t *\n\t * @default true\n\t */\n\tresize?: boolean;\n\t/**\n\t * Enables the `Popover` to shift in order to stay in view when meeting the\n\t * viewport edges.\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\t/**\n\t * Specifies the popover's style.\n\t *\n\t * Leave undefined for the default style. Other values are:\n\t * - 'unstyled': The popover is essentially without any visible style, it\n\t * has no background, border, outline or drop shadow, but\n\t * the popover contents are still displayed.\n\t * - 'toolbar': A style that has no elevation, but a high contrast with\n\t * other elements. This is matches the style of the\n\t * `Toolbar` component.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | 'toolbar';\n\t/**\n\t * Whether to render the popover inline or within the slot.\n\t *\n\t * @default false\n\t */\n\tinline?: boolean;\n\t// Deprecated props\n\t/**\n\t * Prevent the popover from flipping and resizing when meeting the viewport\n\t * edges. _Note: this prop is deprecated. Instead, provide use the individual\n\t * `flip` and `resize` props._\n\t *\n\t * @deprecated\n\t */\n\t__unstableForcePosition?: boolean;\n\t/**\n\t * An object extending a `DOMRect` with an additional optional `ownerDocument`\n\t * property, used to specify a fixed popover position.\n\t *\n\t * @deprecated\n\t */\n\tanchorRect?: DomRectWithOwnerDocument;\n\t/**\n\t * Used to specify a fixed popover position. It can be an `Element`, a React\n\t * reference to an `element`, an object with a `top` and a `bottom` properties\n\t * (both pointing to elements), or a `range`.\n\t *\n\t * @deprecated\n\t */\n\tanchorRef?:\n\t\t| Element\n\t\t| PopoverAnchorRefReference\n\t\t| PopoverAnchorRefTopBottom\n\t\t| Range;\n\t/**\n\t * A function returning the same value as the one expected by the `anchorRect`\n\t * prop, used to specify a dynamic popover position.\n\t *\n\t * @deprecated\n\t */\n\tgetAnchorRect?: (\n\t\tfallbackReferenceElement: Element | null\n\t) => DomRectWithOwnerDocument;\n\t/**\n\t * Used to enable a different visual style for the popover.\n\t * _Note: this prop is deprecated. Use the `variant` prop with the\n\t * 'toolbar' value instead._\n\t *\n\t * @deprecated\n\t */\n\tisAlternate?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/popover/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';\nimport type { Placement } from '@floating-ui/react-dom';\n\ntype PositionYAxis = 'top' | 'middle' | 'bottom';\ntype PositionXAxis = 'left' | 'center' | 'right';\ntype PositionCorner = 'top' | 'right' | 'bottom' | 'left';\n\ntype DomRectWithOwnerDocument = DOMRect & {\n\townerDocument?: Document;\n};\n\ntype PopoverPlacement = Placement | 'overlay';\n\nexport type PopoverAnchorRefReference = MutableRefObject<\n\tElement | null | undefined\n>;\nexport type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };\n\nexport type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {\n\townerDocument?: Document;\n};\n\nexport type PopoverProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\t__unstableSlotName?: string;\n\t/**\n\t * The element that should be used by the popover as its anchor. It can either\n\t * be an `Element` or, alternatively, a `VirtualElement` — ie. an object with\n\t * the `getBoundingClientRect()` and the `ownerDocument` properties defined.\n\t *\n\t * **The anchor element should be stored in local state** rather than a\n\t * plain React ref to ensure reactive updating when it changes.\n\t */\n\tanchor?: Element | VirtualElement | null;\n\t/**\n\t * Whether the popover should animate when opening.\n\t *\n\t * @default true\n\t */\n\tanimate?: boolean;\n\t/**\n\t * The `children` elements rendered as the popover's content.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Show the popover fullscreen on mobile viewports.\n\t */\n\texpandOnMobile?: boolean;\n\t/**\n\t * Specifies whether the popover should flip across its axis if there isn't\n\t * space for it in the normal placement.\n\t * When the using a 'top' placement, the popover will switch to a 'bottom'\n\t * placement. When using a 'left' placement, the popover will switch to a\n\t * `right' placement.\n\t * The popover will retain its alignment of 'start' or 'end' when flipping.\n\t *\n\t * @default true\n\t */\n\tflip?: boolean;\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elswhere, or whether the popover remains part of the wider\n\t * tab order. If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\t/**\n\t * By default, the _first tabbable element_ in the popover will receive focus\n\t * when it mounts. This is the same as setting this prop to `\"firstElement\"`.\n\t * Specifying a `false` value disables the focus handling entirely (this\n\t * should only be done when an appropriately accessible substitute behavior\n\t * exists).\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: 'firstElement' | boolean;\n\t/**\n\t * A callback invoked when the focus leaves the opened popover. This should\n\t * only be provided in advanced use-cases when a popover should close under\n\t * specific circumstances (for example, if the new `document.activeElement`\n\t * is content of or otherwise controlling popover visibility).\n\t *\n\t * When not provided, the `onClose` callback will be called instead.\n\t */\n\tonFocusOutside?: ( event: SyntheticEvent ) => void;\n\t/**\n\t * Used to customize the header text shown when the popover is toggled to\n\t * fullscreen on mobile viewports (see the `expandOnMobile` prop).\n\t */\n\theaderTitle?: string;\n\t/**\n\t * Used to show/hide the arrow that points at the popover's anchor.\n\t *\n\t * @default true\n\t */\n\tnoArrow?: boolean;\n\t/**\n\t * The distance (in px) between the anchor and the popover.\n\t */\n\toffset?: number;\n\t/**\n\t * A callback invoked when the popover should be closed.\n\t */\n\tonClose?: () => void;\n\t/**\n\t * Used to specify the popover's position with respect to its anchor.\n\t *\n\t * @default 'bottom-start'\n\t */\n\tplacement?: PopoverPlacement;\n\t/**\n\t * Legacy way to specify the popover's position with respect to its anchor.\n\t * _Note: this prop is deprecated. Use the `placement` prop instead._\n\t */\n\tposition?:\n\t\t| `${ PositionYAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis } ${ PositionCorner }`;\n\t/**\n\t * Adjusts the size of the popover to prevent its contents from going out of\n\t * view when meeting the viewport edges.\n\t *\n\t * @default true\n\t */\n\tresize?: boolean;\n\t/**\n\t * Enables the `Popover` to shift in order to stay in view when meeting the\n\t * viewport edges.\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\t/**\n\t * Specifies the popover's style.\n\t *\n\t * Leave undefined for the default style. Other values are:\n\t * - 'unstyled': The popover is essentially without any visible style, it\n\t * has no background, border, outline or drop shadow, but\n\t * the popover contents are still displayed.\n\t * - 'toolbar': A style that has no elevation, but a high contrast with\n\t * other elements. This is matches the style of the\n\t * `Toolbar` component.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | 'toolbar';\n\t/**\n\t * Whether to render the popover inline or within the slot.\n\t *\n\t * @default false\n\t */\n\tinline?: boolean;\n\t// Deprecated props\n\t/**\n\t * Prevent the popover from flipping and resizing when meeting the viewport\n\t * edges. _Note: this prop is deprecated. Instead, provide use the individual\n\t * `flip` and `resize` props._\n\t *\n\t * @deprecated\n\t */\n\t__unstableForcePosition?: boolean;\n\t/**\n\t * An object extending a `DOMRect` with an additional optional `ownerDocument`\n\t * property, used to specify a fixed popover position.\n\t *\n\t * @deprecated\n\t */\n\tanchorRect?: DomRectWithOwnerDocument;\n\t/**\n\t * Used to specify a fixed popover position. It can be an `Element`, a React\n\t * reference to an `element`, an object with a `top` and a `bottom` properties\n\t * (both pointing to elements), or a `range`.\n\t *\n\t * @deprecated\n\t */\n\tanchorRef?:\n\t\t| Element\n\t\t| PopoverAnchorRefReference\n\t\t| PopoverAnchorRefTopBottom\n\t\t| Range;\n\t/**\n\t * A function returning the same value as the one expected by the `anchorRect`\n\t * prop, used to specify a dynamic popover position.\n\t *\n\t * @deprecated\n\t */\n\tgetAnchorRect?: (\n\t\tfallbackReferenceElement: Element | null\n\t) => DomRectWithOwnerDocument;\n\t/**\n\t * Used to enable a different visual style for the popover.\n\t * _Note: this prop is deprecated. Use the `variant` prop with the\n\t * 'toolbar' value instead._\n\t *\n\t * @deprecated\n\t */\n\tisAlternate?: boolean;\n};\n\nexport type PopoverSlotProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\tname?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -396,7 +396,7 @@
396
396
  color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
397
397
  background: transparent;
398
398
  }
399
- .components-button.is-tertiary:hover:not(:disabled, [aria-disabled=true]) {
399
+ .components-button.is-tertiary:hover:not(:disabled, [aria-disabled=true], .is-pressed) {
400
400
  background: color-mix(in srgb, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) 4%, transparent);
401
401
  color: var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6));
402
402
  }
@@ -894,6 +894,8 @@ input.components-combobox-control__input[type=text] {
894
894
  margin: 0;
895
895
  line-height: inherit;
896
896
  min-height: auto;
897
+ background: var(--wp-components-color-background, #fff);
898
+ color: var(--wp-components-color-foreground, #1e1e1e);
897
899
  }
898
900
  @media (min-width: 600px) {
899
901
  input.components-combobox-control__input[type=text] {
@@ -934,8 +936,8 @@ input.components-combobox-control__input[type=text]:focus {
934
936
  }
935
937
  }
936
938
  .components-combobox-control__suggestions-container:focus {
937
- border-color: var(--wp-admin-theme-color);
938
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
939
+ border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
940
+ box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
939
941
  outline: 2px solid transparent;
940
942
  }
941
943
  .components-combobox-control__suggestions-container::-webkit-input-placeholder {
@@ -948,8 +950,8 @@ input.components-combobox-control__input[type=text]:focus {
948
950
  color: rgba(30, 30, 30, 0.62);
949
951
  }
950
952
  .components-combobox-control__suggestions-container:focus-within {
951
- border-color: var(--wp-admin-theme-color);
952
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
953
+ border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
954
+ box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
953
955
  outline: 2px solid transparent;
954
956
  }
955
957
  .components-combobox-control__suggestions-container .components-spinner {
@@ -1450,8 +1452,8 @@ body.is-dragging-components-draggable {
1450
1452
  }
1451
1453
  }
1452
1454
  .components-form-token-field__input-container:focus {
1453
- border-color: var(--wp-admin-theme-color);
1454
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
1455
+ border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
1456
+ box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
1455
1457
  outline: 2px solid transparent;
1456
1458
  }
1457
1459
  .components-form-token-field__input-container::-webkit-input-placeholder {
@@ -1468,8 +1470,8 @@ body.is-dragging-components-draggable {
1468
1470
  border-color: #ddd;
1469
1471
  }
1470
1472
  .components-form-token-field__input-container.is-active {
1471
- border-color: var(--wp-admin-theme-color);
1472
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
1473
+ border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
1474
+ box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
1473
1475
  outline: 2px solid transparent;
1474
1476
  }
1475
1477
  .components-form-token-field__input-container input[type=text].components-form-token-field__input {
@@ -1485,7 +1487,7 @@ body.is-dragging-components-draggable {
1485
1487
  min-width: 50px;
1486
1488
  background: inherit;
1487
1489
  border: 0;
1488
- color: #1e1e1e;
1490
+ color: var(--wp-components-color-foreground, #1e1e1e);
1489
1491
  box-shadow: none;
1490
1492
  }
1491
1493
  @media (min-width: 600px) {
@@ -1597,7 +1599,7 @@ body.is-dragging-components-draggable {
1597
1599
  }
1598
1600
 
1599
1601
  .components-form-token-field__suggestion {
1600
- color: #1e1e1e;
1602
+ color: var(--wp-components-color-foreground, #1e1e1e);
1601
1603
  display: block;
1602
1604
  font-size: 13px;
1603
1605
  padding: 8px 12px;
@@ -1607,7 +1609,7 @@ body.is-dragging-components-draggable {
1607
1609
  }
1608
1610
  .components-form-token-field__suggestion.is-selected {
1609
1611
  background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
1610
- color: #fff;
1612
+ color: var(--wp-components-color-foreground-inverted, #fff);
1611
1613
  }
1612
1614
  .components-form-token-field__suggestion[aria-disabled=true] {
1613
1615
  pointer-events: none;