@huin-core/react-scroll-area 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts", "../src/ScrollArea.tsx", "../src/ScrollAreaScrollbar.tsx", "../src/useStateMachine.ts", "../src/ScrollAreaCorner.tsx", "../src/ScrollAreaViewport.tsx", "../src/ScrollAreaThumb.tsx"],
4
+ "sourcesContent": ["\"use client\";\nexport { createScrollAreaScope, ScrollArea, Root } from \"./ScrollArea\";\nexport { ScrollAreaViewport } from \"./ScrollAreaViewport\";\nexport { ScrollAreaScrollbar } from \"./ScrollAreaScrollbar\";\nexport { ScrollAreaThumb } from \"./ScrollAreaThumb\";\nexport { ScrollAreaCorner } from \"./ScrollAreaCorner\";\n\nexport type { ScrollAreaProps } from \"./ScrollArea\";\nexport type { ScrollAreaViewportProps } from \"./ScrollAreaViewport\";\nexport type { ScrollAreaScrollbarProps } from \"./ScrollAreaScrollbar\";\nexport type { ScrollAreaThumbProps } from \"./ScrollAreaThumb\";\nexport type { ScrollAreaCornerProps } from \"./ScrollAreaCorner\";\n", "import * as React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { createContextScope } from \"@huin-core/react-context\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useDirection } from \"@huin-core/react-direction\";\nimport type { Scope } from \"@huin-core/react-context\";\nimport { ScrollAreaViewportElement } from \"./ScrollAreaViewport\";\n\nimport {\n ScrollAreaScrollbarElement,\n SCROLLBAR_NAME,\n ScrollbarContext,\n} from \"./ScrollAreaScrollbar\";\n\nexport type Direction = \"ltr\" | \"rtl\";\nexport type Sizes = {\n content: number;\n viewport: number;\n scrollbar: {\n size: number;\n paddingStart: number;\n paddingEnd: number;\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollArea\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_AREA_NAME = \"ScrollArea\";\n\nexport type ScopedProps<P> = P & { __scopeScrollArea?: Scope };\nexport const [createScrollAreaContext, createScrollAreaScope] =\n createContextScope(SCROLL_AREA_NAME);\n\nexport const [ScrollbarProvider, useScrollbarContext] =\n createScrollAreaContext<ScrollbarContext>(SCROLLBAR_NAME);\n\ntype ScrollAreaContextValue = {\n type: \"auto\" | \"always\" | \"scroll\" | \"hover\";\n dir: Direction;\n scrollHideDelay: number;\n scrollArea: ScrollAreaElement | null;\n viewport: ScrollAreaViewportElement | null;\n onViewportChange(viewport: ScrollAreaViewportElement | null): void;\n content: HTMLDivElement | null;\n onContentChange(content: HTMLDivElement): void;\n scrollbarX: ScrollAreaScrollbarElement | null;\n onScrollbarXChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarXEnabled: boolean;\n onScrollbarXEnabledChange(rendered: boolean): void;\n scrollbarY: ScrollAreaScrollbarElement | null;\n onScrollbarYChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarYEnabled: boolean;\n onScrollbarYEnabledChange(rendered: boolean): void;\n onCornerWidthChange(width: number): void;\n onCornerHeightChange(height: number): void;\n};\n\nexport const [ScrollAreaProvider, useScrollAreaContext] =\n createScrollAreaContext<ScrollAreaContextValue>(SCROLL_AREA_NAME);\n\ntype ScrollAreaElement = React.ElementRef<typeof Primitive.div>;\nexport type PrimitiveDivProps = React.ComponentPropsWithoutRef<\n typeof Primitive.div\n>;\ninterface ScrollAreaProps extends PrimitiveDivProps {\n type?: ScrollAreaContextValue[\"type\"];\n dir?: ScrollAreaContextValue[\"dir\"];\n scrollHideDelay?: number;\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>(\n (props: ScopedProps<ScrollAreaProps>, forwardedRef) => {\n const {\n __scopeScrollArea,\n type = \"hover\",\n dir,\n scrollHideDelay = 600,\n ...scrollAreaProps\n } = props;\n const [scrollArea, setScrollArea] =\n React.useState<ScrollAreaElement | null>(null);\n const [viewport, setViewport] =\n React.useState<ScrollAreaViewportElement | null>(null);\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const [scrollbarX, setScrollbarX] =\n React.useState<ScrollAreaScrollbarElement | null>(null);\n const [scrollbarY, setScrollbarY] =\n React.useState<ScrollAreaScrollbarElement | null>(null);\n const [cornerWidth, setCornerWidth] = React.useState(0);\n const [cornerHeight, setCornerHeight] = React.useState(0);\n const [scrollbarXEnabled, setScrollbarXEnabled] = React.useState(false);\n const [scrollbarYEnabled, setScrollbarYEnabled] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) =>\n setScrollArea(node)\n );\n const direction = useDirection(dir);\n\n return (\n <ScrollAreaProvider\n scope={__scopeScrollArea}\n type={type}\n dir={direction}\n scrollHideDelay={scrollHideDelay}\n scrollArea={scrollArea}\n viewport={viewport}\n onViewportChange={setViewport}\n content={content}\n onContentChange={setContent}\n scrollbarX={scrollbarX}\n onScrollbarXChange={setScrollbarX}\n scrollbarXEnabled={scrollbarXEnabled}\n onScrollbarXEnabledChange={setScrollbarXEnabled}\n scrollbarY={scrollbarY}\n onScrollbarYChange={setScrollbarY}\n scrollbarYEnabled={scrollbarYEnabled}\n onScrollbarYEnabledChange={setScrollbarYEnabled}\n onCornerWidthChange={setCornerWidth}\n onCornerHeightChange={setCornerHeight}\n >\n <Primitive.div\n dir={direction}\n {...scrollAreaProps}\n ref={composedRefs}\n style={{\n position: \"relative\",\n // Pass corner sizes as CSS vars to reduce re-renders of context consumers\n [\"--huin-core-scroll-area-corner-width\" as any]: cornerWidth + \"px\",\n [\"--huin-core-scroll-area-corner-height\" as any]: cornerHeight + \"px\",\n ...props.style,\n }}\n />\n </ScrollAreaProvider>\n );\n }\n);\n\nScrollArea.displayName = SCROLL_AREA_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = ScrollArea;\n\nexport { ScrollArea, Root };\nexport type { ScrollAreaProps };\n", "import React from \"react\";\nimport { useCallbackRef } from \"@huin-core/react-use-callback-ref\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n Direction,\n PrimitiveDivProps,\n ScopedProps,\n ScrollbarProvider,\n Sizes,\n useScrollAreaContext,\n} from \"./ScrollArea\";\nimport { Presence } from \"@huin-core/react-presence\";\nimport { useStateMachine } from \"./useStateMachine\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport { useResizeObserver } from \"./ScrollAreaCorner\";\nimport { ScrollAreaThumbElement } from \"./ScrollAreaThumb\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { clamp } from \"@huin-core/number\";\n\nexport const SCROLLBAR_NAME = 'ScrollAreaScrollbar';\n\nexport type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbar = React.forwardRef<ScrollAreaScrollbarElement, ScrollAreaScrollbarProps>(\n (props: ScopedProps<ScrollAreaScrollbarProps>, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;\n const isHorizontal = props.orientation === 'horizontal';\n\n React.useEffect(() => {\n isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);\n return () => {\n isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);\n };\n }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);\n\n return context.type === 'hover' ? (\n <ScrollAreaScrollbarHover {...scrollbarProps} ref={forwardedRef} forceMount={forceMount} />\n ) : context.type === 'scroll' ? (\n <ScrollAreaScrollbarScroll {...scrollbarProps} ref={forwardedRef} forceMount={forceMount} />\n ) : context.type === 'auto' ? (\n <ScrollAreaScrollbarAuto {...scrollbarProps} ref={forwardedRef} forceMount={forceMount} />\n ) : context.type === 'always' ? (\n <ScrollAreaScrollbarVisible {...scrollbarProps} ref={forwardedRef} />\n ) : null;\n }\n);\n\nScrollAreaScrollbar.displayName = SCROLLBAR_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarHoverElement = ScrollAreaScrollbarAutoElement;\ninterface ScrollAreaScrollbarHoverProps extends ScrollAreaScrollbarAutoProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarHover = React.forwardRef<\n ScrollAreaScrollbarHoverElement,\n ScrollAreaScrollbarHoverProps\n>((props: ScopedProps<ScrollAreaScrollbarHoverProps>, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [visible, setVisible] = React.useState(false);\n\n React.useEffect(() => {\n const scrollArea = context.scrollArea;\n let hideTimer = 0;\n if (scrollArea) {\n const handlePointerEnter = () => {\n window.clearTimeout(hideTimer);\n setVisible(true);\n };\n const handlePointerLeave = () => {\n hideTimer = window.setTimeout(\n () => setVisible(false),\n context.scrollHideDelay\n );\n };\n scrollArea.addEventListener(\"pointerenter\", handlePointerEnter);\n scrollArea.addEventListener(\"pointerleave\", handlePointerLeave);\n return () => {\n window.clearTimeout(hideTimer);\n scrollArea.removeEventListener(\"pointerenter\", handlePointerEnter);\n scrollArea.removeEventListener(\"pointerleave\", handlePointerLeave);\n };\n }\n }, [context.scrollArea, context.scrollHideDelay]);\n\n return (\n <Presence present={forceMount || visible}>\n <ScrollAreaScrollbarAuto\n data-state={visible ? \"visible\" : \"hidden\"}\n {...scrollbarProps}\n ref={forwardedRef}\n />\n </Presence>\n );\n});\n\ntype ScrollAreaScrollbarScrollElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarScrollProps\n extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarScroll = React.forwardRef<\n ScrollAreaScrollbarScrollElement,\n ScrollAreaScrollbarScrollProps\n>((props: ScopedProps<ScrollAreaScrollbarScrollProps>, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const isHorizontal = props.orientation === \"horizontal\";\n const debounceScrollEnd = useDebounceCallback(() => send(\"SCROLL_END\"), 100);\n const [state, send] = useStateMachine(\"hidden\", {\n hidden: {\n SCROLL: \"scrolling\",\n },\n scrolling: {\n SCROLL_END: \"idle\",\n POINTER_ENTER: \"interacting\",\n },\n interacting: {\n SCROLL: \"interacting\",\n POINTER_LEAVE: \"idle\",\n },\n idle: {\n HIDE: \"hidden\",\n SCROLL: \"scrolling\",\n POINTER_ENTER: \"interacting\",\n },\n });\n\n React.useEffect(() => {\n if (state === \"idle\") {\n const hideTimer = window.setTimeout(\n () => send(\"HIDE\"),\n context.scrollHideDelay\n );\n return () => window.clearTimeout(hideTimer);\n }\n }, [state, context.scrollHideDelay, send]);\n\n React.useEffect(() => {\n const viewport = context.viewport;\n const scrollDirection = isHorizontal ? \"scrollLeft\" : \"scrollTop\";\n\n if (viewport) {\n let prevScrollPos = viewport[scrollDirection];\n const handleScroll = () => {\n const scrollPos = viewport[scrollDirection];\n const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;\n if (hasScrollInDirectionChanged) {\n send(\"SCROLL\");\n debounceScrollEnd();\n }\n prevScrollPos = scrollPos;\n };\n viewport.addEventListener(\"scroll\", handleScroll);\n return () => viewport.removeEventListener(\"scroll\", handleScroll);\n }\n }, [context.viewport, isHorizontal, send, debounceScrollEnd]);\n\n return (\n <Presence present={forceMount || state !== \"hidden\"}>\n <ScrollAreaScrollbarVisible\n data-state={state === \"hidden\" ? \"hidden\" : \"visible\"}\n {...scrollbarProps}\n ref={forwardedRef}\n onPointerEnter={composeEventHandlers(props.onPointerEnter, () =>\n send(\"POINTER_ENTER\")\n )}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, () =>\n send(\"POINTER_LEAVE\")\n )}\n />\n </Presence>\n );\n});\n\ntype ScrollAreaScrollbarAutoElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarAutoProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarAuto = React.forwardRef<\n ScrollAreaScrollbarAutoElement,\n ScrollAreaScrollbarAutoProps\n>((props: ScopedProps<ScrollAreaScrollbarAutoProps>, forwardedRef) => {\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { forceMount, ...scrollbarProps } = props;\n const [visible, setVisible] = React.useState(false);\n const isHorizontal = props.orientation === \"horizontal\";\n const handleResize = useDebounceCallback(() => {\n if (context.viewport) {\n const isOverflowX =\n context.viewport.offsetWidth < context.viewport.scrollWidth;\n const isOverflowY =\n context.viewport.offsetHeight < context.viewport.scrollHeight;\n setVisible(isHorizontal ? isOverflowX : isOverflowY);\n }\n }, 10);\n\n useResizeObserver(context.viewport, handleResize);\n useResizeObserver(context.content, handleResize);\n\n return (\n <Presence present={forceMount || visible}>\n <ScrollAreaScrollbarVisible\n data-state={visible ? \"visible\" : \"hidden\"}\n {...scrollbarProps}\n ref={forwardedRef}\n />\n </Presence>\n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;\ninterface ScrollAreaScrollbarVisibleProps\n extends Omit<\n ScrollAreaScrollbarAxisProps,\n keyof ScrollAreaScrollbarAxisPrivateProps\n > {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nconst ScrollAreaScrollbarVisible = React.forwardRef<\n ScrollAreaScrollbarVisibleElement,\n ScrollAreaScrollbarVisibleProps\n>((props: ScopedProps<ScrollAreaScrollbarVisibleProps>, forwardedRef) => {\n const { orientation = \"vertical\", ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const thumbRef = React.useRef<ScrollAreaThumbElement | null>(null);\n const pointerOffsetRef = React.useRef(0);\n const [sizes, setSizes] = React.useState<Sizes>({\n content: 0,\n viewport: 0,\n scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 },\n });\n const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);\n\n type UncommonProps =\n | \"onThumbPositionChange\"\n | \"onDragScroll\"\n | \"onWheelScroll\";\n const commonProps: Omit<ScrollAreaScrollbarAxisPrivateProps, UncommonProps> =\n {\n ...scrollbarProps,\n sizes,\n onSizesChange: setSizes,\n hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),\n onThumbChange: (thumb) => (thumbRef.current = thumb),\n onThumbPointerUp: () => (pointerOffsetRef.current = 0),\n onThumbPointerDown: (pointerPos) =>\n (pointerOffsetRef.current = pointerPos),\n };\n\n function getScrollPosition(pointerPos: number, dir?: Direction) {\n return getScrollPositionFromPointer(\n pointerPos,\n pointerOffsetRef.current,\n sizes,\n dir\n );\n }\n\n if (orientation === \"horizontal\") {\n return (\n <ScrollAreaScrollbarX\n {...commonProps}\n ref={forwardedRef}\n onThumbPositionChange={() => {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollLeft;\n const offset = getThumbOffsetFromScroll(\n scrollPos,\n sizes,\n context.dir\n );\n thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;\n }\n }}\n onWheelScroll={(scrollPos) => {\n if (context.viewport) context.viewport.scrollLeft = scrollPos;\n }}\n onDragScroll={(pointerPos) => {\n if (context.viewport) {\n context.viewport.scrollLeft = getScrollPosition(\n pointerPos,\n context.dir\n );\n }\n }}\n />\n );\n }\n\n if (orientation === \"vertical\") {\n return (\n <ScrollAreaScrollbarY\n {...commonProps}\n ref={forwardedRef}\n onThumbPositionChange={() => {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollTop;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes);\n thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }}\n onWheelScroll={(scrollPos) => {\n if (context.viewport) context.viewport.scrollTop = scrollPos;\n }}\n onDragScroll={(pointerPos) => {\n if (context.viewport)\n context.viewport.scrollTop = getScrollPosition(pointerPos);\n }}\n />\n );\n }\n\n return null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarAxisPrivateProps = {\n hasThumb: boolean;\n sizes: Sizes;\n onSizesChange(sizes: Sizes): void;\n onThumbChange(thumb: ScrollAreaThumbElement | null): void;\n onThumbPointerDown(pointerPos: number): void;\n onThumbPointerUp(): void;\n onThumbPositionChange(): void;\n onWheelScroll(scrollPos: number): void;\n onDragScroll(pointerPos: number): void;\n};\n\ntype ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;\ninterface ScrollAreaScrollbarAxisProps\n extends Omit<\n ScrollAreaScrollbarImplProps,\n keyof ScrollAreaScrollbarImplPrivateProps\n >,\n ScrollAreaScrollbarAxisPrivateProps {}\n\nconst ScrollAreaScrollbarX = React.forwardRef<\n ScrollAreaScrollbarAxisElement,\n ScrollAreaScrollbarAxisProps\n>((props: ScopedProps<ScrollAreaScrollbarAxisProps>, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] =\n React.useState<CSSStyleDeclaration>();\n const ref = React.useRef<ScrollAreaScrollbarAxisElement>(null);\n const composeRefs = useComposedRefs(\n forwardedRef,\n ref,\n context.onScrollbarXChange\n );\n\n React.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n\n return (\n <ScrollAreaScrollbarImpl\n data-orientation=\"horizontal\"\n {...scrollbarProps}\n ref={composeRefs}\n sizes={sizes}\n style={{\n bottom: 0,\n left:\n context.dir === \"rtl\" ? \"var(--huin-core-scroll-area-corner-width)\" : 0,\n right:\n context.dir === \"ltr\" ? \"var(--huin-core-scroll-area-corner-width)\" : 0,\n [\"--huin-core-scroll-area-thumb-width\" as any]: getThumbSize(sizes) + \"px\",\n ...props.style,\n }}\n onThumbPointerDown={(pointerPos) =>\n props.onThumbPointerDown(pointerPos.x)\n }\n onDragScroll={(pointerPos) => props.onDragScroll(pointerPos.x)}\n onWheelScroll={(event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollLeft + event.deltaX;\n props.onWheelScroll(scrollPos);\n // prevent window scroll when wheeling on scrollbar\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n }}\n onResize={() => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollWidth,\n viewport: context.viewport.offsetWidth,\n scrollbar: {\n size: ref.current.clientWidth,\n paddingStart: toInt(computedStyle.paddingLeft),\n paddingEnd: toInt(computedStyle.paddingRight),\n },\n });\n }\n }}\n />\n );\n});\n\nconst ScrollAreaScrollbarY = React.forwardRef<\n ScrollAreaScrollbarAxisElement,\n ScrollAreaScrollbarAxisProps\n>((props: ScopedProps<ScrollAreaScrollbarAxisProps>, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] =\n React.useState<CSSStyleDeclaration>();\n const ref = React.useRef<ScrollAreaScrollbarAxisElement>(null);\n const composeRefs = useComposedRefs(\n forwardedRef,\n ref,\n context.onScrollbarYChange\n );\n\n React.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n\n return (\n <ScrollAreaScrollbarImpl\n data-orientation=\"vertical\"\n {...scrollbarProps}\n ref={composeRefs}\n sizes={sizes}\n style={{\n top: 0,\n right: context.dir === \"ltr\" ? 0 : undefined,\n left: context.dir === \"rtl\" ? 0 : undefined,\n bottom: \"var(--huin-core-scroll-area-corner-height)\",\n [\"--huin-core-scroll-area-thumb-height\" as any]: getThumbSize(sizes) + \"px\",\n ...props.style,\n }}\n onThumbPointerDown={(pointerPos) =>\n props.onThumbPointerDown(pointerPos.y)\n }\n onDragScroll={(pointerPos) => props.onDragScroll(pointerPos.y)}\n onWheelScroll={(event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollTop + event.deltaY;\n props.onWheelScroll(scrollPos);\n // prevent window scroll when wheeling on scrollbar\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n }}\n onResize={() => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollHeight,\n viewport: context.viewport.offsetHeight,\n scrollbar: {\n size: ref.current.clientHeight,\n paddingStart: toInt(computedStyle.paddingTop),\n paddingEnd: toInt(computedStyle.paddingBottom),\n },\n });\n }\n }}\n />\n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport type ScrollbarContext = {\n hasThumb: boolean;\n scrollbar: ScrollAreaScrollbarElement | null;\n onThumbChange(thumb: ScrollAreaThumbElement | null): void;\n onThumbPointerUp(): void;\n onThumbPointerDown(pointerPos: { x: number; y: number }): void;\n onThumbPositionChange(): void;\n};\n\ntype ScrollAreaScrollbarImplElement = React.ElementRef<typeof Primitive.div>;\ntype ScrollAreaScrollbarImplPrivateProps = {\n sizes: Sizes;\n hasThumb: boolean;\n onThumbChange: ScrollbarContext[\"onThumbChange\"];\n onThumbPointerUp: ScrollbarContext[\"onThumbPointerUp\"];\n onThumbPointerDown: ScrollbarContext[\"onThumbPointerDown\"];\n onThumbPositionChange: ScrollbarContext[\"onThumbPositionChange\"];\n onWheelScroll(event: WheelEvent, maxScrollPos: number): void;\n onDragScroll(pointerPos: { x: number; y: number }): void;\n onResize(): void;\n};\ninterface ScrollAreaScrollbarImplProps\n extends Omit<PrimitiveDivProps, keyof ScrollAreaScrollbarImplPrivateProps>,\n ScrollAreaScrollbarImplPrivateProps {}\n\nconst ScrollAreaScrollbarImpl = React.forwardRef<\n ScrollAreaScrollbarImplElement,\n ScrollAreaScrollbarImplProps\n>((props: ScopedProps<ScrollAreaScrollbarImplProps>, forwardedRef) => {\n const {\n __scopeScrollArea,\n sizes,\n hasThumb,\n onThumbChange,\n onThumbPointerUp,\n onThumbPointerDown,\n onThumbPositionChange,\n onDragScroll,\n onWheelScroll,\n onResize,\n ...scrollbarProps\n } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);\n const [scrollbar, setScrollbar] =\n React.useState<ScrollAreaScrollbarElement | null>(null);\n const composeRefs = useComposedRefs(forwardedRef, (node) =>\n setScrollbar(node)\n );\n const rectRef = React.useRef<ClientRect | null>(null);\n const prevWebkitUserSelectRef = React.useRef<string>(\"\");\n const viewport = context.viewport;\n const maxScrollPos = sizes.content - sizes.viewport;\n const handleWheelScroll = useCallbackRef(onWheelScroll);\n const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);\n const handleResize = useDebounceCallback(onResize, 10);\n\n function handleDragScroll(event: React.PointerEvent<HTMLElement>) {\n if (rectRef.current) {\n const x = event.clientX - rectRef.current.left;\n const y = event.clientY - rectRef.current.top;\n onDragScroll({ x, y });\n }\n }\n\n /**\n * We bind wheel event imperatively so we can switch off passive\n * mode for document wheel event to allow it to be prevented\n */\n React.useEffect(() => {\n const handleWheel = (event: WheelEvent) => {\n const element = event.target as HTMLElement;\n const isScrollbarWheel = scrollbar?.contains(element);\n if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);\n };\n document.addEventListener(\"wheel\", handleWheel, { passive: false });\n return () =>\n document.removeEventListener(\"wheel\", handleWheel, {\n passive: false,\n } as any);\n }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);\n\n /**\n * Update thumb position on sizes change\n */\n React.useEffect(handleThumbPositionChange, [\n sizes,\n handleThumbPositionChange,\n ]);\n\n useResizeObserver(scrollbar, handleResize);\n useResizeObserver(context.content, handleResize);\n\n return (\n <ScrollbarProvider\n scope={__scopeScrollArea}\n scrollbar={scrollbar}\n hasThumb={hasThumb}\n onThumbChange={useCallbackRef(onThumbChange)}\n onThumbPointerUp={useCallbackRef(onThumbPointerUp)}\n onThumbPositionChange={handleThumbPositionChange}\n onThumbPointerDown={useCallbackRef(onThumbPointerDown)}\n >\n <Primitive.div\n {...scrollbarProps}\n ref={composeRefs}\n style={{ position: \"absolute\", ...scrollbarProps.style }}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n const mainPointer = 0;\n if (event.button === mainPointer) {\n const element = event.target as HTMLElement;\n element.setPointerCapture(event.pointerId);\n rectRef.current = scrollbar!.getBoundingClientRect();\n // pointer capture doesn't prevent text selection in Safari\n // so we remove text selection manually when scrolling\n prevWebkitUserSelectRef.current =\n document.body.style.webkitUserSelect;\n document.body.style.webkitUserSelect = \"none\";\n if (context.viewport)\n context.viewport.style.scrollBehavior = \"auto\";\n handleDragScroll(event);\n }\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n handleDragScroll\n )}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n const element = event.target as HTMLElement;\n if (element.hasPointerCapture(event.pointerId)) {\n element.releasePointerCapture(event.pointerId);\n }\n document.body.style.webkitUserSelect =\n prevWebkitUserSelectRef.current;\n if (context.viewport) context.viewport.style.scrollBehavior = \"\";\n rectRef.current = null;\n })}\n />\n </ScrollbarProvider>\n );\n});\n\nexport function useDebounceCallback(callback: () => void, delay: number) {\n const handleCallback = useCallbackRef(callback);\n const debounceTimerRef = React.useRef(0);\n React.useEffect(\n () => () => window.clearTimeout(debounceTimerRef.current),\n []\n );\n return React.useCallback(() => {\n window.clearTimeout(debounceTimerRef.current);\n debounceTimerRef.current = window.setTimeout(handleCallback, delay);\n }, [handleCallback, delay]);\n}\n\nfunction toInt(value?: string) {\n return value ? parseInt(value, 10) : 0;\n}\n\nexport function getThumbRatio(viewportSize: number, contentSize: number) {\n const ratio = viewportSize / contentSize;\n return isNaN(ratio) ? 0 : ratio;\n}\n\nfunction getThumbSize(sizes: Sizes) {\n const ratio = getThumbRatio(sizes.viewport, sizes.content);\n const scrollbarPadding =\n sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;\n // minimum of 18 matches macOS minimum\n return Math.max(thumbSize, 18);\n}\n\nfunction getScrollPositionFromPointer(\n pointerPos: number,\n pointerOffset: number,\n sizes: Sizes,\n dir: Direction = \"ltr\"\n) {\n const thumbSizePx = getThumbSize(sizes);\n const thumbCenter = thumbSizePx / 2;\n const offset = pointerOffset || thumbCenter;\n const thumbOffsetFromEnd = thumbSizePx - offset;\n const minPointerPos = sizes.scrollbar.paddingStart + offset;\n const maxPointerPos =\n sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;\n const maxScrollPos = sizes.content - sizes.viewport;\n const scrollRange =\n dir === \"ltr\" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const interpolate = linearScale(\n [minPointerPos, maxPointerPos],\n scrollRange as [number, number]\n );\n return interpolate(pointerPos);\n}\n\nfunction getThumbOffsetFromScroll(\n scrollPos: number,\n sizes: Sizes,\n dir: Direction = \"ltr\"\n) {\n const thumbSizePx = getThumbSize(sizes);\n const scrollbarPadding =\n sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const scrollbar = sizes.scrollbar.size - scrollbarPadding;\n const maxScrollPos = sizes.content - sizes.viewport;\n const maxThumbPos = scrollbar - thumbSizePx;\n const scrollClampRange =\n dir === \"ltr\" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const scrollWithoutMomentum = clamp(\n scrollPos,\n scrollClampRange as [number, number]\n );\n const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);\n return interpolate(scrollWithoutMomentum);\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nfunction linearScale(\n input: readonly [number, number],\n output: readonly [number, number]\n) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\n\nfunction isScrollingWithinScrollbarBounds(\n scrollPos: number,\n maxScrollPos: number\n) {\n return scrollPos > 0 && scrollPos < maxScrollPos;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { ScrollAreaScrollbar };\nexport type { ScrollAreaScrollbarProps };\n", "import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n", "import React from \"react\";\nimport {\n PrimitiveDivProps,\n ScopedProps,\n useScrollAreaContext,\n} from \"./ScrollArea\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { useCallbackRef } from \"@huin-core/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\n\nconst CORNER_NAME = \"ScrollAreaCorner\";\n\ntype ScrollAreaCornerElement = ScrollAreaCornerImplElement;\ninterface ScrollAreaCornerProps extends ScrollAreaCornerImplProps {}\n\nconst ScrollAreaCorner = React.forwardRef<\n ScrollAreaCornerElement,\n ScrollAreaCornerProps\n>((props: ScopedProps<ScrollAreaCornerProps>, forwardedRef) => {\n const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);\n const hasBothScrollbarsVisible = Boolean(\n context.scrollbarX && context.scrollbarY\n );\n const hasCorner = context.type !== \"scroll\" && hasBothScrollbarsVisible;\n return hasCorner ? (\n <ScrollAreaCornerImpl {...props} ref={forwardedRef} />\n ) : null;\n});\n\nScrollAreaCorner.displayName = CORNER_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaCornerImplElement = React.ElementRef<typeof Primitive.div>;\ninterface ScrollAreaCornerImplProps extends PrimitiveDivProps {}\n\nconst ScrollAreaCornerImpl = React.forwardRef<\n ScrollAreaCornerImplElement,\n ScrollAreaCornerImplProps\n>((props: ScopedProps<ScrollAreaCornerImplProps>, forwardedRef) => {\n const { __scopeScrollArea, ...cornerProps } = props;\n const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);\n const [width, setWidth] = React.useState(0);\n const [height, setHeight] = React.useState(0);\n const hasSize = Boolean(width && height);\n\n useResizeObserver(context.scrollbarX, () => {\n const height = context.scrollbarX?.offsetHeight || 0;\n context.onCornerHeightChange(height);\n setHeight(height);\n });\n\n useResizeObserver(context.scrollbarY, () => {\n const width = context.scrollbarY?.offsetWidth || 0;\n context.onCornerWidthChange(width);\n setWidth(width);\n });\n\n return hasSize ? (\n <Primitive.div\n {...cornerProps}\n ref={forwardedRef}\n style={{\n width,\n height,\n position: \"absolute\",\n right: context.dir === \"ltr\" ? 0 : undefined,\n left: context.dir === \"rtl\" ? 0 : undefined,\n bottom: 0,\n ...props.style,\n }}\n />\n ) : null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport function useResizeObserver(element: HTMLElement | null, onResize: () => void) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { ScrollAreaCorner };\nexport type { ScrollAreaCornerProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { PrimitiveDivProps, ScopedProps, useScrollAreaContext } from \"./ScrollArea\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\n\nconst VIEWPORT_NAME = \"ScrollAreaViewport\";\n\nexport type ScrollAreaViewportElement = React.ElementRef<typeof Primitive.div>;\ninterface ScrollAreaViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst ScrollAreaViewport = React.forwardRef<\n ScrollAreaViewportElement,\n ScrollAreaViewportProps\n>((props: ScopedProps<ScrollAreaViewportProps>, forwardedRef) => {\n const { __scopeScrollArea, children, nonce, ...viewportProps } = props;\n const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);\n const ref = React.useRef<ScrollAreaViewportElement>(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n ref,\n context.onViewportChange\n );\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n <style\n dangerouslySetInnerHTML={{\n __html: `[data-huin-core-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-huin-core-scroll-area-viewport]::-webkit-scrollbar{display:none}`,\n }}\n nonce={nonce}\n />\n <Primitive.div\n data-huin-core-scroll-area-viewport=\"\"\n {...viewportProps}\n ref={composedRefs}\n style={{\n /**\n * We don't support `visible` because the intention is to have at least one scrollbar\n * if this component is used and `visible` will behave like `auto` in that case\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description\n *\n * We don't handle `auto` because the intention is for the native implementation\n * to be hidden if using this component. We just want to ensure the node is scrollable\n * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent\n * the browser from having to work out whether to render native scrollbars or not,\n * we tell it to with the intention of hiding them in CSS.\n */\n overflowX: context.scrollbarXEnabled ? \"scroll\" : \"hidden\",\n overflowY: context.scrollbarYEnabled ? \"scroll\" : \"hidden\",\n ...props.style,\n }}\n >\n {/**\n * `display: table` ensures our content div will match the size of its children in both\n * horizontal and vertical axis so we can determine if scroll width/height changed and\n * recalculate thumb sizes. This doesn't account for children with *percentage*\n * widths that change. We'll wait to see what use-cases consumers come up with there\n * before trying to resolve it.\n */}\n <Primitive.div\n ref={context.onContentChange}\n style={{ minWidth: \"100%\", display: \"table\" }}\n >\n {children}\n </Primitive.div>\n </Primitive.div>\n </>\n );\n});\n\nScrollAreaViewport.displayName = VIEWPORT_NAME;\n\nexport { ScrollAreaViewport };\nexport type { ScrollAreaViewportProps };\n", "import React from \"react\";\nimport {\n PrimitiveDivProps,\n ScopedProps,\n useScrollAreaContext,\n useScrollbarContext,\n} from \"./ScrollArea\";\nimport { Presence } from \"@huin-core/react-presence\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport {\n useDebounceCallback,\n} from \"./ScrollAreaScrollbar\";\n\nconst THUMB_NAME = \"ScrollAreaThumb\";\n\nexport type ScrollAreaThumbElement = ScrollAreaThumbImplElement;\ninterface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst ScrollAreaThumb = React.forwardRef<\n ScrollAreaThumbElement,\n ScrollAreaThumbProps\n>((props: ScopedProps<ScrollAreaThumbProps>, forwardedRef) => {\n const { forceMount, ...thumbProps } = props;\n const scrollbarContext = useScrollbarContext(\n THUMB_NAME,\n props.__scopeScrollArea\n );\n return (\n <Presence present={forceMount || scrollbarContext.hasThumb}>\n <ScrollAreaThumbImpl ref={forwardedRef} {...thumbProps} />\n </Presence>\n );\n});\n\ntype ScrollAreaThumbImplElement = React.ElementRef<typeof Primitive.div>;\ninterface ScrollAreaThumbImplProps extends PrimitiveDivProps {}\n\nconst ScrollAreaThumbImpl = React.forwardRef<\n ScrollAreaThumbImplElement,\n ScrollAreaThumbImplProps\n>((props: ScopedProps<ScrollAreaThumbImplProps>, forwardedRef) => {\n const { __scopeScrollArea, style, ...thumbProps } = props;\n const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);\n const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);\n const { onThumbPositionChange } = scrollbarContext;\n const composedRef = useComposedRefs(forwardedRef, (node) =>\n scrollbarContext.onThumbChange(node)\n );\n const removeUnlinkedScrollListenerRef = React.useRef<() => void>();\n const debounceScrollEnd = useDebounceCallback(() => {\n if (removeUnlinkedScrollListenerRef.current) {\n removeUnlinkedScrollListenerRef.current();\n removeUnlinkedScrollListenerRef.current = undefined;\n }\n }, 100);\n\n React.useEffect(() => {\n const viewport = scrollAreaContext.viewport;\n if (viewport) {\n /**\n * We only bind to native scroll event so we know when scroll starts and ends.\n * When scroll starts we start a requestAnimationFrame loop that checks for\n * changes to scroll position. That rAF loop triggers our thumb position change\n * when relevant to avoid scroll-linked effects. We cancel the loop when scroll ends.\n * https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\n */\n const handleScroll = () => {\n debounceScrollEnd();\n if (!removeUnlinkedScrollListenerRef.current) {\n const listener = addUnlinkedScrollListener(\n viewport,\n onThumbPositionChange\n );\n removeUnlinkedScrollListenerRef.current = listener;\n onThumbPositionChange();\n }\n };\n onThumbPositionChange();\n viewport.addEventListener(\"scroll\", handleScroll);\n return () => viewport.removeEventListener(\"scroll\", handleScroll);\n }\n }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);\n\n return (\n <Primitive.div\n data-state={scrollbarContext.hasThumb ? \"visible\" : \"hidden\"}\n {...thumbProps}\n ref={composedRef}\n style={{\n width: \"var(--huin-core-scroll-area-thumb-width)\",\n height: \"var(--huin-core-scroll-area-thumb-height)\",\n ...style,\n }}\n onPointerDownCapture={composeEventHandlers(\n props.onPointerDownCapture,\n (event) => {\n const thumb = event.target as HTMLElement;\n const thumbRect = thumb.getBoundingClientRect();\n const x = event.clientX - thumbRect.left;\n const y = event.clientY - thumbRect.top;\n scrollbarContext.onThumbPointerDown({ x, y });\n }\n )}\n onPointerUp={composeEventHandlers(\n props.onPointerUp,\n scrollbarContext.onThumbPointerUp\n )}\n />\n );\n});\n\nScrollAreaThumb.displayName = THUMB_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// Custom scroll handler to avoid scroll-linked effects\n// https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\nconst addUnlinkedScrollListener = (node: HTMLElement, handler = () => {}) => {\n let prevPosition = { left: node.scrollLeft, top: node.scrollTop };\n let rAF = 0;\n (function loop() {\n const position = { left: node.scrollLeft, top: node.scrollTop };\n const isHorizontalScroll = prevPosition.left !== position.left;\n const isVerticalScroll = prevPosition.top !== position.top;\n if (isHorizontalScroll || isVerticalScroll) handler();\n prevPosition = position;\n rAF = window.requestAnimationFrame(loop);\n })();\n return () => window.cancelAnimationFrame(rAF);\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { ScrollAreaThumb };\nexport type { ScrollAreaThumbProps };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,IAAAC,0BAA0B;AAC1B,2BAAmC;AACnC,IAAAC,6BAAgC;AAChC,6BAA6B;;;ACJ7B,IAAAC,gBAAkB;AAClB,IAAAC,iCAA+B;AAC/B,IAAAC,0BAA0B;AAS1B,4BAAyB;;;ACXzB,YAAuB;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;ADNA,uBAAqC;;;AEbrC,mBAAkB;AAMlB,6BAA0B;AAC1B,oCAA+B;AAC/B,qCAAgC;AAiB5B;AAfJ,IAAM,cAAc;AAKpB,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AAa;AAAA,QACX,MAAM;AAAA,QACN,iBAAiB;AAAA,MACnB;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,gBAAgB,cAAc;AAM9B,IAAM,4BAA4B,CAAC,MAAmB,UAAU,MAAM;AAAC,MAAM;AAC3E,MAAI,eAAe,EAAE,MAAM,KAAK,YAAY,KAAK,KAAK,UAAU;AAChE,MAAI,MAAM;AACV,GAAC,SAAS,OAAO;AACf,UAAM,WAAW,EAAE,MAAM,KAAK,YAAY,KAAK,KAAK,UAAU;AAC9D,UAAM,qBAAqB,aAAa,SAAS,SAAS;AAC1D,UAAM,mBAAmB,aAAa,QAAQ,SAAS;AACvD,QAAI,sBAAsB,iBAAkB,SAAQ;AACpD,mBAAe;AACf,UAAM,OAAO,sBAAsB,IAAI;AAAA,EACzC,GAAG;AACH,SAAO,MAAM,OAAO,qBAAqB,GAAG;AAC9C;",
6
+ "names": ["React", "import_react_primitive", "import_react_compose_refs", "import_react", "import_react_use_callback_ref", "import_react_primitive", "React", "height", "width", "import_jsx_runtime", "React", "import_jsx_runtime", "import_react", "import_react_primitive", "import_react_compose_refs", "import_jsx_runtime", "React", "import_react", "import_react_presence", "import_react_compose_refs", "import_react_primitive", "import_primitive", "import_jsx_runtime", "React"]
7
+ }