@sanity/ui 4.4.1 → 4.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/{arrow-A3jQ7LS0.js → arrow-MMVAW3Ew.js} +2 -2
  2. package/dist/{arrow-A3jQ7LS0.js.map → arrow-MMVAW3Ew.js.map} +1 -1
  3. package/dist/autocomplete.d.ts +5 -1
  4. package/dist/autocomplete.d.ts.map +1 -1
  5. package/dist/autocomplete.js +96 -99
  6. package/dist/autocomplete.js.map +1 -1
  7. package/dist/breadcrumbs.js +4 -4
  8. package/dist/{button-dhq4ViVg.js → button-Btcy6IOp.js} +48 -46
  9. package/dist/button-Btcy6IOp.js.map +1 -0
  10. package/dist/button-dnqMFkWg.d.ts.map +1 -1
  11. package/dist/code.d.ts.map +1 -1
  12. package/dist/code.js +12 -6
  13. package/dist/code.js.map +1 -1
  14. package/dist/{flex-BqQXaSxS.js → flex-ohP2jG9d.js} +2 -2
  15. package/dist/{flex-BqQXaSxS.js.map → flex-ohP2jG9d.js.map} +1 -1
  16. package/dist/{getElementRef-Jw7gY0eV.js → getElementRef-BLVMlHTn.js} +78 -3
  17. package/dist/getElementRef-BLVMlHTn.js.map +1 -0
  18. package/dist/{grid-Bpb2bIJ6.js → grid-D-gOpN8z.js} +2 -2
  19. package/dist/{grid-Bpb2bIJ6.js.map → grid-D-gOpN8z.js.map} +1 -1
  20. package/dist/{hotkeys-sG9yO97K.js → hotkeys-BPJuQ-gO.js} +10 -11
  21. package/dist/{hotkeys-sG9yO97K.js.map → hotkeys-BPJuQ-gO.js.map} +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +133 -81
  24. package/dist/index.js.map +1 -1
  25. package/dist/{layer-AWzYcY_j.js → layer-DP8gT1ex.js} +2 -2
  26. package/dist/{layer-AWzYcY_j.js.map → layer-DP8gT1ex.js.map} +1 -1
  27. package/dist/menu.d.ts +5 -0
  28. package/dist/menu.d.ts.map +1 -1
  29. package/dist/menu.js +184 -153
  30. package/dist/menu.js.map +1 -1
  31. package/dist/{popover-B0kvwaep.js → popover-BVbv1K3z.js} +143 -146
  32. package/dist/popover-BVbv1K3z.js.map +1 -0
  33. package/dist/popover-HDVgZg5e.d.ts.map +1 -1
  34. package/dist/popover.js +1 -1
  35. package/dist/responsiveFont-Cyvxxz-G.js +81 -0
  36. package/dist/responsiveFont-Cyvxxz-G.js.map +1 -0
  37. package/dist/{stack-Cv-WM-7p.js → stack-CPdFknrG.js} +22 -16
  38. package/dist/stack-CPdFknrG.js.map +1 -0
  39. package/dist/{textInput-Ddxi4mkC.js → textInput-nVtAHeX8.js} +38 -17
  40. package/dist/textInput-nVtAHeX8.js.map +1 -0
  41. package/dist/toast.js +5 -5
  42. package/dist/tooltip.js +72 -84
  43. package/dist/tooltip.js.map +1 -1
  44. package/dist/{useLayer-B0i19TTM.js → useLayer-D_TnC6On.js} +43 -28
  45. package/dist/useLayer-D_TnC6On.js.map +1 -0
  46. package/package.json +1 -1
  47. package/dist/button-dhq4ViVg.js.map +0 -1
  48. package/dist/codeFontStyle-B-bhR3hF.js +0 -11
  49. package/dist/codeFontStyle-B-bhR3hF.js.map +0 -1
  50. package/dist/getElementRef-Jw7gY0eV.js.map +0 -1
  51. package/dist/popover-B0kvwaep.js.map +0 -1
  52. package/dist/responsiveFont-B08q0jwm.js +0 -57
  53. package/dist/responsiveFont-B08q0jwm.js.map +0 -1
  54. package/dist/stack-Cv-WM-7p.js.map +0 -1
  55. package/dist/textInput-Ddxi4mkC.js.map +0 -1
  56. package/dist/useLayer-B0i19TTM.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-B0kvwaep.js","names":["size","getTransformOrigin(originX, originY)","{\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n width,\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n }","animate ? 'transform' : undefined","useMemo(\n () => ({\n left: x,\n position: strategy,\n top: y,\n transformOrigin: getTransformOrigin(originX, originY),\n width,\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n }),\n [animate, originX, originY, strategy, style, width, x, y, zIndex],\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","<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 widthRef.current = width\n }","[width]","calcMaxWidth({boundaryWidth, currentWidth: width})","() => {\n maxWidthRef.current = maxWidth\n }","[maxWidth]","() => {\n const floatingElement = ref.current\n\n if (!open || !floatingElement) return\n\n const referenceWidth = referenceWidthRef.current\n\n if (matchReferenceWidth) {\n if (referenceWidth !== undefined) {\n floatingElement.style.width = `${referenceWidth}px`\n }\n } else if (width !== undefined) {\n floatingElement.style.width = `${width}px`\n }\n\n if (typeof maxWidth === 'number') {\n floatingElement.style.maxWidth = `${maxWidth}px`\n }\n }","[width, matchReferenceWidth, maxWidth, open]","referenceWidth","{\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\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 }","() => {\n if (!intentReference) return undefined\n\n const controller = new AbortController()\n const {signal} = controller\n // In a transition, so that it never holds up an open that follows right away (a click), and\n // so that React pre-renders the hidden popover in the background\n const handleIntent = () => startTransition(() => setHasRendered(true))\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 intentReference.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} = intentReference.ownerDocument\n\n if (activeElement && intentReference.contains(activeElement)) handleIntent()\n\n return () => controller.abort()\n }","[intentReference]","(arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }","useCallback((arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }, [])","(node: HTMLDivElement | null) => {\n ref.current = node\n refs.setFloating(node)\n }","useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n refs.setFloating(node)\n },\n [refs],\n )","childProp ? getElementRef(childProp) : null","() => refs.reference.current","current","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: refs.setReference})\n }, [childProp, referenceElement, refs.setReference])","cloneElement(childProp, {ref: refs.setReference})","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 hidden={referenceHidden}\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={matchReferenceWidth ? referenceWidth : width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>","matchReferenceWidth ? referenceWidth : width","<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 hidden={referenceHidden}\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={matchReferenceWidth ? referenceWidth : 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 maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\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 maxWidthRef: React.RefObject<number | undefined>\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n referenceWidthRef: React.RefObject<number | undefined>\n rootBoundary: RootBoundary\n setReferenceWidth: (referenceWidth: number) => void\n widthRef: React.RefObject<number | undefined>\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 maxWidthRef,\n padding: DEFAULT_POPOVER_PADDING,\n referenceWidthRef,\n setReferenceWidth,\n widthRef,\n })","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 maxWidthRef,\n padding: DEFAULT_POPOVER_PADDING,\n referenceWidthRef,\n setReferenceWidth,\n widthRef,\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 maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\n ])","_c","_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 maxWidthRef: React.RefObject<number | undefined>\n padding?: number\n referenceWidthRef: React.RefObject<number | undefined>\n setReferenceWidth: (referenceWidth: number) => void\n widthRef: React.RefObject<number | undefined>\n}): Middleware {\n const {\n constrainSize,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n padding = 0,\n referenceWidthRef,\n setReferenceWidth,\n widthRef,\n } = options\n\n return {\n name: '@sanity/ui/size',\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\n const availableWidth = maxWidth - margins[1] - margins[3]\n const availableHeight = maxHeight - margins[0] - margins[2]\n const referenceWidth = reference.width - margins[1] - margins[3]\n referenceWidthRef.current = referenceWidth\n setReferenceWidth(referenceWidth)\n\n if (matchReferenceWidth) {\n elements.floating.style.width = `${referenceWidth}px`\n } else if (widthRef.current !== undefined) {\n elements.floating.style.width = `${widthRef.current}px`\n }\n\n if (constrainSize) {\n elements.floating.style.maxWidth = `${Math.min(availableWidth, maxWidthRef.current ?? 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 if (currentWidth === undefined && boundaryWidth === undefined) {\n return undefined\n }\n\n return Math.min(\n currentWidth ?? Infinity,\n (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2,\n )\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 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 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 width,\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n }),\n [animate, originX, originY, strategy, style, width, x, y, zIndex],\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 {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {usePrefersReducedMotion} from '../../hooks/usePrefersReducedMotion'\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\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 const widthRef = useRef(width)\n\n useEffect(() => {\n widthRef.current = width\n }, [width])\n\n // Update max width when\n // - boundary width changes\n // - `width` property changes\n const maxWidth = calcMaxWidth({boundaryWidth, currentWidth: width})\n const maxWidthRef = useRef(maxWidth)\n\n useEffect(() => {\n maxWidthRef.current = maxWidth\n }, [maxWidth])\n\n // Keep track of reference element width (see `size` middleware below)\n const referenceWidthRef = useRef<number>(undefined)\n\n // Force apply width & max width to floating element\n useEffect(() => {\n const floatingElement = ref.current\n\n if (!open || !floatingElement) return\n\n const referenceWidth = referenceWidthRef.current\n\n if (matchReferenceWidth) {\n if (referenceWidth !== undefined) {\n floatingElement.style.width = `${referenceWidth}px`\n }\n } else if (width !== undefined) {\n floatingElement.style.width = `${width}px`\n }\n\n if (typeof maxWidth === 'number') {\n floatingElement.style.maxWidth = `${maxWidth}px`\n }\n }, [width, matchReferenceWidth, maxWidth, open])\n\n const [referenceWidth, setReferenceWidth] = useState<number | undefined>(undefined)\n const middleware = useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\n })\n\n const {x, y, elements, middlewareData, placement, refs, strategy, update} =\n 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\n const intentReference = shouldRender || disabled ? null : elements.reference\n\n useEffect(() => {\n if (!intentReference) return undefined\n\n const controller = new AbortController()\n const {signal} = controller\n // In a transition, so that it never holds up an open that follows right away (a click), and\n // so that React pre-renders the hidden popover in the background\n const handleIntent = () => startTransition(() => setHasRendered(true))\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 intentReference.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} = intentReference.ownerDocument\n\n if (activeElement && intentReference.contains(activeElement)) handleIntent()\n\n return () => controller.abort()\n }, [intentReference])\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 const setFloating = useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n refs.setFloating(node)\n },\n [refs],\n )\n\n // If there's a child then we need to set the reference element to the cloned child ref\n // and if child changes we make sure to update or remove the reference element.\n useImperativeHandle(childProp ? getElementRef(childProp) : null, () => refs.reference.current)\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: refs.setReference})\n }, [childProp, referenceElement, refs.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 hidden={referenceHidden}\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={matchReferenceWidth ? referenceWidth : 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 maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\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 maxWidthRef: React.RefObject<number | undefined>\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n referenceWidthRef: React.RefObject<number | undefined>\n rootBoundary: RootBoundary\n setReferenceWidth: (referenceWidth: number) => void\n widthRef: React.RefObject<number | undefined>\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 maxWidthRef,\n padding: DEFAULT_POPOVER_PADDING,\n referenceWidthRef,\n setReferenceWidth,\n widthRef,\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 maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\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,SAUN;CACb,IAAM,EACJ,eACA,SACA,qBACA,aACA,UAAU,GACV,mBACA,mBACA,aACE;CAEJ,OAAO;EACL,MAAM;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X,EAAA,KAAA,eAI8C,EAAA,KAAA,oBAMhC,EAAA,KAAA,kBAkBZ,EAAA,KAAA,SALe,EAAA,KAAA,qBAOf,EAAA,KAAA,aA1BsB,EAAA,KAAA,eAHtB,EAAA,MAAA,mBADe,EAAA,MAAA,iBAoEP,EAAA,MAAA,mBApCR,EAAA,MAAA,mBAnBE,EAAA,MAAA,cAoBF,EAAA,MAAA,mBACA,EAAA,MAAA;;CAtCR,OAAOE;AAkGT"}
@@ -1,57 +0,0 @@
1
- import { a as _ruleSet, i as _responsive, o as rem } from "./helpers-XThPpWje.js";
2
- import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
3
- /**
4
- * A utility function getting responsive font styles.
5
- * @internal
6
- */
7
- function responsiveFont(fontKey, props) {
8
- let { $size, $weight } = props, { font, media } = getTheme_v2(props.theme), { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
9
- position: "relative",
10
- fontFamily: family,
11
- fontWeight: `${fontWeight}`,
12
- padding: "1px 0",
13
- margin: 0,
14
- "&:before": {
15
- content: "\"\"",
16
- display: "block",
17
- height: 0
18
- },
19
- "&:after": {
20
- content: "\"\"",
21
- display: "block",
22
- height: 0
23
- },
24
- "& > code, & > span": { display: "block" },
25
- "&:not([hidden])": { display: "block" }
26
- };
27
- if (!$size) return responsiveFont.warned ||= (console.warn("No size specified for responsive font", {
28
- fontKey,
29
- $size,
30
- props,
31
- base
32
- }), !0), _ruleSet(base);
33
- let resp = _responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize));
34
- return _ruleSet(base, resp);
35
- }
36
- function fontSize(size) {
37
- let { ascenderHeight, descenderHeight, fontSize, iconSize, letterSpacing, lineHeight } = size, negHeight = ascenderHeight + descenderHeight, capHeight = lineHeight - negHeight, iconOffset = (capHeight - iconSize) / 2, customIconSize = Math.floor(fontSize * 1.125 / 2) * 2 + 1, customIconOffset = (capHeight - customIconSize) / 2;
38
- return {
39
- fontSize: rem(fontSize),
40
- lineHeight: `calc(${lineHeight} / ${fontSize})`,
41
- letterSpacing: rem(letterSpacing),
42
- transform: `translateY(${rem(descenderHeight)})`,
43
- "&:before": { marginTop: `calc(${rem(0 - negHeight)} - 1px)` },
44
- "&:after": { marginBottom: "-1px" },
45
- "& svg:not([data-sanity-icon])": {
46
- fontSize: `calc(${customIconSize} / 16 * 1rem)`,
47
- margin: rem(customIconOffset)
48
- },
49
- "& [data-sanity-icon]": {
50
- fontSize: `calc(${iconSize} / 16 * 1rem)`,
51
- margin: rem(iconOffset)
52
- }
53
- };
54
- }
55
- export { responsiveFont as t };
56
-
57
- //# sourceMappingURL=responsiveFont-B08q0jwm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responsiveFont-B08q0jwm.js","names":["\"position\"","\"fontFamily\"","\"fontWeight\"","\"padding\"","\"margin\"","\"fontSize\"","\"lineHeight\"","\"letterSpacing\"","\"transform\""],"sources":["../src/core/styles/font/responsiveFont.ts"],"sourcesContent":["import {CSSObject} from '../../../theme/system/css'\nimport {ThemeFontKey, ThemeFontSize} from '../../../theme/system/font'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, _ruleSet, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {FontWeightStyleProps, ResponsiveFontSizeStyleProps} from './types'\n\n/**\n * A utility function getting responsive font styles.\n * @internal\n */\nexport function responsiveFont(\n fontKey: ThemeFontKey,\n props: FontWeightStyleProps & ResponsiveFontSizeStyleProps & ThemeProps,\n): CSSObject[] {\n const {$size, $weight} = props\n const {font, media} = getTheme_v2(props.theme)\n const {family, sizes, weights} = font[fontKey]\n const fontWeight = ($weight && weights[$weight]) || weights.regular\n\n // @todo: make this configurable\n const defaultSize = sizes[2]\n\n const base: CSSObject = {\n 'position': 'relative',\n 'fontFamily': family,\n 'fontWeight': `${fontWeight}`,\n 'padding': '1px 0',\n 'margin': 0,\n\n '&:before': {\n content: '\"\"',\n display: 'block',\n height: 0,\n },\n\n '&:after': {\n content: '\"\"',\n display: 'block',\n height: 0,\n },\n\n '& > code, & > span': {\n display: 'block',\n },\n\n '&:not([hidden])': {\n display: 'block',\n },\n }\n\n // @TODO fix the real condition that is causing $size to be undefined sometimes\n if (!$size) {\n // @ts-expect-error: `warned` isn't typed, the underlying issue should be solved rather than typing it\n if (!responsiveFont.warned) {\n console.warn('No size specified for responsive font', {fontKey, $size, props, base})\n // @ts-expect-error: `warned` isn't typed, the underlying issue should be solved rather than typing it\n responsiveFont.warned = true\n }\n\n return _ruleSet(base)\n }\n\n const resp = _responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize))\n\n return _ruleSet(base, resp)\n}\n\nfunction fontSize(size: ThemeFontSize): CSSObject {\n const {ascenderHeight, descenderHeight, fontSize, iconSize, letterSpacing, lineHeight} = size\n const negHeight = ascenderHeight + descenderHeight\n const capHeight = lineHeight - negHeight\n const iconOffset = (capHeight - iconSize) / 2\n const customIconSize = Math.floor((fontSize * 1.125) / 2) * 2 + 1\n const customIconOffset = (capHeight - customIconSize) / 2\n\n return {\n 'fontSize': rem(fontSize),\n 'lineHeight': `calc(${lineHeight} / ${fontSize})`,\n 'letterSpacing': rem(letterSpacing),\n 'transform': `translateY(${rem(descenderHeight)})`,\n\n '&:before': {\n marginTop: `calc(${rem(0 - negHeight)} - 1px)`,\n },\n\n '&:after': {\n marginBottom: '-1px',\n },\n\n '& svg:not([data-sanity-icon])': {\n fontSize: `calc(${customIconSize} / 16 * 1rem)`,\n margin: rem(customIconOffset),\n },\n\n '& [data-sanity-icon]': {\n fontSize: `calc(${iconSize} / 16 * 1rem)`,\n margin: rem(iconOffset),\n },\n }\n}\n"],"mappings":";;;;;;AAWA,SAAgB,eACd,SACA,OACa;CACb,IAAM,EAAC,OAAO,YAAW,OACnB,EAAC,MAAM,UAAS,YAAY,MAAM,KAAK,GACvC,EAAC,QAAQ,OAAO,YAAW,KAAK,UAChC,aAAc,WAAW,QAAQ,YA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</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/textAlignStyle.ts","../src/core/styles/font/textFontStyle.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'\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 {CSSObject} from '../../../theme/system/css'\nimport {ThemeProps} from '../types'\nimport {responsiveFont} from './responsiveFont'\nimport {ResponsiveFontStyleProps} from './types'\n\n/**\n * Get responsive CSS for the `text` font style.\n * @internal\n */\nexport function responsiveTextFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[] {\n return responsiveFont('text', props)\n}\n","import {style} from '@vanilla-extract/css'\n\nexport const spanWithTextOverflow = style({\n display: 'block',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: ['hidden', 'clip'],\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 {ThemeProps} from '../../styles/types'\n\nexport function textBaseStyle(\n props: {$accent?: boolean; $muted?: boolean} & ThemeProps,\n): ReturnType<typeof css> {\n const {$accent, $muted} = props\n const {font} = getTheme_v2(props.theme)\n\n return css`\n color: var(--card-fg-color);\n\n ${\n $accent &&\n css`\n color: var(--card-accent-fg-color);\n `\n }\n\n ${\n $muted &&\n css`\n color: var(--card-muted-fg-color);\n `\n }\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 {responsiveTextAlignStyle} from '../../styles/font/textAlignStyle'\nimport {responsiveTextFont} from '../../styles/font/textFontStyle'\nimport {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 StyledText = styled.div<ResponsiveFontStyleProps>(\n responsiveTextFont,\n responsiveTextAlignStyle,\n textBaseStyle,\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":";;;;;;;;;;;AAUA,SAAgB,yBACd,OACa;CACb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KAAA,GAG/BL;CAAc,AAAA,EAAA,OAAA,mBAAd,KAAA,cAAc,GAAG,GAAH,EAAA,KAAA;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 +0,0 @@
1
- {"version":3,"file":"textInput-Ddxi4mkC.js","names":["() => {\n ref.current?.setCustomValidity(customValidity || '')\n }","[customValidity, ref]","ref.current?.setCustomValidity","_c","border = true","disabled = false","fontSizeProp = 2","gap = 3","paddingProp = 3","radiusProp = 2","type = 'text'","_getArrayProp(fontSizeProp)","_getArrayProp(paddingProp)","_getArrayProp(radiusProp)","_getArrayProp(gap)","() => ref.current","useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n }, [])","(event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (onClear) onClear()\n\n // Focus the input, in case focus has been lost when clicking the clear button\n ref.current?.focus()\n }","useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (onClear) onClear()\n\n // Focus the input, in case focus has been lost when clicking the clear button\n ref.current?.focus()\n },\n [onClear, ref],\n )","prefix && (\n <Prefix borderTop borderLeft borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{prefix}</span>\n </Prefix>\n )","useMemo(\n () =>\n prefix && (\n <Prefix borderTop borderLeft borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{prefix}</span>\n </Prefix>\n ),\n [prefix, radius],\n )","IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )","!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\n )","<Presentation\n $hasPrefix={$hasPrefix}\n $unstableDisableFocusRing={__unstable_disableFocusRing}\n $hasSuffix={$hasSuffix}\n $radius={radius}\n $scheme={rootTheme.scheme}\n $tone={rootTheme.tone}\n data-border={border ? '' : undefined}\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\n )}\n </Presentation>","scheme","tone","border ? '' : undefined","useMemo(\n () => (\n <Presentation\n $hasPrefix={$hasPrefix}\n $unstableDisableFocusRing={__unstable_disableFocusRing}\n $hasSuffix={$hasSuffix}\n $radius={radius}\n $scheme={rootTheme.scheme}\n $tone={rootTheme.tone}\n data-border={border ? '' : undefined}\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\n )}\n </Presentation>\n ),\n [\n __unstable_disableFocusRing,\n border,\n fontSize,\n IconComponent,\n IconRightComponent,\n padding,\n radius,\n rootTheme,\n $hasClearButton,\n $hasPrefix,\n $hasSuffix,\n ],\n )","padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 1\n if (v === 2) return 1\n\n return v - 2\n })","(v) => {\n if (v === 0) return 0\n if (v === 1) return 1\n if (v === 2) return 1\n\n return v - 2\n }","useMemo(\n () =>\n padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 1\n if (v === 2) return 1\n\n return v - 2\n }),\n [padding],\n )","padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 0\n if (v === 2) return 1\n\n return v - 1\n })","(v) => {\n if (v === 0) return 0\n if (v === 1) return 0\n if (v === 2) return 1\n\n return v - 1\n }","useMemo(\n () =>\n padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 0\n if (v === 2) return 1\n\n return v - 1\n }),\n [padding],\n )","!disabled &&\n !readOnly &&\n clearButton && (\n <RightCard\n forwardedAs=\"span\"\n padding={clearButtonBoxPadding}\n style={CLEAR_BUTTON_BOX_STYLE}\n tone={customValidity ? 'critical' : 'inherit'}\n >\n <Button\n aria-label=\"Clear\"\n data-qa=\"clear-button\"\n fontSize={fontSize}\n icon={CloseIcon}\n mode=\"bleed\"\n padding={clearButtonPadding}\n radius={radius}\n {...clearButtonProps}\n className={clsx(textInputClearButton, clearButtonProps.className)}\n onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n )","clearButtonProps.className","useMemo(\n () =>\n !disabled &&\n !readOnly &&\n clearButton && (\n <RightCard\n forwardedAs=\"span\"\n padding={clearButtonBoxPadding}\n style={CLEAR_BUTTON_BOX_STYLE}\n tone={customValidity ? 'critical' : 'inherit'}\n >\n <Button\n aria-label=\"Clear\"\n data-qa=\"clear-button\"\n fontSize={fontSize}\n icon={CloseIcon}\n mode=\"bleed\"\n padding={clearButtonPadding}\n radius={radius}\n {...clearButtonProps}\n className={clsx(textInputClearButton, clearButtonProps.className)}\n onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n ),\n [\n clearButton,\n clearButtonBoxPadding,\n clearButtonPadding,\n clearButtonProps,\n customValidity,\n disabled,\n fontSize,\n handleClearClick,\n handleClearMouseDown,\n radius,\n readOnly,\n ],\n )","suffix && (\n <Suffix borderTop borderRight borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{suffix}</span>\n </Suffix>\n )","useMemo(\n () =>\n suffix && (\n <Suffix borderTop borderRight borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{suffix}</span>\n </Suffix>\n ),\n [radius, suffix],\n )","<Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\n {...restProps}\n $fontSize={fontSize}\n $iconLeft={$hasIcon}\n $iconRight={$hasIconRight || $hasClearButton}\n $padding={padding}\n $scheme={rootTheme.scheme}\n $space={space}\n $tone={rootTheme.tone}\n $weight={weight}\n disabled={disabled}\n readOnly={readOnly}\n ref={ref}\n type={type}\n />","$hasIconRight || $hasClearButton","<span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\n {...restProps}\n $fontSize={fontSize}\n $iconLeft={$hasIcon}\n $iconRight={$hasIconRight || $hasClearButton}\n $padding={padding}\n $scheme={rootTheme.scheme}\n $space={space}\n $tone={rootTheme.tone}\n $weight={weight}\n disabled={disabled}\n readOnly={readOnly}\n ref={ref}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>","<Card\n as=\"span\"\n className={textInputRoot}\n data-ui=\"TextInput\"\n display=\"flex\"\n tone={rootTheme.tone}\n >\n {prefixNode}\n\n <span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\n {...restProps}\n $fontSize={fontSize}\n $iconLeft={$hasIcon}\n $iconRight={$hasIconRight || $hasClearButton}\n $padding={padding}\n $scheme={rootTheme.scheme}\n $space={space}\n $tone={rootTheme.tone}\n $weight={weight}\n disabled={disabled}\n readOnly={readOnly}\n ref={ref}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>\n\n {suffixNode}\n </Card>","v","_c"],"sources":["../src/core/helpers/animation.ts","../src/core/helpers/focus.ts","../src/core/hooks/useCustomValidity.ts","../src/core/styles/input/responsiveInputPaddingStyle.ts","../src/core/styles/input/textInputStyle.ts","../src/core/styles/input/textInput.css.ts","../src/core/primitives/textInput/textInput.css.ts","../src/core/primitives/textInput/textInput.tsx"],"sourcesContent":["/**\n * @internal\n */\nexport function _raf(fn: () => void): () => void {\n const frameId = requestAnimationFrame(fn)\n\n return () => {\n cancelAnimationFrame(frameId)\n }\n}\n\n/**\n * @internal\n */\nexport function _raf2(fn: () => void): () => void {\n let innerDispose: (() => void) | null = null\n\n const outerDispose = _raf(() => {\n innerDispose = _raf(fn)\n })\n\n return () => {\n if (innerDispose) innerDispose()\n\n outerDispose()\n }\n}\n","import {\n isHTMLAnchorElement,\n isHTMLButtonElement,\n isHTMLElement,\n isHTMLInputElement,\n isHTMLSelectElement,\n isHTMLTextAreaElement,\n} from './element'\n\n// export const globalFocusState = {\n// IgnoreUtilFocusChanges: false,\n// }\n\n/**\n * @internal\n */\nexport function _hasFocus(element: HTMLElement): boolean {\n return Boolean(document.activeElement) && element.contains(document.activeElement)\n}\n\n/**\n * @internal\n */\nexport function isFocusable(element: HTMLElement): boolean {\n if (\n element.tabIndex > 0 ||\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\n ) {\n return true\n }\n\n if (isHTMLAnchorElement(element)) {\n return Boolean(element.href) && element.rel !== 'ignore'\n }\n\n if (isHTMLInputElement(element)) {\n return element.type !== 'hidden' && element.type !== 'file' && !element.disabled\n }\n\n if (\n isHTMLButtonElement(element) ||\n isHTMLSelectElement(element) ||\n isHTMLTextAreaElement(element)\n ) {\n return !element.disabled\n }\n\n return false\n}\n\n/**\n * @internal\n */\nexport function attemptFocus(element: HTMLElement): boolean {\n if (!isFocusable(element)) {\n return false\n }\n\n // globalFocusState.IgnoreUtilFocusChanges = true\n\n try {\n element.focus()\n } catch {\n // ignore\n }\n\n // globalFocusState.IgnoreUtilFocusChanges = false\n\n return document.activeElement === element\n}\n\n/**\n * @internal\n */\nexport function focusFirstDescendant(element: HTMLElement): boolean {\n for (let i = 0; i < element.childNodes.length; i++) {\n const child = element.childNodes[i]\n\n if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child))) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * @internal\n */\nexport function focusLastDescendant(element: HTMLElement): boolean {\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\n const child = element.childNodes[i]\n\n if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child))) {\n return true\n }\n }\n\n return false\n}\n","import {useEffect} from 'react'\n\n/**\n * @beta\n */\nexport function useCustomValidity(\n ref: {current: null | {setCustomValidity: (validity: string) => void}},\n customValidity: string | undefined,\n): void {\n useEffect(() => {\n ref.current?.setCustomValidity(customValidity || '')\n }, [customValidity, ref])\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\n\nexport interface TextInputResponsivePaddingStyleProps {\n $fontSize: number[]\n $iconLeft?: boolean\n $iconRight?: boolean\n $padding: number[]\n $space: number[]\n}\n\nexport function responsiveInputPaddingStyle(\n props: TextInputResponsivePaddingStyleProps & ThemeProps,\n): CSSObject[] {\n const {$fontSize, $iconLeft, $iconRight, $padding, $space} = props\n const {font, media, space} = getTheme_v2(props.theme)\n const len = Math.max($padding.length, $space.length, $fontSize.length)\n const _padding: number[] = []\n const _space: number[] = []\n const _fontSize: number[] = []\n\n for (let i = 0; i < len; i += 1) {\n _fontSize[i] = $fontSize[i] === undefined ? _fontSize[i - 1] : $fontSize[i]\n _padding[i] = $padding[i] === undefined ? _padding[i - 1] : $padding[i]\n _space[i] = $space[i] === undefined ? _space[i - 1] : $space[i]\n }\n\n return _responsive(media, _padding, (_, i) => {\n const size = font.text.sizes[_fontSize[i]] || font.text.sizes[2]\n const emSize = size.lineHeight - size.ascenderHeight - size.descenderHeight\n const p = space[_padding[i]]\n const s = space[_space[i]]\n\n const styles = {\n paddingTop: rem(p - size.ascenderHeight),\n paddingRight: rem(p),\n paddingBottom: rem(p - size.descenderHeight),\n paddingLeft: rem(p),\n }\n\n if ($iconRight) styles.paddingRight = rem(p + emSize + s)\n if ($iconLeft) styles.paddingLeft = rem(p + emSize + s)\n\n return styles\n })\n}\n\nexport function responsiveInputPaddingIconRightStyle(\n props: {\n $fontSize: number[]\n $padding: number[]\n $space: number[]\n } & ThemeProps,\n): CSSObject[] {\n return responsiveInputPaddingStyle({...props, $iconRight: true})\n}\n","import {css} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {CSSObject} from '../../../theme/system/css'\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {CardTone} from '../../types/card'\nimport {focusRingBorderStyle, focusRingStyle} from '../focusRing'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\n\n/**\n * @internal\n */\nexport interface TextInputInputStyleProps {\n $fontSize: number[]\n $scheme: ThemeColorSchemeKey\n $tone: CardTone\n $weight?: ThemeFontWeightKey\n}\n\n/**\n * @internal\n */\nexport interface TextInputRepresentationStyleProps {\n $hasPrefix?: boolean\n $hasSuffix?: boolean\n $scheme: ThemeColorSchemeKey\n $tone: CardTone\n $unstableDisableFocusRing?: boolean\n}\n\nexport function textInputBaseStyle(\n props: TextInputInputStyleProps & ThemeProps,\n): ReturnType<typeof css> {\n const {$scheme, $tone, $weight} = props\n const {color, font} = getTheme_v2(props.theme)\n\n return css`\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ${font.text.family};\n font-weight: ${($weight && font.text.weights[$weight]) || font.text.weights.regular};\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome’s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='${$scheme}'][data-tone='${$tone}'] {\n --input-fg-color: ${color.input.default.enabled.fg};\n --input-placeholder-color: ${color.input.default.enabled.placeholder};\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ${color.input.default.enabled.fg};\n --input-placeholder-color: ${color.input.default.enabled.placeholder};\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ${color.input.default.disabled.fg};\n --input-placeholder-color: ${color.input.default.disabled.placeholder};\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ${color.input.invalid.enabled.fg};\n --input-placeholder-color: ${color.input.invalid.enabled.placeholder};\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ${color.input.default.readOnly.fg};\n --input-placeholder-color: ${color.input.default.readOnly.placeholder};\n }\n }\n `\n}\n\nexport function textInputFontSizeStyle(props: TextInputInputStyleProps & ThemeProps): CSSObject[] {\n const {font, media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$fontSize, (sizeIndex) => {\n const size = font.text.sizes[sizeIndex] || font.text.sizes[2]\n\n return {\n fontSize: rem(size.fontSize),\n lineHeight: `${size.lineHeight / size.fontSize}`,\n }\n })\n}\n\nexport function textInputRepresentationStyle(\n props: TextInputRepresentationStyleProps & ThemeProps,\n): ReturnType<typeof css> {\n const {$hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing} = props\n const {color, input} = getTheme_v2(props.theme)\n\n return css`\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ${$hasPrefix ? 0 : undefined};\n border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};\n border-top-right-radius: ${$hasSuffix ? 0 : undefined};\n border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};\n\n &[data-scheme='${$scheme}'][data-tone='${$tone}'] {\n --card-bg-color: ${color.input.default.enabled.bg};\n --card-fg-color: ${color.input.default.enabled.fg};\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.enabled.border,\n width: input.border.width,\n })};\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ${color.input.invalid.enabled.bg};\n --card-fg-color: ${color.input.invalid.enabled.fg};\n\n &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.invalid.enabled.border,\n width: input.border.width,\n })};\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ${\n $unstableDisableFocusRing\n ? undefined\n : focusRingStyle({\n border: {color: color.input.default.enabled.border, width: input.border.width},\n focusRing: input.text.focusRing,\n })\n };\n }\n\n &:not([data-border]) {\n --input-box-shadow: ${\n $unstableDisableFocusRing\n ? undefined\n : focusRingStyle({focusRing: input.text.focusRing})\n };\n }\n }\n\n /* disabled */\n *:not(:invalid):disabled + & {\n --card-bg-color: ${color.input.default.disabled.bg} !important;\n --card-fg-color: ${color.input.default.disabled.fg} !important;\n --card-icon-color: ${color.input.default.disabled.fg} !important;\n\n &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.disabled.border,\n width: input.border.width,\n })};\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: ${color.input.invalid.disabled.bg} !important;\n --card-fg-color: ${color.input.invalid.disabled.fg} !important;\n --card-icon-color: ${color.input.invalid.disabled.fg} !important;\n\n &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.invalid.disabled.border,\n width: input.border.width,\n })};\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: ${color.input.default.readOnly.bg} !important;\n --card-fg-color: ${color.input.default.readOnly.fg} !important;\n }\n\n *:invalid:read-only + & {\n --card-bg-color: ${color.input.invalid.readOnly.bg} !important;\n --card-fg-color: ${color.input.invalid.readOnly.fg} !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ${color.input.default.hovered.bg};\n --card-fg-color: ${color.input.default.hovered.fg};\n }\n\n *:invalid:not(:disabled):not(:read-only):hover + & {\n --card-bg-color: ${color.input.invalid.hovered.bg};\n --card-fg-color: ${color.input.invalid.hovered.fg};\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.hovered.border,\n width: input.border.width,\n })};\n }\n\n *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.invalid.hovered.border,\n width: input.border.width,\n })};\n }\n }\n }\n `\n}\n","import {style} from '@vanilla-extract/css'\n\n// TextInput renders its root as a Card, whose Box styles own `display`, so the\n// flex layout comes from the `display` prop there and only the alignment lives\n// here. TextArea's root is a plain span, so it reuses that class and adds display.\nexport const textInputRoot = style({\n alignItems: 'center',\n})\n\nexport const textAreaRoot = style([\n textInputRoot,\n {\n selectors: {\n '&:not([hidden])': {\n display: 'flex',\n },\n },\n },\n])\n\nexport const inputRoot = style({\n flex: 1,\n minWidth: 0,\n display: 'block',\n position: 'relative',\n})\n","import {style} from '@vanilla-extract/css'\n\nexport const textInputLeftBox = style({\n position: 'absolute',\n top: 0,\n left: 0,\n})\n\nexport const textInputRightBox = style({\n position: 'absolute',\n top: 0,\n right: 0,\n})\n\nexport const textInputClearButton = style({\n selectors: {\n '&:not([hidden])': {\n display: 'block',\n },\n },\n})\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {clsx} from 'clsx/lite'\nimport {isValidElement, useCallback, useImperativeHandle, useMemo, useRef} from 'react'\nimport {isValidElementType} from 'react-is'\nimport {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {EMPTY_RECORD} from '../../constants'\nimport {useCustomValidity} from '../../hooks/useCustomValidity'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {\n responsiveInputPaddingStyle,\n TextInputResponsivePaddingStyleProps,\n} from '../../styles/input/responsiveInputPaddingStyle'\nimport {\n textInputBaseStyle,\n textInputFontSizeStyle,\n TextInputInputStyleProps,\n textInputRepresentationStyle,\n TextInputRepresentationStyleProps,\n} from '../../styles/input/textInputStyle'\nimport {responsiveRadiusStyle} from '../../styles/radius/radiusStyle'\nimport {ResponsiveRadiusStyleProps} from '../../styles/radius/types'\nimport {useRootTheme} from '../../theme/useRootTheme'\nimport {Radius} from '../../types/radius'\nimport {Box} from '../box/box'\nimport {Button, ButtonOwnProps} from '../button/button'\nimport {Card} from '../card/card'\nimport {Text} from '../text/text'\n\nimport {inputRoot, textInputRoot} from '../../styles/input/textInput.css'\nimport {textInputClearButton, textInputLeftBox, textInputRightBox} from './textInput.css'\n\n/**\n * @public\n */\nexport type TextInputClearButtonProps = ButtonOwnProps &\n Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>\n\n/**\n * @public\n */\nexport type TextInputType =\n | 'search'\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'url'\n | 'month'\n | 'number'\n | 'password'\n | 'tel'\n | 'time'\n | 'text'\n | 'week'\n | 'color'\n\n/**\n * @public\n */\nexport interface TextInputProps {\n /**\n * @beta\n */\n __unstable_disableFocusRing?: boolean\n border?: boolean\n /**\n * @beta\n */\n clearButton?: boolean | TextInputClearButtonProps\n customValidity?: string\n fontSize?: number | number[]\n // oxlint-disable-next-line no-redundant-type-constituents\n icon?: React.ElementType | React.ReactNode\n // oxlint-disable-next-line no-redundant-type-constituents\n iconRight?: React.ElementType | React.ReactNode\n /**\n * @beta\n */\n onClear?: () => void\n padding?: number | number[]\n prefix?: React.ReactNode\n radius?: Radius | Radius[]\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n gap?: number | number[]\n suffix?: React.ReactNode\n type?: TextInputType\n weight?: ThemeFontWeightKey\n}\n\nconst CLEAR_BUTTON_BOX_STYLE: React.CSSProperties = {zIndex: 2}\n\n// Prefix and Suffix stay on styled-components: their corner radius longhands\n// must beat Card's runtime `border-radius` shorthand at equal specificity,\n// which needs both rules in the runtime stylesheet.\nconst Prefix = styled(Card).attrs({forwardedAs: 'span'})`\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n`\n\nconst Suffix = styled(Card).attrs({forwardedAs: 'span'})`\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n`\n\nconst Input = styled.input<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(\n responsiveInputPaddingStyle,\n textInputBaseStyle,\n textInputFontSizeStyle,\n)\n\nconst Presentation = styled.span<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>(\n responsiveRadiusStyle,\n textInputRepresentationStyle,\n)\n\n// Stays on styled-components: `background-color: transparent` must beat Card's\n// runtime `background-color: var(--card-bg-color)` at equal specificity, which\n// needs both rules in the runtime stylesheet.\nconst RightCard = styled(Card)`\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n`\n\n/**\n * Single line text input.\n *\n * @public\n */\nexport function TextInput(\n props: TextInputProps & Omit<React.HTMLProps<HTMLInputElement>, 'as' | 'prefix' | 'type'>,\n) {\n const {\n __unstable_disableFocusRing,\n border = true,\n clearButton,\n disabled = false,\n fontSize: fontSizeProp = 2,\n gap = 3,\n icon: IconComponent,\n iconRight: IconRightComponent,\n onClear,\n padding: paddingProp = 3,\n prefix,\n radius: radiusProp = 2,\n readOnly,\n ref: forwardedRef,\n suffix,\n customValidity,\n type = 'text',\n weight,\n ...restProps\n } = props\n const ref = useRef<HTMLInputElement | null>(null)\n\n const rootTheme = useRootTheme()\n\n const fontSize = _getArrayProp(fontSizeProp)\n const padding = _getArrayProp(paddingProp)\n const radius = _getArrayProp(radiusProp)\n const space = _getArrayProp(gap)\n\n // Transient properties\n const $hasClearButton = Boolean(clearButton)\n const $hasIcon = Boolean(IconComponent)\n const $hasIconRight = Boolean(IconRightComponent)\n const $hasSuffix = Boolean(suffix)\n const $hasPrefix = Boolean(prefix)\n\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n forwardedRef,\n () => ref.current,\n )\n\n useCustomValidity(ref, customValidity)\n\n // Prevent the clear button from taking the focus away from the input\n const handleClearMouseDown = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n }, [])\n\n const handleClearClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (onClear) onClear()\n\n // Focus the input, in case focus has been lost when clicking the clear button\n ref.current?.focus()\n },\n [onClear, ref],\n )\n\n // Render prefix (memoized)\n const prefixNode = useMemo(\n () =>\n prefix && (\n <Prefix borderTop borderLeft borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{prefix}</span>\n </Prefix>\n ),\n [prefix, radius],\n )\n\n // Render presentation (memoized)\n const presentationNode = useMemo(\n () => (\n <Presentation\n $hasPrefix={$hasPrefix}\n $unstableDisableFocusRing={__unstable_disableFocusRing}\n $hasSuffix={$hasSuffix}\n $radius={radius}\n $scheme={rootTheme.scheme}\n $tone={rootTheme.tone}\n data-border={border ? '' : undefined}\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\n )}\n </Presentation>\n ),\n [\n __unstable_disableFocusRing,\n border,\n fontSize,\n IconComponent,\n IconRightComponent,\n padding,\n radius,\n rootTheme,\n $hasClearButton,\n $hasPrefix,\n $hasSuffix,\n ],\n )\n\n // Render clear button (memoized)\n const clearButtonBoxPadding = useMemo(\n () =>\n padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 1\n if (v === 2) return 1\n\n return v - 2\n }),\n [padding],\n )\n const clearButtonPadding = useMemo(\n () =>\n padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 0\n if (v === 2) return 1\n\n return v - 1\n }),\n [padding],\n )\n const clearButtonProps: TextInputClearButtonProps =\n typeof clearButton === 'object' ? clearButton : EMPTY_RECORD\n const clearButtonNode = useMemo(\n () =>\n !disabled &&\n !readOnly &&\n clearButton && (\n <RightCard\n forwardedAs=\"span\"\n padding={clearButtonBoxPadding}\n style={CLEAR_BUTTON_BOX_STYLE}\n tone={customValidity ? 'critical' : 'inherit'}\n >\n <Button\n aria-label=\"Clear\"\n data-qa=\"clear-button\"\n fontSize={fontSize}\n icon={CloseIcon}\n mode=\"bleed\"\n padding={clearButtonPadding}\n radius={radius}\n {...clearButtonProps}\n className={clsx(textInputClearButton, clearButtonProps.className)}\n onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n ),\n [\n clearButton,\n clearButtonBoxPadding,\n clearButtonPadding,\n clearButtonProps,\n customValidity,\n disabled,\n fontSize,\n handleClearClick,\n handleClearMouseDown,\n radius,\n readOnly,\n ],\n )\n\n // Render suffix (memoized)\n const suffixNode = useMemo(\n () =>\n suffix && (\n <Suffix borderTop borderRight borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{suffix}</span>\n </Suffix>\n ),\n [radius, suffix],\n )\n\n return (\n <Card\n as=\"span\"\n className={textInputRoot}\n data-ui=\"TextInput\"\n display=\"flex\"\n tone={rootTheme.tone}\n >\n {prefixNode}\n\n <span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\n {...restProps}\n $fontSize={fontSize}\n $iconLeft={$hasIcon}\n $iconRight={$hasIconRight || $hasClearButton}\n $padding={padding}\n $scheme={rootTheme.scheme}\n $space={space}\n $tone={rootTheme.tone}\n $weight={weight}\n disabled={disabled}\n readOnly={readOnly}\n ref={ref}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>\n\n {suffixNode}\n </Card>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAgB,KAAK,IAA4B;CAC/C,IAAM,UAAU,sBAAsB,EAAE;CAExC,aAAa;EACX,qBAAqB,OAAO;CAC9B;AACF;;;;AAKA,SAAgB,MAAM,IAA4B;CAChD,IAAI,eAAoC,MAElC,eAAe,WAAW;EAC9B,eAAe,KAAK,EAAE;CACxB,CAAC;CAED,aAAa;EAGX,AAFI,gBAAc,aAAa,GAE/B,aAAa;CACf;AACF;;;;ACVA,SAAgB,UAAU,SAA+B;CACvD,OAAO,EAAQ,SAAS,iBAAkB,QAAQ,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AChBA,QAAM,IAAU,IAEbA,MAAI;AACb;AAjBY,SAAA,OAAC,GAAM;CAKjB,OAJI,MAAM,IAAU,IAChB,MAAM,KACN,MAAM,IAAU,IAEb,IAAI;AACb;AAvFqC,SAAA,MAAC,OAA+C;CAEvF,AADA,MAAM,eAAe,GACrB,MAAM,gBAAgB;AACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLayer-B0i19TTM.js","names":["RULES","RULES","RULES","asProp = 'div'","display = 'block'","margin = 0","padding = 0","_getArrayProp(gridColumn)","_getArrayProp(gridColumnStart)","_getArrayProp(gridColumnEnd)","_getArrayProp(display)","_getArrayProp(flex)","_getArrayProp(height)","_getArrayProp(margin)","_getArrayProp(marginX)","_getArrayProp(marginY)","_getArrayProp(marginTop)","_getArrayProp(marginRight)","_getArrayProp(marginBottom)","_getArrayProp(marginLeft)","_getArrayProp(overflow)","_getArrayProp(padding)","_getArrayProp(paddingX)","_getArrayProp(paddingY)","_getArrayProp(paddingTop)","_getArrayProp(paddingRight)","_getArrayProp(paddingBottom)","_getArrayProp(paddingLeft)","_getArrayProp(gridRow)","_getArrayProp(gridRowStart)","_getArrayProp(gridRowEnd)","_getArrayProp(sizing)","<StyledBox\n data-as={typeof asProp === 'string' ? asProp : undefined}\n data-ui=\"Box\"\n {...restProps}\n $column={_getArrayProp(gridColumn)}\n $columnStart={_getArrayProp(gridColumnStart)}\n $columnEnd={_getArrayProp(gridColumnEnd)}\n $display={_getArrayProp(display)}\n $flex={_getArrayProp(flex)}\n $height={_getArrayProp(height)}\n $margin={_getArrayProp(margin)}\n $marginX={_getArrayProp(marginX)}\n $marginY={_getArrayProp(marginY)}\n $marginTop={_getArrayProp(marginTop)}\n $marginRight={_getArrayProp(marginRight)}\n $marginBottom={_getArrayProp(marginBottom)}\n $marginLeft={_getArrayProp(marginLeft)}\n $overflow={_getArrayProp(overflow)}\n $padding={_getArrayProp(padding)}\n $paddingX={_getArrayProp(paddingX)}\n $paddingY={_getArrayProp(paddingY)}\n $paddingTop={_getArrayProp(paddingTop)}\n $paddingRight={_getArrayProp(paddingRight)}\n $paddingBottom={_getArrayProp(paddingBottom)}\n $paddingLeft={_getArrayProp(paddingLeft)}\n $row={_getArrayProp(gridRow)}\n $rowStart={_getArrayProp(gridRowStart)}\n $rowEnd={_getArrayProp(gridRowEnd)}\n $sizing={_getArrayProp(sizing)}\n // styled-components 6.5 distributes PolymorphicCallProps over ElementType and\n // hits TS2589; narrow the call-site target while still passing the real value.\n // oxlint-disable-next-line no-unsafe-type-assertion\n as={asProp as 'div'}\n ref={ref}\n >\n {props.children}\n </StyledBox>","children","asProp as 'div'","typeof asProp === 'string' ? asProp : undefined","_c","getTheme_v2(useStyledTheme() as Theme)","useStyledTheme() as Theme","useTheme","useStyledTheme","_c","RULES","useMemo(() => {\n if (!rootTheme) return null\n\n return {\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }\n }, [rootTheme, scheme, tone])","{\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }","useMemo(() => {\n if (!rootTheme) return null\n\n return getScopedTheme(rootTheme, scheme, tone)\n }, [scheme, rootTheme, tone])","getScopedTheme(rootTheme, scheme, tone)","<pre>ThemeProvider: no \"theme\" property provided</pre>","<StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>","<ThemeContext.Provider value={themeContext}>\n <StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>\n </ThemeContext.Provider>","ThemeContext.Provider","ThemeProvider","_c","StyledThemeProvider","<ThemeProvider scheme={scheme || root.scheme} theme={root.theme} tone={tone}>\n {children}\n </ThemeProvider>","theme","scheme || root.scheme","_c","ThemeProvider","checkered = false","focusRing = false","radius = 0","toneProp = 'default'","_getArrayProp(border)","_getArrayProp(borderTop)","_getArrayProp(borderRight)","_getArrayProp(borderBottom)","_getArrayProp(borderLeft)","_getArrayProp(radius)","_getArrayProp(shadow)","<StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />","scheme","muted ?? false","checkered ? '' : undefined","pressed ? '' : undefined","selected ? '' : undefined","typeof as === 'string' ? as : undefined","rootTheme.scheme","<ThemeColorProvider scheme={scheme} tone={tone}>\n <StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />\n </ThemeColorProvider>","_c","_getCanonicalMedia(useTheme_v2().media)","media","useTheme_v2()","_createMediaStore(media)","useMemo(() => _createMediaStore(media), [media])","_c","(onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n }","() => window.matchMedia(mediaQueryString).matches","useCallback(\n (onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n },\n [mediaQueryString],\n )","_c","() => false","getServerSnapshot = () => false","zOffsetProp = 0","parentContextValue && getLayerContext(parentContextValue)","_getArrayProp(zOffsetProp)","{childLayers, childrenWithoutLevel}","(childLevel?: number) => {\n const parentDispose = parentRegisterChild?.(childLevel)\n\n dispatch({type: 'child/register', level: childLevel})\n\n return () => {\n dispatch({type: 'child/unregister', level: childLevel})\n\n parentDispose?.()\n }\n }","useCallback(\n (childLevel?: number) => {\n const parentDispose = parentRegisterChild?.(childLevel)\n\n dispatch({type: 'child/register', level: childLevel})\n\n return () => {\n dispatch({type: 'child/unregister', level: childLevel})\n\n parentDispose?.()\n }\n },\n [parentRegisterChild],\n )","() => parentRegisterChild?.(level)","[level, parentRegisterChild]","{\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }","useMemo(\n () => ({\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }),\n [isTopLayer, level, registerChild, size, zIndex],\n )","<LayerContext.Provider value={value}>{children}</LayerContext.Provider>","LayerContext.Provider","_c","getLayerContext(value)","err","_c"],"sources":["../src/core/styles/box/boxStyle.ts","../src/core/styles/flex/flexItemStyle.ts","../src/core/styles/grid/gridItemStyle.ts","../src/core/styles/margin/marginStyle.ts","../src/core/styles/padding/paddingStyle.ts","../src/core/primitives/box/box.tsx","../src/core/styles/radius/radiusStyle.ts","../src/core/theme/useTheme.ts","../src/core/styles/card/_cardColorStyle.ts","../src/core/styles/focusRing/index.ts","../src/core/styles/border/borderStyle.ts","../src/core/styles/shadow/shadowStyle.ts","../src/core/lib/globalScope.ts","../src/core/lib/createGlobalScopedContext.ts","../src/core/theme/themeContext.ts","../src/core/theme/themeProvider.tsx","../src/core/theme/useRootTheme.ts","../src/core/theme/themeColorProvider.tsx","../src/core/primitives/card/styles.ts","../src/core/primitives/card/card.tsx","../src/core/hooks/useMediaIndex/useMediaIndex.ts","../src/core/hooks/useMatchMedia.ts","../src/core/hooks/usePrefersReducedMotion.ts","../src/core/lib/isRecord.ts","../src/core/utils/layer/getLayerContext.ts","../src/core/utils/layer/layerContext.ts","../src/core/utils/layer/layerReducer.ts","../src/core/utils/layer/layerProvider.tsx","../src/core/utils/layer/useLayer.ts"],"sourcesContent":["import {Property} from 'csstype'\n\nimport {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, _ruleSet} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveBoxStyleProps} from './types'\n\nconst BASE_STYLE: CSSObject = {\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n}\n\nconst BOX_SIZING: {[key: string]: Property.BoxSizing} = {\n content: 'content-box',\n border: 'border-box',\n}\n\nconst BOX_HEIGHT = {\n stretch: 'stretch',\n fill: '100%',\n}\n\nexport function boxStyle(): CSSObject {\n return BASE_STYLE\n}\n\nconst RULES = _ruleSet(\n responsiveBoxSizingStyle,\n responsiveBoxHeightStyle,\n responsiveBoxOverflowStyle,\n responsiveBoxDisplayStyle,\n)\n\nexport function responsiveBoxStyle(): CSSObject[] {\n return RULES\n}\n\nfunction responsiveBoxDisplayStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$display, (display) => ({\n '&:not([hidden])': {display},\n }))\n}\n\nfunction responsiveBoxSizingStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$sizing, (sizing) => ({\n boxSizing: BOX_SIZING[sizing],\n }))\n}\n\nfunction responsiveBoxHeightStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$height, (height) => ({\n height: BOX_HEIGHT[height],\n }))\n}\n\nfunction responsiveBoxOverflowStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$overflow, (overflow) => ({\n overflow,\n }))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, _ruleSet} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveFlexItemStyleProps} from './types'\n\nconst BASE_STYLE: CSSObject = {\n minWidth: 0,\n minHeight: 0,\n}\n\nconst RULES = _ruleSet(BASE_STYLE, responsiveFlexItemStyle)\n\nexport function flexItemStyle(): CSSObject[] {\n return RULES\n}\n\nfunction responsiveFlexItemStyle(props: ResponsiveFlexItemStyleProps & ThemeProps): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n if (!props.$flex) return _ruleSet()\n\n return _responsive(media, props.$flex, (flex) => ({flex: `${flex}`}))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, _ruleSet} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveGridItemStyleProps} from './types'\n\nconst RULES = _ruleSet(\n responsiveGridItemRowStyle,\n responsiveGridItemRowStartStyle,\n responsiveGridItemRowEndStyle,\n responsiveGridItemColumnStyle,\n responsiveGridItemColumnStartStyle,\n responsiveGridItemColumnEndStyle,\n)\n\nexport function responsiveGridItemStyle(): CSSObject[] {\n return RULES\n}\n\nconst GRID_ITEM_ROW = {\n auto: 'auto',\n full: '1 / -1',\n}\n\nconst GRID_ITEM_COLUMN = {\n auto: 'auto',\n full: '1 / -1',\n}\n\nfunction responsiveGridItemRowStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$row, (row) => {\n if (typeof row === 'number') {\n return {gridRow: `span ${row} / span ${row}`}\n }\n\n return {gridRow: GRID_ITEM_ROW[row]}\n })\n}\n\nfunction responsiveGridItemRowStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$rowStart, (rowStart) => ({\n gridRowStart: `${rowStart}`,\n }))\n}\n\nfunction responsiveGridItemRowEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$rowEnd, (rowEnd) => ({gridRowEnd: `${rowEnd}`}))\n}\n\nfunction responsiveGridItemColumnStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$column, (column) => {\n if (typeof column === 'number') {\n return {gridColumn: `span ${column} / span ${column}`}\n }\n\n return {gridColumn: GRID_ITEM_COLUMN[column]}\n })\n}\n\nfunction responsiveGridItemColumnStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$columnStart, (columnStart) => ({\n gridColumnStart: `${columnStart}`,\n }))\n}\n\nfunction responsiveGridItemColumnEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$columnEnd, (columnEnd) => ({\n gridColumnEnd: `${columnEnd}`,\n }))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {_getResponsiveSpace, _ruleSet} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveMarginStyleProps} from './types'\n\nexport function responsiveMarginStyle(props: ResponsiveMarginStyleProps & ThemeProps): CSSObject[] {\n const {theme} = props\n\n return _ruleSet(\n ...[\n _getResponsiveSpace(theme, ['margin'], props.$margin),\n _getResponsiveSpace(theme, ['marginLeft', 'marginRight'], props.$marginX),\n _getResponsiveSpace(theme, ['marginTop', 'marginBottom'], props.$marginY),\n _getResponsiveSpace(theme, ['marginTop'], props.$marginTop),\n _getResponsiveSpace(theme, ['marginRight'], props.$marginRight),\n _getResponsiveSpace(theme, ['marginBottom'], props.$marginBottom),\n _getResponsiveSpace(theme, ['marginLeft'], props.$marginLeft),\n ].filter((value): value is CSSObject[] => value !== null),\n )\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {_getResponsiveSpace, _ruleSet} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsivePaddingStyleProps} from './types'\n\nexport function responsivePaddingStyle(\n props: ResponsivePaddingStyleProps & ThemeProps,\n): CSSObject[] {\n const {theme} = props\n\n return _ruleSet(\n ...[\n _getResponsiveSpace(theme, ['padding'], props.$padding),\n _getResponsiveSpace(theme, ['paddingLeft', 'paddingRight'], props.$paddingX),\n _getResponsiveSpace(theme, ['paddingTop', 'paddingBottom'], props.$paddingY),\n _getResponsiveSpace(theme, ['paddingTop'], props.$paddingTop),\n _getResponsiveSpace(theme, ['paddingRight'], props.$paddingRight),\n _getResponsiveSpace(theme, ['paddingBottom'], props.$paddingBottom),\n _getResponsiveSpace(theme, ['paddingLeft'], props.$paddingLeft),\n ].filter((value): value is CSSObject[] => value !== null),\n )\n}\n","import {styled} from 'styled-components'\n\nimport {boxStyle, responsiveBoxStyle} from '../../styles/box/boxStyle'\nimport {ResponsiveBoxStyleProps} from '../../styles/box/types'\nimport {flexItemStyle} from '../../styles/flex/flexItemStyle'\nimport {FlexItemStyleProps} from '../../styles/flex/types'\nimport {responsiveGridItemStyle} from '../../styles/grid/gridItemStyle'\nimport {ResponsiveGridItemStyleProps} from '../../styles/grid/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveMarginStyle} from '../../styles/margin/marginStyle'\nimport {ResponsiveMarginStyleProps} from '../../styles/margin/types'\nimport {responsivePaddingStyle} from '../../styles/padding/paddingStyle'\nimport {ResponsivePaddingStyleProps} from '../../styles/padding/types'\nimport {ElementType, Props} from '../../types/component'\nimport {\n ResponsiveBoxProps,\n ResponsiveFlexItemProps,\n ResponsiveGridItemProps,\n ResponsiveMarginProps,\n ResponsivePaddingProps,\n} from '../types'\n\n/**\n * The props that `Box` adds on top of the element it renders as.\n *\n * @public\n */\nexport interface BoxOwnProps\n extends\n ResponsiveFlexItemProps,\n ResponsiveBoxProps,\n ResponsiveGridItemProps,\n ResponsiveMarginProps,\n ResponsivePaddingProps {\n forwardedAs?: ElementType\n}\n\n/**\n * @public\n */\nexport type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>\n\nconst StyledBox = styled.div<\n FlexItemStyleProps &\n ResponsiveBoxStyleProps &\n ResponsiveGridItemStyleProps &\n ResponsiveMarginStyleProps &\n ResponsivePaddingStyleProps\n>(\n boxStyle,\n flexItemStyle,\n responsiveBoxStyle,\n responsiveGridItemStyle,\n responsiveMarginStyle,\n responsivePaddingStyle,\n)\n\nconst BoxComponent = function Box(\n props: BoxOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,\n) {\n const {\n as: asProp = 'div',\n ref,\n gridColumn,\n gridColumnStart,\n gridColumnEnd,\n display = 'block',\n flex,\n height,\n margin = 0,\n marginX,\n marginY,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n overflow,\n padding = 0,\n paddingX,\n paddingY,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n gridRow,\n gridRowStart,\n gridRowEnd,\n sizing,\n ...restProps\n } = props\n\n return (\n <StyledBox\n data-as={typeof asProp === 'string' ? asProp : undefined}\n data-ui=\"Box\"\n {...restProps}\n $column={_getArrayProp(gridColumn)}\n $columnStart={_getArrayProp(gridColumnStart)}\n $columnEnd={_getArrayProp(gridColumnEnd)}\n $display={_getArrayProp(display)}\n $flex={_getArrayProp(flex)}\n $height={_getArrayProp(height)}\n $margin={_getArrayProp(margin)}\n $marginX={_getArrayProp(marginX)}\n $marginY={_getArrayProp(marginY)}\n $marginTop={_getArrayProp(marginTop)}\n $marginRight={_getArrayProp(marginRight)}\n $marginBottom={_getArrayProp(marginBottom)}\n $marginLeft={_getArrayProp(marginLeft)}\n $overflow={_getArrayProp(overflow)}\n $padding={_getArrayProp(padding)}\n $paddingX={_getArrayProp(paddingX)}\n $paddingY={_getArrayProp(paddingY)}\n $paddingTop={_getArrayProp(paddingTop)}\n $paddingRight={_getArrayProp(paddingRight)}\n $paddingBottom={_getArrayProp(paddingBottom)}\n $paddingLeft={_getArrayProp(paddingLeft)}\n $row={_getArrayProp(gridRow)}\n $rowStart={_getArrayProp(gridRowStart)}\n $rowEnd={_getArrayProp(gridRowEnd)}\n $sizing={_getArrayProp(sizing)}\n // styled-components 6.5 distributes PolymorphicCallProps over ElementType and\n // hits TS2589; narrow the call-site target while still passing the real value.\n // oxlint-disable-next-line no-unsafe-type-assertion\n as={asProp as 'div'}\n ref={ref}\n >\n {props.children}\n </StyledBox>\n )\n}\n\n/**\n * The `Box` component is a basic layout wrapper component which provides utility properties\n * for flex, margins and padding.\n *\n * @public\n */\nexport const Box: <E extends ElementType = 'div'>(props: BoxProps<E>) => React.JSX.Element =\n BoxComponent\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveRadiusStyleProps} from './types'\n\nexport function responsiveRadiusStyle(props: ResponsiveRadiusStyleProps & ThemeProps): CSSObject[] {\n const {media, radius} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$radius, (value) => {\n let borderRadius: string | 0 = 0\n\n if (typeof value === 'number') {\n borderRadius = rem(radius[value])\n }\n\n if (value === 'full') {\n borderRadius = '9999px'\n }\n\n return {borderRadius}\n })\n}\n","import {useTheme as useStyledTheme} from 'styled-components'\n\nimport {Theme, Theme_v2} from '../../theme/system/theme'\nimport {getTheme_v2} from '../../theme/versioning/getTheme_v2'\n\n/**\n * @public\n */\nexport function useTheme(): Theme {\n // oxlint-disable-next-line no-unnecessary-type-assertion\n return useStyledTheme() as Theme\n}\n\n/**\n * @public\n */\nexport function useTheme_v2(): Theme_v2 {\n // oxlint-disable-next-line no-unnecessary-type-assertion\n return getTheme_v2(useStyledTheme() as Theme)\n}\n","import {ThemeColorCard_v2} from '../../../theme/system/color/color'\nimport {ThemeColorState_v2} from '../../../theme/system/color/state'\nimport {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function _cardColorStyle(\n base: ThemeColorCard_v2,\n color: ThemeColorState_v2,\n checkered = false,\n): CSSObject {\n return {\n // from base\n\n '--card-backdrop-color': base.backdrop,\n\n '--card-focus-ring-color': base.focusRing,\n\n '--card-shadow-outline-color': base.shadow.outline,\n '--card-shadow-umbra-color': base.shadow.umbra,\n '--card-shadow-penumbra-color': base.shadow.penumbra,\n '--card-shadow-ambient-color': base.shadow.ambient,\n\n // from state\n\n '--card-accent-fg-color': color.accent.fg,\n\n '--card-avatar-gray-bg-color': color.avatar.gray.bg,\n '--card-avatar-gray-fg-color': color.avatar.gray.fg,\n '--card-avatar-blue-bg-color': color.avatar.blue.bg,\n '--card-avatar-blue-fg-color': color.avatar.blue.fg,\n '--card-avatar-purple-bg-color': color.avatar.purple.bg,\n '--card-avatar-purple-fg-color': color.avatar.purple.fg,\n '--card-avatar-magenta-bg-color': color.avatar.magenta.bg,\n '--card-avatar-magenta-fg-color': color.avatar.magenta.fg,\n '--card-avatar-red-bg-color': color.avatar.red.bg,\n '--card-avatar-red-fg-color': color.avatar.red.fg,\n '--card-avatar-orange-bg-color': color.avatar.orange.bg,\n '--card-avatar-orange-fg-color': color.avatar.orange.fg,\n '--card-avatar-yellow-bg-color': color.avatar.yellow.bg,\n '--card-avatar-yellow-fg-color': color.avatar.yellow.fg,\n '--card-avatar-green-bg-color': color.avatar.green.bg,\n '--card-avatar-green-fg-color': color.avatar.green.fg,\n '--card-avatar-cyan-bg-color': color.avatar.cyan.bg,\n '--card-avatar-cyan-fg-color': color.avatar.cyan.fg,\n\n '--card-bg-color': color.bg,\n '--card-bg-image': checkered\n ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)`\n : undefined,\n\n '--card-border-color': color.border,\n\n '--card-badge-default-bg-color': color.badge.default.bg,\n '--card-badge-default-dot-color': color.badge.default.dot,\n '--card-badge-default-fg-color': color.badge.default.fg,\n '--card-badge-default-icon-color': color.badge.default.icon,\n '--card-badge-neutral-bg-color': color.badge.neutral?.bg,\n '--card-badge-neutral-dot-color': color.badge.neutral?.dot,\n '--card-badge-neutral-fg-color': color.badge.neutral?.fg,\n '--card-badge-neutral-icon-color': color.badge.neutral?.icon,\n '--card-badge-primary-bg-color': color.badge.primary.bg,\n '--card-badge-primary-dot-color': color.badge.primary.dot,\n '--card-badge-primary-fg-color': color.badge.primary.fg,\n '--card-badge-primary-icon-color': color.badge.primary.icon,\n '--card-badge-suggest-bg-color': color.badge.suggest?.bg,\n '--card-badge-suggest-dot-color': color.badge.suggest?.dot,\n '--card-badge-suggest-fg-color': color.badge.suggest?.fg,\n '--card-badge-suggest-icon-color': color.badge.suggest?.icon,\n '--card-badge-positive-bg-color': color.badge.positive.bg,\n '--card-badge-positive-dot-color': color.badge.positive.dot,\n '--card-badge-positive-fg-color': color.badge.positive.fg,\n '--card-badge-positive-icon-color': color.badge.positive.icon,\n '--card-badge-caution-bg-color': color.badge.caution.bg,\n '--card-badge-caution-dot-color': color.badge.caution.dot,\n '--card-badge-caution-fg-color': color.badge.caution.fg,\n '--card-badge-caution-icon-color': color.badge.caution.icon,\n '--card-badge-critical-bg-color': color.badge.critical.bg,\n '--card-badge-critical-dot-color': color.badge.critical.dot,\n '--card-badge-critical-fg-color': color.badge.critical.fg,\n '--card-badge-critical-icon-color': color.badge.critical.icon,\n\n '--card-code-bg-color': color.code.bg,\n '--card-code-fg-color': color.code.fg,\n\n '--card-fg-color': color.fg,\n\n '--card-icon-color': color.icon,\n\n '--card-kbd-bg-color': color.kbd.bg,\n '--card-kbd-border-color': color.kbd.border,\n '--card-kbd-fg-color': color.kbd.fg,\n\n '--card-link-fg-color': color.link.fg,\n\n '--card-muted-bg-color': color.muted.bg,\n '--card-muted-fg-color': color.muted.fg,\n\n '--card-skeleton-color-from': color.skeleton.from,\n '--card-skeleton-color-to': color.skeleton.to,\n\n // deprecated variables (kept for legacy)\n\n '--card-bg2-color': color.muted.bg,\n '--card-link-color': color.link.fg,\n '--card-hairline-soft-color': color.border,\n '--card-hairline-hard-color': color.border,\n }\n}\n","import {ThemeFocusRing} from '../../../theme/system/focusRing'\n\nexport function focusRingBorderStyle(border: {color: string; width: number}): string {\n return `inset 0 0 0 ${border.width}px ${border.color}`\n}\n\nexport function focusRingStyle(opts: {\n base?: {bg: string}\n border?: {color: string; width: number}\n focusRing: ThemeFocusRing\n}): string {\n const {base, border, focusRing} = opts\n const focusRingOutsetWidth = focusRing.offset + focusRing.width\n const focusRingInsetWidth = 0 - focusRing.offset\n const bgColor = base ? base.bg : 'var(--card-bg-color)'\n\n return [\n focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,\n border && focusRingBorderStyle(border),\n focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,\n focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`,\n ]\n .filter(Boolean)\n .join(',')\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, _ruleSet} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveBorderStyleProps} from './types'\n\nconst RULES = _ruleSet(border, borderTop, borderRight, borderBottom, borderLeft)\n\nexport function responsiveBorderStyle(): CSSObject[] {\n return RULES\n}\n\nfunction border(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$border, (value) =>\n value ? {'&&': {border: borderStyle}} : {'&&': {border: 0}},\n )\n}\n\nfunction borderTop(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderTop, (value) =>\n value ? {'&&': {borderTop: borderStyle}} : {'&&': {borderTop: 0}},\n )\n}\n\nfunction borderRight(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderRight, (value) =>\n value ? {'&&': {borderRight: borderStyle}} : {'&&': {borderRight: 0}},\n )\n}\n\nfunction borderBottom(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderBottom, (value) =>\n value ? {'&&': {borderBottom: borderStyle}} : {'&&': {borderBottom: 0}},\n )\n}\n\nfunction borderLeft(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderLeft, (value) =>\n value ? {'&&': {borderLeft: borderStyle}} : {'&&': {borderLeft: 0}},\n )\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {ThemeBoxShadow, ThemeShadow} from '../../../theme/system/shadow'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {EMPTY_RECORD} from '../../constants'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveShadowStyleProps} from './types'\n\nfunction toBoxShadow(shadow: ThemeBoxShadow, color: string) {\n return `${shadow.map(rem).join(' ')} ${color}`\n}\n\nfunction shadowStyle(shadow: ThemeShadow | null, outlineWidth: number = 1): CSSObject {\n if (!shadow) return EMPTY_RECORD\n\n const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`\n const umbra = toBoxShadow(shadow.umbra, 'var(--card-shadow-umbra-color)')\n const penumbra = toBoxShadow(shadow.penumbra, 'var(--card-shadow-penumbra-color)')\n const ambient = toBoxShadow(shadow.ambient, 'var(--card-shadow-ambient-color)')\n\n return {boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}`}\n}\n\nexport function responsiveShadowStyle(props: ResponsiveShadowStyleProps & ThemeProps): CSSObject[] {\n const {card, media, shadow} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$shadow, (index) =>\n shadowStyle(shadow[index], card.shadow.outline),\n )\n}\n","/**\n * Gets the global scope instance in a given environment.\n *\n * The strategy is to return the most modern, and if not, the most common:\n * - The `globalThis` variable is the modern approach to accessing the global scope\n * - The `window` variable is the global scope in a web browser\n * - The `self` variable is the global scope in workers and others\n * - The `global` variable is the global scope in Node.js\n */\nfunction getGlobalScope() {\n if (typeof globalThis !== 'undefined') return globalThis\n if (typeof window !== 'undefined') return window\n if (typeof self !== 'undefined') return self\n if (typeof global !== 'undefined') return global\n\n throw new Error('@sanity/ui: could not locate global scope')\n}\n\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const globalScope = getGlobalScope() as any\n","/**\n * As `@sanity/ui` is declared as a dependency, and may be duplicated, sometimes across major versions\n * it's critical that vital react contexts are shared even when there is a duplicate.\n * If we used a model similar to `sanity` itself, or `styled-components`, this would be unnecessary as\n * those libraries enforce single instances.\n * Since we don't enforce it we have to support a sanity plugin being able to call hooks like `useToast`, and then\n * read the context setup by `sanity`, which calls `ToastProvider`, even if the provider and hook are different instances in memory.\n * It's also why it's vital that all changes to globally scoped providers remain fully backwards compatible to v1.\n */\n\nimport {type Context, createContext} from 'react'\n\nimport {globalScope} from './globalScope'\n\n// oxlint-disable-next-line no-unnecessary-type-parameters\nexport function createGlobalScopedContext<ContextType, const T extends ContextType = ContextType>(\n /**\n * Enforce that all Symbol.for keys used for globally scoped contexts have a predictable prefix\n */\n key: `@sanity/ui/context/${string}`,\n defaultValue: T,\n): Context<ContextType> {\n const symbol = Symbol.for(key)\n\n /**\n * Prevent errors about re-renders on React SSR on Next.js App Router\n */\n if (typeof document === 'undefined') {\n const context = createContext<ContextType>(defaultValue)\n context.displayName = key\n return context\n }\n\n globalScope[symbol] = globalScope[symbol] || createContext<T>(defaultValue)\n\n return globalScope[symbol]\n}\n","import {createGlobalScopedContext} from '../lib/createGlobalScopedContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @internal\n */\nexport const ThemeContext = createGlobalScopedContext<ThemeContextValue | null>(\n '@sanity/ui/context/theme',\n null,\n)\n","import {useContext, useMemo} from 'react'\nimport {ThemeProvider as StyledThemeProvider} from 'styled-components'\n\nimport {getScopedTheme} from '../../theme/getScopedTheme'\nimport {\n type ThemeColorCardToneKey,\n type ThemeColorSchemeKey,\n} from '../../theme/system/color/_system'\nimport {type RootTheme, type Theme} from '../../theme/system/theme'\nimport {ThemeContext} from './themeContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @public\n */\nexport interface ThemeProviderProps {\n children?: React.ReactNode\n scheme?: ThemeColorSchemeKey\n theme?: RootTheme\n tone?: ThemeColorCardToneKey\n}\n\n/**\n * @public\n */\nexport function ThemeProvider(props: ThemeProviderProps): React.JSX.Element {\n const parentTheme = useContext(ThemeContext)\n const {children} = props\n const scheme = props.scheme ?? (parentTheme?.scheme || 'light')\n const rootTheme = props.theme ?? (parentTheme?.theme || null)\n const tone = props.tone ?? (parentTheme?.tone || 'default')\n\n const themeContext: ThemeContextValue | null = useMemo(() => {\n if (!rootTheme) return null\n\n return {\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }\n }, [rootTheme, scheme, tone])\n\n const theme: Theme | null = useMemo(() => {\n if (!rootTheme) return null\n\n return getScopedTheme(rootTheme, scheme, tone)\n }, [scheme, rootTheme, tone])\n\n if (!theme) {\n return <pre>ThemeProvider: no \"theme\" property provided</pre>\n }\n\n return (\n <ThemeContext.Provider value={themeContext}>\n <StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>\n </ThemeContext.Provider>\n )\n}\n","import {useContext} from 'react'\n\nimport {ThemeContext} from './themeContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @public\n */\nexport function useRootTheme(): ThemeContextValue {\n const value = useContext(ThemeContext)\n\n if (!value) {\n throw new Error('useRootTheme(): missing context value')\n }\n\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n return value as unknown as ThemeContextValue\n}\n","import {ThemeColorCardToneKey, ThemeColorSchemeKey} from '../../theme/system/color/_system'\nimport {ThemeProvider} from './themeProvider'\nimport {useRootTheme} from './useRootTheme'\n\n/**\n * @public\n */\nexport interface ThemeColorProviderProps {\n children?: React.ReactNode\n scheme?: ThemeColorSchemeKey\n tone?: ThemeColorCardToneKey\n}\n\n/**\n * @public\n */\nexport function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element {\n const {children, scheme, tone} = props\n const root = useRootTheme()\n\n return (\n <ThemeProvider scheme={scheme || root.scheme} theme={root.theme} tone={tone}>\n {children}\n </ThemeProvider>\n )\n}\n","import {css} from 'styled-components'\n\nimport {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_cardColorStyle} from '../../styles/card/_cardColorStyle'\nimport {focusRingStyle} from '../../styles/focusRing'\nimport {_ruleSet} from '../../styles/helpers'\nimport {ThemeProps} from '../../styles/types'\nimport {CardStyleProps} from './types'\n\nconst RULES = _ruleSet(cardBaseStyle, cardColorStyle)\n\nexport function cardStyle(): CSSObject[] {\n return RULES\n}\n\nfunction cardBaseStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {\n const {$checkered} = props\n const {space} = getTheme_v2(props.theme)\n\n return css`\n ${\n $checkered &&\n css`\n background-size: ${space[3]}px ${space[3]}px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n `\n }\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n `\n}\n\nfunction cardColorStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {\n const {$checkered, $focusRing, $muted} = props\n const {card, color, style} = getTheme_v2(props.theme)\n const border = {width: card.border.width, color: 'var(--card-border-color)'}\n\n return css`\n color-scheme: ${color._dark ? 'dark' : 'light'};\n\n ${_cardColorStyle(color, color, $checkered)}\n\n background-color: ${$muted ? 'var(--card-muted-bg-color)' : 'var(--card-bg-color)'};\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n\n &[data-selected] {\n ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}\n }\n\n &:active {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ${\n $focusRing\n ? focusRingStyle({base: color, border, focusRing: card.focusRing})\n : undefined\n };\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n\n &[data-selected] {\n ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}\n }\n\n &:active {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ${\n $focusRing\n ? focusRingStyle({base: color, border, focusRing: card.focusRing})\n : undefined\n };\n }\n }\n }\n\n ${style?.card?.root}\n `\n}\n","import {isValidElementType} from 'react-is'\nimport {styled} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {responsiveBorderStyle} from '../../styles/border/borderStyle'\nimport {ResponsiveBorderStyleProps} from '../../styles/border/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveRadiusStyle} from '../../styles/radius/radiusStyle'\nimport {ResponsiveRadiusStyleProps} from '../../styles/radius/types'\nimport {responsiveShadowStyle} from '../../styles/shadow/shadowStyle'\nimport {ResponsiveShadowStyleProps} from '../../styles/shadow/types'\nimport {ThemeColorProvider} from '../../theme/themeColorProvider'\nimport {useRootTheme} from '../../theme/useRootTheme'\nimport {CardTone} from '../../types/card'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'\nimport {cardStyle} from './styles'\nimport {CardStyleProps} from './types'\n\n/**\n * @public\n */\nexport interface CardOwnProps\n extends BoxOwnProps, ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps {\n /**\n * Do not use in production.\n * @beta\n */\n __unstable_checkered?: boolean\n /**\n * Do not use in production.\n * @beta\n */\n __unstable_focusRing?: boolean\n disabled?: boolean\n muted?: boolean\n pressed?: boolean\n scheme?: ThemeColorSchemeKey\n selected?: boolean\n tone?: CardTone\n}\n\n/**\n * @public\n */\nexport type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>\n\nconst StyledCard = styled(Box)<\n CardStyleProps &\n ResponsiveRadiusStyleProps &\n ResponsiveBorderStyleProps &\n ResponsiveShadowStyleProps\n>(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle)\n\nfunction CardComponent(\n props: CardOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,\n) {\n const {\n __unstable_checkered: checkered = false,\n __unstable_focusRing: focusRing = false,\n as: asProp,\n border,\n borderTop,\n borderRight,\n borderBottom,\n borderLeft,\n muted,\n pressed,\n radius = 0,\n ref,\n scheme,\n selected,\n shadow,\n tone: toneProp = 'default',\n ...restProps\n } = props\n\n const as = isValidElementType(asProp) ? asProp : 'div'\n const rootTheme = useRootTheme()\n const tone = toneProp === 'inherit' ? rootTheme.tone : toneProp\n\n // todo: Consider adding the wrapper approach for nested cards in which the tones are not changing, avoid unnecessary ThemeColorProvider\n return (\n <ThemeColorProvider scheme={scheme} tone={tone}>\n <StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />\n </ThemeColorProvider>\n )\n}\n\n/**\n * The `Card` component acts much like a `Box`, but with a background and foreground color.\n * Components within a `Card` inherit its colors.\n *\n * @public\n */\nexport const Card: <E extends ElementType = 'div'>(props: CardProps<E>) => React.JSX.Element =\n CardComponent\n","import {useMemo, useSyncExternalStore} from 'react'\n\nimport {useTheme_v2} from '../../theme/useTheme'\n\n/**\n * @internal\n */\nexport interface _MediaStore {\n subscribe: (onStoreChange: () => void) => () => void\n getSnapshot: () => number\n}\n\ntype MediaQueryMinWidth = `(min-width: ${number}px)`\ntype MediaQueryMaxWidth = `(max-width: ${number}px)`\ntype MediaQueryMinMaxWidth = `${MediaQueryMinWidth} and ${MediaQueryMaxWidth}`\ntype MediaQuery = `screen and ${MediaQueryMinWidth | MediaQueryMaxWidth | MediaQueryMinMaxWidth}`\n\nfunction _getMediaQuery(media: number[], index: number): MediaQuery {\n if (index === 0) {\n return `screen and (max-width: ${media[index] - 1}px)`\n }\n\n if (index === media.length) {\n return `screen and (min-width: ${media[index - 1]}px)`\n }\n\n return `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`\n}\n\n// One canonical breakpoint array per content. Theme objects are rebuilt freely\n// (`buildTheme({media})` per workspace or scheme, cloned or deserialized themes),\n// and each rebuild carries its own `media` array instance. The store below is\n// keyed on that instance, so without this a new array with the same values\n// would tear down `media.length + 1` MediaQueryLists and listeners in every\n// subscribed `useMediaIndex` and create them again, for no change. Keyed by the\n// joined values; an app has as many entries as it has distinct breakpoint\n// configurations, so the map does not grow with rendering.\nconst canonicalMedia = new Map<string, number[]>()\n\nfunction _getCanonicalMedia(media: number[]): number[] {\n const key = media.join(',')\n const canonical = canonicalMedia.get(key)\n\n if (canonical) return canonical\n\n canonicalMedia.set(key, media)\n\n return media\n}\n\nfunction _createMediaStore(media: number[]): _MediaStore {\n const mediaLen = media.length\n let sizes: {mq: MediaQueryList; index: number}[]\n\n // The _createMediaStore function is called in both server and client environments.\n // However since subscribe and getSnapshot are only called on the client we lazy init what we need for them\n // so that we don't need to run checks for wether it's safe to call `window.matchMedia`\n const getSizes = () => {\n if (!sizes) {\n sizes = []\n\n for (let index = mediaLen; index > -1; index -= 1) {\n const mediaQuery = _getMediaQuery(media, index)\n\n sizes.push({index, mq: window.matchMedia(mediaQuery)})\n }\n }\n\n return sizes\n }\n\n const getSnapshot = () => {\n for (const {index, mq} of getSizes()) {\n if (mq.matches) return index\n }\n\n return 0\n }\n\n const subscribe = (onStoreChange: () => void) => {\n const disposeFns: (() => void)[] = []\n\n for (const {mq} of getSizes()) {\n const handleChange = () => {\n if (mq.matches) onStoreChange()\n }\n\n mq.addEventListener('change', handleChange)\n\n disposeFns.push(() => mq.removeEventListener('change', handleChange))\n }\n\n return () => {\n for (const disposeFn of disposeFns) {\n disposeFn()\n }\n }\n }\n\n return {getSnapshot, subscribe}\n}\n\n/**\n * Only called during server-side rendering, and hydration if using hydrateRoot\n * Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query\n * and we assume `(prefers-color-scheme: light)` since it's the most common scheme\n *\n * @link https://beta.reactjs.org/apis/react/useSyncExternalStore#adding-support-for-server-rendering\n */\nfunction getServerSnapshot() {\n return 0\n}\n\n/**\n * This API might change. DO NOT USE IN PRODUCTION.\n * @beta\n */\nexport function useMediaIndex(): number {\n const media = _getCanonicalMedia(useTheme_v2().media)\n const store = useMemo(() => _createMediaStore(media), [media])\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot)\n}\n","import {useCallback, useDebugValue, useSyncExternalStore} from 'react'\n\n/**\n * Efficiently subscribes to `window.matchMedia` queries\n *\n * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)\n *\n * @public\n */\nexport function useMatchMedia(\n mediaQueryString: `(${string})`,\n getServerSnapshot?: () => boolean,\n): boolean {\n useDebugValue(mediaQueryString)\n\n return useSyncExternalStore(\n useCallback(\n (onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n },\n [mediaQueryString],\n ),\n () => window.matchMedia(mediaQueryString).matches,\n getServerSnapshot,\n )\n}\n","import {useMatchMedia} from './useMatchMedia'\n\n/**\n * Returns true if motion should be reduced\n *\n * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)\n *\n * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.\n * Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion\n * @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b\n *\n * @public\n */\nexport function usePrefersReducedMotion(getServerSnapshot = () => false): boolean {\n return useMatchMedia('(prefers-reduced-motion: reduce)', getServerSnapshot)\n}\n","export function isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === 'object' && !Array.isArray(value))\n}\n","import {isRecord} from '../../lib/isRecord'\nimport {LayerContextValue} from './types'\n\nexport function getLayerContext(contextValue: LayerContextValue): LayerContextValue {\n // NOTE: This check is for future-compatiblity\n // - If the value is not an object, it’s not compatible with the current version\n // - If the value is an object, but doesn’t have `version: 0.0`, it’s not compatible with the current version\n if (!isRecord(contextValue) || contextValue.version !== 0.0) {\n throw new Error('the context value is not compatible')\n }\n\n if (!contextValue) {\n throw new Error('components using `useLayer()` should be wrapped in a <LayerProvider>.')\n }\n\n if (contextValue.version === 0.0) {\n return contextValue\n }\n\n throw new Error('could not get layer context')\n}\n","import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'\nimport {LayerContextValue} from './types'\n\nexport const LayerContext = createGlobalScopedContext<LayerContextValue | null>(\n '@sanity/ui/context/layer',\n null,\n)\n","/** @internal */\nexport interface LayerState {\n childLayers: ReadonlyMap<number, number>\n childrenWithoutLevel: number\n}\n\n/**\n * Registers or unregisters a child layer. Children from older `@sanity/ui` copies that share the\n * layer context register without a `level`.\n *\n * @internal\n */\nexport type LayerAction =\n | {type: 'child/register'; level?: number}\n | {type: 'child/unregister'; level?: number}\n\n/** @internal */\nexport const initialLayerState: LayerState = {childLayers: new Map(), childrenWithoutLevel: 0}\n\n/** @internal */\nexport function layerReducer(state: LayerState, action: LayerAction): LayerState {\n const {level} = action\n\n switch (action.type) {\n case 'child/register': {\n if (level === undefined) {\n return {...state, childrenWithoutLevel: state.childrenWithoutLevel + 1}\n }\n\n const childLayers = new Map(state.childLayers)\n\n childLayers.set(level, (childLayers.get(level) ?? 0) + 1)\n\n return {...state, childLayers}\n }\n\n case 'child/unregister': {\n if (level === undefined) {\n return {...state, childrenWithoutLevel: state.childrenWithoutLevel - 1}\n }\n\n const childLayers = new Map(state.childLayers)\n const count = childLayers.get(level) ?? 0\n\n if (count === 1) {\n childLayers.delete(level)\n } else {\n childLayers.set(level, count - 1)\n }\n\n return {...state, childLayers}\n }\n\n default: {\n action satisfies never\n\n return state\n }\n }\n}\n","import {useCallback, useContext, useEffect, useMemo, useReducer} from 'react'\n\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {getLayerContext} from './getLayerContext'\nimport {LayerContext} from './layerContext'\nimport {initialLayerState, layerReducer} from './layerReducer'\nimport {LayerContextValue} from './types'\n\n/**\n * @public\n */\nexport interface LayerProviderProps {\n children?: React.ReactNode\n zOffset?: number | number[]\n}\n\n/**\n * @public\n */\nexport function LayerProvider(props: LayerProviderProps): React.JSX.Element {\n const {children, zOffset: zOffsetProp = 0} = props\n\n // Get parent context values\n const parentContextValue = useContext(LayerContext)\n const parent = parentContextValue && getLayerContext(parentContextValue)\n const parentRegisterChild = parent?.registerChild\n const parentLevel = parent?.level ?? 0\n\n // Get level\n const level = parentLevel + 1\n\n // Get z-index offset\n const zOffset = _getArrayProp(zOffsetProp)\n\n // Get responsive z-index value\n const maxMediaIndex = zOffset.length - 1\n const mediaIndex = Math.min(useMediaIndex(), maxMediaIndex)\n const zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex]\n\n const [{childLayers, childrenWithoutLevel}, dispatch] = useReducer(\n layerReducer,\n initialLayerState,\n )\n\n const size = childLayers.size + childrenWithoutLevel\n const isTopLayer = size === 0\n\n const registerChild = useCallback(\n (childLevel?: number) => {\n const parentDispose = parentRegisterChild?.(childLevel)\n\n dispatch({type: 'child/register', level: childLevel})\n\n return () => {\n dispatch({type: 'child/unregister', level: childLevel})\n\n parentDispose?.()\n }\n },\n [parentRegisterChild],\n )\n\n // Register this layer on mount\n useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild])\n\n const value: LayerContextValue = useMemo(\n () => ({\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }),\n [isTopLayer, level, registerChild, size, zIndex],\n )\n\n return <LayerContext.Provider value={value}>{children}</LayerContext.Provider>\n}\n","import {useContext} from 'react'\n\nimport {getLayerContext} from './getLayerContext'\nimport {LayerContext} from './layerContext'\nimport {LayerContextValue} from './types'\n\n/**\n * @public\n */\nexport function useLayer(): LayerContextValue {\n const value = useContext(LayerContext)\n\n if (!value) {\n throw new Error('useLayer(): missing context value')\n }\n\n try {\n return getLayerContext(value)\n } catch (err) {\n if (err instanceof Error) {\n // oxlint-disable-next-line preserve-caught-error\n throw new Error(`useLayer(): ${err.message}`)\n } else {\n // oxlint-disable-next-line preserve-caught-error, restrict-template-expressions\n throw new Error(`useLayer(): ${err}`)\n }\n }\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,aAAwB,EAC5B,uCAAmC,EACjC,WAAW,OACb,EACF,GAEM,aAAkD;CACtD,SAAS;CACT,QAAQ;AACV,GAEM,aAAa;CACjB,SAAS;CACT,MAAM;AACR;AAEA,SAAgB,WAAsB;CACpC,OAAO;AACT;AAEA,MAAMA,UAAQ,SACZ,0BACA,0BACA,4BACA,yBACF;AAEA,SAAgB,qBAAkC;CAChD,OAAOA;AACT;AAEA,SAAS,0BAA0B,OAA6C;CAC9E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,WAAW,aAAa,EACtD,mBAAmB,EAAC,QAAO,EAC7B,EAAE;AACJ;AAEA,SAAS,yBAAyB,OAA6C;CAC7E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAA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