-
Notifications
You must be signed in to change notification settings - Fork 0
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
9 changed files
with
234 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Tabs as TabsPrimitive } from "bits-ui"; | ||
import Content from "./tabs-content.svelte"; | ||
import List from "./tabs-list.svelte"; | ||
import Trigger from "./tabs-trigger.svelte"; | ||
|
||
const Root = TabsPrimitive.Root; | ||
|
||
export { | ||
Root, | ||
Content, | ||
List, | ||
Trigger, | ||
// | ||
Root as Tabs, | ||
Content as TabsContent, | ||
List as TabsList, | ||
Trigger as TabsTrigger, | ||
}; |
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,21 @@ | ||
<script lang="ts"> | ||
import { Tabs as TabsPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = TabsPrimitive.ContentProps; | ||
let className: $$Props["class"] = undefined; | ||
export let value: $$Props["value"]; | ||
export { className as class }; | ||
</script> | ||
|
||
<TabsPrimitive.Content | ||
class={cn( | ||
"ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", | ||
className | ||
)} | ||
{value} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</TabsPrimitive.Content> |
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,19 @@ | ||
<script lang="ts"> | ||
import { Tabs as TabsPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = TabsPrimitive.ListProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<TabsPrimitive.List | ||
class={cn( | ||
"bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1", | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</TabsPrimitive.List> |
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,23 @@ | ||
<script lang="ts"> | ||
import { Tabs as TabsPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = TabsPrimitive.TriggerProps; | ||
type $$Events = TabsPrimitive.TriggerEvents; | ||
let className: $$Props["class"] = undefined; | ||
export let value: $$Props["value"]; | ||
export { className as class }; | ||
</script> | ||
|
||
<TabsPrimitive.Trigger | ||
class={cn( | ||
"ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm", | ||
className | ||
)} | ||
{value} | ||
{...$$restProps} | ||
on:click | ||
> | ||
<slot /> | ||
</TabsPrimitive.Trigger> |
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