@sanity/ui 4.4.6 → 4.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/arrow-CleOpGKV.js.map +1 -1
- package/dist/autocomplete.js.map +1 -1
- package/dist/breadcrumbs.js.map +1 -1
- package/dist/button-DnJrhWml.js.map +1 -1
- package/dist/code.js.map +1 -1
- package/dist/flex-ohP2jG9d.js.map +1 -1
- package/dist/getElementRef-BLVMlHTn.js.map +1 -1
- package/dist/grid-D-gOpN8z.js.map +1 -1
- package/dist/hotkeys-Bd5rZOMO.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layer-umnlcWXZ.js.map +1 -1
- package/dist/menu.js.map +1 -1
- package/dist/popover-Bb5NvE5n.js.map +1 -1
- package/dist/refractor-CC48DwHi.js.map +1 -1
- package/dist/stack-DyrC2YfU.js.map +1 -1
- package/dist/styles.css +616 -620
- package/dist/textInput-DhYi5cPT.js.map +1 -1
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/useClickOutsideEvent-CC1zgOmv.js.map +1 -1
- package/dist/useLayer-D_TnC6On.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-Bb5NvE5n.js","names":["size","getTransformOrigin(originX, originY)","{\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 }","animate ? 'transform' : undefined","constrainSize ? undefined : (style?.maxHeight ?? '')","constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? '')","matchReferenceWidth ? undefined : (width ?? style?.width ?? '')","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 left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }","arrowX !== null ? arrowX : undefined","arrowY !== null ? arrowY : undefined","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 )","<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>","animate ? POPOVER_MOTION_PROPS : undefined","_c","() => {\n if (shouldRender) stopListening(stopRef)\n }","[shouldRender]","(node: HTMLElement) => {\n if (!shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n }","shouldRenderRef.current","useCallback(\n (node: HTMLElement) => {\n if (!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","_fallbackPlacements","_floatingBoundary","paddingProp","forwardedRef","_referenceBoundary","_zOffsetProp","...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}","autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n })","flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n })","floatingBoundary || undefined","offset({mainAxis: DEFAULT_POPOVER_DISTANCE})","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 })","constrainSize ? maxWidth : undefined","shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n })","arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n })","hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n })","referenceBoundary || undefined","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 ])","_c","childRef","_Fragment","size","\"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 = Math.max(0, maxWidth - margins[1] - margins[3])\n const availableHeight = Math.max(0, 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 elements.floating.style.maxWidth = `${Math.min(availableWidth, options.maxWidth ?? Infinity)}px`\n\n elements.floating.style.maxHeight = `${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, handleIntent: () => void): () => void {\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 */\nfunction useChildIntent(\n shouldRender: boolean,\n handleIntent: () => void,\n): (node: HTMLElement) => () => 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) => {\n if (!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;CACzE4F,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;EA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AA,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;;CAjBV,OAAOE;AA6FT"}
|
|
1
|
+
{"version":3,"file":"popover-Bb5NvE5n.js","names":["size","getTransformOrigin(originX, originY)","{\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 }","animate ? 'transform' : undefined","constrainSize ? undefined : (style?.maxHeight ?? '')","constrainSize ? undefined : (maxWidth ?? style?.maxWidth ?? '')","matchReferenceWidth ? undefined : (width ?? style?.width ?? '')","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 left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }","arrowX !== null ? arrowX : undefined","arrowY !== null ? arrowY : undefined","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 )","<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>","animate ? POPOVER_MOTION_PROPS : undefined","_c","() => {\n if (shouldRender) stopListening(stopRef)\n }","[shouldRender]","(node: HTMLElement) => {\n if (!shouldRenderRef.current) stopRef.current = listenForIntent(node, handleIntent)\n\n return () => stopListening(stopRef)\n }","shouldRenderRef.current","useCallback(\n (node: HTMLElement) => {\n if (!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","_fallbackPlacements","_floatingBoundary","paddingProp","forwardedRef","_referenceBoundary","_zOffsetProp","...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}","autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n })","flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n })","floatingBoundary || undefined","offset({mainAxis: DEFAULT_POPOVER_DISTANCE})","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 })","constrainSize ? maxWidth : undefined","shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n })","arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n })","hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n })","referenceBoundary || undefined","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 ])","_c","childRef","_Fragment","size","\"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 = Math.max(0, maxWidth - margins[1] - margins[3])\n const availableHeight = Math.max(0, 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 elements.floating.style.maxWidth = `${Math.min(availableWidth, options.maxWidth ?? Infinity)}px`\n\n elements.floating.style.maxHeight = `${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, handleIntent: () => void): () => void {\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 */\nfunction useChildIntent(\n shouldRender: boolean,\n handleIntent: () => void,\n): (node: HTMLElement) => () => 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) => {\n if (!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;CACzE4F,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/F,OAAK,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;IACrC,gBAAgB;IAChB;IACA,cAAc;GAChB,CAAC,GAEG,WAAW,UACX,YAAY,UAEV,YAAY,SAAS,OACrB,YAAY,SAAS;GAiB3B,AAfI,UAAU,SAAS,KAAK,MAC1B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MANZ,KAAAS,OAAK;IACH,iBAAiBZ;IACjB;IACA;IACA;IAEA,UAAUG;IACV,SAAA;GACF,CAAC,GANC,EAAA,MAAA,eACA,EAAA,MAAA,SACA,EAAA,MAAA,qBAHiBH,EAAAA,MAAAA,IAKPG,EAAAA,MAAAA,I,0BAPd,IAAI,KACFD,EASF;EACF;EAGA,IAAI,iBAAiB;GAGL,IAAA,KAAA,oBAAoB,KAAA,GADhCE;GADF,AAGI,EAAA,QAAA,gBAAA,EAAA,QADUJ,MADZ,KAAA,MAAM;IACJ,UAAUA;IACV;IACA,SAAA;GACF,CAAC,GAFC,EAAA,MAAA,cADUA,EAAAA,MAAAA,I,0BAFd,IAAI,KACFI,EAKF;EACF;EAGA,IAAI,WAAW;GAEXC,IAAAA;GADF,AAEa,EAAA,QAAA,W,cADX,KAAA,MAAM;IACJ,SAAS;IACT,SAAA;GACF,CAAC,GAFU,EAAA,MAAA,U,aAFb,IAAI,KACFA,EAIF;EACF;EAIA,AAAI,WACF,IAAI,KAAK,MAAM;EAKH,IAAA,KAAA,qBAAqB,KAAA,GADjCC;E,AACYC,EAAAA,QAAAA,K,cADZ,KAAA,KAAK;GACH,UAAUA;GACV,SAAA;GACA,UAAU;EACZ,CAAC,GAHWA,EAAAA,MAAAA,I,aAFd,IAAI,KACFD,EAKF,GAVI,EAAA,KAAA,SAXA,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,OAAOE;AA6FT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refractor-CC48DwHi.js","names":["language ? hasLanguage(language as any) : false","!(language && registered) && <code>{value}</code>","language && registered && <Refractor inline language={language} value={String(value)} />","<>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>","_c","_Fragment"],"sources":["../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";;;AAEA,SAAwB,cACtB,OAGA;
|
|
1
|
+
{"version":3,"file":"refractor-CC48DwHi.js","names":["language ? hasLanguage(language as any) : false","!(language && registered) && <code>{value}</code>","language && registered && <Refractor inline language={language} value={String(value)} />","<>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>","_c","_Fragment"],"sources":["../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";;;AAEA,SAAwB,cACtB,OAGA;C,eACM,EAAC,UAAU,cAAc,UAAS,OAClC,WAAW,OAAO,gBAAiB,WAAW,eAAe,KAAA,GAEhDA;C,iCAAW,KAAA,WAAA,YAAY,QAAe,IAAI,IAA1C,EAAA,KAAA,U;CAAnB,IAAM,aAAaA,IAIdC;CAAE,AAAA,EAAA,OAAA,YAAA,EAAA,OAAY,cAAA,EAAA,OAAsB,SAApC,KAAA,EAAE,YAAY,eAAe,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA,GAA9C,EAAA,KAAA,UAAY,EAAA,KAAA,YAAsB,EAAA,KAAA,O;CAEpCC,IAAAA;CAAY,AAAA,EAAA,OAAA,YAAA,EAAA,OAAA,cAAA,EAAA,OAAkE,SAA9E,KAAA,YAAY,cAAc,oBAAC,WAAD;EAAW,QAAA;EAAiB;EAAU,OAAO,OAAO,KAAK;CAAI,CAAA,GAAvF,EAAA,KAAA,UAAY,EAAA,KAAA,YAAkE,EAAA,KAAA,O;CAHjFC,IAAAA;CADF,OAEKF,EAAAA,QAAAA,MAAAA,EAAAA,QAEAC,MAHH,KAAA,qBAAAG,UAAA,EAAA,UAAA,CACGJ,IAEAC,EACD,EAAA,CAAA,GAHCD,EAAAA,MAAAA,IAEAC,EAAAA,MAAAA,I,0BAHHC;AAMJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-DyrC2YfU.js","names":["<span className={spanWithTextOverflow}>{props.children}</span>","children","_c","accent = false","muted = false","size = 2","<SpanWithTextOverflow>{children}</SpanWithTextOverflow>","_getArrayProp(align)","_getArrayProp(size)","<span>{children}</span>","<StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>","_c","_getArrayProp(gap)","<StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />","typeof as === 'string' ? as : undefined","_c","\"gridTemplateColumns\"","\"gridAutoRows\""],"sources":["../src/core/styles/font/fontColorStyle.ts","../src/core/styles/font/textAlignStyle.ts","../src/core/utils/spanWithTextOverflow.css.ts","../src/core/utils/spanWithTextOverflow.tsx","../src/core/primitives/text/styles.ts","../src/core/primitives/text/text.tsx","../src/core/primitives/stack/styles.ts","../src/core/primitives/stack/stack.tsx"],"sourcesContent":["import {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function fontColorStyle(props: {\n $accent?: boolean\n $muted?: boolean\n}): CSSObject | undefined {\n if (props.$muted) return {color: 'var(--card-muted-fg-color)'}\n if (props.$accent) return {color: 'var(--card-accent-fg-color)'}\n return undefined\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveTextAlignStyleProps} from './types'\n\n/**\n * Get responsive text align styles.\n * @internal\n */\nexport function responsiveTextAlignStyle(\n props: ResponsiveTextAlignStyleProps & ThemeProps,\n): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$align, (textAlign) => {\n return {textAlign}\n })\n}\n","import {css, firstThatWorks} from '#styled-system/css'\n\nexport const spanWithTextOverflow = css({\n display: 'block',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: firstThatWorks('clip', 'hidden'),\n})\n","import {spanWithTextOverflow} from './spanWithTextOverflow.css'\n\n/** @internal */\nexport function SpanWithTextOverflow(props: {children?: React.ReactNode}): React.JSX.Element {\n return <span className={spanWithTextOverflow}>{props.children}</span>\n}\n","import {css} from 'styled-components'\n\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_fontBase} from '../../styles/font/responsiveFont'\nimport {ThemeProps} from '../../styles/types'\n\nexport function textBaseStyle(props: ThemeProps): ReturnType<typeof css> {\n const {font} = getTheme_v2(props.theme)\n\n return css`\n ${_fontBase('text', props)}\n\n color: var(--card-fg-color);\n\n & code {\n font-family: ${font.code.family};\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ${font.text.weights.bold};\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n /* ...and aren't squeezed by resets that set max-width: 100% */\n max-width: unset;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n `\n}\n","import {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {fontColorStyle} from '../../styles/font/fontColorStyle'\nimport {_fontWeight, _responsiveFontSize} from '../../styles/font/responsiveFont'\nimport {responsiveTextAlignStyle} from '../../styles/font/textAlignStyle'\nimport {ResponsiveFontSizeStyleProps, ResponsiveFontStyleProps} from '../../styles/font/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {TextAlign} from '../../types/text'\nimport {SpanWithTextOverflow} from '../../utils/spanWithTextOverflow'\nimport {textBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface TextOwnProps {\n accent?: boolean\n align?: TextAlign | TextAlign[]\n /** When `true` the text color will be muted. */\n muted?: boolean\n size?: number | number[]\n /**\n * Controls how overflowing text is treated.\n * Use `textOverflow=\"ellipsis\"` to render text as a single line which is concatenated with a `…` symbol.\n * @beta\n */\n textOverflow?: 'ellipsis'\n weight?: ThemeFontWeightKey\n}\n\n/**\n * @public\n */\nexport type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>\n\nconst TextBase = styled.div(textBaseStyle)\n\nconst TextSize = styled(TextBase)<ResponsiveFontSizeStyleProps>((props) =>\n _responsiveFontSize('text', props),\n)\n\nconst StyledText = styled(TextSize)<ResponsiveFontStyleProps>(\n (props) => _fontWeight('text', props),\n responsiveTextAlignStyle,\n fontColorStyle,\n)\n\nfunction TextComponent(\n props: TextOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'size'>,\n) {\n const {\n accent = false,\n align,\n children: childrenProp,\n muted = false,\n ref,\n size = 2,\n textOverflow,\n weight,\n ...restProps\n } = props\n\n let children = childrenProp\n\n if (textOverflow === 'ellipsis') {\n children = <SpanWithTextOverflow>{children}</SpanWithTextOverflow>\n }\n\n return (\n <StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>\n )\n}\n\n/**\n * The `Text` component is an agile, themed typographic element.\n *\n * @public\n */\nexport const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element =\n TextComponent\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../../styles/helpers'\nimport {ThemeProps} from '../../styles/types'\n\nexport interface ResponsiveStackSpaceStyleProps {\n $space: number[]\n}\n\nconst BASE_STYLE: CSSObject = {\n '&&:not([hidden])': {\n display: 'grid',\n },\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n 'gridTemplateColumns': 'minmax(0, 1fr)',\n 'gridAutoRows': 'min-content',\n}\n\nexport function stackBaseStyle(): CSSObject {\n return BASE_STYLE\n}\n\nexport function responsiveStackSpaceStyle(\n props: ResponsiveStackSpaceStyleProps & ThemeProps,\n): CSSObject[] {\n const {media, space} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$space, (spaceIndex) => ({\n // oxlint-disable-next-line no-deprecated\n gridGap: rem(space[spaceIndex]),\n }))\n}\n","import {styled} from 'styled-components'\n\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {responsiveStackSpaceStyle, ResponsiveStackSpaceStyleProps, stackBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface StackOwnProps extends BoxOwnProps {\n gap?: number | number[]\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n}\n\n/**\n * @public\n */\nexport type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>\n\nconst StyledStack = styled(Box)<ResponsiveStackSpaceStyleProps>(\n stackBaseStyle,\n responsiveStackSpaceStyle,\n)\n\nfunction StackComponent(\n props: StackOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as'>,\n) {\n const {as, gap, ref, ...restProps} = props\n\n return (\n <StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />\n )\n}\n\n/**\n * The `Stack` component is used to place elements on top of each other.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Stack = StackComponent as unknown as <E extends ElementType = 'div'>(\n props: StackProps<E>,\n) => React.JSX.Element\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,eAAe,OAGL;CACxB,IAAI,MAAM,QAAQ,OAAO,EAAC,OAAO,6BAA4B;CAC7D,IAAI,MAAM,SAAS,OAAO,EAAC,OAAO,8BAA6B;AAEjE;;;;;ACFA,SAAgB,yBACd,OACa;CACb,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,SAAS,eAChC,EAAC,UAAS,EAClB;AACH;;AEfA,SAAgB,qBAAqB,OAAwD;eACpFA;CAAP,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AA;CAJxBC,IAAAA;CADF,OAMiB,EAAA,OAAA,MAAA,EAAA,OACR,OAAA,EAAA,OAHD,aAAA,EAAA,QAFKC,MAAAA,EAAAA,QAGDF,MAJV,KAAA,oBAAC,aAAD;EACE,WAASE;EACT,WAAQ;EACR,GAAI;EACJ,QAAQF;EACR,aAAa;EACR;CACN,CAAA,GAFc,EAAA,KAAA,IACR,EAAA,KAAA,KAHD,EAAA,KAAA,WAFKE,EAAAA,MAAAA,IAGDF,EAAAA,MAAAA,8BAJVC;AASJ;;;;;;AAQA,MAAa,QAAQ"}
|
|
1
|
+
{"version":3,"file":"stack-DyrC2YfU.js","names":["<span className={spanWithTextOverflow}>{props.children}</span>","children","_c","accent = false","muted = false","size = 2","<SpanWithTextOverflow>{children}</SpanWithTextOverflow>","_getArrayProp(align)","_getArrayProp(size)","<span>{children}</span>","<StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>","_c","_getArrayProp(gap)","<StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />","typeof as === 'string' ? as : undefined","_c","\"gridTemplateColumns\"","\"gridAutoRows\""],"sources":["../src/core/styles/font/fontColorStyle.ts","../src/core/styles/font/textAlignStyle.ts","../src/core/utils/spanWithTextOverflow.css.ts","../src/core/utils/spanWithTextOverflow.tsx","../src/core/primitives/text/styles.ts","../src/core/primitives/text/text.tsx","../src/core/primitives/stack/styles.ts","../src/core/primitives/stack/stack.tsx"],"sourcesContent":["import {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function fontColorStyle(props: {\n $accent?: boolean\n $muted?: boolean\n}): CSSObject | undefined {\n if (props.$muted) return {color: 'var(--card-muted-fg-color)'}\n if (props.$accent) return {color: 'var(--card-accent-fg-color)'}\n return undefined\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveTextAlignStyleProps} from './types'\n\n/**\n * Get responsive text align styles.\n * @internal\n */\nexport function responsiveTextAlignStyle(\n props: ResponsiveTextAlignStyleProps & ThemeProps,\n): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$align, (textAlign) => {\n return {textAlign}\n })\n}\n","import {css, firstThatWorks} from '#styled-system/css'\n\nexport const spanWithTextOverflow = css({\n display: 'block',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: firstThatWorks('clip', 'hidden'),\n})\n","import {spanWithTextOverflow} from './spanWithTextOverflow.css'\n\n/** @internal */\nexport function SpanWithTextOverflow(props: {children?: React.ReactNode}): React.JSX.Element {\n return <span className={spanWithTextOverflow}>{props.children}</span>\n}\n","import {css} from 'styled-components'\n\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_fontBase} from '../../styles/font/responsiveFont'\nimport {ThemeProps} from '../../styles/types'\n\nexport function textBaseStyle(props: ThemeProps): ReturnType<typeof css> {\n const {font} = getTheme_v2(props.theme)\n\n return css`\n ${_fontBase('text', props)}\n\n color: var(--card-fg-color);\n\n & code {\n font-family: ${font.code.family};\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ${font.text.weights.bold};\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n /* ...and aren't squeezed by resets that set max-width: 100% */\n max-width: unset;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n `\n}\n","import {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {fontColorStyle} from '../../styles/font/fontColorStyle'\nimport {_fontWeight, _responsiveFontSize} from '../../styles/font/responsiveFont'\nimport {responsiveTextAlignStyle} from '../../styles/font/textAlignStyle'\nimport {ResponsiveFontSizeStyleProps, ResponsiveFontStyleProps} from '../../styles/font/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {TextAlign} from '../../types/text'\nimport {SpanWithTextOverflow} from '../../utils/spanWithTextOverflow'\nimport {textBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface TextOwnProps {\n accent?: boolean\n align?: TextAlign | TextAlign[]\n /** When `true` the text color will be muted. */\n muted?: boolean\n size?: number | number[]\n /**\n * Controls how overflowing text is treated.\n * Use `textOverflow=\"ellipsis\"` to render text as a single line which is concatenated with a `…` symbol.\n * @beta\n */\n textOverflow?: 'ellipsis'\n weight?: ThemeFontWeightKey\n}\n\n/**\n * @public\n */\nexport type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>\n\nconst TextBase = styled.div(textBaseStyle)\n\nconst TextSize = styled(TextBase)<ResponsiveFontSizeStyleProps>((props) =>\n _responsiveFontSize('text', props),\n)\n\nconst StyledText = styled(TextSize)<ResponsiveFontStyleProps>(\n (props) => _fontWeight('text', props),\n responsiveTextAlignStyle,\n fontColorStyle,\n)\n\nfunction TextComponent(\n props: TextOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'size'>,\n) {\n const {\n accent = false,\n align,\n children: childrenProp,\n muted = false,\n ref,\n size = 2,\n textOverflow,\n weight,\n ...restProps\n } = props\n\n let children = childrenProp\n\n if (textOverflow === 'ellipsis') {\n children = <SpanWithTextOverflow>{children}</SpanWithTextOverflow>\n }\n\n return (\n <StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>\n )\n}\n\n/**\n * The `Text` component is an agile, themed typographic element.\n *\n * @public\n */\nexport const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element =\n TextComponent\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../../styles/helpers'\nimport {ThemeProps} from '../../styles/types'\n\nexport interface ResponsiveStackSpaceStyleProps {\n $space: number[]\n}\n\nconst BASE_STYLE: CSSObject = {\n '&&:not([hidden])': {\n display: 'grid',\n },\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n 'gridTemplateColumns': 'minmax(0, 1fr)',\n 'gridAutoRows': 'min-content',\n}\n\nexport function stackBaseStyle(): CSSObject {\n return BASE_STYLE\n}\n\nexport function responsiveStackSpaceStyle(\n props: ResponsiveStackSpaceStyleProps & ThemeProps,\n): CSSObject[] {\n const {media, space} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$space, (spaceIndex) => ({\n // oxlint-disable-next-line no-deprecated\n gridGap: rem(space[spaceIndex]),\n }))\n}\n","import {styled} from 'styled-components'\n\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {responsiveStackSpaceStyle, ResponsiveStackSpaceStyleProps, stackBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface StackOwnProps extends BoxOwnProps {\n gap?: number | number[]\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n}\n\n/**\n * @public\n */\nexport type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>\n\nconst StyledStack = styled(Box)<ResponsiveStackSpaceStyleProps>(\n stackBaseStyle,\n responsiveStackSpaceStyle,\n)\n\nfunction StackComponent(\n props: StackOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as'>,\n) {\n const {as, gap, ref, ...restProps} = props\n\n return (\n <StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />\n )\n}\n\n/**\n * The `Stack` component is used to place elements on top of each other.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Stack = StackComponent as unknown as <E extends ElementType = 'div'>(\n props: StackProps<E>,\n) => React.JSX.Element\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,eAAe,OAGL;CACxB,IAAI,MAAM,QAAQ,OAAO,EAAC,OAAO,6BAA4B;CAC7D,IAAI,MAAM,SAAS,OAAO,EAAC,OAAO,8BAA6B;AAEjE;;;;;ACFA,SAAgB,yBACd,OACa;CACb,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,SAAS,eAChC,EAAC,UAAS,EAClB;AACH;;AEfA,SAAgB,qBAAqB,OAAwD;C,cACpFA;CAAP,OAAqDC,EAAAA,OAAAA,MAAAA,W,aAA9C,KAAA,oBAAC,QAAD;EAAM,WAAW;EAAuB,UAAA,MAAM;CAAe,CAAA,GAAfA,EAAAA,KAAAA,MAAAA,U,YAA9CD;AACT;ACCA,SAAgB,cAAc,OAA2C;CACvE,IAAM,EAAC,SAAQ,YAAY,MAAM,KAAK;CAEtC,OAAO,GAAG,GACN,UAAU,QAAQ,KAAK,EAAE,iDAKV,KAAK,KAAK,OAAO,4YA8BjB,KAAK,KAAK,QAAQ,KAAK;AAoB5C;ACvBA,MAAM,aAAa,uBAJF,uBAFA,uBAAO,IAAA,WAAA;;;AAAI,CAAA,CAAA,CAAA,aAEJ,CAAQ,CAAC,CAA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