This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
@@ -0,0 +1,30 @@
<script lang="ts">
import { mergeProps } from "svelte-toolbelt";
import {
ScrollAreaScrollbarAutoState,
ScrollAreaScrollbarHoverState,
} from "../scroll-area.svelte.js";
import type { _ScrollbarStubProps } from "../types.js";
import ScrollAreaScrollbarVisible from "./scroll-area-scrollbar-visible.svelte";
import PresenceLayer from "../../utilities/presence-layer/presence-layer.svelte";
let { forceMount = false, ...restProps }: _ScrollbarStubProps = $props();
const scrollbarHoverState = ScrollAreaScrollbarHoverState.create();
const scrollbarAutoState = ScrollAreaScrollbarAutoState.create();
const mergedProps = $derived(
mergeProps(restProps, scrollbarHoverState.props, scrollbarAutoState.props, {
"data-state": scrollbarHoverState.isVisible ? "visible" : "hidden",
})
);
const open = $derived(
forceMount || (scrollbarHoverState.isVisible && scrollbarAutoState.isVisible)
);
</script>
<PresenceLayer {open} ref={scrollbarAutoState.scrollbar.opts.ref}>
{#snippet presence()}
<ScrollAreaScrollbarVisible {...mergedProps} />
{/snippet}
</PresenceLayer>