-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
217 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
sites/docs/src/lib/components/component-preview-min.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script lang="ts"> | ||
import type { Snippet } from "svelte"; | ||
import { Collapsible } from "bits-ui"; | ||
import DemoContainer from "./demo-container.svelte"; | ||
import DemoCodeContainer from "./demo-code-container.svelte"; | ||
type Props = { | ||
preview: Snippet; | ||
children: Snippet; | ||
class?: string; | ||
}; | ||
let { preview, children, class: className }: Props = $props(); | ||
</script> | ||
|
||
<DemoContainer> | ||
{@render preview?.()} | ||
</DemoContainer> | ||
<Collapsible.Root> | ||
<Collapsible.Trigger>Show code</Collapsible.Trigger> | ||
<Collapsible.Content> | ||
<DemoCodeContainer class={className}> | ||
{@render children?.()} | ||
</DemoCodeContainer> | ||
</Collapsible.Content> | ||
</Collapsible.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
sites/docs/src/lib/components/demos/scroll-area-demo-always.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script lang="ts"> | ||
import { ScrollArea } from "bits-ui"; | ||
</script> | ||
|
||
<ScrollArea.Root | ||
class="relative overflow-hidden rounded-[10px] border border-dark-10 bg-background-alt px-4 py-4 shadow-card" | ||
type="always" | ||
> | ||
<ScrollArea.Viewport class="h-full max-h-[200px] w-full max-w-[200px]"> | ||
<h4 class="mb-4 mt-2 text-xl font-semibold leading-none tracking-[-0.01em] text-foreground"> | ||
Scroll Area | ||
</h4> | ||
<p class="text-wrap text-sm leading-5 text-foreground-alt"> | ||
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Dignissimos impedit rem, | ||
repellat deserunt ducimus quasi nisi voluptatem cumque aliquid esse ea deleniti eveniet | ||
incidunt! Deserunt minus laborum accusamus iusto dolorum. Lorem ipsum dolor sit, amet | ||
consectetur adipisicing elit. Blanditiis officiis error minima eos fugit voluptate | ||
excepturi eveniet dolore et, ratione impedit consequuntur dolorem hic quae corrupti | ||
autem? Dolorem, sit voluptatum. | ||
</p> | ||
</ScrollArea.Viewport> | ||
<ScrollArea.Scrollbar | ||
orientation="vertical" | ||
class="flex w-2.5 touch-none select-none rounded-full border-l border-l-transparent bg-muted p-px transition-all duration-200 hover:w-3 hover:bg-dark-10 data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
> | ||
<ScrollArea.Thumb | ||
class="flex-1 rounded-full bg-muted-foreground data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
/> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Scrollbar | ||
orientation="horizontal" | ||
class="flex h-2.5 touch-none select-none rounded-full border-t border-t-transparent bg-muted p-px transition-all duration-200 hover:h-3 hover:bg-dark-10 data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
> | ||
<ScrollArea.Thumb | ||
class="rounded-full bg-muted-foreground data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
/> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Corner /> | ||
</ScrollArea.Root> |
39 changes: 39 additions & 0 deletions
39
sites/docs/src/lib/components/demos/scroll-area-demo-auto.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script lang="ts"> | ||
import { ScrollArea } from "bits-ui"; | ||
</script> | ||
|
||
<ScrollArea.Root | ||
class="relative overflow-hidden rounded-[10px] border border-dark-10 bg-background-alt px-4 py-4 shadow-card" | ||
type="auto" | ||
> | ||
<ScrollArea.Viewport class="h-full max-h-[200px] w-full max-w-[200px]"> | ||
<h4 class="mb-4 mt-2 text-xl font-semibold leading-none tracking-[-0.01em] text-foreground"> | ||
Scroll Area | ||
</h4> | ||
<p class="text-wrap text-sm leading-5 text-foreground-alt"> | ||
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Dignissimos impedit rem, | ||
repellat deserunt ducimus quasi nisi voluptatem cumque aliquid esse ea deleniti eveniet | ||
incidunt! Deserunt minus laborum accusamus iusto dolorum. Lorem ipsum dolor sit, amet | ||
consectetur adipisicing elit. Blanditiis officiis error minima eos fugit voluptate | ||
excepturi eveniet dolore et, ratione impedit consequuntur dolorem hic quae corrupti | ||
autem? Dolorem, sit voluptatum. | ||
</p> | ||
</ScrollArea.Viewport> | ||
<ScrollArea.Scrollbar | ||
orientation="vertical" | ||
class="flex w-2.5 touch-none select-none rounded-full border-l border-l-transparent bg-muted p-px transition-all duration-200 hover:w-3 hover:bg-dark-10 data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
> | ||
<ScrollArea.Thumb | ||
class="flex-1 rounded-full bg-muted-foreground data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
/> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Scrollbar | ||
orientation="horizontal" | ||
class="flex h-2.5 touch-none select-none rounded-full border-t border-t-transparent bg-muted p-px transition-all duration-200 hover:h-3 hover:bg-dark-10 data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
> | ||
<ScrollArea.Thumb | ||
class="rounded-full bg-muted-foreground data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
/> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Corner /> | ||
</ScrollArea.Root> |
39 changes: 39 additions & 0 deletions
39
sites/docs/src/lib/components/demos/scroll-area-demo-scroll.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script lang="ts"> | ||
import { ScrollArea } from "bits-ui"; | ||
</script> | ||
|
||
<ScrollArea.Root | ||
class="relative overflow-hidden rounded-[10px] border border-dark-10 bg-background-alt px-4 py-4 shadow-card" | ||
type="scroll" | ||
> | ||
<ScrollArea.Viewport class="h-full max-h-[200px] w-full max-w-[200px]"> | ||
<h4 class="mb-4 mt-2 text-xl font-semibold leading-none tracking-[-0.01em] text-foreground"> | ||
Scroll Area | ||
</h4> | ||
<p class="text-wrap text-sm leading-5 text-foreground-alt"> | ||
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Dignissimos impedit rem, | ||
repellat deserunt ducimus quasi nisi voluptatem cumque aliquid esse ea deleniti eveniet | ||
incidunt! Deserunt minus laborum accusamus iusto dolorum. Lorem ipsum dolor sit, amet | ||
consectetur adipisicing elit. Blanditiis officiis error minima eos fugit voluptate | ||
excepturi eveniet dolore et, ratione impedit consequuntur dolorem hic quae corrupti | ||
autem? Dolorem, sit voluptatum. | ||
</p> | ||
</ScrollArea.Viewport> | ||
<ScrollArea.Scrollbar | ||
orientation="vertical" | ||
class="flex w-2.5 touch-none select-none rounded-full border-l border-l-transparent bg-muted p-px transition-all duration-200 hover:w-3 hover:bg-dark-10 data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
> | ||
<ScrollArea.Thumb | ||
class="flex-1 rounded-full bg-muted-foreground data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
/> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Scrollbar | ||
orientation="horizontal" | ||
class="flex h-2.5 touch-none select-none rounded-full border-t border-t-transparent bg-muted p-px transition-all duration-200 hover:h-3 hover:bg-dark-10 data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
> | ||
<ScrollArea.Thumb | ||
class="rounded-full bg-muted-foreground data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0" | ||
/> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Corner /> | ||
</ScrollArea.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters