@sanity/ui 4.4.12 → 4.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{_system-CTe2lb5l.d.ts → _system-DjnSx8gA.d.ts} +1 -1
  2. package/dist/{_system-CTe2lb5l.d.ts.map → _system-DjnSx8gA.d.ts.map} +1 -1
  3. package/dist/{arrow-Df43Duu7.js → arrow-BhooatHA.js} +2 -2
  4. package/dist/{arrow-Df43Duu7.js.map → arrow-BhooatHA.js.map} +1 -1
  5. package/dist/autocomplete.d.ts +3 -3
  6. package/dist/autocomplete.js +8 -8
  7. package/dist/breadcrumbs.js +6 -6
  8. package/dist/{button-dnqMFkWg.d.ts → button-DJ_N-Z82.d.ts} +5 -5
  9. package/dist/{button-dnqMFkWg.d.ts.map → button-DJ_N-Z82.d.ts.map} +1 -1
  10. package/dist/{button-DBWvhK72.js → button-GFefHUiY.js} +8 -8
  11. package/dist/{button-DBWvhK72.js.map → button-GFefHUiY.js.map} +1 -1
  12. package/dist/card-CEB9JLru.d.ts +7 -0
  13. package/dist/card-CEB9JLru.d.ts.map +1 -0
  14. package/dist/code.d.ts +1 -1
  15. package/dist/code.js +4 -4
  16. package/dist/{component-DVlwaWB-.d.ts → component-CWyWF8Ut.d.ts} +1 -1
  17. package/dist/{component-DVlwaWB-.d.ts.map → component-CWyWF8Ut.d.ts.map} +1 -1
  18. package/dist/{element-BYgCE_iK.js → element-DIcKo4Jp.js} +1 -1
  19. package/dist/{element-BYgCE_iK.js.map → element-DIcKo4Jp.js.map} +1 -1
  20. package/dist/{elementSizeObserver-pevZfdGa.js → elementSizeObserver-CSI5StGC.js} +1 -1
  21. package/dist/{elementSizeObserver-pevZfdGa.js.map → elementSizeObserver-CSI5StGC.js.map} +1 -1
  22. package/dist/{factory-BzXTX8_Q.js → factory-D1M0GqJn.js} +3 -3
  23. package/dist/{factory-BzXTX8_Q.js.map → factory-D1M0GqJn.js.map} +1 -1
  24. package/dist/{flex-DZLSBZTk.js → flex-DeU6k2uN.js} +4 -4
  25. package/dist/{flex-DZLSBZTk.js.map → flex-DeU6k2uN.js.map} +1 -1
  26. package/dist/{font-EtfxKPUz.d.ts → font-DI_tc5s8.d.ts} +1 -1
  27. package/dist/{font-EtfxKPUz.d.ts.map → font-DI_tc5s8.d.ts.map} +1 -1
  28. package/dist/{getElementRef-BLVMlHTn.js → getElementRef-5HypX0AT.js} +1 -1
  29. package/dist/{getElementRef-BLVMlHTn.js.map → getElementRef-5HypX0AT.js.map} +1 -1
  30. package/dist/{getScopedTheme-C-sZsyAz.js → getScopedTheme-BJoqtbrb.js} +2 -2
  31. package/dist/{getScopedTheme-C-sZsyAz.js.map → getScopedTheme-BJoqtbrb.js.map} +1 -1
  32. package/dist/{getTheme_v2-y09KqtEb.js → getTheme_v2-CP5x_AcH.js} +1 -1
  33. package/dist/{getTheme_v2-y09KqtEb.js.map → getTheme_v2-CP5x_AcH.js.map} +1 -1
  34. package/dist/{grid-HONPZVbL.js → grid-Bz_gKSjw.js} +4 -4
  35. package/dist/{grid-HONPZVbL.js.map → grid-Bz_gKSjw.js.map} +1 -1
  36. package/dist/{helpers-XThPpWje.js → helpers-jp2T-bdR.js} +2 -2
  37. package/dist/{helpers-XThPpWje.js.map → helpers-jp2T-bdR.js.map} +1 -1
  38. package/dist/{hotkeys-CQgNwGAf.js → hotkeys-B9h8uliL.js} +5 -5
  39. package/dist/{hotkeys-CQgNwGAf.js.map → hotkeys-B9h8uliL.js.map} +1 -1
  40. package/dist/index.d.ts +8 -8
  41. package/dist/index.js +19 -19
  42. package/dist/{layer-CZ8G9TS5.js → layer-Bl7rtdZ_.js} +4 -4
  43. package/dist/{layer-CZ8G9TS5.js.map → layer-Bl7rtdZ_.js.map} +1 -1
  44. package/dist/{layer-ChlP9Ik6.d.ts → layer-CAyooswI.d.ts} +1 -1
  45. package/dist/{layer-ChlP9Ik6.d.ts.map → layer-CAyooswI.d.ts.map} +1 -1
  46. package/dist/menu.d.ts +4 -4
  47. package/dist/menu.js +12 -12
  48. package/dist/{popover-sE-Xd89W.js → popover-C-YWzo_l.js} +9 -9
  49. package/dist/{popover-sE-Xd89W.js.map → popover-C-YWzo_l.js.map} +1 -1
  50. package/dist/{popover-fmTtK69w.d.ts → popover-DpHuX7yr.d.ts} +4 -4
  51. package/dist/{popover-fmTtK69w.d.ts.map → popover-DpHuX7yr.d.ts.map} +1 -1
  52. package/dist/popover.d.ts +1 -1
  53. package/dist/popover.js +1 -1
  54. package/dist/{refractor-CC48DwHi.js → refractor-DeAFUFLp.js} +2 -2
  55. package/dist/{refractor-CC48DwHi.js.map → refractor-DeAFUFLp.js.map} +1 -1
  56. package/dist/{responsiveFont-DJ-TUdSl.js → responsiveFont-CfFXLc7o.js} +3 -3
  57. package/dist/{responsiveFont-DJ-TUdSl.js.map → responsiveFont-CfFXLc7o.js.map} +1 -1
  58. package/dist/{rgba-BSYaEUW6.d.ts → rgba-Hlu7P1jF.d.ts} +3 -3
  59. package/dist/{rgba-BSYaEUW6.d.ts.map → rgba-Hlu7P1jF.d.ts.map} +1 -1
  60. package/dist/selectable-2IHh9SLq.d.ts +7 -0
  61. package/dist/selectable-2IHh9SLq.d.ts.map +1 -0
  62. package/dist/{stack-DFSqrIj4.js → stack-DFRXALVU.js} +5 -5
  63. package/dist/{stack-DFSqrIj4.js.map → stack-DFRXALVU.js.map} +1 -1
  64. package/dist/{textInput-CUhBHHFK.js → textInput-cMQvSl5n.js} +7 -7
  65. package/dist/{textInput-CUhBHHFK.js.map → textInput-cMQvSl5n.js.map} +1 -1
  66. package/dist/theme.d.ts +3 -3
  67. package/dist/theme.js +3 -3
  68. package/dist/toast.js +8 -8
  69. package/dist/tooltip.d.ts +2 -2
  70. package/dist/tooltip.js +7 -7
  71. package/dist/{useClickOutsideEvent-CC1zgOmv.js → useClickOutsideEvent-C-9cvlOu.js} +2 -2
  72. package/dist/{useClickOutsideEvent-CC1zgOmv.js.map → useClickOutsideEvent-C-9cvlOu.js.map} +1 -1
  73. package/dist/{useLayer-CKA2DU8j.js → useLayer-DiYnwQ5T.js} +4 -4
  74. package/dist/{useLayer-CKA2DU8j.js.map → useLayer-DiYnwQ5T.js.map} +1 -1
  75. package/package.json +17 -17
  76. package/dist/card-C0a0wQTc.d.ts +0 -7
  77. package/dist/card-C0a0wQTc.d.ts.map +0 -1
  78. package/dist/selectable-B0GUIL74.d.ts +0 -7
  79. package/dist/selectable-B0GUIL74.d.ts.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { A as ThemeColorMutedTone, B as ThemeColorBase, C as ThemeColorSpotKey, D as ThemeColorSelectableState, E as ThemeColorSelectable, F as ThemeColorCardState, H as ThemeColorToneKey, I as ThemeColorButton, L as ThemeColorButtonState, M as ThemeColorInputState, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, R as ThemeColorButtonStates, S as ThemeColorSpot, T as ThemeColorSolidTone, U as ThemeColorGenericState, V as ThemeColorName, W as ThemeAvatar, _ as Theme_v2, _t as ThemeColorSyntax$1, a as rgbToHex$1, b as ThemeColorScheme, c as screen$1, d as ThemeColorBuilderOpts, f as createColorTheme$1, ft as ThemeStyles, g as Theme$1, gt as ThemeLayer$1, ht as ThemeShadow$1, i as hslToRgb$1, j as ThemeColorInput, k as ThemeColorMuted, l as multiply$1, m as RootTheme$1, mt as ThemeBoxShadow, n as parseColor$1, o as rgbToHsl$1, p as BaseTheme$1, pt as CSSObject, r as hexToRgb$1, t as rgba$1, u as PartialThemeColorBuilderOpts, v as ThemeInput, vt as HSL$1, w as ThemeColorSolid, x as ThemeColorSchemes, y as ThemeColor, yt as RGB$1, z as ThemeColorButtonTones } from "./rgba-BSYaEUW6.js";
2
- import { i as ThemeColorCardToneKey, l as ThemeColorStateToneKey, r as ThemeColorButtonModeKey$1, s as ThemeColorSchemeKey$1, t as ThemeColorAvatarColorKey } from "./_system-CTe2lb5l.js";
3
- import { a as ThemeFontWeightKey$1, i as ThemeFontWeight$1, n as ThemeFontKey$1, o as ThemeFonts$1, r as ThemeFontSize$1, t as ThemeFont$1 } from "./font-EtfxKPUz.js";
4
- import { A as FlexWrap, C as GridAutoCols, D as FlexDirection, E as FlexAlign, M as BoxHeight, N as BoxOverflow, O as FlexJustify, P as BoxSizing, S as GridItemRowStart, T as GridAutoRows, _ as GridItemColumn, a as ResponsiveBorderProps, b as GridItemRow, c as ResponsiveFlexProps, d as ResponsiveMarginProps, f as ResponsivePaddingProps, g as Radius, h as ResponsiveWidthProps, i as Delay, j as BoxDisplay, k as FlexValue, l as ResponsiveGridItemProps, m as ResponsiveShadowProps, n as LayerProps, o as ResponsiveBoxProps, p as ResponsiveRadiusProps, r as Placement, s as ResponsiveFlexItemProps, t as Layer, u as ResponsiveGridProps, v as GridItemColumnEnd, w as GridAutoFlow, x as GridItemRowEnd, y as GridItemColumnStart } from "./layer-ChlP9Ik6.js";
5
- import { a as ButtonTextAlign, c as Box, i as ButtonMode, l as BoxOwnProps, n as ButtonOwnProps, o as ButtonTone, r as ButtonProps, s as ButtonWidth, t as Button, u as BoxProps } from "./button-dnqMFkWg.js";
6
- import { a as Props, i as EmptyProps, n as ComponentType, o as TagType, r as ElementType, t as Assign } from "./component-DVlwaWB-.js";
7
- import { t as CardTone } from "./card-C0a0wQTc.js";
8
- import { t as SelectableTone } from "./selectable-B0GUIL74.js";
1
+ import { A as ThemeColorMutedTone, B as ThemeColorBase, C as ThemeColorSpotKey, D as ThemeColorSelectableState, E as ThemeColorSelectable, F as ThemeColorCardState, H as ThemeColorToneKey, I as ThemeColorButton, L as ThemeColorButtonState, M as ThemeColorInputState, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, R as ThemeColorButtonStates, S as ThemeColorSpot, T as ThemeColorSolidTone, U as ThemeColorGenericState, V as ThemeColorName, W as ThemeAvatar, _ as Theme_v2, _t as ThemeColorSyntax$1, a as rgbToHex$1, b as ThemeColorScheme, c as screen$1, d as ThemeColorBuilderOpts, f as createColorTheme$1, ft as ThemeStyles, g as Theme$1, gt as ThemeLayer$1, ht as ThemeShadow$1, i as hslToRgb$1, j as ThemeColorInput, k as ThemeColorMuted, l as multiply$1, m as RootTheme$1, mt as ThemeBoxShadow, n as parseColor$1, o as rgbToHsl$1, p as BaseTheme$1, pt as CSSObject, r as hexToRgb$1, t as rgba$1, u as PartialThemeColorBuilderOpts, v as ThemeInput, vt as HSL$1, w as ThemeColorSolid, x as ThemeColorSchemes, y as ThemeColor, yt as RGB$1, z as ThemeColorButtonTones } from "./rgba-Hlu7P1jF.js";
2
+ import { i as ThemeColorCardToneKey, l as ThemeColorStateToneKey, r as ThemeColorButtonModeKey$1, s as ThemeColorSchemeKey$1, t as ThemeColorAvatarColorKey } from "./_system-DjnSx8gA.js";
3
+ import { a as ThemeFontWeightKey$1, i as ThemeFontWeight$1, n as ThemeFontKey$1, o as ThemeFonts$1, r as ThemeFontSize$1, t as ThemeFont$1 } from "./font-DI_tc5s8.js";
4
+ import { A as FlexWrap, C as GridAutoCols, D as FlexDirection, E as FlexAlign, M as BoxHeight, N as BoxOverflow, O as FlexJustify, P as BoxSizing, S as GridItemRowStart, T as GridAutoRows, _ as GridItemColumn, a as ResponsiveBorderProps, b as GridItemRow, c as ResponsiveFlexProps, d as ResponsiveMarginProps, f as ResponsivePaddingProps, g as Radius, h as ResponsiveWidthProps, i as Delay, j as BoxDisplay, k as FlexValue, l as ResponsiveGridItemProps, m as ResponsiveShadowProps, n as LayerProps, o as ResponsiveBoxProps, p as ResponsiveRadiusProps, r as Placement, s as ResponsiveFlexItemProps, t as Layer, u as ResponsiveGridProps, v as GridItemColumnEnd, w as GridAutoFlow, x as GridItemRowEnd, y as GridItemColumnStart } from "./layer-CAyooswI.js";
5
+ import { a as ButtonTextAlign, c as Box, i as ButtonMode, l as BoxOwnProps, n as ButtonOwnProps, o as ButtonTone, r as ButtonProps, s as ButtonWidth, t as Button, u as BoxProps } from "./button-DJ_N-Z82.js";
6
+ import { a as Props, i as EmptyProps, n as ComponentType, o as TagType, r as ElementType, t as Assign } from "./component-CWyWF8Ut.js";
7
+ import { t as CardTone } from "./card-CEB9JLru.js";
8
+ import { t as SelectableTone } from "./selectable-2IHh9SLq.js";
9
9
  import { Component, HTMLProps, PropsWithChildren } from "react";
10
10
  /**
11
11
  * @public
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  "use client";
2
- import { a as rgba$1, c as hslToRgb$1, i as multiply$1, l as rgbToHex$1, n as buildTheme, o as parseColor$1, r as screen$1, s as hexToRgb$1, t as createColorTheme$1, u as rgbToHsl$1 } from "./factory-BzXTX8_Q.js";
3
- import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, n as containsOrEqualsElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement, t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
4
- import { _ as isFocusable, a as textInputColorStyle, c as textInputRepresentationColorStyle, d as responsiveInputPaddingStyle, f as useCustomValidity, g as focusLastDescendant, h as focusFirstDescendant, i as textInputBaseStyle, l as textInputRepresentationStyle, m as attemptFocus, n as inputRoot, o as textInputFontSizeStyle, p as _hasFocus, r as textAreaRoot, s as textInputFontStyle, t as TextInput, u as responsiveInputPaddingIconRightStyle, v as _raf, y as _raf2 } from "./textInput-CUhBHHFK.js";
5
- import { t as useClickOutsideEvent } from "./useClickOutsideEvent-CC1zgOmv.js";
6
- import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-CQgNwGAf.js";
7
- import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-CKA2DU8j.js";
8
- import { n as Spinner, t as Button } from "./button-DBWvhK72.js";
9
- import { a as _ruleSet, c as EMPTY_RECORD, i as _responsive, n as _getArrayProp, o as rem, r as _getResponsiveSpace, t as _fillCSSObject } from "./helpers-XThPpWje.js";
10
- import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
11
- import { t as Flex } from "./flex-DZLSBZTk.js";
12
- import { a as fontColorStyle, i as responsiveTextAlignStyle, n as Text, r as SpanWithTextOverflow, t as Stack } from "./stack-DFSqrIj4.js";
13
- import { a as resolvePortalElement, i as PortalContext, n as Portal, o as useBoundaryElement, r as usePortal, s as BoundaryElementContext, t as Arrow } from "./arrow-Df43Duu7.js";
14
- import { t as Layer } from "./layer-CZ8G9TS5.js";
15
- import { t as _elementSizeObserver } from "./elementSizeObserver-pevZfdGa.js";
16
- import { i as responsiveFont, n as _fontWeight, r as _responsiveFontSize, t as _fontBase } from "./responsiveFont-DJ-TUdSl.js";
17
- import { t as Grid } from "./grid-HONPZVbL.js";
2
+ import { a as rgba$1, c as hslToRgb$1, i as multiply$1, l as rgbToHex$1, n as buildTheme, o as parseColor$1, r as screen$1, s as hexToRgb$1, t as createColorTheme$1, u as rgbToHsl$1 } from "./factory-D1M0GqJn.js";
18
3
  import { c } from "react/compiler-runtime";
19
- import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
4
+ import { CloseIcon } from "@sanity/icons/Close";
20
5
  import { clsx } from "clsx/lite";
21
6
  import { Children, Component, cloneElement, isValidElement, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
22
7
  import { css, styled } from "styled-components";
8
+ import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, n as containsOrEqualsElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement, t as _isEnterToClickElement } from "./element-DIcKo4Jp.js";
9
+ import { _ as isFocusable, a as textInputColorStyle, c as textInputRepresentationColorStyle, d as responsiveInputPaddingStyle, f as useCustomValidity, g as focusLastDescendant, h as focusFirstDescendant, i as textInputBaseStyle, l as textInputRepresentationStyle, m as attemptFocus, n as inputRoot, o as textInputFontSizeStyle, p as _hasFocus, r as textAreaRoot, s as textInputFontStyle, t as TextInput, u as responsiveInputPaddingIconRightStyle, v as _raf, y as _raf2 } from "./textInput-cMQvSl5n.js";
10
+ import { t as useClickOutsideEvent } from "./useClickOutsideEvent-C-9cvlOu.js";
11
+ import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-B9h8uliL.js";
12
+ import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-DiYnwQ5T.js";
13
+ import { n as Spinner, t as Button } from "./button-GFefHUiY.js";
14
+ import { a as _ruleSet, c as EMPTY_RECORD, i as _responsive, n as _getArrayProp, o as rem, r as _getResponsiveSpace, t as _fillCSSObject } from "./helpers-jp2T-bdR.js";
15
+ import { t as getTheme_v2 } from "./getTheme_v2-CP5x_AcH.js";
23
16
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
24
- import ReactIs from "react-is";
25
- import { CloseIcon } from "@sanity/icons/Close";
17
+ import { t as Flex } from "./flex-DeU6k2uN.js";
18
+ import { a as fontColorStyle, i as responsiveTextAlignStyle, n as Text, r as SpanWithTextOverflow, t as Stack } from "./stack-DFRXALVU.js";
19
+ import { a as resolvePortalElement, i as PortalContext, n as Portal, o as useBoundaryElement, r as usePortal, s as BoundaryElementContext, t as Arrow } from "./arrow-BhooatHA.js";
20
+ import { t as Layer } from "./layer-Bl7rtdZ_.js";
26
21
  import { ToggleArrowRightIcon } from "@sanity/icons/ToggleArrowRight";
22
+ import { t as _elementSizeObserver } from "./elementSizeObserver-CSI5StGC.js";
23
+ import ReactIs from "react-is";
24
+ import { i as responsiveFont, n as _fontWeight, r as _responsiveFontSize, t as _fontBase } from "./responsiveFont-CfFXLc7o.js";
27
25
  import { CheckmarkIcon } from "@sanity/icons/Checkmark";
28
26
  import { RemoveIcon } from "@sanity/icons/Remove";
27
+ import { t as Grid } from "./grid-Bz_gKSjw.js";
28
+ import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
29
29
  /**
30
30
  * @public
31
31
  * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
@@ -1,9 +1,9 @@
1
- import { c as EMPTY_RECORD } from "./helpers-XThPpWje.js";
2
- import { a as isHTMLElement, n as containsOrEqualsElement } from "./element-BYgCE_iK.js";
3
- import { n as LayerProvider, t as useLayer } from "./useLayer-CKA2DU8j.js";
4
1
  import { c } from "react/compiler-runtime";
5
2
  import { clsx } from "clsx/lite";
6
3
  import { useEffect, useImperativeHandle, useRef } from "react";
4
+ import { c as EMPTY_RECORD } from "./helpers-jp2T-bdR.js";
5
+ import { a as isHTMLElement, n as containsOrEqualsElement } from "./element-DIcKo4Jp.js";
6
+ import { n as LayerProvider, t as useLayer } from "./useLayer-DiYnwQ5T.js";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  function LayerChildren(props) {
9
9
  let $ = c(29), children, className, forwardedRef, onActivate, onFocus, restProps, t0, t1;
@@ -57,4 +57,4 @@ function Layer(props) {
57
57
  }
58
58
  export { Layer as t };
59
59
 
60
- //# sourceMappingURL=layer-CZ8G9TS5.js.map
60
+ //# sourceMappingURL=layer-Bl7rtdZ_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layer-CZ8G9TS5.js","names":["as = 'div'","style = EMPTY_RECORD","...restProps","() => ref.current","() => {\n const becameTopLayer = isTopLayerRef.current !== isTopLayer && isTopLayer\n\n if (becameTopLayer) {\n onActivate?.({activeElement: lastFocusedRef.current})\n }\n\n isTopLayerRef.current = isTopLayer\n }","[isTopLayer, onActivate]","(event: FocusEvent<HTMLDivElement, Element>) => {\n // Call the user-provided onFocus handler if any\n onFocus?.(event)\n\n const rootElement = ref.current\n const target = document.activeElement\n\n if (!isTopLayer || !rootElement || !target) return\n\n if (isHTMLElement(target) && containsOrEqualsElement(rootElement, target)) {\n lastFocusedRef.current = target\n }\n }","useCallback(\n // oxlint-disable-next-line no-unnecessary-type-arguments\n (event: FocusEvent<HTMLDivElement, Element>) => {\n // Call the user-provided onFocus handler if any\n onFocus?.(event)\n\n const rootElement = ref.current\n const target = document.activeElement\n\n if (!isTopLayer || !rootElement || !target) return\n\n if (isHTMLElement(target) && containsOrEqualsElement(rootElement, target)) {\n lastFocusedRef.current = target\n }\n },\n [isTopLayer, onFocus],\n )","clsx(layer, className)","{...style, zIndex}","<Component\n data-ui=\"Layer\"\n {...restProps}\n className={clsx(layer, className)}\n onFocus={handleFocus}\n ref={ref}\n style={{...style, zIndex}}\n >\n {children}\n </Component>","zOffset = 1","<LayerChildren {...restProps}>{children}</LayerChildren>","<LayerProvider zOffset={zOffset}>\n <LayerChildren {...restProps}>{children}</LayerChildren>\n </LayerProvider>"],"sources":["../src/core/utils/layer/layer.css.ts","../src/core/utils/layer/layer.tsx"],"sourcesContent":["import {css} from '#styled-system/css'\n\nexport const layer = css({\n position: 'relative',\n})\n","import {clsx} from 'clsx/lite'\nimport {FocusEvent, useCallback, useEffect, useImperativeHandle, useRef} from 'react'\n\nimport {EMPTY_RECORD} from '../../constants'\nimport {containsOrEqualsElement, isHTMLElement} from '../../helpers/element'\nimport {LayerProvider} from './layerProvider'\nimport {useLayer} from './useLayer'\n\nimport {layer} from './layer.css'\n\n/**\n * @public\n */\nexport interface LayerProps {\n as?: React.ElementType | keyof React.JSX.IntrinsicElements\n /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */\n onActivate?: (props: {activeElement: HTMLElement | null}) => void\n zOffset?: number | number[]\n}\n\ninterface LayerChildrenProps {\n as?: React.ElementType | keyof React.JSX.IntrinsicElements\n onActivate?: LayerProps['onActivate']\n}\n\nfunction LayerChildren(props: LayerChildrenProps & Omit<React.HTMLProps<HTMLDivElement>, 'as'>) {\n const {\n as = 'div',\n children,\n className,\n onActivate,\n onFocus,\n ref: forwardedRef,\n style = EMPTY_RECORD,\n ...restProps\n } = props\n const {zIndex, isTopLayer} = useLayer()\n const lastFocusedRef = useRef<HTMLElement | null>(null)\n const ref = useRef<HTMLDivElement | null>(null)\n const isTopLayerRef = useRef<boolean>(isTopLayer)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n // When the layer very first mounts, it will be the top layer, but we don't want to fire\n // the callback in that case. We use a ref to track the previous value of isTopLayer to\n // determine if the layer has become the top layer since the last render.\n useEffect(() => {\n const becameTopLayer = isTopLayerRef.current !== isTopLayer && isTopLayer\n\n if (becameTopLayer) {\n onActivate?.({activeElement: lastFocusedRef.current})\n }\n\n isTopLayerRef.current = isTopLayer\n }, [isTopLayer, onActivate])\n\n const handleFocus = useCallback(\n // oxlint-disable-next-line no-unnecessary-type-arguments\n (event: FocusEvent<HTMLDivElement, Element>) => {\n // Call the user-provided onFocus handler if any\n onFocus?.(event)\n\n const rootElement = ref.current\n const target = document.activeElement\n\n if (!isTopLayer || !rootElement || !target) return\n\n if (isHTMLElement(target) && containsOrEqualsElement(rootElement, target)) {\n lastFocusedRef.current = target\n }\n },\n [isTopLayer, onFocus],\n )\n\n // Rendering the polymorphic `as` needs one concrete element type for JSX to\n // type-check the div-flavored props (the same widening styled-components'\n // `as` prop performed here before).\n // oxlint-disable-next-line no-unsafe-type-assertion\n const Component = as as 'div'\n\n return (\n <Component\n data-ui=\"Layer\"\n {...restProps}\n className={clsx(layer, className)}\n onFocus={handleFocus}\n ref={ref}\n style={{...style, zIndex}}\n >\n {children}\n </Component>\n )\n}\n\n/**\n * @public\n */\nexport function Layer(props: LayerProps & Omit<React.HTMLProps<HTMLDivElement>, 'as'>) {\n const {children, zOffset = 1, ...restProps} = props\n\n return (\n <LayerProvider zOffset={zOffset}>\n <LayerChildren {...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AO;CAAM,GAAb,EAAA,MAAA,OAAO,EAAA,MAAA,Q;CANpBC,IAAAA;CADF,OACG,EAAA,QAAA,aAAA,EAAA,QAQE,YAAA,EAAA,QAJQ,eAAA,EAAA,QAFL,aAAA,EAAA,QACOF,MAAAA,EAAAA,QAGJC,MANTC,KAAAA,oBAAC,WAAD;EACE,WAAQ;EACR,GAAI;EACJ,WAAWF;EACX,SAAS;EACJ;EACL,OAAOC;EAEN;CACQ,CAAA,GATV,EAAA,MAAA,WAQE,EAAA,MAAA,UAJQ,EAAA,MAAA,aAFL,EAAA,MAAA,WACOD,EAAAA,MAAAA,IAGJC,EAAAA,MAAAA,I,0BANTC;AAWJ;;;;AAKA,SAAgB,MAAM,OAAiE;C,eAC9E,UAA0B,WAAhBC;CAA6B,EAAA,OAAA,S,iDAAxC,CAAC,UAAUA,SAAAA,IAAaT,GAAAA,aAAgB,O;CAA7BS,IAAAA,UAAAA,OAAAA,KAAAA,IAAU,IAAVA,IAIbC;CAA+B,EAAA,OAAA,YAAA,EAAA,OAAZ,aAAnBA,KAAAA,oBAAC,eAAD;EAAe,GAAI;EAAY;CAAwB,CAAA,GAAxB,EAAA,KAAA,UAAZ,EAAA,KAAA,W;CADrBC,IAAAA;CADF,OAEID,EAAAA,OAAAA,MAAAA,EAAAA,OADsB,WAAxBC,KAAAA,oBAAC,eAAD;EAAwB;EACtBD,UAAAA;CACa,CAAA,GADbA,EAAAA,KAAAA,IADsB,EAAA,KAAA,S,wBAAxBC;AAIJ"}
1
+ {"version":3,"file":"layer-Bl7rtdZ_.js","names":["as = 'div'","style = EMPTY_RECORD","...restProps","() => ref.current","() => {\n const becameTopLayer = isTopLayerRef.current !== isTopLayer && isTopLayer\n\n if (becameTopLayer) {\n onActivate?.({activeElement: lastFocusedRef.current})\n }\n\n isTopLayerRef.current = isTopLayer\n }","[isTopLayer, onActivate]","(event: FocusEvent<HTMLDivElement, Element>) => {\n // Call the user-provided onFocus handler if any\n onFocus?.(event)\n\n const rootElement = ref.current\n const target = document.activeElement\n\n if (!isTopLayer || !rootElement || !target) return\n\n if (isHTMLElement(target) && containsOrEqualsElement(rootElement, target)) {\n lastFocusedRef.current = target\n }\n }","useCallback(\n // oxlint-disable-next-line no-unnecessary-type-arguments\n (event: FocusEvent<HTMLDivElement, Element>) => {\n // Call the user-provided onFocus handler if any\n onFocus?.(event)\n\n const rootElement = ref.current\n const target = document.activeElement\n\n if (!isTopLayer || !rootElement || !target) return\n\n if (isHTMLElement(target) && containsOrEqualsElement(rootElement, target)) {\n lastFocusedRef.current = target\n }\n },\n [isTopLayer, onFocus],\n )","clsx(layer, className)","{...style, zIndex}","<Component\n data-ui=\"Layer\"\n {...restProps}\n className={clsx(layer, className)}\n onFocus={handleFocus}\n ref={ref}\n style={{...style, zIndex}}\n >\n {children}\n </Component>","zOffset = 1","<LayerChildren {...restProps}>{children}</LayerChildren>","<LayerProvider zOffset={zOffset}>\n <LayerChildren {...restProps}>{children}</LayerChildren>\n </LayerProvider>"],"sources":["../src/core/utils/layer/layer.css.ts","../src/core/utils/layer/layer.tsx"],"sourcesContent":["import {css} from '#styled-system/css'\n\nexport const layer = css({\n position: 'relative',\n})\n","import {clsx} from 'clsx/lite'\nimport {FocusEvent, useCallback, useEffect, useImperativeHandle, useRef} from 'react'\n\nimport {EMPTY_RECORD} from '../../constants'\nimport {containsOrEqualsElement, isHTMLElement} from '../../helpers/element'\nimport {LayerProvider} from './layerProvider'\nimport {useLayer} from './useLayer'\n\nimport {layer} from './layer.css'\n\n/**\n * @public\n */\nexport interface LayerProps {\n as?: React.ElementType | keyof React.JSX.IntrinsicElements\n /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */\n onActivate?: (props: {activeElement: HTMLElement | null}) => void\n zOffset?: number | number[]\n}\n\ninterface LayerChildrenProps {\n as?: React.ElementType | keyof React.JSX.IntrinsicElements\n onActivate?: LayerProps['onActivate']\n}\n\nfunction LayerChildren(props: LayerChildrenProps & Omit<React.HTMLProps<HTMLDivElement>, 'as'>) {\n const {\n as = 'div',\n children,\n className,\n onActivate,\n onFocus,\n ref: forwardedRef,\n style = EMPTY_RECORD,\n ...restProps\n } = props\n const {zIndex, isTopLayer} = useLayer()\n const lastFocusedRef = useRef<HTMLElement | null>(null)\n const ref = useRef<HTMLDivElement | null>(null)\n const isTopLayerRef = useRef<boolean>(isTopLayer)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n // When the layer very first mounts, it will be the top layer, but we don't want to fire\n // the callback in that case. We use a ref to track the previous value of isTopLayer to\n // determine if the layer has become the top layer since the last render.\n useEffect(() => {\n const becameTopLayer = isTopLayerRef.current !== isTopLayer && isTopLayer\n\n if (becameTopLayer) {\n onActivate?.({activeElement: lastFocusedRef.current})\n }\n\n isTopLayerRef.current = isTopLayer\n }, [isTopLayer, onActivate])\n\n const handleFocus = useCallback(\n // oxlint-disable-next-line no-unnecessary-type-arguments\n (event: FocusEvent<HTMLDivElement, Element>) => {\n // Call the user-provided onFocus handler if any\n onFocus?.(event)\n\n const rootElement = ref.current\n const target = document.activeElement\n\n if (!isTopLayer || !rootElement || !target) return\n\n if (isHTMLElement(target) && containsOrEqualsElement(rootElement, target)) {\n lastFocusedRef.current = target\n }\n },\n [isTopLayer, onFocus],\n )\n\n // Rendering the polymorphic `as` needs one concrete element type for JSX to\n // type-check the div-flavored props (the same widening styled-components'\n // `as` prop performed here before).\n // oxlint-disable-next-line no-unsafe-type-assertion\n const Component = as as 'div'\n\n return (\n <Component\n data-ui=\"Layer\"\n {...restProps}\n className={clsx(layer, className)}\n onFocus={handleFocus}\n ref={ref}\n style={{...style, zIndex}}\n >\n {children}\n </Component>\n )\n}\n\n/**\n * @public\n */\nexport function Layer(props: LayerProps & Omit<React.HTMLProps<HTMLDivElement>, 'as'>) {\n const {children, zOffset = 1, ...restProps} = props\n\n return (\n <LayerProvider zOffset={zOffset}>\n <LayerChildren {...restProps}>{children}</LayerChildren>\n </LayerProvider>\n )\n}\n"],"mapp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q;CANpBC,IAAAA;CADF,OACG,EAAA,QAAA,aAAA,EAAA,QAQE,YAAA,EAAA,QAJQ,eAAA,EAAA,QAFL,aAAA,EAAA,QACOF,MAAAA,EAAAA,QAGJC,MANTC,KAAAA,oBAAC,WAAD;EACE,WAAQ;EACR,GAAI;EACJ,WAAWF;EACX,SAAS;EACJ;EACL,OAAOC;EAEN;CACQ,CAAA,GATV,EAAA,MAAA,WAQE,EAAA,MAAA,UAJQ,EAAA,MAAA,aAFL,EAAA,MAAA,WACOD,EAAAA,MAAAA,IAGJC,EAAAA,MAAAA,I,0BANTC;AAWJ;;;;AAKA,SAAgB,MAAM,OAAiE;C,eAC9E,UAA0B,WAAhBC;CAA6B,EAAA,OAAA,S,iDAAxC,CAAC,UAAUA,SAAAA,IAAaT,GAAAA,aAAgB,O;CAA7BS,IAAAA,UAAAA,OAAAA,KAAAA,IAAU,IAAVA,IAIbC;CAA+B,EAAA,OAAA,YAAA,EAAA,OAAZ,aAAnBA,KAAAA,oBAAC,eAAD;EAAe,GAAI;EAAY;CAAwB,CAAA,GAAxB,EAAA,KAAA,UAAZ,EAAA,KAAA,W;CADrBC,IAAAA;CADF,OAEID,EAAAA,OAAAA,MAAAA,EAAAA,OADsB,WAAxBC,KAAAA,oBAAC,eAAD;EAAwB;EACtBD,UAAAA;CACa,CAAA,GADbA,EAAAA,KAAAA,IADsB,EAAA,KAAA,S,wBAAxBC;AAIJ"}
@@ -239,4 +239,4 @@ interface LayerProps {
239
239
  */
240
240
  declare function Layer(props: LayerProps & Omit<React.HTMLProps<HTMLDivElement>, 'as'>): import("react").JSX.Element;
241
241
  export { FlexWrap as A, GridAutoCols as C, FlexDirection as D, FlexAlign as E, BoxHeight as M, BoxOverflow as N, FlexJustify as O, BoxSizing as P, GridItemRowStart as S, GridAutoRows as T, GridItemColumn as _, ResponsiveBorderProps as a, GridItemRow as b, ResponsiveFlexProps as c, ResponsiveMarginProps as d, ResponsivePaddingProps as f, Radius as g, ResponsiveWidthProps as h, Delay as i, BoxDisplay as j, FlexValue as k, ResponsiveGridItemProps as l, ResponsiveShadowProps as m, LayerProps as n, ResponsiveBoxProps as o, ResponsiveRadiusProps as p, Placement as r, ResponsiveFlexItemProps as s, Layer as t, ResponsiveGridProps as u, GridItemColumnEnd as v, GridAutoFlow as w, GridItemRowEnd as x, GridItemColumnStart as y };
242
- //# sourceMappingURL=layer-ChlP9Ik6.d.ts.map
242
+ //# sourceMappingURL=layer-CAyooswI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layer-ChlP9Ik6.d.ts","names":[],"sources":["../src/core/types/box.ts","../src/core/types/flex.ts","../src/core/types/grid.ts","../src/core/types/gridItem.ts","../src/core/types/radius.ts","../src/core/primitives/types.ts","../src/core/types/placement.ts","../src/core/utils/layer/layer.tsx"],"mappings":"AAGA;;;KAAY;;;;KAKA;;;;KAKA;;;;KAKA;;;;KCfA;;;;KAKA;;;;KAKA;;;;KAWA;;;;KAKA;;;;KC1BA;;;;KAKA;;;;KAKA;;;;KCVA;;;;KAKA;;;;KAKA;;;;KAKA;;;;KAKA;;;;KAKA;;;;KCzBA;;;;UCaK;EACf;EACA;EACA;EACA;EACA;;;;;UAMe;EACf,UAAU,aAAa;EACvB,SAAS,YAAY;EACrB,WAAW,cAAc;EACzB,SAAS,YAAY;;;;;UAMN;EACf,QAAQ,YAAY;EACpB,YAAY,gBAAgB;EAC5B,UAAU,cAAc;EACxB,OAAO,WAAW;;;;;UAMH;;EAEf,OAAO,YAAY;;;;;UAMJ;EACf,WAAW,eAAe;EAC1B,WAAW,eAAe;EAC1B,WAAW,eAAe;;;;EAK1B;EACA;EACA;EACA;EACA;;;;EAIA;EACA;;;;;UAMe;EACf,aAAa,iBAAiB;;;;EAI9B;EACA,kBAAkB,sBAAsB;;;;EAIxC;EACA,gBAAgB,oBAAoB;;;;EAIpC;EACA,UAAU,cAAc;;;;EAIxB;EACA,eAAe,mBAAmB;;;;EAIlC;EACA,aAAa,iBAAiB;;;;EAI9B;;;;;UAMe;;EAEf;;EAEA;;EAEA;EACA;EACA;EACA;EACA;;;;;UAMe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;UAMe;EACf,SAAS,SAAS;;;;;UAMH;EACf;;;;;UAMe;EACf;;;;;KAMU,iBAER;EACE;EACA;;;;;;;KCnKM;;;;UCQK;EACf,KAAK,MAAM,oBAAoB,MAAM,IAAI;;EAEzC,cAAc;IAAQ,eAAe;;EACrC;;;;;iBAgFc,MAAM,OAAO,aAAa,KAAK,MAAM,UAAU,yCAAsB,IAAA"}
1
+ {"version":3,"file":"layer-CAyooswI.d.ts","names":[],"sources":["../src/core/types/box.ts","../src/core/types/flex.ts","../src/core/types/grid.ts","../src/core/types/gridItem.ts","../src/core/types/radius.ts","../src/core/primitives/types.ts","../src/core/types/placement.ts","../src/core/utils/layer/layer.tsx"],"mappings":"AAGA;;;KAAY;;;;KAKA;;;;KAKA;;;;KAKA;;;;KCfA;;;;KAKA;;;;KAKA;;;;KAWA;;;;KAKA;;;;KC1BA;;;;KAKA;;;;KAKA;;;;KCVA;;;;KAKA;;;;KAKA;;;;KAKA;;;;KAKA;;;;KAKA;;;;KCzBA;;;;UCaK;EACf;EACA;EACA;EACA;EACA;;;;;UAMe;EACf,UAAU,aAAa;EACvB,SAAS,YAAY;EACrB,WAAW,cAAc;EACzB,SAAS,YAAY;;;;;UAMN;EACf,QAAQ,YAAY;EACpB,YAAY,gBAAgB;EAC5B,UAAU,cAAc;EACxB,OAAO,WAAW;;;;;UAMH;;EAEf,OAAO,YAAY;;;;;UAMJ;EACf,WAAW,eAAe;EAC1B,WAAW,eAAe;EAC1B,WAAW,eAAe;;;;EAK1B;EACA;EACA;EACA;EACA;;;;EAIA;EACA;;;;;UAMe;EACf,aAAa,iBAAiB;;;;EAI9B;EACA,kBAAkB,sBAAsB;;;;EAIxC;EACA,gBAAgB,oBAAoB;;;;EAIpC;EACA,UAAU,cAAc;;;;EAIxB;EACA,eAAe,mBAAmB;;;;EAIlC;EACA,aAAa,iBAAiB;;;;EAI9B;;;;;UAMe;;EAEf;;EAEA;;EAEA;EACA;EACA;EACA;EACA;;;;;UAMe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;UAMe;EACf,SAAS,SAAS;;;;;UAMH;EACf;;;;;UAMe;EACf;;;;;KAMU,iBAER;EACE;EACA;;;;;;;KCnKM;;;;UCQK;EACf,KAAK,MAAM,oBAAoB,MAAM,IAAI;;EAEzC,cAAc;IAAQ,eAAe;;EACrC;;;;;iBAgFc,MAAM,OAAO,aAAa,KAAK,MAAM,UAAU,yCAAsB,IAAA"}
package/dist/menu.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { f as ResponsivePaddingProps, g as Radius, p as ResponsiveRadiusProps } from "./layer-ChlP9Ik6.js";
2
- import { n as PopoverProps } from "./popover-fmTtK69w.js";
3
- import { a as Props, i as EmptyProps, r as ElementType } from "./component-DVlwaWB-.js";
4
- import { t as SelectableTone } from "./selectable-B0GUIL74.js";
1
+ import { f as ResponsivePaddingProps, g as Radius, p as ResponsiveRadiusProps } from "./layer-CAyooswI.js";
2
+ import { n as PopoverProps } from "./popover-DpHuX7yr.js";
3
+ import { a as Props, i as EmptyProps, r as ElementType } from "./component-CWyWF8Ut.js";
4
+ import { t as SelectableTone } from "./selectable-2IHh9SLq.js";
5
5
  /**
6
6
  * @public
7
7
  */
package/dist/menu.js CHANGED
@@ -1,21 +1,21 @@
1
1
  "use client";
2
- import { t as useClickOutsideEvent } from "./useClickOutsideEvent-CC1zgOmv.js";
3
- import { i as useGlobalKeyDown, t as Hotkeys } from "./hotkeys-CQgNwGAf.js";
4
- import { d as createGlobalScopedContext, h as _cardColorStyle, l as useRootTheme, r as isRecord, t as useLayer, v as responsiveRadiusStyle, y as Box } from "./useLayer-CKA2DU8j.js";
5
- import { n as Text, t as Stack } from "./stack-DFSqrIj4.js";
6
- import { i as isHTMLButtonElement, r as isHTMLAnchorElement } from "./element-BYgCE_iK.js";
7
- import { t as Popover } from "./popover-sE-Xd89W.js";
8
- import { o as attachRef } from "./getElementRef-BLVMlHTn.js";
9
- import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
10
- import { t as Flex } from "./flex-DZLSBZTk.js";
11
- import { n as _getArrayProp } from "./helpers-XThPpWje.js";
12
2
  import { c } from "react/compiler-runtime";
13
3
  import { clsx } from "clsx/lite";
14
4
  import { cloneElement, isValidElement, startTransition, useContext, useEffect, useImperativeHandle, useRef, useState } from "react";
15
- import { css, styled } from "styled-components";
5
+ import { t as useClickOutsideEvent } from "./useClickOutsideEvent-C-9cvlOu.js";
6
+ import { i as useGlobalKeyDown, t as Hotkeys } from "./hotkeys-B9h8uliL.js";
7
+ import { d as createGlobalScopedContext, h as _cardColorStyle, l as useRootTheme, r as isRecord, t as useLayer, v as responsiveRadiusStyle, y as Box } from "./useLayer-DiYnwQ5T.js";
8
+ import { n as Text, t as Stack } from "./stack-DFRXALVU.js";
9
+ import { i as isHTMLButtonElement, r as isHTMLAnchorElement } from "./element-DIcKo4Jp.js";
16
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
- import { isValidElementType } from "react-is";
11
+ import { t as Popover } from "./popover-C-YWzo_l.js";
12
+ import { o as attachRef } from "./getElementRef-5HypX0AT.js";
18
13
  import { ChevronRightIcon } from "@sanity/icons/ChevronRight";
14
+ import { isValidElementType } from "react-is";
15
+ import { css, styled } from "styled-components";
16
+ import { t as getTheme_v2 } from "./getTheme_v2-CP5x_AcH.js";
17
+ import { t as Flex } from "./flex-DeU6k2uN.js";
18
+ import { n as _getArrayProp } from "./helpers-jp2T-bdR.js";
19
19
  const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
20
20
  /**
21
21
  * @internal
@@ -1,15 +1,15 @@
1
- import { a as useReferenceElement, i as origin, n as AnimateActivity, r as getTransformOrigin, s as useLatestRef, t as getElementRef } from "./getElementRef-BLVMlHTn.js";
2
- import { _ as useTheme_v2, i as usePrefersReducedMotion, n as LayerProvider, o as useMediaIndex, s as Card, t as useLayer } from "./useLayer-CKA2DU8j.js";
3
- import { t as _elementSizeObserver } from "./elementSizeObserver-pevZfdGa.js";
4
- import { l as POPOVER_MOTION_PROPS, n as _getArrayProp } from "./helpers-XThPpWje.js";
5
- import { n as Portal, o as useBoundaryElement, t as Arrow } from "./arrow-Df43Duu7.js";
6
- import { t as Flex } from "./flex-DZLSBZTk.js";
7
1
  import { c } from "react/compiler-runtime";
2
+ import { arrow, autoPlacement, autoUpdate, detectOverflow, flip, hide, offset, shift, useFloating } from "@floating-ui/react-dom";
8
3
  import { Activity, cloneElement, startTransition, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
4
+ import { a as useReferenceElement, i as origin, n as AnimateActivity, r as getTransformOrigin, s as useLatestRef, t as getElementRef } from "./getElementRef-5HypX0AT.js";
5
+ import { _ as useTheme_v2, i as usePrefersReducedMotion, n as LayerProvider, o as useMediaIndex, s as Card, t as useLayer } from "./useLayer-DiYnwQ5T.js";
6
+ import { t as _elementSizeObserver } from "./elementSizeObserver-CSI5StGC.js";
7
+ import { l as POPOVER_MOTION_PROPS, n as _getArrayProp } from "./helpers-jp2T-bdR.js";
8
+ import { n as Portal, o as useBoundaryElement, t as Arrow } from "./arrow-BhooatHA.js";
9
+ import { motion } from "motion/react";
9
10
  import { styled } from "styled-components";
11
+ import { t as Flex } from "./flex-DeU6k2uN.js";
10
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- import { arrow, autoPlacement, autoUpdate, detectOverflow, flip, hide, offset, shift, useFloating } from "@floating-ui/react-dom";
12
- import { motion } from "motion/react";
13
13
  const DEFAULT_POPOVER_MARGINS = [
14
14
  0,
15
15
  0,
@@ -484,4 +484,4 @@ function useMiddleware(t0) {
484
484
  }
485
485
  export { Popover as t };
486
486
 
487
- //# sourceMappingURL=popover-sE-Xd89W.js.map
487
+ //# sourceMappingURL=popover-C-YWzo_l.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-sE-Xd89W.js","names":["...restProps","getTransformOrigin(originX, originY)","animate ? 'transform' : undefined","constrainSize ? undefined : (style?.maxHeight ?? '')","constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? '')","matchReferenceWidth ? undefined : (width ?? style?.width ?? '')","{\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n // The `size` middleware writes these to the element while it owns them (React leaves a style\n // it keeps rendering as `undefined` alone), and `''` clears its write once React owns them\n maxHeight: constrainSize ? undefined : (style?.maxHeight ?? ''),\n maxWidth: constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? ''),\n width: matchReferenceWidth ? undefined : (width ?? style?.width ?? ''),\n }","useMemo(\n () => ({\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n // The `size` middleware writes these to the element while it owns them (React leaves a style\n // it keeps rendering as `undefined` alone), and `''` clears its write once React owns them\n maxHeight: constrainSize ? undefined : (style?.maxHeight ?? ''),\n maxWidth: constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? ''),\n width: matchReferenceWidth ? undefined : (width ?? style?.width ?? ''),\n }),\n [\n animate,\n constrainSize,\n matchReferenceWidth,\n maxWidth,\n originX,\n originY,\n strategy,\n style,\n width,\n x,\n y,\n zIndex,\n ],\n )","arrowX !== null ? arrowX : undefined","arrowY !== null ? arrowY : undefined","{\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }","useMemo(\n () => ({\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }),\n [arrowX, arrowY],\n )","animate ? POPOVER_MOTION_PROPS : undefined","<Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>","<Flex data-ui=\"Popover__wrapper\" direction=\"column\" flex={1} overflow={overflow}>\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </Flex>","arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )","<MotionCard\n data-ui=\"Popover\"\n {...restProps}\n data-placement={placement}\n radius={radius}\n ref={ref}\n scheme={scheme}\n shadow={shadow}\n sizing=\"border\"\n style={rootStyle}\n tone={tone}\n {...(animate ? POPOVER_MOTION_PROPS : undefined)}\n >\n <Flex data-ui=\"Popover__wrapper\" direction=\"column\" flex={1} overflow={overflow}>\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </Flex>\n\n {arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )}\n </MotionCard>","_jsx","() => {\n if (shouldRender) stopListening(stopRef)\n }","[shouldRender]","(node: HTMLElement | null) => {\n stopListening(stopRef)\n\n if (node && !shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n }","shouldRenderRef.current","useCallback(\n (node: HTMLElement | null) => {\n stopListening(stopRef)\n\n if (node && !shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n },\n [handleIntent, shouldRenderRef],\n )","<div\n data-ui=\"PopoverOverlay\"\n style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}}\n />","margins = DEFAULT_POPOVER_MARGINS","_animate = false","tone = 'inherit'","widthProp = 'auto'","arrowProp = false","constrainSize = false","overflow = 'hidden'","placementProp = 'bottom'","placementStrategy = 'flip'","preventOverflow = true","radiusProp = 3","shadowProp = 3","childProp","content","disabled","_fallbackPlacements","matchReferenceWidth","_floatingBoundary","modal","open","paddingProp","portal","forwardedRef","_referenceBoundary","referenceElement","scheme","_zOffsetProp","updateRef","...restProps","_getArrayProp(paddingProp)","_getArrayProp(radiusProp)","_getArrayProp(shadowProp)","_getArrayProp(zOffsetProp)","() => ref.current","{\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n }","referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined","{\n middleware,\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined,\n }","() => startTransition(() => setHasRendered(true))","useCallback(() => startTransition(() => setHasRendered(true)), [])","() => {\n if (!intentReference) return undefined\n\n return listenForIntent(intentReference, handleIntent)\n }","[handleIntent, intentReference]","(arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }","useCallback((arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }, [])","childProp && !referenceElement ? getElementRef<HTMLElement>(childProp) : undefined","(node: HTMLDivElement | null) => {\n ref.current = node\n if (node) handOverReference()\n refs.setFloating(node)\n }","useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n if (node) handOverReference()\n refs.setFloating(node)\n },\n [handOverReference, refs],\n )","useMemo(() => {\n // If a reference element is defined, we don't need to clone the child\n if (referenceElement) return childProp\n\n if (!childProp) return null\n\n return cloneElement(childProp, {ref: setReference})\n }, [childProp, referenceElement, setReference])","cloneElement(childProp, {ref: setReference})","() => update","[update]","childProp || <></>","modal && <ViewportOverlay />","<PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n constrainSize={constrainSize}\n hidden={referenceHidden}\n matchReferenceWidth={matchReferenceWidth}\n maxWidth={maxWidth}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>","<LayerProvider zOffset={zOffset}>\n {/* Optional transparent blocking overlay at the top-most z-index layer. Must be positioned before the below popover card. */}\n {modal && <ViewportOverlay />}\n\n <PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n constrainSize={constrainSize}\n hidden={referenceHidden}\n matchReferenceWidth={matchReferenceWidth}\n maxWidth={maxWidth}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>\n </LayerProvider>","portal ? (\n <Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>{popover}</Portal>\n ) : (\n popover\n )","animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {shouldRender ? popoverNode : null}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{shouldRender ? popoverNode : null}</Activity>\n )","<>\n {/* the popover (not rendered until it opens or is about to, see `hasRendered`) */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {shouldRender ? popoverNode : null}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{shouldRender ? popoverNode : null}</Activity>\n )}\n\n {/* the referred element */}\n {child}\n </>","() => {\n if (!open || !element) return undefined\n\n // Measuring the boundary is what this effect is for: the DOM is only measurable after the\n // commit, and the result has to be in the next paint\n // oxlint-disable-next-line react/set-state-in-effect\n setSize((prev) => sameSize(prev, measureBorderBox(element)))\n\n return _elementSizeObserver.subscribe(element, ({border}) =>\n setSize((prev) =>\n sameSize(prev, {width: Math.round(border.width), height: Math.round(border.height)}),\n ),\n )\n }","[element, open]","{border}","prev","{\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n}: {\n animate: boolean\n arrowProp: boolean\n arrowRef: React.RefObject<HTMLDivElement | null>\n constrainSize: boolean\n fallbackPlacements: Placement[]\n floatingBoundary: HTMLElement | null\n margins: PopoverMargins\n matchReferenceWidth: boolean | undefined\n maxWidth: number | undefined\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n rootBoundary: RootBoundary\n}","const ret: Middleware[] = []","autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n })","floatingBoundary || undefined","flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n })","offset({mainAxis: DEFAULT_POPOVER_DISTANCE})","constrainSize ? maxWidth : undefined","size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n // The card renders the cap unless `constrainSize`: no reason to change the middleware then\n maxWidth: constrainSize ? maxWidth : undefined,\n padding: DEFAULT_POPOVER_PADDING,\n })","shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n })","arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n })","referenceBoundary || undefined","hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n })","useMemo(() => {\n const ret: Middleware[] = []\n\n // Flip the floating element when leaving the boundary box\n if (constrainSize || preventOverflow) {\n if (placementStrategy === 'autoPlacement') {\n ret.push(\n autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n }),\n )\n } else {\n ret.push(\n flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n }),\n )\n }\n }\n\n // Define distance between reference and floating element\n ret.push(offset({mainAxis: DEFAULT_POPOVER_DISTANCE}))\n\n // Track sizes\n if (constrainSize || matchReferenceWidth) {\n ret.push(\n size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n // The card renders the cap unless `constrainSize`: no reason to change the middleware then\n maxWidth: constrainSize ? maxWidth : undefined,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Shift the popover so its sits within the boundary element\n if (preventOverflow) {\n ret.push(\n shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Place arrow\n if (arrowProp) {\n ret.push(\n arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Determine the origin to scale from.\n // Must be placed after `@sanity/ui/size` and `shift` middleware.\n if (animate) {\n ret.push(origin)\n }\n\n ret.push(\n hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n }),\n )\n\n return ret\n }, [\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n ])","_jsx","childRef","_Fragment","\"top\"","\"bottom\"","\"left\"","\"right\""],"sources":["../src/core/primitives/popover/constants.ts","../src/core/primitives/popover/floating-ui/size.ts","../src/core/primitives/popover/helpers.ts","../src/core/primitives/popover/popoverCard.tsx","../src/core/primitives/popover/popover.tsx"],"sourcesContent":["import {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\n\nexport const DEFAULT_POPOVER_DISTANCE = 4\nexport const DEFAULT_POPOVER_PADDING = 4\nexport const DEFAULT_POPOVER_ARROW_WIDTH = 19\nexport const DEFAULT_POPOVER_ARROW_HEIGHT = 8\nexport const DEFAULT_POPOVER_ARROW_RADIUS = 2\nexport const DEFAULT_POPOVER_MARGINS: PopoverMargins = [0, 0, 0, 0]\nexport const DEFAULT_FALLBACK_PLACEMENTS: Record<Placement, Placement[]> = {\n 'top': ['bottom', 'left', 'right'],\n 'top-start': ['bottom-start', 'left-start', 'right-start'],\n 'top-end': ['bottom-end', 'left-end', 'right-end'],\n 'bottom': ['top', 'left', 'right'],\n 'bottom-start': ['top-start', 'left-start', 'right-start'],\n 'bottom-end': ['top-end', 'left-end', 'right-end'],\n 'left': ['right', 'top', 'bottom'],\n 'left-start': ['right-start', 'top-start', 'bottom-start'],\n 'left-end': ['right-end', 'top-end', 'bottom-end'],\n 'right': ['left', 'top', 'bottom'],\n 'right-start': ['left-start', 'top-start', 'bottom-start'],\n 'right-end': ['left-end', 'top-end', 'bottom-end'],\n}\n","import {detectOverflow, Middleware} from '@floating-ui/react-dom'\n\nimport {PopoverMargins} from '../../../types/popover'\n\nexport function size(options: {\n boundaryElement?: HTMLElement | null\n constrainSize: boolean\n margins: PopoverMargins\n matchReferenceWidth?: boolean\n maxWidth: number | undefined\n padding?: number\n}): Middleware {\n const {constrainSize, margins, matchReferenceWidth, padding = 0} = options\n\n return {\n name: '@sanity/ui/size',\n // `useFloating` compares middleware deeply and functions by their source text, so without its\n // `options` it would keep running this middleware with outdated ones\n options,\n async fn(args) {\n const {elements, placement, platform, rects} = args\n const {floating, reference} = rects\n\n const overflow = await detectOverflow(args, {\n altBoundary: true,\n boundary: options.boundaryElement || undefined,\n elementContext: 'floating',\n padding,\n rootBoundary: 'viewport',\n })\n\n let maxWidth = Infinity\n let maxHeight = Infinity\n\n const floatingW = floating.width\n const floatingH = floating.height\n\n if (placement.includes('top')) {\n maxWidth = floatingW - (overflow.left + overflow.right)\n maxHeight = floatingH - overflow.top\n }\n\n if (placement.includes('right')) {\n maxWidth = floatingW - overflow.right\n maxHeight = floatingH - (overflow.top + overflow.bottom)\n }\n\n if (placement.includes('bottom')) {\n maxWidth = floatingW - (overflow.left + overflow.right)\n maxHeight = floatingH - overflow.bottom\n }\n\n if (placement.includes('left')) {\n maxWidth = floatingW - overflow.left\n maxHeight = floatingH - (overflow.top + overflow.bottom)\n }\n\n // IMPORTANT – APPLY ELEMENT STYLES HERE\n // Elements need to be resized BEFORE the `platform.getDimensions` call below, and never to a\n // negative size: CSS ignores a negative length, keeping the previous one\n const availableWidth = maxWidth - margins[1] - margins[3]\n const availableHeight = maxHeight - margins[0] - margins[2]\n const referenceWidth = Math.max(0, reference.width - margins[1] - margins[3])\n\n if (matchReferenceWidth) {\n elements.floating.style.width = `${referenceWidth}px`\n }\n\n if (constrainSize) {\n // No room at all means the popover lies outside the area it is measured in, like a submenu\n // beside the scrolling menu its reference is in: a max size of zero would collapse it\n const constrainedWidth = Math.min(\n availableWidth > 0 ? availableWidth : Infinity,\n options.maxWidth ?? Infinity,\n )\n\n elements.floating.style.maxWidth = Number.isFinite(constrainedWidth)\n ? `${constrainedWidth}px`\n : ''\n\n elements.floating.style.maxHeight = availableHeight > 0 ? `${availableHeight}px` : ''\n }\n\n const nextDimensions = await platform.getDimensions(elements.floating)\n\n const targetH = nextDimensions.height\n const targetW = nextDimensions.width\n\n if (floatingW !== targetW || floatingH !== targetH) {\n return {reset: {rects: true}}\n }\n\n return {}\n },\n }\n}\n","import {DEFAULT_POPOVER_PADDING} from './constants'\nimport {PopoverWidth} from './types'\n\nexport function calcCurrentWidth(params: {\n mediaIndex: number\n container: number[]\n width: PopoverWidth[]\n}): number | undefined {\n const {container, mediaIndex, width} = params\n\n const w = width[mediaIndex]\n const currentWidth: PopoverWidth | undefined = w === undefined ? width[width.length - 1] : w\n\n return typeof currentWidth === 'number' ? container[currentWidth] : undefined\n}\n\nexport function calcMaxWidth(params: {\n boundaryWidth: number | undefined\n currentWidth: number | undefined\n}): number | undefined {\n const {boundaryWidth, currentWidth} = params\n\n const maxWidth = Math.min(\n currentWidth ?? Infinity,\n (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2,\n )\n\n // Also uncapped for a boundary of width `0` (collapsed, or `display: none`), and never negative\n // for one narrower than the padding: CSS ignores a negative length, keeping the previous cap\n return Number.isFinite(maxWidth) ? Math.max(0, maxWidth) : undefined\n}\n","import {Strategy} from '@floating-ui/react-dom'\nimport {motion} from 'motion/react'\nimport React, {CSSProperties, useMemo} from 'react'\nimport {styled} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {POPOVER_MOTION_PROPS} from '../../constants'\nimport {getTransformOrigin} from '../../middleware/origin'\nimport {BoxOverflow} from '../../types/box'\nimport {CardTone} from '../../types/card'\nimport {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\nimport {Radius} from '../../types/radius'\nimport {Arrow} from '../../utils/arrow/arrow'\nimport {useLayer} from '../../utils/layer/useLayer'\nimport {Card} from '../card/card'\nimport {Flex} from '../flex/flex'\nimport {\n DEFAULT_POPOVER_ARROW_HEIGHT,\n DEFAULT_POPOVER_ARROW_RADIUS,\n DEFAULT_POPOVER_ARROW_WIDTH,\n DEFAULT_POPOVER_MARGINS,\n} from './constants'\n\nconst MotionCard = styled(motion.create(Card))`\n &:not([hidden]) {\n display: flex;\n }\n flex-direction: column;\n width: max-content;\n min-width: min-content;\n will-change: transform;\n`\n\n/**\n * @internal\n */\nexport function PopoverCard(\n props: {\n /** @beta*/\n __unstable_margins?: PopoverMargins\n animate?: boolean\n arrow: boolean\n arrowRef: React.Ref<HTMLDivElement>\n arrowX?: number\n arrowY?: number\n constrainSize?: boolean\n matchReferenceWidth?: boolean\n maxWidth: number | undefined\n originX?: number\n originY?: number\n overflow?: BoxOverflow\n padding?: number | number[]\n placement: Placement\n radius?: Radius | Radius[]\n scheme?: ThemeColorSchemeKey\n shadow?: number | number[]\n strategy: Strategy\n tone: CardTone\n width: number | undefined\n x: number | null\n y: number | null\n } & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'width'>,\n) {\n const {\n __unstable_margins: marginsProp,\n animate,\n arrow,\n arrowRef,\n arrowX,\n arrowY,\n children,\n constrainSize,\n matchReferenceWidth,\n maxWidth,\n padding,\n placement,\n originX,\n originY,\n overflow,\n radius,\n ref,\n scheme,\n shadow,\n strategy,\n style,\n tone,\n width,\n x: xProp,\n y: yProp,\n ...restProps\n } = props\n\n const {zIndex} = useLayer()\n\n // Get margins: [top, right, bottom, left]\n const margins: PopoverMargins = useMemo(\n () => marginsProp || DEFAULT_POPOVER_MARGINS,\n [marginsProp],\n )\n\n // Translate according to margins\n const x = (xProp ?? 0) + margins[3]\n const y = (yProp ?? 0) + margins[0]\n\n const rootStyle: CSSProperties = useMemo(\n () => ({\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n // The `size` middleware writes these to the element while it owns them (React leaves a style\n // it keeps rendering as `undefined` alone), and `''` clears its write once React owns them\n maxHeight: constrainSize ? undefined : (style?.maxHeight ?? ''),\n maxWidth: constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? ''),\n width: matchReferenceWidth ? undefined : (width ?? style?.width ?? ''),\n }),\n [\n animate,\n constrainSize,\n matchReferenceWidth,\n maxWidth,\n originX,\n originY,\n strategy,\n style,\n width,\n x,\n y,\n zIndex,\n ],\n )\n\n const arrowStyle: CSSProperties = useMemo(\n () => ({\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }),\n [arrowX, arrowY],\n )\n\n return (\n <MotionCard\n data-ui=\"Popover\"\n {...restProps}\n data-placement={placement}\n radius={radius}\n ref={ref}\n scheme={scheme}\n shadow={shadow}\n sizing=\"border\"\n style={rootStyle}\n tone={tone}\n {...(animate ? POPOVER_MOTION_PROPS : undefined)}\n >\n <Flex data-ui=\"Popover__wrapper\" direction=\"column\" flex={1} overflow={overflow}>\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </Flex>\n\n {arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )}\n </MotionCard>\n )\n}\n","import {\n arrow,\n autoPlacement,\n autoUpdate,\n flip,\n hide,\n Middleware,\n offset,\n RootBoundary,\n shift,\n useFloating,\n} from '@floating-ui/react-dom'\nimport {\n Activity,\n cloneElement,\n type Ref,\n startTransition,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {useLatestRef} from '../../hooks/useLatestRef'\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {usePrefersReducedMotion} from '../../hooks/usePrefersReducedMotion'\nimport {useReferenceElement} from '../../hooks/useReferenceElement'\nimport {origin} from '../../middleware/origin'\nimport {_elementSizeObserver, ElementRectValue} from '../../observers/elementSizeObserver'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {useTheme_v2} from '../../theme/useTheme'\nimport {BoxOverflow} from '../../types/box'\nimport {CardTone} from '../../types/card'\nimport {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\nimport {AnimateActivity} from '../../utils/animateActivity'\nimport {useBoundaryElement} from '../../utils/boundaryElement/useBoundaryElement'\nimport {getElementRef} from '../../utils/getElementRef'\nimport {LayerProps} from '../../utils/layer/layer'\nimport {LayerProvider} from '../../utils/layer/layerProvider'\nimport {useLayer} from '../../utils/layer/useLayer'\nimport {Portal} from '../../utils/portal/portal'\nimport {ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'\nimport {\n DEFAULT_FALLBACK_PLACEMENTS,\n DEFAULT_POPOVER_DISTANCE,\n DEFAULT_POPOVER_MARGINS,\n DEFAULT_POPOVER_PADDING,\n} from './constants'\nimport {size} from './floating-ui/size'\nimport {calcCurrentWidth, calcMaxWidth} from './helpers'\nimport {PopoverCard} from './popoverCard'\nimport {PopoverUpdateCallback, PopoverWidth} from './types'\n\n/** @public */\nexport interface PopoverProps\n extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {\n /** @beta */\n __unstable_margins?: PopoverMargins\n /**\n * Whether the popover should animate in and out.\n *\n * @beta\n * @defaultValue false\n */\n animate?: boolean\n arrow?: boolean\n /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */\n boundaryElement?: never\n children?: React.JSX.Element\n /**\n * When `true`, prevent overflow within the current boundary:\n * - by flipping on its side axis\n * - by resizing\n /*\n * Note that:\n * - setting `preventOverflow` to `true` also prevents overflow on its side axis\n * - setting `matchReferenceWidth` to `true` also causes the popover to resize\n *\n * @defaultValue false\n */\n constrainSize?: boolean\n content?: React.ReactNode\n disabled?: boolean\n fallbackPlacements?: Placement[]\n floatingBoundary?: HTMLElement | null\n /**\n * When `true`, set the maximum width to match the reference element, and also prevent overflow within\n * the current boundary by resizing.\n *\n * Note that setting `constrainSize` to `true` also causes the popover to resize\n *\n * @defaultValue false\n */\n matchReferenceWidth?: boolean\n /**\n * When true, blocks all pointer interaction with elements beneath the popover until closed.\n *\n * @beta\n * @defaultValue false\n */\n modal?: boolean\n /**\n * Whether the popover is open.\n *\n * Set it inside `startTransition`. A closed popover pre-renders its content hidden, in a\n * transition, once the reference element shows intent to open it (focus, a pointer entering or\n * pressing it). Opening in a transition too lets React keep rendering that content in the\n * background when the open comes before it is done, instead of rendering it synchronously in the\n * click. Content that was pre-rendered already shows in the first frame after the click either\n * way.\n *\n * ```tsx\n * const [open, setOpen] = useState(false)\n *\n * <Popover content={content} open={open}>\n * <Button onClick={() => startTransition(() => setOpen((isOpen) => !isOpen))} text=\"Toggle\" />\n * </Popover>\n * ```\n *\n * Wrap the state update itself: a `startTransition` around code that schedules the update for\n * later (a timeout) does not reach it.\n */\n open?: boolean\n overflow?: BoxOverflow\n padding?: number | number[]\n placement?: Placement\n /**\n * When 'flip' (default), the placement is determined from the initial placement and the\n * fallback placements in order. Whichever fits in the viewport first.\n *\n * When 'autoPlacement', the initial placement and all fallback placements are evaluated\n * and the placement with the most viewport space available.\n *\n * Option is only relevant if either `constrainSize` or `preventOverflow` is `true`\n */\n placementStrategy?: 'flip' | 'autoPlacement'\n /** Whether or not to render the popover in a portal element. */\n portal?: boolean | string\n preventOverflow?: boolean\n referenceBoundary?: HTMLElement | null\n /**\n * When defined, the popover will be positioned relative to this element.\n * The children of the popover won't be rendered.\n */\n referenceElement?: HTMLElement | null\n scheme?: ThemeColorSchemeKey\n tone?: CardTone\n /** @beta */\n updateRef?: Ref<PopoverUpdateCallback | undefined>\n width?: PopoverWidth | PopoverWidth[]\n}\n\n/**\n * The events on the reference element that count as intent to open the popover. Each precedes the\n * interaction that usually opens a popover: focus before a key press, the pointer entering before\n * a click or a tap.\n */\nconst INTENT_EVENT_TYPES = ['focusin', 'pointerenter', 'pointerdown'] as const\n\n/** Calls `handleIntent` on intent to open the popover, until the returned function is called */\nfunction listenForIntent(element: HTMLElement | null, handleIntent: () => void): () => void {\n if (!element) return () => {}\n\n const controller = new AbortController()\n const {signal} = controller\n\n // `focusin` rather than `focus` so that focus landing inside the reference element counts too.\n // `pointerdown` is a fallback for a pointer that was already over the element when it\n // rendered, which fires no `pointerenter`.\n for (const type of INTENT_EVENT_TYPES) {\n element.addEventListener(type, handleIntent, {signal})\n }\n\n // Focus that landed before the listeners did (an `autoFocus` reference, a `referenceElement`\n // that was focused already) fired its `focusin` unheard, so count it now\n const {activeElement} = element.ownerDocument\n\n if (activeElement && element.contains(activeElement)) handleIntent()\n\n return () => controller.abort()\n}\n\n/**\n * Listens for intent on the cloned child's element from the moment it attaches, until it detaches\n * or the popover has rendered. Returns the callback for `useReferenceElement` to attach with.\n *\n * The node is null when the child forwards a ref with nothing mounted, and when that ref later\n * clears. Null and a swap onto another element both stop whatever was already listening. A child\n * may report the next node without running the previous cleanup. Null attaches nothing.\n */\nfunction useChildIntent(\n shouldRender: boolean,\n handleIntent: () => void,\n): (node: HTMLElement | null) => () => void {\n const shouldRenderRef = useLatestRef(shouldRender)\n const stopRef = useRef<(() => void) | null>(null)\n\n useEffect(() => {\n if (shouldRender) stopListening(stopRef)\n }, [shouldRender])\n\n return useCallback(\n (node: HTMLElement | null) => {\n stopListening(stopRef)\n\n if (node && !shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n },\n [handleIntent, shouldRenderRef],\n )\n}\n\nfunction stopListening(stopRef: React.RefObject<(() => void) | null>) {\n stopRef.current?.()\n stopRef.current = null\n}\n\nconst ViewportOverlay = () => {\n const {zIndex} = useLayer()\n\n return (\n <div\n data-ui=\"PopoverOverlay\"\n style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}}\n />\n )\n}\n\n/**\n * The `Popover` component is used to display some content on top of another.\n *\n * @public\n */\nexport function Popover(\n props: PopoverProps &\n Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'width'>,\n): React.JSX.Element {\n const {container, layer} = useTheme_v2()\n const boundaryElementContext = useBoundaryElement()\n\n const {\n __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,\n animate: _animate = false,\n arrow: arrowProp = false,\n children: childProp,\n constrainSize = false,\n content,\n disabled,\n fallbackPlacements: _fallbackPlacements,\n matchReferenceWidth,\n floatingBoundary: _floatingBoundary,\n modal,\n // oxlint-disable-next-line no-unused-vars\n onActivate,\n open,\n overflow = 'hidden',\n padding: paddingProp,\n placement: placementProp = 'bottom',\n placementStrategy = 'flip',\n portal,\n preventOverflow = true,\n radius: radiusProp = 3,\n ref: forwardedRef,\n referenceBoundary: _referenceBoundary,\n referenceElement,\n scheme,\n shadow: shadowProp = 3,\n tone = 'inherit',\n width: widthProp = 'auto',\n zOffset: _zOffsetProp,\n updateRef,\n ...restProps\n } = props\n const fallbackPlacements =\n _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? 'bottom']\n const floatingBoundary = _floatingBoundary ?? boundaryElementContext.element\n const referenceBoundary = _referenceBoundary ?? boundaryElementContext.element\n // Max-width uses BoundaryElementProvider when present; otherwise the floating\n // boundary (same element the old `boundaryElement` prop used for both).\n const boundaryElement = boundaryElementContext.element ?? floatingBoundary\n const zOffsetProp = _zOffsetProp ?? layer.popover.zOffset\n const prefersReducedMotion = usePrefersReducedMotion()\n const animate = prefersReducedMotion ? false : _animate\n\n // Opening renders the popover whether or not any intent preceded it. A `disabled` popover\n // renders only its child, so neither `open` nor intent counts while it is disabled: otherwise\n // enabling it later would render it hidden without it ever having opened or been about to.\n const isOpen = Boolean(open) && !disabled\n\n const boundarySize = useBoundarySize(boundaryElement, isOpen)\n const padding = _getArrayProp(paddingProp)\n const radius = _getArrayProp(radiusProp)\n const shadow = _getArrayProp(shadowProp)\n const widthArrayProp = _getArrayProp(widthProp)\n const zOffset = _getArrayProp(zOffsetProp)\n const ref = useRef<HTMLDivElement | null>(null)\n const arrowRef = useRef<HTMLDivElement | null>(null)\n const rootBoundary: RootBoundary = 'viewport'\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n const mediaIndex = useMediaIndex()\n const boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : undefined\n\n // Update width when\n // - media index changes\n // - `width` property changes\n const width = calcCurrentWidth({\n container,\n mediaIndex,\n width: widthArrayProp,\n })\n\n // Update max width when\n // - boundary width changes\n // - `width` property changes\n const maxWidth = calcMaxWidth({boundaryWidth, currentWidth: width})\n\n const middleware = useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n })\n\n const {x, y, middlewareData, placement, refs, strategy, update} = useFloating<HTMLElement>({\n middleware,\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined,\n })\n\n // Whether the popover (card, portal and `content`) has been rendered yet. Closed popovers\n // render inside a hidden `<Activity>`, so whatever is rendered while closed is pre-rendered DOM\n // that only pays off if the popover opens. Nothing is rendered until the popover opens or the\n // reference element shows intent to open it (see `INTENT_EVENT_TYPES`), and from then on it\n // stays rendered so the state of its `content` survives reopening. Consumers that do not want\n // a popover pre-rendered on intent can leave `content` empty until it opens.\n const [hasRendered, setHasRendered] = useState(false)\n\n if (isOpen && !hasRendered) setHasRendered(true)\n\n const shouldRender = isOpen || hasRendered\n // The element to listen to for intent to open the popover: none once the popover has rendered,\n // since there is nothing left to pre-render, and none while disabled, which also drops the\n // listeners of a popover that was enabled before. A cloned child is listened to from the moment\n // it attaches instead (see `useChildIntent`), and a disabled popover does not clone it.\n const intentReference = shouldRender || disabled ? null : referenceElement\n // In a transition, so that it never holds up an open that follows right away (a click), and so\n // that React pre-renders the hidden popover in the background\n const handleIntent = useCallback(() => startTransition(() => setHasRendered(true)), [])\n\n useEffect(() => {\n if (!intentReference) return undefined\n\n return listenForIntent(intentReference, handleIntent)\n }, [handleIntent, intentReference])\n\n const listenForChildIntent = useChildIntent(shouldRender, handleIntent)\n\n const referenceHidden = middlewareData.hide?.referenceHidden\n\n const arrowX = middlewareData.arrow?.x\n const arrowY = middlewareData.arrow?.y\n\n const originX = middlewareData['@sanity/ui/origin']?.originX\n const originY = middlewareData['@sanity/ui/origin']?.originY\n\n const setArrow = useCallback((arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }, [])\n\n // With a `referenceElement` the child is not cloned and keeps its ref to itself\n const childRef =\n childProp && !referenceElement ? getElementRef<HTMLElement>(childProp) : undefined\n const {handOverReference, setReference} = useReferenceElement(\n refs,\n childRef,\n listenForChildIntent,\n )\n\n const setFloating = useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n if (node) handOverReference()\n refs.setFloating(node)\n },\n [handOverReference, refs],\n )\n\n const child = useMemo(() => {\n // If a reference element is defined, we don't need to clone the child\n if (referenceElement) return childProp\n\n if (!childProp) return null\n\n return cloneElement(childProp, {ref: setReference})\n }, [childProp, referenceElement, setReference])\n\n useImperativeHandle(updateRef, () => update, [update])\n\n if (disabled) {\n return childProp || <></>\n }\n\n const popover = (\n <LayerProvider zOffset={zOffset}>\n {/* Optional transparent blocking overlay at the top-most z-index layer. Must be positioned before the below popover card. */}\n {modal && <ViewportOverlay />}\n\n <PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n constrainSize={constrainSize}\n hidden={referenceHidden}\n matchReferenceWidth={matchReferenceWidth}\n maxWidth={maxWidth}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>\n </LayerProvider>\n )\n\n const popoverNode = portal ? (\n <Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>{popover}</Portal>\n ) : (\n popover\n )\n\n return (\n <>\n {/* the popover (not rendered until it opens or is about to, see `hasRendered`) */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {shouldRender ? popoverNode : null}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{shouldRender ? popoverNode : null}</Activity>\n )}\n\n {/* the referred element */}\n {child}\n </>\n )\n}\n\n/**\n * The border-box size of the boundary element in whole pixels, tracked only while the popover is\n * open.\n *\n * Closed popovers have nothing to size, so they hold no `ResizeObserver` subscription and do not\n * re-render when the boundary resizes (one subscription per popover, every closed popover\n * re-rendering on every boundary resize, is what this replaces). The boundary is measured\n * synchronously in a layout effect when the popover opens, so the max width is right in the first\n * painted frame instead of one `ResizeObserver` callback later; the shared observer takes over\n * from there. The last size is kept while closed.\n *\n * Both measurements are rounded to whole pixels so that they agree: the observer's first delivery\n * must not change the size the opening commit measured, or the max width would be corrected a\n * frame later after all. See `measureBorderBox`.\n */\nfunction useBoundarySize(element: HTMLElement | null, open: boolean): ElementRectValue | undefined {\n const [size, setSize] = useState<ElementRectValue | undefined>(undefined)\n\n useLayoutEffect(() => {\n if (!open || !element) return undefined\n\n // Measuring the boundary is what this effect is for: the DOM is only measurable after the\n // commit, and the result has to be in the next paint\n // oxlint-disable-next-line react/set-state-in-effect\n setSize((prev) => sameSize(prev, measureBorderBox(element)))\n\n return _elementSizeObserver.subscribe(element, ({border}) =>\n setSize((prev) =>\n sameSize(prev, {width: Math.round(border.width), height: Math.round(border.height)}),\n ),\n )\n }, [element, open])\n\n return size\n}\n\n/**\n * The border-box size of an element in whole pixels, the way `_elementSizeObserver` reports it:\n * from `ResizeObserverEntry.borderBoxSize`, which is the layout size with no CSS transform or\n * `zoom` applied, in the element's writing mode (`inlineSize` as `width`, `blockSize` as\n * `height`), rounded by `useBoundarySize`. `offsetWidth`/`offsetHeight` are that same untransformed\n * border box rounded to whole pixels. `getBoundingClientRect` would include transforms (a boundary\n * mid scale animation) and `zoom`, and `getComputedStyle` serializes lengths with limited\n * precision, so neither agrees with the observer for every element.\n *\n * Kept at module scope on purpose: reading the offset size forces a synchronous layout, and the\n * React Compiler (which the package build runs) lifts a member expression on an element captured\n * by a component callback into a memo dependency evaluated during render. A plain function call\n * on the element gives it nothing to lift.\n */\nfunction measureBorderBox(element: HTMLElement): ElementRectValue {\n const {offsetWidth, offsetHeight} = element\n\n if (getComputedStyle(element).writingMode.startsWith('horizontal')) {\n return {width: offsetWidth, height: offsetHeight}\n }\n\n // In a vertical writing mode the inline size is the physical height\n return {width: offsetHeight, height: offsetWidth}\n}\n\n/** Keeps the previous object when the size has not changed, so `setState` bails out */\nfunction sameSize(prev: ElementRectValue | undefined, next: ElementRectValue): ElementRectValue {\n return prev && prev.width === next.width && prev.height === next.height ? prev : next\n}\n\nfunction useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n}: {\n animate: boolean\n arrowProp: boolean\n arrowRef: React.RefObject<HTMLDivElement | null>\n constrainSize: boolean\n fallbackPlacements: Placement[]\n floatingBoundary: HTMLElement | null\n margins: PopoverMargins\n matchReferenceWidth: boolean | undefined\n maxWidth: number | undefined\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n rootBoundary: RootBoundary\n}) {\n return useMemo(() => {\n const ret: Middleware[] = []\n\n // Flip the floating element when leaving the boundary box\n if (constrainSize || preventOverflow) {\n if (placementStrategy === 'autoPlacement') {\n ret.push(\n autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n }),\n )\n } else {\n ret.push(\n flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n }),\n )\n }\n }\n\n // Define distance between reference and floating element\n ret.push(offset({mainAxis: DEFAULT_POPOVER_DISTANCE}))\n\n // Track sizes\n if (constrainSize || matchReferenceWidth) {\n ret.push(\n size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n // The card renders the cap unless `constrainSize`: no reason to change the middleware then\n maxWidth: constrainSize ? maxWidth : undefined,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Shift the popover so its sits within the boundary element\n if (preventOverflow) {\n ret.push(\n shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Place arrow\n if (arrowProp) {\n ret.push(\n arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Determine the origin to scale from.\n // Must be placed after `@sanity/ui/size` and `shift` middleware.\n if (animate) {\n ret.push(origin)\n }\n\n ret.push(\n hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n }),\n )\n\n return ret\n }, [\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n ])\n}\n"],"mappings":";;;;;;;;;;;;AAQA,MAAa,0BAA0C;CAAC;CAAG;CAAG;CAAG;AAAC,GACrD,8BAA8D;CACzEqG,KAAO;EAAC;EAAU;EAAQ;CAAO;CACjC,aAAa;EAAC;EAAgB;EAAc;CAAa;CACzD,WAAW;EAAC;EAAc;EAAY;CAAW;CACjDC,QAAU;EAAC;EAAO;EAAQ;CAAO;CACjC,gBAAgB;EAAC;EAAa;EAAc;CAAa;CACzD,cAAc;EAAC;EAAW;EAAY;CAAW;CACjDC,MAAQ;EAAC;EAAS;EAAO;CAAQ;CACjC,cAAc;EAAC;EAAe;EAAa;CAAc;CACzD,YAAY;EAAC;EAAa;EAAW;CAAY;CACjDC,OAAS;EAAC;EAAQ;EAAO;CAAQ;CACjC,eAAe;EAAC;EAAc;EAAa;CAAc;CACzD,aAAa;EAAC;EAAY;EAAW;CAAY;AACnD;AClBA,SAAgB,KAAK,SAON;CACb,IAAM,EAAC,eAAe,SAAS,qBAAqB,UAAU,MAAK;CAEnE,OAAO;EACL,MAAM;EAGN;EACA,MAAM,GAAG,MAAM;GACb,IAAM,EAAC,UAAU,WAAW,UAAU,UAAS,MACzC,EAAC,UAAU,cAAa,OAExB,WAAW,MAAM,eAAe,MAAM;IAC1C,aAAa;IACb,UAAU,QAAQ,mBAAmB,KAAA;IACr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A3BJ,EAAA,KAAA,eAHtB,EAAA,MAAA,mBADe,EAAA,MAAA,iBAkEP,EAAA,MAAA,mBArDN,EAAA,MAAA,c;;CAjBV,OAAOC;AA6FT"}
1
+ {"version":3,"file":"popover-C-YWzo_l.js","names":["...restProps","getTransformOrigin(originX, originY)","animate ? 'transform' : undefined","constrainSize ? undefined : (style?.maxHeight ?? '')","constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? '')","matchReferenceWidth ? undefined : (width ?? style?.width ?? '')","{\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n // The `size` middleware writes these to the element while it owns them (React leaves a style\n // it keeps rendering as `undefined` alone), and `''` clears its write once React owns them\n maxHeight: constrainSize ? undefined : (style?.maxHeight ?? ''),\n maxWidth: constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? ''),\n width: matchReferenceWidth ? undefined : (width ?? style?.width ?? ''),\n }","useMemo(\n () => ({\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n // The `size` middleware writes these to the element while it owns them (React leaves a style\n // it keeps rendering as `undefined` alone), and `''` clears its write once React owns them\n maxHeight: constrainSize ? undefined : (style?.maxHeight ?? ''),\n maxWidth: constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? ''),\n width: matchReferenceWidth ? undefined : (width ?? style?.width ?? ''),\n }),\n [\n animate,\n constrainSize,\n matchReferenceWidth,\n maxWidth,\n originX,\n originY,\n strategy,\n style,\n width,\n x,\n y,\n zIndex,\n ],\n )","arrowX !== null ? arrowX : undefined","arrowY !== null ? arrowY : undefined","{\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }","useMemo(\n () => ({\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }),\n [arrowX, arrowY],\n )","animate ? POPOVER_MOTION_PROPS : undefined","<Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>","<Flex data-ui=\"Popover__wrapper\" direction=\"column\" flex={1} overflow={overflow}>\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </Flex>","arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )","<MotionCard\n data-ui=\"Popover\"\n {...restProps}\n data-placement={placement}\n radius={radius}\n ref={ref}\n scheme={scheme}\n shadow={shadow}\n sizing=\"border\"\n style={rootStyle}\n tone={tone}\n {...(animate ? POPOVER_MOTION_PROPS : undefined)}\n >\n <Flex data-ui=\"Popover__wrapper\" direction=\"column\" flex={1} overflow={overflow}>\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </Flex>\n\n {arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )}\n </MotionCard>","_jsx","() => {\n if (shouldRender) stopListening(stopRef)\n }","[shouldRender]","(node: HTMLElement | null) => {\n stopListening(stopRef)\n\n if (node && !shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n }","shouldRenderRef.current","useCallback(\n (node: HTMLElement | null) => {\n stopListening(stopRef)\n\n if (node && !shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n },\n [handleIntent, shouldRenderRef],\n )","<div\n data-ui=\"PopoverOverlay\"\n style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}}\n />","margins = DEFAULT_POPOVER_MARGINS","_animate = false","tone = 'inherit'","widthProp = 'auto'","arrowProp = false","constrainSize = false","overflow = 'hidden'","placementProp = 'bottom'","placementStrategy = 'flip'","preventOverflow = true","radiusProp = 3","shadowProp = 3","childProp","content","disabled","_fallbackPlacements","matchReferenceWidth","_floatingBoundary","modal","open","paddingProp","portal","forwardedRef","_referenceBoundary","referenceElement","scheme","_zOffsetProp","updateRef","...restProps","_getArrayProp(paddingProp)","_getArrayProp(radiusProp)","_getArrayProp(shadowProp)","_getArrayProp(zOffsetProp)","() => ref.current","{\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n }","referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined","{\n middleware,\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined,\n }","() => startTransition(() => setHasRendered(true))","useCallback(() => startTransition(() => setHasRendered(true)), [])","() => {\n if (!intentReference) return undefined\n\n return listenForIntent(intentReference, handleIntent)\n }","[handleIntent, intentReference]","(arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }","useCallback((arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }, [])","childProp && !referenceElement ? getElementRef<HTMLElement>(childProp) : undefined","(node: HTMLDivElement | null) => {\n ref.current = node\n if (node) handOverReference()\n refs.setFloating(node)\n }","useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n if (node) handOverReference()\n refs.setFloating(node)\n },\n [handOverReference, refs],\n )","useMemo(() => {\n // If a reference element is defined, we don't need to clone the child\n if (referenceElement) return childProp\n\n if (!childProp) return null\n\n return cloneElement(childProp, {ref: setReference})\n }, [childProp, referenceElement, setReference])","cloneElement(childProp, {ref: setReference})","() => update","[update]","childProp || <></>","modal && <ViewportOverlay />","<PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n constrainSize={constrainSize}\n hidden={referenceHidden}\n matchReferenceWidth={matchReferenceWidth}\n maxWidth={maxWidth}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>","<LayerProvider zOffset={zOffset}>\n {/* Optional transparent blocking overlay at the top-most z-index layer. Must be positioned before the below popover card. */}\n {modal && <ViewportOverlay />}\n\n <PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n constrainSize={constrainSize}\n hidden={referenceHidden}\n matchReferenceWidth={matchReferenceWidth}\n maxWidth={maxWidth}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>\n </LayerProvider>","portal ? (\n <Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>{popover}</Portal>\n ) : (\n popover\n )","animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {shouldRender ? popoverNode : null}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{shouldRender ? popoverNode : null}</Activity>\n )","<>\n {/* the popover (not rendered until it opens or is about to, see `hasRendered`) */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {shouldRender ? popoverNode : null}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{shouldRender ? popoverNode : null}</Activity>\n )}\n\n {/* the referred element */}\n {child}\n </>","() => {\n if (!open || !element) return undefined\n\n // Measuring the boundary is what this effect is for: the DOM is only measurable after the\n // commit, and the result has to be in the next paint\n // oxlint-disable-next-line react/set-state-in-effect\n setSize((prev) => sameSize(prev, measureBorderBox(element)))\n\n return _elementSizeObserver.subscribe(element, ({border}) =>\n setSize((prev) =>\n sameSize(prev, {width: Math.round(border.width), height: Math.round(border.height)}),\n ),\n )\n }","[element, open]","{border}","prev","{\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n}: {\n animate: boolean\n arrowProp: boolean\n arrowRef: React.RefObject<HTMLDivElement | null>\n constrainSize: boolean\n fallbackPlacements: Placement[]\n floatingBoundary: HTMLElement | null\n margins: PopoverMargins\n matchReferenceWidth: boolean | undefined\n maxWidth: number | undefined\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n rootBoundary: RootBoundary\n}","const ret: Middleware[] = []","autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n })","floatingBoundary || undefined","flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n })","offset({mainAxis: DEFAULT_POPOVER_DISTANCE})","constrainSize ? maxWidth : undefined","size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n // The card renders the cap unless `constrainSize`: no reason to change the middleware then\n maxWidth: constrainSize ? maxWidth : undefined,\n padding: DEFAULT_POPOVER_PADDING,\n })","shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n })","arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n })","referenceBoundary || undefined","hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n })","useMemo(() => {\n const ret: Middleware[] = []\n\n // Flip the floating element when leaving the boundary box\n if (constrainSize || preventOverflow) {\n if (placementStrategy === 'autoPlacement') {\n ret.push(\n autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n }),\n )\n } else {\n ret.push(\n flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n }),\n )\n }\n }\n\n // Define distance between reference and floating element\n ret.push(offset({mainAxis: DEFAULT_POPOVER_DISTANCE}))\n\n // Track sizes\n if (constrainSize || matchReferenceWidth) {\n ret.push(\n size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n // The card renders the cap unless `constrainSize`: no reason to change the middleware then\n maxWidth: constrainSize ? maxWidth : undefined,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Shift the popover so its sits within the boundary element\n if (preventOverflow) {\n ret.push(\n shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Place arrow\n if (arrowProp) {\n ret.push(\n arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Determine the origin to scale from.\n // Must be placed after `@sanity/ui/size` and `shift` middleware.\n if (animate) {\n ret.push(origin)\n }\n\n ret.push(\n hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n }),\n )\n\n return ret\n }, [\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n ])","_jsx","childRef","_Fragment","\"top\"","\"bottom\"","\"left\"","\"right\""],"sources":["../src/core/primitives/popover/constants.ts","../src/core/primitives/popover/floating-ui/size.ts","../src/core/primitives/popover/helpers.ts","../src/core/primitives/popover/popoverCard.tsx","../src/core/primitives/popover/popover.tsx"],"sourcesContent":["import {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\n\nexport const DEFAULT_POPOVER_DISTANCE = 4\nexport const DEFAULT_POPOVER_PADDING = 4\nexport const DEFAULT_POPOVER_ARROW_WIDTH = 19\nexport const DEFAULT_POPOVER_ARROW_HEIGHT = 8\nexport const DEFAULT_POPOVER_ARROW_RADIUS = 2\nexport const DEFAULT_POPOVER_MARGINS: PopoverMargins = [0, 0, 0, 0]\nexport const DEFAULT_FALLBACK_PLACEMENTS: Record<Placement, Placement[]> = {\n 'top': ['bottom', 'left', 'right'],\n 'top-start': ['bottom-start', 'left-start', 'right-start'],\n 'top-end': ['bottom-end', 'left-end', 'right-end'],\n 'bottom': ['top', 'left', 'right'],\n 'bottom-start': ['top-start', 'left-start', 'right-start'],\n 'bottom-end': ['top-end', 'left-end', 'right-end'],\n 'left': ['right', 'top', 'bottom'],\n 'left-start': ['right-start', 'top-start', 'bottom-start'],\n 'left-end': ['right-end', 'top-end', 'bottom-end'],\n 'right': ['left', 'top', 'bottom'],\n 'right-start': ['left-start', 'top-start', 'bottom-start'],\n 'right-end': ['left-end', 'top-end', 'bottom-end'],\n}\n","import {detectOverflow, Middleware} from '@floating-ui/react-dom'\n\nimport {PopoverMargins} from '../../../types/popover'\n\nexport function size(options: {\n boundaryElement?: HTMLElement | null\n constrainSize: boolean\n margins: PopoverMargins\n matchReferenceWidth?: boolean\n maxWidth: number | undefined\n padding?: number\n}): Middleware {\n const {constrainSize, margins, matchReferenceWidth, padding = 0} = options\n\n return {\n name: '@sanity/ui/size',\n // `useFloating` compares middleware deeply and functions by their source text, so without its\n // `options` it would keep running this middleware with outdated ones\n options,\n async fn(args) {\n const {elements, placement, platform, rects} = args\n const {floating, reference} = rects\n\n const overflow = await detectOverflow(args, {\n altBoundary: true,\n boundary: options.boundaryElement || undefined,\n elementContext: 'floating',\n padding,\n rootBoundary: 'viewport',\n })\n\n let maxWidth = Infinity\n let maxHeight = Infinity\n\n const floatingW = floating.width\n const floatingH = floating.height\n\n if (placement.includes('top')) {\n maxWidth = floatingW - (overflow.left + overflow.right)\n maxHeight = floatingH - overflow.top\n }\n\n if (placement.includes('right')) {\n maxWidth = floatingW - overflow.right\n maxHeight = floatingH - (overflow.top + overflow.bottom)\n }\n\n if (placement.includes('bottom')) {\n maxWidth = floatingW - (overflow.left + overflow.right)\n maxHeight = floatingH - overflow.bottom\n }\n\n if (placement.includes('left')) {\n maxWidth = floatingW - overflow.left\n maxHeight = floatingH - (overflow.top + overflow.bottom)\n }\n\n // IMPORTANT – APPLY ELEMENT STYLES HERE\n // Elements need to be resized BEFORE the `platform.getDimensions` call below, and never to a\n // negative size: CSS ignores a negative length, keeping the previous one\n const availableWidth = maxWidth - margins[1] - margins[3]\n const availableHeight = maxHeight - margins[0] - margins[2]\n const referenceWidth = Math.max(0, reference.width - margins[1] - margins[3])\n\n if (matchReferenceWidth) {\n elements.floating.style.width = `${referenceWidth}px`\n }\n\n if (constrainSize) {\n // No room at all means the popover lies outside the area it is measured in, like a submenu\n // beside the scrolling menu its reference is in: a max size of zero would collapse it\n const constrainedWidth = Math.min(\n availableWidth > 0 ? availableWidth : Infinity,\n options.maxWidth ?? Infinity,\n )\n\n elements.floating.style.maxWidth = Number.isFinite(constrainedWidth)\n ? `${constrainedWidth}px`\n : ''\n\n elements.floating.style.maxHeight = availableHeight > 0 ? `${availableHeight}px` : ''\n }\n\n const nextDimensions = await platform.getDimensions(elements.floating)\n\n const targetH = nextDimensions.height\n const targetW = nextDimensions.width\n\n if (floatingW !== targetW || floatingH !== targetH) {\n return {reset: {rects: true}}\n }\n\n return {}\n },\n }\n}\n","import {DEFAULT_POPOVER_PADDING} from './constants'\nimport {PopoverWidth} from './types'\n\nexport function calcCurrentWidth(params: {\n mediaIndex: number\n container: number[]\n width: PopoverWidth[]\n}): number | undefined {\n const {container, mediaIndex, width} = params\n\n const w = width[mediaIndex]\n const currentWidth: PopoverWidth | undefined = w === undefined ? width[width.length - 1] : w\n\n return typeof currentWidth === 'number' ? container[currentWidth] : undefined\n}\n\nexport function calcMaxWidth(params: {\n boundaryWidth: number | undefined\n currentWidth: number | undefined\n}): number | undefined {\n const {boundaryWidth, currentWidth} = params\n\n const maxWidth = Math.min(\n currentWidth ?? Infinity,\n (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2,\n )\n\n // Also uncapped for a boundary of width `0` (collapsed, or `display: none`), and never negative\n // for one narrower than the padding: CSS ignores a negative length, keeping the previous cap\n return Number.isFinite(maxWidth) ? Math.max(0, maxWidth) : undefined\n}\n","import {Strategy} from '@floating-ui/react-dom'\nimport {motion} from 'motion/react'\nimport React, {CSSProperties, useMemo} from 'react'\nimport {styled} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {POPOVER_MOTION_PROPS} from '../../constants'\nimport {getTransformOrigin} from '../../middleware/origin'\nimport {BoxOverflow} from '../../types/box'\nimport {CardTone} from '../../types/card'\nimport {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\nimport {Radius} from '../../types/radius'\nimport {Arrow} from '../../utils/arrow/arrow'\nimport {useLayer} from '../../utils/layer/useLayer'\nimport {Card} from '../card/card'\nimport {Flex} from '../flex/flex'\nimport {\n DEFAULT_POPOVER_ARROW_HEIGHT,\n DEFAULT_POPOVER_ARROW_RADIUS,\n DEFAULT_POPOVER_ARROW_WIDTH,\n DEFAULT_POPOVER_MARGINS,\n} from './constants'\n\nconst MotionCard = styled(motion.create(Card))`\n &:not([hidden]) {\n display: flex;\n }\n flex-direction: column;\n width: max-content;\n min-width: min-content;\n will-change: transform;\n`\n\n/**\n * @internal\n */\nexport function PopoverCard(\n props: {\n /** @beta*/\n __unstable_margins?: PopoverMargins\n animate?: boolean\n arrow: boolean\n arrowRef: React.Ref<HTMLDivElement>\n arrowX?: number\n arrowY?: number\n constrainSize?: boolean\n matchReferenceWidth?: boolean\n maxWidth: number | undefined\n originX?: number\n originY?: number\n overflow?: BoxOverflow\n padding?: number | number[]\n placement: Placement\n radius?: Radius | Radius[]\n scheme?: ThemeColorSchemeKey\n shadow?: number | number[]\n strategy: Strategy\n tone: CardTone\n width: number | undefined\n x: number | null\n y: number | null\n } & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'width'>,\n) {\n const {\n __unstable_margins: marginsProp,\n animate,\n arrow,\n arrowRef,\n arrowX,\n arrowY,\n children,\n constrainSize,\n matchReferenceWidth,\n maxWidth,\n padding,\n placement,\n originX,\n originY,\n overflow,\n radius,\n ref,\n scheme,\n shadow,\n strategy,\n style,\n tone,\n width,\n x: xProp,\n y: yProp,\n ...restProps\n } = props\n\n const {zIndex} = useLayer()\n\n // Get margins: [top, right, bottom, left]\n const margins: PopoverMargins = useMemo(\n () => marginsProp || DEFAULT_POPOVER_MARGINS,\n [marginsProp],\n )\n\n // Translate according to margins\n const x = (xProp ?? 0) + margins[3]\n const y = (yProp ?? 0) + margins[0]\n\n const rootStyle: CSSProperties = useMemo(\n () => ({\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n // The `size` middleware writes these to the element while it owns them (React leaves a style\n // it keeps rendering as `undefined` alone), and `''` clears its write once React owns them\n maxHeight: constrainSize ? undefined : (style?.maxHeight ?? ''),\n maxWidth: constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? ''),\n width: matchReferenceWidth ? undefined : (width ?? style?.width ?? ''),\n }),\n [\n animate,\n constrainSize,\n matchReferenceWidth,\n maxWidth,\n originX,\n originY,\n strategy,\n style,\n width,\n x,\n y,\n zIndex,\n ],\n )\n\n const arrowStyle: CSSProperties = useMemo(\n () => ({\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }),\n [arrowX, arrowY],\n )\n\n return (\n <MotionCard\n data-ui=\"Popover\"\n {...restProps}\n data-placement={placement}\n radius={radius}\n ref={ref}\n scheme={scheme}\n shadow={shadow}\n sizing=\"border\"\n style={rootStyle}\n tone={tone}\n {...(animate ? POPOVER_MOTION_PROPS : undefined)}\n >\n <Flex data-ui=\"Popover__wrapper\" direction=\"column\" flex={1} overflow={overflow}>\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </Flex>\n\n {arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )}\n </MotionCard>\n )\n}\n","import {\n arrow,\n autoPlacement,\n autoUpdate,\n flip,\n hide,\n Middleware,\n offset,\n RootBoundary,\n shift,\n useFloating,\n} from '@floating-ui/react-dom'\nimport {\n Activity,\n cloneElement,\n type Ref,\n startTransition,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {useLatestRef} from '../../hooks/useLatestRef'\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {usePrefersReducedMotion} from '../../hooks/usePrefersReducedMotion'\nimport {useReferenceElement} from '../../hooks/useReferenceElement'\nimport {origin} from '../../middleware/origin'\nimport {_elementSizeObserver, ElementRectValue} from '../../observers/elementSizeObserver'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {useTheme_v2} from '../../theme/useTheme'\nimport {BoxOverflow} from '../../types/box'\nimport {CardTone} from '../../types/card'\nimport {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\nimport {AnimateActivity} from '../../utils/animateActivity'\nimport {useBoundaryElement} from '../../utils/boundaryElement/useBoundaryElement'\nimport {getElementRef} from '../../utils/getElementRef'\nimport {LayerProps} from '../../utils/layer/layer'\nimport {LayerProvider} from '../../utils/layer/layerProvider'\nimport {useLayer} from '../../utils/layer/useLayer'\nimport {Portal} from '../../utils/portal/portal'\nimport {ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'\nimport {\n DEFAULT_FALLBACK_PLACEMENTS,\n DEFAULT_POPOVER_DISTANCE,\n DEFAULT_POPOVER_MARGINS,\n DEFAULT_POPOVER_PADDING,\n} from './constants'\nimport {size} from './floating-ui/size'\nimport {calcCurrentWidth, calcMaxWidth} from './helpers'\nimport {PopoverCard} from './popoverCard'\nimport {PopoverUpdateCallback, PopoverWidth} from './types'\n\n/** @public */\nexport interface PopoverProps\n extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {\n /** @beta */\n __unstable_margins?: PopoverMargins\n /**\n * Whether the popover should animate in and out.\n *\n * @beta\n * @defaultValue false\n */\n animate?: boolean\n arrow?: boolean\n /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */\n boundaryElement?: never\n children?: React.JSX.Element\n /**\n * When `true`, prevent overflow within the current boundary:\n * - by flipping on its side axis\n * - by resizing\n /*\n * Note that:\n * - setting `preventOverflow` to `true` also prevents overflow on its side axis\n * - setting `matchReferenceWidth` to `true` also causes the popover to resize\n *\n * @defaultValue false\n */\n constrainSize?: boolean\n content?: React.ReactNode\n disabled?: boolean\n fallbackPlacements?: Placement[]\n floatingBoundary?: HTMLElement | null\n /**\n * When `true`, set the maximum width to match the reference element, and also prevent overflow within\n * the current boundary by resizing.\n *\n * Note that setting `constrainSize` to `true` also causes the popover to resize\n *\n * @defaultValue false\n */\n matchReferenceWidth?: boolean\n /**\n * When true, blocks all pointer interaction with elements beneath the popover until closed.\n *\n * @beta\n * @defaultValue false\n */\n modal?: boolean\n /**\n * Whether the popover is open.\n *\n * Set it inside `startTransition`. A closed popover pre-renders its content hidden, in a\n * transition, once the reference element shows intent to open it (focus, a pointer entering or\n * pressing it). Opening in a transition too lets React keep rendering that content in the\n * background when the open comes before it is done, instead of rendering it synchronously in the\n * click. Content that was pre-rendered already shows in the first frame after the click either\n * way.\n *\n * ```tsx\n * const [open, setOpen] = useState(false)\n *\n * <Popover content={content} open={open}>\n * <Button onClick={() => startTransition(() => setOpen((isOpen) => !isOpen))} text=\"Toggle\" />\n * </Popover>\n * ```\n *\n * Wrap the state update itself: a `startTransition` around code that schedules the update for\n * later (a timeout) does not reach it.\n */\n open?: boolean\n overflow?: BoxOverflow\n padding?: number | number[]\n placement?: Placement\n /**\n * When 'flip' (default), the placement is determined from the initial placement and the\n * fallback placements in order. Whichever fits in the viewport first.\n *\n * When 'autoPlacement', the initial placement and all fallback placements are evaluated\n * and the placement with the most viewport space available.\n *\n * Option is only relevant if either `constrainSize` or `preventOverflow` is `true`\n */\n placementStrategy?: 'flip' | 'autoPlacement'\n /** Whether or not to render the popover in a portal element. */\n portal?: boolean | string\n preventOverflow?: boolean\n referenceBoundary?: HTMLElement | null\n /**\n * When defined, the popover will be positioned relative to this element.\n * The children of the popover won't be rendered.\n */\n referenceElement?: HTMLElement | null\n scheme?: ThemeColorSchemeKey\n tone?: CardTone\n /** @beta */\n updateRef?: Ref<PopoverUpdateCallback | undefined>\n width?: PopoverWidth | PopoverWidth[]\n}\n\n/**\n * The events on the reference element that count as intent to open the popover. Each precedes the\n * interaction that usually opens a popover: focus before a key press, the pointer entering before\n * a click or a tap.\n */\nconst INTENT_EVENT_TYPES = ['focusin', 'pointerenter', 'pointerdown'] as const\n\n/** Calls `handleIntent` on intent to open the popover, until the returned function is called */\nfunction listenForIntent(element: HTMLElement | null, handleIntent: () => void): () => void {\n if (!element) return () => {}\n\n const controller = new AbortController()\n const {signal} = controller\n\n // `focusin` rather than `focus` so that focus landing inside the reference element counts too.\n // `pointerdown` is a fallback for a pointer that was already over the element when it\n // rendered, which fires no `pointerenter`.\n for (const type of INTENT_EVENT_TYPES) {\n element.addEventListener(type, handleIntent, {signal})\n }\n\n // Focus that landed before the listeners did (an `autoFocus` reference, a `referenceElement`\n // that was focused already) fired its `focusin` unheard, so count it now\n const {activeElement} = element.ownerDocument\n\n if (activeElement && element.contains(activeElement)) handleIntent()\n\n return () => controller.abort()\n}\n\n/**\n * Listens for intent on the cloned child's element from the moment it attaches, until it detaches\n * or the popover has rendered. Returns the callback for `useReferenceElement` to attach with.\n *\n * The node is null when the child forwards a ref with nothing mounted, and when that ref later\n * clears. Null and a swap onto another element both stop whatever was already listening. A child\n * may report the next node without running the previous cleanup. Null attaches nothing.\n */\nfunction useChildIntent(\n shouldRender: boolean,\n handleIntent: () => void,\n): (node: HTMLElement | null) => () => void {\n const shouldRenderRef = useLatestRef(shouldRender)\n const stopRef = useRef<(() => void) | null>(null)\n\n useEffect(() => {\n if (shouldRender) stopListening(stopRef)\n }, [shouldRender])\n\n return useCallback(\n (node: HTMLElement | null) => {\n stopListening(stopRef)\n\n if (node && !shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n },\n [handleIntent, shouldRenderRef],\n )\n}\n\nfunction stopListening(stopRef: React.RefObject<(() => void) | null>) {\n stopRef.current?.()\n stopRef.current = null\n}\n\nconst ViewportOverlay = () => {\n const {zIndex} = useLayer()\n\n return (\n <div\n data-ui=\"PopoverOverlay\"\n style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}}\n />\n )\n}\n\n/**\n * The `Popover` component is used to display some content on top of another.\n *\n * @public\n */\nexport function Popover(\n props: PopoverProps &\n Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'width'>,\n): React.JSX.Element {\n const {container, layer} = useTheme_v2()\n const boundaryElementContext = useBoundaryElement()\n\n const {\n __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,\n animate: _animate = false,\n arrow: arrowProp = false,\n children: childProp,\n constrainSize = false,\n content,\n disabled,\n fallbackPlacements: _fallbackPlacements,\n matchReferenceWidth,\n floatingBoundary: _floatingBoundary,\n modal,\n // oxlint-disable-next-line no-unused-vars\n onActivate,\n open,\n overflow = 'hidden',\n padding: paddingProp,\n placement: placementProp = 'bottom',\n placementStrategy = 'flip',\n portal,\n preventOverflow = true,\n radius: radiusProp = 3,\n ref: forwardedRef,\n referenceBoundary: _referenceBoundary,\n referenceElement,\n scheme,\n shadow: shadowProp = 3,\n tone = 'inherit',\n width: widthProp = 'auto',\n zOffset: _zOffsetProp,\n updateRef,\n ...restProps\n } = props\n const fallbackPlacements =\n _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? 'bottom']\n const floatingBoundary = _floatingBoundary ?? boundaryElementContext.element\n const referenceBoundary = _referenceBoundary ?? boundaryElementContext.element\n // Max-width uses BoundaryElementProvider when present; otherwise the floating\n // boundary (same element the old `boundaryElement` prop used for both).\n const boundaryElement = boundaryElementContext.element ?? floatingBoundary\n const zOffsetProp = _zOffsetProp ?? layer.popover.zOffset\n const prefersReducedMotion = usePrefersReducedMotion()\n const animate = prefersReducedMotion ? false : _animate\n\n // Opening renders the popover whether or not any intent preceded it. A `disabled` popover\n // renders only its child, so neither `open` nor intent counts while it is disabled: otherwise\n // enabling it later would render it hidden without it ever having opened or been about to.\n const isOpen = Boolean(open) && !disabled\n\n const boundarySize = useBoundarySize(boundaryElement, isOpen)\n const padding = _getArrayProp(paddingProp)\n const radius = _getArrayProp(radiusProp)\n const shadow = _getArrayProp(shadowProp)\n const widthArrayProp = _getArrayProp(widthProp)\n const zOffset = _getArrayProp(zOffsetProp)\n const ref = useRef<HTMLDivElement | null>(null)\n const arrowRef = useRef<HTMLDivElement | null>(null)\n const rootBoundary: RootBoundary = 'viewport'\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n const mediaIndex = useMediaIndex()\n const boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : undefined\n\n // Update width when\n // - media index changes\n // - `width` property changes\n const width = calcCurrentWidth({\n container,\n mediaIndex,\n width: widthArrayProp,\n })\n\n // Update max width when\n // - boundary width changes\n // - `width` property changes\n const maxWidth = calcMaxWidth({boundaryWidth, currentWidth: width})\n\n const middleware = useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n })\n\n const {x, y, middlewareData, placement, refs, strategy, update} = useFloating<HTMLElement>({\n middleware,\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined,\n })\n\n // Whether the popover (card, portal and `content`) has been rendered yet. Closed popovers\n // render inside a hidden `<Activity>`, so whatever is rendered while closed is pre-rendered DOM\n // that only pays off if the popover opens. Nothing is rendered until the popover opens or the\n // reference element shows intent to open it (see `INTENT_EVENT_TYPES`), and from then on it\n // stays rendered so the state of its `content` survives reopening. Consumers that do not want\n // a popover pre-rendered on intent can leave `content` empty until it opens.\n const [hasRendered, setHasRendered] = useState(false)\n\n if (isOpen && !hasRendered) setHasRendered(true)\n\n const shouldRender = isOpen || hasRendered\n // The element to listen to for intent to open the popover: none once the popover has rendered,\n // since there is nothing left to pre-render, and none while disabled, which also drops the\n // listeners of a popover that was enabled before. A cloned child is listened to from the moment\n // it attaches instead (see `useChildIntent`), and a disabled popover does not clone it.\n const intentReference = shouldRender || disabled ? null : referenceElement\n // In a transition, so that it never holds up an open that follows right away (a click), and so\n // that React pre-renders the hidden popover in the background\n const handleIntent = useCallback(() => startTransition(() => setHasRendered(true)), [])\n\n useEffect(() => {\n if (!intentReference) return undefined\n\n return listenForIntent(intentReference, handleIntent)\n }, [handleIntent, intentReference])\n\n const listenForChildIntent = useChildIntent(shouldRender, handleIntent)\n\n const referenceHidden = middlewareData.hide?.referenceHidden\n\n const arrowX = middlewareData.arrow?.x\n const arrowY = middlewareData.arrow?.y\n\n const originX = middlewareData['@sanity/ui/origin']?.originX\n const originY = middlewareData['@sanity/ui/origin']?.originY\n\n const setArrow = useCallback((arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }, [])\n\n // With a `referenceElement` the child is not cloned and keeps its ref to itself\n const childRef =\n childProp && !referenceElement ? getElementRef<HTMLElement>(childProp) : undefined\n const {handOverReference, setReference} = useReferenceElement(\n refs,\n childRef,\n listenForChildIntent,\n )\n\n const setFloating = useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n if (node) handOverReference()\n refs.setFloating(node)\n },\n [handOverReference, refs],\n )\n\n const child = useMemo(() => {\n // If a reference element is defined, we don't need to clone the child\n if (referenceElement) return childProp\n\n if (!childProp) return null\n\n return cloneElement(childProp, {ref: setReference})\n }, [childProp, referenceElement, setReference])\n\n useImperativeHandle(updateRef, () => update, [update])\n\n if (disabled) {\n return childProp || <></>\n }\n\n const popover = (\n <LayerProvider zOffset={zOffset}>\n {/* Optional transparent blocking overlay at the top-most z-index layer. Must be positioned before the below popover card. */}\n {modal && <ViewportOverlay />}\n\n <PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n constrainSize={constrainSize}\n hidden={referenceHidden}\n matchReferenceWidth={matchReferenceWidth}\n maxWidth={maxWidth}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>\n </LayerProvider>\n )\n\n const popoverNode = portal ? (\n <Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>{popover}</Portal>\n ) : (\n popover\n )\n\n return (\n <>\n {/* the popover (not rendered until it opens or is about to, see `hasRendered`) */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {shouldRender ? popoverNode : null}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{shouldRender ? popoverNode : null}</Activity>\n )}\n\n {/* the referred element */}\n {child}\n </>\n )\n}\n\n/**\n * The border-box size of the boundary element in whole pixels, tracked only while the popover is\n * open.\n *\n * Closed popovers have nothing to size, so they hold no `ResizeObserver` subscription and do not\n * re-render when the boundary resizes (one subscription per popover, every closed popover\n * re-rendering on every boundary resize, is what this replaces). The boundary is measured\n * synchronously in a layout effect when the popover opens, so the max width is right in the first\n * painted frame instead of one `ResizeObserver` callback later; the shared observer takes over\n * from there. The last size is kept while closed.\n *\n * Both measurements are rounded to whole pixels so that they agree: the observer's first delivery\n * must not change the size the opening commit measured, or the max width would be corrected a\n * frame later after all. See `measureBorderBox`.\n */\nfunction useBoundarySize(element: HTMLElement | null, open: boolean): ElementRectValue | undefined {\n const [size, setSize] = useState<ElementRectValue | undefined>(undefined)\n\n useLayoutEffect(() => {\n if (!open || !element) return undefined\n\n // Measuring the boundary is what this effect is for: the DOM is only measurable after the\n // commit, and the result has to be in the next paint\n // oxlint-disable-next-line react/set-state-in-effect\n setSize((prev) => sameSize(prev, measureBorderBox(element)))\n\n return _elementSizeObserver.subscribe(element, ({border}) =>\n setSize((prev) =>\n sameSize(prev, {width: Math.round(border.width), height: Math.round(border.height)}),\n ),\n )\n }, [element, open])\n\n return size\n}\n\n/**\n * The border-box size of an element in whole pixels, the way `_elementSizeObserver` reports it:\n * from `ResizeObserverEntry.borderBoxSize`, which is the layout size with no CSS transform or\n * `zoom` applied, in the element's writing mode (`inlineSize` as `width`, `blockSize` as\n * `height`), rounded by `useBoundarySize`. `offsetWidth`/`offsetHeight` are that same untransformed\n * border box rounded to whole pixels. `getBoundingClientRect` would include transforms (a boundary\n * mid scale animation) and `zoom`, and `getComputedStyle` serializes lengths with limited\n * precision, so neither agrees with the observer for every element.\n *\n * Kept at module scope on purpose: reading the offset size forces a synchronous layout, and the\n * React Compiler (which the package build runs) lifts a member expression on an element captured\n * by a component callback into a memo dependency evaluated during render. A plain function call\n * on the element gives it nothing to lift.\n */\nfunction measureBorderBox(element: HTMLElement): ElementRectValue {\n const {offsetWidth, offsetHeight} = element\n\n if (getComputedStyle(element).writingMode.startsWith('horizontal')) {\n return {width: offsetWidth, height: offsetHeight}\n }\n\n // In a vertical writing mode the inline size is the physical height\n return {width: offsetHeight, height: offsetWidth}\n}\n\n/** Keeps the previous object when the size has not changed, so `setState` bails out */\nfunction sameSize(prev: ElementRectValue | undefined, next: ElementRectValue): ElementRectValue {\n return prev && prev.width === next.width && prev.height === next.height ? prev : next\n}\n\nfunction useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n}: {\n animate: boolean\n arrowProp: boolean\n arrowRef: React.RefObject<HTMLDivElement | null>\n constrainSize: boolean\n fallbackPlacements: Placement[]\n floatingBoundary: HTMLElement | null\n margins: PopoverMargins\n matchReferenceWidth: boolean | undefined\n maxWidth: number | undefined\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n rootBoundary: RootBoundary\n}) {\n return useMemo(() => {\n const ret: Middleware[] = []\n\n // Flip the floating element when leaving the boundary box\n if (constrainSize || preventOverflow) {\n if (placementStrategy === 'autoPlacement') {\n ret.push(\n autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n }),\n )\n } else {\n ret.push(\n flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n }),\n )\n }\n }\n\n // Define distance between reference and floating element\n ret.push(offset({mainAxis: DEFAULT_POPOVER_DISTANCE}))\n\n // Track sizes\n if (constrainSize || matchReferenceWidth) {\n ret.push(\n size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n // The card renders the cap unless `constrainSize`: no reason to change the middleware then\n maxWidth: constrainSize ? maxWidth : undefined,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Shift the popover so its sits within the boundary element\n if (preventOverflow) {\n ret.push(\n shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Place arrow\n if (arrowProp) {\n ret.push(\n arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Determine the origin to scale from.\n // Must be placed after `@sanity/ui/size` and `shift` middleware.\n if (animate) {\n ret.push(origin)\n }\n\n ret.push(\n hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n }),\n )\n\n return ret\n }, [\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidth,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n rootBoundary,\n ])\n}\n"],"mappings":";;;;;;;;;;;;AAQA,MAAa,0BAA0C;CAAC;CAAG;CAAG;CAAG;AAAC,GACrD,8BAA8D;CACzEqG,KAAO;EAAC;EAAU;EAAQ;CAAO;CACjC,aAAa;EAAC;EAAgB;EAAc;CAAa;CACzD,WAAW;EAAC;EAAc;EAAY;CAAW;CACjDC,QAAU;EAAC;EAAO;EAAQ;CAAO;CACjC,gBAAgB;EAAC;EAAa;EAAc;CAAa;CACzD,cAAc;EAAC;EAAW;EAAY;CAAW;CACjDC,MAAQ;EAAC;EAAS;EAAO;CAAQ;CACjC,cAAc;EAAC;EAAe;EAAa;CAAc;CACzD,YAAY;EAAC;EAAa;EAAW;CAAY;CACjDC,OAAS;EAAC;EAAQ;EAAO;CAAQ;CACjC,eAAe;EAAC;EAAc;EAAa;CAAc;CACzD,aAAa;EAAC;EAAY;EAAW;CAAY;AACnD;AClBA,SAAgB,KAAK,SAON;CACb,IAAM,EAAC,eAAe,SAAS,qBAAqB,UAAU,MAAK;CAEnE,OAAO;EACL,MAAM;EAGN;EACA,MAAM,GAAG,MAA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EAAA,KAAA,WAGW,EAAA,KAAA,UApDX,EAAA,KAAA,eAI8C,EAAA,KAAA,oBAMhC,EAAA,KAAA,kBAkBZ,EAAA,KAAA,SALe,EAAA,KAAA,qBAQW,EAAA,KAAA,UA3BJ,EAAA,KAAA,eAHtB,EAAA,MAAA,mBADe,EAAA,MAAA,iBAkEP,EAAA,MAAA,mBArDN,EAAA,MAAA,c;;CAjBV,OAAOC;AA6FT"}
@@ -1,7 +1,7 @@
1
- import { s as ThemeColorSchemeKey } from "./_system-CTe2lb5l.js";
2
- import { N as BoxOverflow, m as ResponsiveShadowProps, n as LayerProps, p as ResponsiveRadiusProps, r as Placement } from "./layer-ChlP9Ik6.js";
3
- import { t as CardTone } from "./card-C0a0wQTc.js";
4
1
  import { Ref } from "react";
2
+ import { s as ThemeColorSchemeKey } from "./_system-DjnSx8gA.js";
3
+ import { N as BoxOverflow, m as ResponsiveShadowProps, n as LayerProps, p as ResponsiveRadiusProps, r as Placement } from "./layer-CAyooswI.js";
4
+ import { t as CardTone } from "./card-CEB9JLru.js";
5
5
  /**
6
6
  * @beta
7
7
  */
@@ -114,4 +114,4 @@ interface PopoverProps extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, Re
114
114
  */
115
115
  declare function Popover(props: PopoverProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'width'>): React.JSX.Element;
116
116
  export { PopoverMargins as a, PopoverWidth as i, PopoverProps as n, PopoverUpdateCallback as r, Popover as t };
117
- //# sourceMappingURL=popover-fmTtK69w.d.ts.map
117
+ //# sourceMappingURL=popover-DpHuX7yr.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-fmTtK69w.d.ts","names":[],"sources":["../src/core/types/popover.ts","../src/core/primitives/popover/types.ts","../src/core/primitives/popover/popover.tsx"],"mappings":";;;;;;;KAGY;;KCFA;;KAIA;;UCsDK,qBACP,KAAK,mBAAmB,uBAAuB;;EAEvD,qBAAqB;;;;;;;EAOrB;EACA;;EAEA;EACA,WAAW,MAAM,IAAI;;;;;;;;;;;;EAYrB;EACA,UAAU,MAAM;EAChB;EACA,qBAAqB;EACrB,mBAAmB;;;;;;;;;EASnB;;;;;;;EAOA;;;;;;;;;;;;;;;;;;;;;;EAsBA;EACA,WAAW;EACX;EACA,YAAY;;;;;;;;;;EAUZ;;EAEA;EACA;EACA,oBAAoB;;;;;EAKpB,mBAAmB;EACnB,SAAS;EACT,OAAO;;EAEP,YAAY,IAAI;EAChB,QAAQ,eAAe;;;;;;;iBAqFT,QACd,OAAO,eACL,KAAK,MAAM,UAAU,4DACtB,MAAM,IAAI"}
1
+ {"version":3,"file":"popover-DpHuX7yr.d.ts","names":[],"sources":["../src/core/types/popover.ts","../src/core/primitives/popover/types.ts","../src/core/primitives/popover/popover.tsx"],"mappings":";;;;;;;KAGY;;KCFA;;KAIA;;UCsDK,qBACP,KAAK,mBAAmB,uBAAuB;;EAEvD,qBAAqB;;;;;;;EAOrB;EACA;;EAEA;EACA,WAAW,MAAM,IAAI;;;;;;;;;;;;EAYrB;EACA,UAAU,MAAM;EAChB;EACA,qBAAqB;EACrB,mBAAmB;;;;;;;;;EASnB;;;;;;;EAOA;;;;;;;;;;;;;;;;;;;;;;EAsBA;EACA,WAAW;EACX;EACA,YAAY;;;;;;;;;;EAUZ;;EAEA;EACA;EACA,oBAAoB;;;;;EAKpB,mBAAmB;EACnB,SAAS;EACT,OAAO;;EAEP,YAAY,IAAI;EAChB,QAAQ,eAAe;;;;;;;iBAqFT,QACd,OAAO,eACL,KAAK,MAAM,UAAU,4DACtB,MAAM,IAAI"}
package/dist/popover.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as PopoverMargins, i as PopoverWidth, n as PopoverProps, r as PopoverUpdateCallback, t as Popover } from "./popover-fmTtK69w.js";
1
+ import { a as PopoverMargins, i as PopoverWidth, n as PopoverProps, r as PopoverUpdateCallback, t as Popover } from "./popover-DpHuX7yr.js";
2
2
  export { Popover, type PopoverMargins, type PopoverProps, type PopoverUpdateCallback, type PopoverWidth };