@sanity/ui 4.0.4 → 4.0.5

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 (58) hide show
  1. package/dist/{arrow-D0mvjJMb.js → arrow-BaqZdFUX.js} +5 -5
  2. package/dist/arrow-BaqZdFUX.js.map +1 -0
  3. package/dist/autocomplete.js +7 -7
  4. package/dist/autocomplete.js.map +1 -1
  5. package/dist/breadcrumbs.js +6 -6
  6. package/dist/breadcrumbs.js.map +1 -1
  7. package/dist/{button-QO2lWHVH.js → button-DpAiERt1.js} +6 -6
  8. package/dist/button-DpAiERt1.js.map +1 -0
  9. package/dist/code.js +1 -1
  10. package/dist/code.js.map +1 -1
  11. package/dist/codeFontStyle-aWvllgWi.js.map +1 -1
  12. package/dist/element-BYgCE_iK.js.map +1 -1
  13. package/dist/factory-BA3gEfyI.js.map +1 -1
  14. package/dist/{flex-C9NHtXFi.js → flex-C6SsHFy8.js} +3 -3
  15. package/dist/flex-C6SsHFy8.js.map +1 -0
  16. package/dist/getElementRef-5HZQ-Owu.js.map +1 -1
  17. package/dist/getScopedTheme-C-sZsyAz.js.map +1 -1
  18. package/dist/getTheme_v2-y09KqtEb.js.map +1 -1
  19. package/dist/{grid-Cr7qKmZQ.js → grid-3kBnMOwF.js} +3 -3
  20. package/dist/grid-3kBnMOwF.js.map +1 -0
  21. package/dist/helpers-JV5y3U_M.js.map +1 -1
  22. package/dist/{hotkeys-DyrSy500.js → hotkeys-BYRfM-HW.js} +10 -10
  23. package/dist/hotkeys-BYRfM-HW.js.map +1 -0
  24. package/dist/index.js +57 -57
  25. package/dist/index.js.map +1 -1
  26. package/dist/{layer-DcsNupeg.js → layer-DsScTlqC.js} +3 -3
  27. package/dist/layer-DsScTlqC.js.map +1 -0
  28. package/dist/menu.js +8 -8
  29. package/dist/menu.js.map +1 -1
  30. package/dist/{popover-5fEUllFf.js → popover-C2DFbwZu.js} +6 -6
  31. package/dist/popover-C2DFbwZu.js.map +1 -0
  32. package/dist/popover.js +1 -1
  33. package/dist/refractor-CC48DwHi.js.map +1 -1
  34. package/dist/responsiveFont-BwYElGq4.js.map +1 -1
  35. package/dist/{stack-B2zXPxzb.js → stack-wyPeapSx.js} +4 -4
  36. package/dist/stack-wyPeapSx.js.map +1 -0
  37. package/dist/{textInput-CgNWWr7H.js → textInput-DW447nYT.js} +14 -14
  38. package/dist/textInput-DW447nYT.js.map +1 -0
  39. package/dist/theme.js.map +1 -1
  40. package/dist/toast.js +11 -11
  41. package/dist/toast.js.map +1 -1
  42. package/dist/tooltip.js +5 -5
  43. package/dist/tooltip.js.map +1 -1
  44. package/dist/useClickOutsideEvent-DbLUuPQ6.js.map +1 -1
  45. package/dist/useElementSize-BJvbGHq8.js.map +1 -1
  46. package/dist/{useLayer-UpfaKlm7.js → useLayer-Dhme0dcp.js} +11 -11
  47. package/dist/useLayer-Dhme0dcp.js.map +1 -0
  48. package/package.json +3 -3
  49. package/dist/arrow-D0mvjJMb.js.map +0 -1
  50. package/dist/button-QO2lWHVH.js.map +0 -1
  51. package/dist/flex-C9NHtXFi.js.map +0 -1
  52. package/dist/grid-Cr7qKmZQ.js.map +0 -1
  53. package/dist/hotkeys-DyrSy500.js.map +0 -1
  54. package/dist/layer-DcsNupeg.js.map +0 -1
  55. package/dist/popover-5fEUllFf.js.map +0 -1
  56. package/dist/stack-B2zXPxzb.js.map +0 -1
  57. package/dist/textInput-CgNWWr7H.js.map +0 -1
  58. package/dist/useLayer-UpfaKlm7.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-C2DFbwZu.js","names":["{\n left: x,\n originX,\n originY,\n position: strategy,\n top: y,\n width,\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n }","animate ? 'transform' : undefined","useMemo(\n () => ({\n left: x,\n originX,\n originY,\n position: strategy,\n top: y,\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 )","animate ? ['hidden', 'initial'] : undefined","animate ? ['visible', 'scaleIn'] : undefined","animate ? ['hidden', 'scaleOut'] : undefined","<Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>","<MotionFlex\n data-ui=\"Popover__wrapper\"\n direction=\"column\"\n flex={1}\n overflow={overflow}\n transition={POPOVER_MOTION_PROPS.transition}\n initial={animate ? POPOVER_MOTION_PROPS.content.hidden : undefined}\n // The content fade is deliberately driven by `open` as a plain\n // target instead of participating in the card's variant/exit\n // propagation. Re-entering while an exit is (or seems) in flight can\n // leave motion's presence bookkeeping in a state where a variant\n // child's fade-in is skipped (it waits for a parent-driven animation\n // that never comes), permanently stuck at opacity 0. A target derived\n // from `open` is recomputed on every render and always animates from\n // the current value, so any rapid open/close/open sequence converges.\n animate={\n animate\n ? open\n ? POPOVER_MOTION_PROPS.content.visible\n : POPOVER_MOTION_PROPS.content.hidden\n : undefined\n }\n >\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </MotionFlex>","animate ? POPOVER_MOTION_PROPS.content.hidden : undefined","animate\n ? open\n ? POPOVER_MOTION_PROPS.content.visible\n : POPOVER_MOTION_PROPS.content.hidden\n : undefined","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 variants={POPOVER_MOTION_PROPS.card}\n transition={POPOVER_MOTION_PROPS.transition}\n initial={animate ? ['hidden', 'initial'] : undefined}\n animate={animate ? ['visible', 'scaleIn'] : undefined}\n exit={animate ? ['hidden', 'scaleOut'] : undefined}\n >\n <MotionFlex\n data-ui=\"Popover__wrapper\"\n direction=\"column\"\n flex={1}\n overflow={overflow}\n transition={POPOVER_MOTION_PROPS.transition}\n initial={animate ? POPOVER_MOTION_PROPS.content.hidden : undefined}\n // The content fade is deliberately driven by `open` as a plain\n // target instead of participating in the card's variant/exit\n // propagation. Re-entering while an exit is (or seems) in flight can\n // leave motion's presence bookkeeping in a state where a variant\n // child's fade-in is skipped (it waits for a parent-driven animation\n // that never comes), permanently stuck at opacity 0. A target derived\n // from `open` is recomputed on every render and always animates from\n // the current value, so any rapid open/close/open sequence converges.\n animate={\n animate\n ? open\n ? POPOVER_MOTION_PROPS.content.visible\n : POPOVER_MOTION_PROPS.content.hidden\n : undefined\n }\n >\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </MotionFlex>\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>","<div style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}} />","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 }","(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 open={open}\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 open={open}\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 {popoverNode}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{popoverNode}</Activity>\n )","<>\n {/* the popover */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {popoverNode}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{popoverNode}</Activity>\n )}\n\n {/* the referred element */}\n {child}\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 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 ])"],"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 {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\nconst MotionFlex = styled(motion.create(Flex))`\n will-change: opacity;\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 open?: boolean\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 open,\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 originX,\n originY,\n position: strategy,\n top: y,\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 variants={POPOVER_MOTION_PROPS.card}\n transition={POPOVER_MOTION_PROPS.transition}\n initial={animate ? ['hidden', 'initial'] : undefined}\n animate={animate ? ['visible', 'scaleIn'] : undefined}\n exit={animate ? ['hidden', 'scaleOut'] : undefined}\n >\n <MotionFlex\n data-ui=\"Popover__wrapper\"\n direction=\"column\"\n flex={1}\n overflow={overflow}\n transition={POPOVER_MOTION_PROPS.transition}\n initial={animate ? POPOVER_MOTION_PROPS.content.hidden : undefined}\n // The content fade is deliberately driven by `open` as a plain\n // target instead of participating in the card's variant/exit\n // propagation. Re-entering while an exit is (or seems) in flight can\n // leave motion's presence bookkeeping in a state where a variant\n // child's fade-in is skipped (it waits for a parent-driven animation\n // that never comes), permanently stuck at opacity 0. A target derived\n // from `open` is recomputed on every render and always animates from\n // the current value, so any rapid open/close/open sequence converges.\n animate={\n animate\n ? open\n ? POPOVER_MOTION_PROPS.content.visible\n : POPOVER_MOTION_PROPS.content.hidden\n : undefined\n }\n >\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </MotionFlex>\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 useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {useElementSize} from '../../hooks/useElementSize'\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {usePrefersReducedMotion} from '../../hooks/usePrefersReducedMotion'\nimport {origin} from '../../middleware/origin'\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 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\nconst ViewportOverlay = () => {\n const {zIndex} = useLayer()\n\n return <div style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}} />\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 const boundarySize = useElementSize(boundaryElement)?.border\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, middlewareData, placement, refs, strategy, update} = useFloating({\n middleware,\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined,\n })\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 open={open}\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 */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {popoverNode}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{popoverNode}</Activity>\n )}\n\n {/* the referred element */}\n {child}\n </>\n )\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;CACzE,KAAO;EAAC;EAAU;EAAQ;CAAO;CACjC,aAAa;EAAC;EAAgB;EAAc;CAAa;CACzD,WAAW;EAAC;EAAc;EAAY;CAAW;CACjD,QAAU;EAAC;EAAO;EAAQ;CAAO;CACjC,gBAAgB;EAAC;EAAa;EAAc;CAAa;CACzD,cAAc;EAAC;EAAW;EAAY;CAAW;CACjD,MAAQ;EAAC;EAAS;EAAO;CAAQ;CACjC,cAAc;EAAC;EAAe;EAAa;CAAc;CACzD,YAAY;EAAC;EAAa;EAAW;CAAY;CACjD,OAAS;EAAC;EAAQ;EAAO;CAAQ;CACjC,eAAe;EAAC;EAAc;EAAa;CAAc;CACzD,aAAa;EAAC;EAAY;EAAW;CAAY;AACnD;AClBA,SAAgB,KAAK,SAUN;CACb,IAAM,EACJ,eACA,SACA,qBACA,aACA,UAAU,GACV,mBACA,mBACA,aACE;CAEJ,OAAO;EACL,MAAM;EACN,MAAM,GAAG,MAAM;GACb,IAAM,EAAC,UAAU,WAAW,UAAU,UAAS,MACzC,EAAC,UAAU,cAAa,OAExB,WAAW,MAAM,eAAe,MAAM;IAC1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D,EAKF,GAVI,EAAA,KAAA,SAXA,EAAA,KAAA,WAGW,EAAA,KAAA,UAtDX,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"}
package/dist/popover.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import { t as Popover } from "./popover-5fEUllFf.js";
2
+ import { t as Popover } from "./popover-C2DFbwZu.js";
3
3
  export { Popover };
@@ -1 +1 @@
1
- {"version":3,"file":"refractor-CC48DwHi.js","names":["hasLanguage","Refractor","LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","registered","t1","t2","String","t3"],"sources":["../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";;;AAEA,SAAeE,cAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GAKb,EAAAC,UAAAC,cAAAC,UAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAxBA,eAAAE,KAAAA,GAA2DC;CAAA,AAAAN,EAAA,OAAAE,WAEVI,KAAAN,EAAA,MAA/CM,KAAAJ,WAAWN,YAAYM,QAAuB,IAA9C,IAA+CF,EAAA,KAAAE,UAAAF,EAAA,KAAAM;CAAlE,IAAAC,aAAmBD,IAA+CE;CAAA,AAAAR,EAAA,OAAAE,YAAAF,EAAA,OAAAO,cAAAP,EAAA,OAAAI,SAI7DI,KAAA,EAAEN,YAAAK,eAA2B,oBAAA,QAAA,EAAA,UAAOH,MAAa,CAAA,GAAAJ,EAAA,KAAAE,UAAAF,EAAA,KAAAO,YAAAP,EAAA,KAAAI,OAAAJ,EAAA,KAAAQ,MAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,AAAAT,EAAA,OAAAE,YAAAF,EAAA,OAAAO,cAAAP,EAAA,OAAAI,SAEjDK,KAAAP,YAAAK,cAA0B,oBAAC,WAAD;EAAW,QAAA;EAAiBL;EAAiB,OAAAQ,OAAON,KAAK;CAAC,CAAA,GAAIJ,EAAA,KAAAE,UAAAF,EAAA,KAAAO,YAAAP,EAAA,KAAAI,OAAAJ,EAAA,KAAAS,MAAAA,KAAAT,EAAA;CAAA,IAAAW;CACxF,OADwFX,EAAA,QAAAQ,MAAAR,EAAA,QAAAS,MAH3FE,KAAA,qBAAA,UAAA,EAAA,UAAA,CACGH,IAEAC,EAAwF,EAAA,CAAA,GACxFT,EAAA,MAAAQ,IAAAR,EAAA,MAAAS,IAAAT,EAAA,MAAAW,MAAAA,KAAAX,EAAA,KAJHW;AAIG"}
1
+ {"version":3,"file":"refractor-CC48DwHi.js","names":["language ? hasLanguage(language as any) : false","!(language && registered) && <code>{value}</code>","language && registered && <Refractor inline language={language} value={String(value)} />","<>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>"],"sources":["../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";;;AAEA,SAAwB,cACtB,OAGA;gBACM,EAAC,UAAU,cAAc,UAAS,OAClC,WAAW,OAAO,gBAAiB,WAAW,eAAe,KAAA,GAEhDA;kCAAW,KAAA,WAAA,YAAY,QAAe,IAAI,IAA1C,EAAA,KAAA;CAAnB,IAAM,aAAaA,IAIdC;CAAE,AAAA,EAAA,OAAA,YAAA,EAAA,OAAY,cAAA,EAAA,OAAsB,SAApC,KAAA,EAAE,YAAY,eAAe,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA,GAA9C,EAAA,KAAA,UAAY,EAAA,KAAA,YAAsB,EAAA,KAAA;CAEpCC,IAAAA;CAAY,AAAA,EAAA,OAAA,YAAA,EAAA,OAAA,cAAA,EAAA,OAAkE,SAA9E,KAAA,YAAY,cAAc,oBAAC,WAAD;EAAW,QAAA;EAAiB;EAAU,OAAO,OAAO,KAAK;CAAI,CAAA,GAAvF,EAAA,KAAA,UAAY,EAAA,KAAA,YAAkE,EAAA,KAAA;CAHjFC,IAAAA;CADF,OAEKF,EAAAA,QAAAA,MAAAA,EAAAA,QAEAC,MAHH,KAAA,qBAAA,UAAA,EAAA,UAAA,CACGD,IAEAC,EACD,EAAA,CAAA,GAHCD,EAAAA,MAAAA,IAEAC,EAAAA,MAAAA,8BAHHC;AAMJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"responsiveFont-BwYElGq4.js","names":["CSSObject","ThemeFontKey","ThemeFontSize","getTheme_v2","_responsive","rem","ThemeProps","FontWeightStyleProps","ResponsiveFontSizeStyleProps","responsiveFont","fontKey","props","$size","$weight","font","media","theme","family","sizes","weights","fontWeight","regular","defaultSize","base","content","display","height","warned","console","warn","resp","sizeIndex","fontSize","size","ascenderHeight","descenderHeight","iconSize","letterSpacing","lineHeight","negHeight","capHeight","iconOffset","customIconSize","Math","floor","customIconOffset","marginTop","marginBottom","margin"],"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, 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 [base]\n }\n\n const resp = _responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize))\n\n return [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,SAAgBS,eACdC,SACAC,OACa;CACb,IAAM,EAACC,OAAOC,YAAWF,OACnB,EAACG,MAAMC,UAASZ,YAAYQ,MAAMK,KAAK,GACvC,EAACC,QAAQC,OAAOC,YAAWL,KAAKJ,UAChCU,aAAcP,WAAWM,QAAQN,YAAaM,QAAQE,SAGtDC,cAAcJ,MAAM,IAEpBK,OAAkB;EACtB,UAAY;EACZ,YAAcN;EACd,YAAc,GAAGG;EACjB,SAAW;EACX,QAAU;EAEV,YAAY;GACVI,SAAS;GACTC,SAAS;GACTC,QAAQ;EACV;EAEA,WAAW;GACTF,SAAS;GACTC,SAAS;GACTC,QAAQ;EACV;EAEA,sBAAsB,EACpBD,SAAS,QACX;EAEA,mBAAmB,EACjBA,SAAS,QACX;CACF;CAgBA,OAbKb,QAaE,CAACW,MAAM,GAFDnB,YAAYW,OAAOH,QAAQmB,cAAcC,SAASd,MAAMa,cAAcT,WAAW,CAE7EQ,CAAI,KAXnB,AAGErB,eAAekB,YAFfC,QAAQC,KAAK,yCAAyC;EAACnB;EAASE;EAAOD;EAAOY;CAAI,CAAC,GAE3D,KAGnB,CAACA,IAAI;AAMhB;AAEA,SAASS,SAASC,MAAgC;CAChD,IAAM,EAACC,gBAAgBC,iBAAiBH,UAAUI,UAAUC,eAAeC,eAAcL,MACnFM,YAAYL,iBAAiBC,iBAC7BK,YAAYF,aAAaC,WACzBE,cAAcD,YAAYJ,YAAY,GACtCM,iBAAiBC,KAAKC,MAAOZ,WAAW,QAAS,CAAC,IAAI,IAAI,GAC1Da,oBAAoBL,YAAYE,kBAAkB;CAExD,OAAO;EACL,UAAYrC,IAAI2B,QAAQ;EACxB,YAAc,QAAQM,WAAU,KAAMN,SAAQ;EAC9C,eAAiB3B,IAAIgC,aAAa;EAClC,WAAa,cAAchC,IAAI8B,eAAe,EAAC;EAE/C,YAAY,EACVW,WAAW,QAAQzC,IAAI,IAAIkC,SAAS,EAAC,SACvC;EAEA,WAAW,EACTQ,cAAc,OAChB;EAEA,iCAAiC;GAC/Bf,UAAU,QAAQU,eAAc;GAChCM,QAAQ3C,IAAIwC,gBAAgB;EAC9B;EAEA,wBAAwB;GACtBb,UAAU,QAAQI,SAAQ;GAC1BY,QAAQ3C,IAAIoC,UAAU;EACxB;CACF;AACF"}
1
+ {"version":3,"file":"responsiveFont-BwYElGq4.js","names":[],"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, 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 [base]\n }\n\n const resp = _responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize))\n\n return [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]': {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,eAAe;GACjC,QAAQ,IAAI,gBAAgB;EAC9B;EAEA,wBAAwB;GACtB,UAAU,QAAQ,SAAS;GAC3B,QAAQ,IAAI,UAAU;EACxB;CACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { a as rem, i as _responsive, n as _getArrayProp } from "./helpers-JV5y3U_M.js";
2
2
  import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
3
- import { y as Box } from "./useLayer-UpfaKlm7.js";
3
+ import { y as Box } from "./useLayer-Dhme0dcp.js";
4
4
  import { t as responsiveFont } from "./responsiveFont-BwYElGq4.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { css, styled } from "styled-components";
@@ -35,7 +35,7 @@ function textBaseStyle(props) {
35
35
  }
36
36
  const StyledText = /* @__PURE__ */ styled.div.withConfig({
37
37
  displayName: "StyledText",
38
- componentId: "sc-01ese4-0"
38
+ componentId: "sc-300p63-0"
39
39
  })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
40
40
  function TextComponent(props) {
41
41
  let $ = c(27), align, childrenProp, ref, restProps, t0, t1, t2, textOverflow, weight;
@@ -84,7 +84,7 @@ function responsiveStackSpaceStyle(props) {
84
84
  }
85
85
  const StyledStack = /* @__PURE__ */ styled(Box).withConfig({
86
86
  displayName: "StyledStack",
87
- componentId: "sc-zdrpl6-0"
87
+ componentId: "sc-z8vnhh-0"
88
88
  })(stackBaseStyle, responsiveStackSpaceStyle);
89
89
  function StackComponent(props) {
90
90
  let $ = c(13), as, gap, ref, restProps;
@@ -109,4 +109,4 @@ function StackComponent(props) {
109
109
  const Stack = StackComponent;
110
110
  export { responsiveTextAlignStyle as a, responsiveTextFont as i, Text as n, SpanWithTextOverflow as r, Stack as t };
111
111
 
112
- //# sourceMappingURL=stack-B2zXPxzb.js.map
112
+ //# sourceMappingURL=stack-wyPeapSx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-wyPeapSx.js","names":["<span className={spanWithTextOverflow}>{props.children}</span>","children","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>","_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"],"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 */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Text = TextComponent as unknown as <E extends ElementType = 'div'>(\n props: TextProps<E>,\n) => React.JSX.Element\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,IAAM,E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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,9 +1,9 @@
1
1
  import { a as rem, i as _responsive, n as _getArrayProp, s as EMPTY_RECORD } from "./helpers-JV5y3U_M.js";
2
2
  import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement } from "./element-BYgCE_iK.js";
3
3
  import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
4
- import { l as useRootTheme, m as focusRingStyle, p as focusRingBorderStyle, s as Card, v as responsiveRadiusStyle, y as Box } from "./useLayer-UpfaKlm7.js";
5
- import { n as Text } from "./stack-B2zXPxzb.js";
6
- import { t as Button } from "./button-QO2lWHVH.js";
4
+ import { l as useRootTheme, m as focusRingStyle, p as focusRingBorderStyle, s as Card, v as responsiveRadiusStyle, y as Box } from "./useLayer-Dhme0dcp.js";
5
+ import { n as Text } from "./stack-wyPeapSx.js";
6
+ import { t as Button } from "./button-DpAiERt1.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import { isValidElement, useEffect, useImperativeHandle, useRef } from "react";
9
9
  import { css, styled } from "styled-components";
@@ -148,34 +148,34 @@ function textInputRepresentationStyle(props) {
148
148
  }
149
149
  const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, StyledTextInput = /* @__PURE__ */ styled(Card).attrs({ forwardedAs: "span" }).withConfig({
150
150
  displayName: "StyledTextInput",
151
- componentId: "sc-ceualg-0"
151
+ componentId: "sc-zwsvc0-0"
152
152
  })(textInputRootStyle), InputRoot = styled.span.withConfig({
153
153
  displayName: "InputRoot",
154
- componentId: "sc-ceualg-1"
154
+ componentId: "sc-zwsvc0-1"
155
155
  })`flex:1;min-width:0;display:block;position:relative;`, Prefix = styled(Card).attrs({ forwardedAs: "span" }).withConfig({
156
156
  displayName: "Prefix",
157
- componentId: "sc-ceualg-2"
157
+ componentId: "sc-zwsvc0-2"
158
158
  })`border-top-right-radius:0;border-bottom-right-radius:0;& > span{display:block;margin:-1px;}`, Suffix = styled(Card).attrs({ forwardedAs: "span" }).withConfig({
159
159
  displayName: "Suffix",
160
- componentId: "sc-ceualg-3"
160
+ componentId: "sc-zwsvc0-3"
161
161
  })`border-top-left-radius:0;border-bottom-left-radius:0;& > span{display:block;margin:-1px;}`, Input = /* @__PURE__ */ styled.input.withConfig({
162
162
  displayName: "Input",
163
- componentId: "sc-ceualg-4"
163
+ componentId: "sc-zwsvc0-4"
164
164
  })(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled.span.withConfig({
165
165
  displayName: "Presentation",
166
- componentId: "sc-ceualg-5"
166
+ componentId: "sc-zwsvc0-5"
167
167
  })(responsiveRadiusStyle, textInputRepresentationStyle), LeftBox = styled(Box).withConfig({
168
168
  displayName: "LeftBox",
169
- componentId: "sc-ceualg-6"
169
+ componentId: "sc-zwsvc0-6"
170
170
  })`position:absolute;top:0;left:0;`, RightBox = styled(Box).withConfig({
171
171
  displayName: "RightBox",
172
- componentId: "sc-ceualg-7"
172
+ componentId: "sc-zwsvc0-7"
173
173
  })`position:absolute;top:0;right:0;`, RightCard = styled(Card).withConfig({
174
174
  displayName: "RightCard",
175
- componentId: "sc-ceualg-8"
175
+ componentId: "sc-zwsvc0-8"
176
176
  })`background-color:transparent;position:absolute;top:0;right:0;`, TextInputClearButton = /* @__PURE__ */ styled(Button).withConfig({
177
177
  displayName: "TextInputClearButton",
178
- componentId: "sc-ceualg-9"
178
+ componentId: "sc-zwsvc0-9"
179
179
  })({ "&:not([hidden])": { display: "block" } });
180
180
  /**
181
181
  * Single line text input.
@@ -318,4 +318,4 @@ function _temp(event) {
318
318
  }
319
319
  export { textInputRootStyle as a, useCustomValidity as c, focusFirstDescendant as d, focusLastDescendant as f, _raf2 as h, textInputRepresentationStyle as i, _hasFocus as l, _raf as m, textInputBaseStyle as n, responsiveInputPaddingIconRightStyle as o, isFocusable as p, textInputFontSizeStyle as r, responsiveInputPaddingStyle as s, TextInput as t, attemptFocus as u };
320
320
 
321
- //# sourceMappingURL=textInput-CgNWWr7H.js.map
321
+ //# sourceMappingURL=textInput-DW447nYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textInput-DW447nYT.js","names":["() => {\n ref.current?.setCustomValidity(customValidity || '')\n }","[customValidity, ref]","ref.current?.setCustomValidity","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 <LeftBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </LeftBox>\n )","!$hasClearButton && IconRightComponent && (\n <RightBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </RightBox>\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 >\n {IconComponent && (\n <LeftBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </LeftBox>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <RightBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </RightBox>\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 >\n {IconComponent && (\n <LeftBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </LeftBox>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <RightBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </RightBox>\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 <TextInputClearButton\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 onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n )","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 <TextInputClearButton\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 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 {...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","<InputRoot>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\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 </InputRoot>","<StyledTextInput data-ui=\"TextInput\" tone={rootTheme.tone}>\n {prefixNode}\n\n <InputRoot>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\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 </InputRoot>\n\n {suffixNode}\n </StyledTextInput>","v"],"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/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\nconst ROOT_STYLE = css`\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n`\n\nexport function textInputRootStyle(): ReturnType<typeof css> {\n return ROOT_STYLE\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 {CloseIcon} from '@sanity/icons/Close'\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 textInputRootStyle,\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\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\nconst StyledTextInput = styled(Card).attrs({forwardedAs: 'span'})(textInputRootStyle)\n\nconst InputRoot = styled.span`\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n`\n\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\nconst LeftBox = styled(Box)`\n position: absolute;\n top: 0;\n left: 0;\n`\n\nconst RightBox = styled(Box)`\n position: absolute;\n top: 0;\n right: 0;\n`\n\nconst RightCard = styled(Card)`\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n`\n\nconst TextInputClearButton = styled(Button)({\n '&:not([hidden])': {\n display: 'block',\n },\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 >\n {IconComponent && (\n <LeftBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </LeftBox>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <RightBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </RightBox>\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 = useMemo(\n () => (typeof clearButton === 'object' ? clearButton : EMPTY_RECORD),\n [clearButton],\n )\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 <TextInputClearButton\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 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 <StyledTextInput data-ui=\"TextInput\" tone={rootTheme.tone}>\n {prefixNode}\n\n <InputRoot>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\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 </InputRoot>\n\n {suffixNode}\n </StyledTextInput>\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,SAAS,SAAS,aAAa;AACnF;;;;AAKA,SAAgB,YAAY,SAA+B;CAwBzD,OAtBE,QAAQ,WAAW,KAClB,QAAQ,aAAa,KAAK,QAAQ,aAAa,UAAU,MAAM,OAEzD,KAGL,oBAAoB,OAAO,IACtB,EAAQ,QAAQ,QAAS,QAAQ,QAAQ,WAG9C,mBAAmB,OAAO,IACrB,QAAQ,SAAS,YAAY,QAAQ,SAAS,UAAU,CAAC,QAAQ,WAIxE,oBAAoB,OAAO,KAC3B,oBAAoB,OAAO,KAC3B,sBAAsB,OAAO,IAEtB,CAAC,QAAQ,WAGX;AACT;;;;AAKA,SAAgB,aAAa,SAA+B;CAC1D,IAAI,CAAC,YAAY,OAAO,GACtB,OAAO;CAKT,IAAI;EACF,QAAQ,MAAM;CAChB,QAAQ,CAER;CAIA,OAAO,SAAS,kBAAkB;AACpC;;;;AAKA,SAAgB,qBAAqB,SAA+B;CAClE,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,WAAW,QAAQ,KAAK;EAClD,IAAM,QAAQ,QAAQ,WAAW;EAEjC,IAAI,cAAc,KAAK,MAAM,aAAa,KAAK,KAAK,qBAAqB,KAAK,IAC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D,EAAA,MAAA,UARC,EAAA,MAAA,UAGD,EAAA,MAAA,SAMA,EAAA,MAAA,UAVN,EAAA,MAAA,WAFmBf,EAAAA,MAAAA,UAAAA,QACFC,EAAAA,MAAAA,UAAAA,MAOb,EAAA,MAAA,OAHIc,EAAAA,MAAAA,KASN,EAAA,MAAA,MAJG,EAAA,MAAA;CAbbC,IAAAA;CAqBG,AAAA,EAAA,QAAA,mBAAA,EAAA,QADA,oBAAA,EAAA,QAnBDF,OADF,MAAA,qBAAC,WAAD,EAAA,UAAA;EACEA;EAmBC;EACA;CACQ,EAAA,CAAA,GADR,EAAA,MAAA,iBADA,EAAA,MAAA,kBAnBDA,EAAAA,MAAAA;CAJJG,IAAAA;CADF,OAEK,EAAA,QAAA,cAAA,EAAA,QADkDhB,UAAAA,QAAAA,EAAAA,QA2BlD,cAAA,EAAA,QAxBDe,OAHF,MAAA,qBAAC,iBAAD;EAAiB,WAAQ;EAAY,MAAM,UAAU;EAArD,UAAA;GACG;GAEDA;GAwBC;EACc;KA3Bd,EAAA,MAAA,YADkDf,EAAAA,MAAAA,UAAAA,MA2BlD,EAAA,MAAA,YAxBDe,EAAAA,MAAAA,iCAHFC;AA8BJ;AA/FkB,SAAA,OAAC,KAAM;CAKjB,OAJIC,QAAM,KACNA,QAAM,IAAU,IAChBA,QAAM,IAAU,IAEbA,MAAI;AACb;AAjBY,SAAA,OAAC,GAAM;CAKjB,OAJI,MAAM,IAAU,IAChB,MAAM,KACN,MAAM,IAAU,IAEb,IAAI;AACb;AAtFqC,SAAA,MAAC,OAA+C;CAEvF,AADA,MAAM,eAAe,GACrB,MAAM,gBAAgB;AACxB"}
package/dist/theme.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","names":["parseColor","RGB","RGBA","getContrastRatio","bg","fg","rgb1","rgb2","c1","rgb_lrgb","c2","l1","lrgb_luminance","l2","Math","max","min","r","g","b","rgb_lrgb1","v","isColorButtonMode","isColorConfigBaseKey","isColorConfigBaseTone","isColorConfigBlendKey","isColorConfigStateKey","isColorConfigStateTone","TokenKeyNode","parseTokenKey","str","segments","split","segment0","shift","key","join","type","tone","segment1","segment2","mode","undefined","RootTheme","RootTheme_v2","is_v0","themeProp","_version"],"sources":["../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/versioning/is_v0.ts"],"sourcesContent":["import {parseColor} from './parse'\nimport {RGB, RGBA} from './types'\n\n/** @internal */\nexport function getContrastRatio(bg: string, fg: string): number {\n const rgb1 = parseColor(bg) // bg: RGB | RGBA, fg: RGB | RGBA\n const rgb2 = parseColor(fg)\n\n // convert the two colors from sRGB to linear-light RGB\n const c1 = rgb_lrgb(rgb1)\n const c2 = rgb_lrgb(rgb2)\n\n // compute the relative luminances\n const l1 = lrgb_luminance(c1)\n const l2 = lrgb_luminance(c2)\n\n // compute the contrast ratio\n return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)\n}\n\nfunction rgb_lrgb({r, g, b}: RGB | RGBA): [number, number, number] {\n return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)]\n}\n\nfunction rgb_lrgb1(v: number) {\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction lrgb_luminance([r, g, b]: [number, number, number]) {\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n","import {isColorButtonMode} from '../../system/color/_helpers'\nimport {\n isColorConfigBaseKey,\n isColorConfigBaseTone,\n isColorConfigBlendKey,\n isColorConfigStateKey,\n isColorConfigStateTone,\n} from '../helpers'\nimport {TokenKeyNode} from './types'\n\n/** @internal */\nexport function parseTokenKey(str: string): TokenKeyNode | undefined {\n const segments = str.split('/')\n const segment0 = segments.shift() || ''\n\n if (isColorConfigBaseTone(segment0)) {\n const key = segments.join('/')\n\n if (isColorConfigBaseKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n }\n\n if (segment0 === 'button') {\n const segment1 = segments.shift() || ''\n\n if (isColorConfigStateTone(segment1)) {\n const segment2 = segments.shift() || ''\n\n if (isColorButtonMode(segment2)) {\n const key = segments.join('/')\n\n if (isColorConfigStateKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n }\n }\n }\n\n return undefined\n}\n","import {RootTheme, RootTheme_v2} from '../system/theme'\n\n/** @internal */\nexport function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme {\n return themeProp._version === 0\n}\n"],"mappings":";;;;AAIA,SAAgBG,iBAAiBC,IAAYC,IAAoB;CAC/D,IAAMC,OAAON,WAAWI,EAAE,GACpBG,OAAOP,WAAWK,EAAE,GAGpBG,KAAKC,SAASH,IAAI,GAClBI,KAAKD,SAASF,IAAI,GAGlBI,KAAKC,eAAeJ,EAAE,GACtBK,KAAKD,eAAeF,EAAE;CAG5B,QAAQI,KAAKC,IAAIJ,IAAIE,EAAE,IAAI,QAASC,KAAKE,IAAIL,IAAIE,EAAE,IAAI;AACzD;AAEA,SAASJ,SAAS,EAACQ,GAAGC,GAAGC,KAA0C;CACjE,OAAO;EAACC,UAAUH,IAAI,GAAG;EAAGG,UAAUF,IAAI,GAAG;EAAGE,UAAUD,IAAI,GAAG;CAAC;AACpE;AAEA,SAASC,UAAUC,GAAW;CAC5B,OAAOA,KAAK,SAAUA,IAAI,UAAUA,IAAI,QAAS,UAAU;AAC7D;AAEA,SAAST,eAAe,CAACK,GAAGC,GAAGC,IAA8B;CAC3D,OAAO,QAASF,IAAI,QAASC,IAAI,QAASC;AAC5C;;ACnBA,SAAgBU,cAAcC,KAAuC;CACnE,IAAMC,WAAWD,IAAIE,MAAM,GAAG,GACxBC,WAAWF,SAASG,MAAM,KAAK;CAErC,IAAIV,sBAAsBS,QAAQ,GAAG;EACnC,IAAME,MAAMJ,SAASK,KAAK,GAAG;EAU7B,IARIb,qBAAqBY,GAAG,KAQxBV,sBAAsBU,GAAG,GAC3B,OAAO;GACLE,MAAM;GACNC,MAAML;GACNE;EACF;CAEJ;CAEA,IAAIF,aAAa,UAAU;EACzB,IAAMM,WAAWR,SAASG,MAAM,KAAK;EAErC,IAAIP,uBAAuBY,QAAQ,GAAG;GACpC,IAAMC,WAAWT,SAASG,MAAM,KAAK;GAErC,IAAIZ,kBAAkBkB,QAAQ,GAAG;IAC/B,IAAML,MAAMJ,SAASK,KAAK,GAAG;IAW7B,IATIV,sBAAsBS,GAAG,KASzBV,sBAAsBU,GAAG,GAC3B,OAAO;KACLE,MAAM;KACNC,MAAMC;KACNE,MAAMD;KACNL;IACF;GAEJ;EACF;CACF;AAGF;;AC/DA,SAAgBU,MAAMC,WAA6D;CACjF,OAAOA,UAAUC,aAAa;AAChC"}
1
+ {"version":3,"file":"theme.js","names":[],"sources":["../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/versioning/is_v0.ts"],"sourcesContent":["import {parseColor} from './parse'\nimport {RGB, RGBA} from './types'\n\n/** @internal */\nexport function getContrastRatio(bg: string, fg: string): number {\n const rgb1 = parseColor(bg) // bg: RGB | RGBA, fg: RGB | RGBA\n const rgb2 = parseColor(fg)\n\n // convert the two colors from sRGB to linear-light RGB\n const c1 = rgb_lrgb(rgb1)\n const c2 = rgb_lrgb(rgb2)\n\n // compute the relative luminances\n const l1 = lrgb_luminance(c1)\n const l2 = lrgb_luminance(c2)\n\n // compute the contrast ratio\n return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)\n}\n\nfunction rgb_lrgb({r, g, b}: RGB | RGBA): [number, number, number] {\n return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)]\n}\n\nfunction rgb_lrgb1(v: number) {\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction lrgb_luminance([r, g, b]: [number, number, number]) {\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n","import {isColorButtonMode} from '../../system/color/_helpers'\nimport {\n isColorConfigBaseKey,\n isColorConfigBaseTone,\n isColorConfigBlendKey,\n isColorConfigStateKey,\n isColorConfigStateTone,\n} from '../helpers'\nimport {TokenKeyNode} from './types'\n\n/** @internal */\nexport function parseTokenKey(str: string): TokenKeyNode | undefined {\n const segments = str.split('/')\n const segment0 = segments.shift() || ''\n\n if (isColorConfigBaseTone(segment0)) {\n const key = segments.join('/')\n\n if (isColorConfigBaseKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n }\n\n if (segment0 === 'button') {\n const segment1 = segments.shift() || ''\n\n if (isColorConfigStateTone(segment1)) {\n const segment2 = segments.shift() || ''\n\n if (isColorButtonMode(segment2)) {\n const key = segments.join('/')\n\n if (isColorConfigStateKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n }\n }\n }\n\n return undefined\n}\n","import {RootTheme, RootTheme_v2} from '../system/theme'\n\n/** @internal */\nexport function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme {\n return themeProp._version === 0\n}\n"],"mappings":";;;;AAIA,SAAgB,iBAAiB,IAAY,IAAoB;CAC/D,IAAM,OAAO,WAAW,EAAE,GACpB,OAAO,WAAW,EAAE,GAGpB,KAAK,SAAS,IAAI,GAClB,KAAK,SAAS,IAAI,GAGlB,KAAK,eAAe,EAAE,GACtB,KAAK,eAAe,EAAE;CAG5B,QAAQ,KAAK,IAAI,IAAI,EAAE,IAAI,QAAS,KAAK,IAAI,IAAI,EAAE,IAAI;AACzD;AAEA,SAAS,SAAS,EAAC,GAAG,GAAG,KAA0C;CACjE,OAAO;EAAC,UAAU,IAAI,GAAG;EAAG,UAAU,IAAI,GAAG;EAAG,UAAU,IAAI,GAAG;CAAC;AACpE;AAEA,SAAS,UAAU,GAAW;CAC5B,OAAO,KAAK,SAAU,IAAI,UAAU,IAAI,QAAS,UAAU;AAC7D;AAEA,SAAS,eAAe,CAAC,GAAG,GAAG,IAA8B;CAC3D,OAAO,QAAS,IAAI,QAAS,IAAI,QAAS;AAC5C;;ACnBA,SAAgB,cAAc,KAAuC;CACnE,IAAM,WAAW,IAAI,MAAM,GAAG,GACxB,WAAW,SAAS,MAAM,KAAK;CAErC,IAAI,sBAAsB,QAAQ,GAAG;EACnC,IAAM,MAAM,SAAS,KAAK,GAAG;EAU7B,IARI,qBAAqB,GAAG,KAQxB,sBAAsB,GAAG,GAC3B,OAAO;GACL,MAAM;GACN,MAAM;GACN;EACF;CAEJ;CAEA,IAAI,aAAa,UAAU;EACzB,IAAM,WAAW,SAAS,MAAM,KAAK;EAErC,IAAI,uBAAuB,QAAQ,GAAG;GACpC,IAAM,WAAW,SAAS,MAAM,KAAK;GAErC,IAAI,kBAAkB,QAAQ,GAAG;IAC/B,IAAM,MAAM,SAAS,KAAK,GAAG;IAW7B,IATI,sBAAsB,GAAG,KASzB,sBAAsB,GAAG,GAC3B,OAAO;KACL,MAAM;KACN,MAAM;KACN,MAAM;KACN;IACF;GAEJ;EACF;CACF;AAGF;;AC/DA,SAAgB,MAAM,WAA6D;CACjF,OAAO,UAAU,aAAa;AAChC"}
package/dist/toast.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
3
- import { d as createGlobalScopedContext, i as usePrefersReducedMotion, n as LayerProvider, r as isRecord, s as Card, t as useLayer, y as Box } from "./useLayer-UpfaKlm7.js";
4
- import { t as Flex } from "./flex-C9NHtXFi.js";
5
- import { n as Text, t as Stack } from "./stack-B2zXPxzb.js";
6
- import { t as Button } from "./button-QO2lWHVH.js";
7
- import { t as Grid } from "./grid-Cr7qKmZQ.js";
3
+ import { d as createGlobalScopedContext, i as usePrefersReducedMotion, n as LayerProvider, r as isRecord, s as Card, t as useLayer, y as Box } from "./useLayer-Dhme0dcp.js";
4
+ import { t as Flex } from "./flex-C6SsHFy8.js";
5
+ import { n as Text, t as Stack } from "./stack-wyPeapSx.js";
6
+ import { t as Button } from "./button-DpAiERt1.js";
7
+ import { t as Grid } from "./grid-3kBnMOwF.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { startTransition, useContext, useState, useSyncExternalStore } from "react";
10
10
  import { styled } from "styled-components";
@@ -23,19 +23,19 @@ const STATUS_CARD_TONE = {
23
23
  info: "neutral"
24
24
  }, TextBox = styled(Flex).withConfig({
25
25
  displayName: "TextBox",
26
- componentId: "sc-xd2ehd-0"
26
+ componentId: "sc-iyk5nq-0"
27
27
  })`overflow-x:auto;`, StyledToast = styled(Card).withConfig({
28
28
  displayName: "StyledToast",
29
- componentId: "sc-xd2ehd-1"
29
+ componentId: "sc-iyk5nq-1"
30
30
  })`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${2}px / 2);}`, LoadingBar = styled.div.withConfig({
31
31
  displayName: "LoadingBar",
32
- componentId: "sc-xd2ehd-2"
32
+ componentId: "sc-iyk5nq-2"
33
33
  })`display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;`, LoadingBarMask = styled(Card).withConfig({
34
34
  displayName: "LoadingBarMask",
35
- componentId: "sc-xd2ehd-3"
35
+ componentId: "sc-iyk5nq-3"
36
36
  })`position:absolute;top:0;left:-${2}px;right:-${2}px;bottom:${2}px;z-index:1;`, LoadingBarProgress = styled(Card).withConfig({
37
37
  displayName: "LoadingBarProgress",
38
- componentId: "sc-xd2ehd-4"
38
+ componentId: "sc-iyk5nq-4"
39
39
  })`display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:${(props) => {
40
40
  let { color } = getTheme_v2(props.theme);
41
41
  return color.button.default[props.tone].enabled.bg;
@@ -212,7 +212,7 @@ function ToastLayer(props) {
212
212
  }
213
213
  const StyledLayer = styled(Grid).withConfig({
214
214
  displayName: "StyledLayer",
215
- componentId: "sc-kxgg1x-0"
215
+ componentId: "sc-7muzlg-0"
216
216
  })`box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;`;
217
217
  let toastId = 0;
218
218
  /** @internal */