-
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.
Rewrite + mod types + collapsible mods
- Loading branch information
Showing
15 changed files
with
249 additions
and
118 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
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,29 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from "bits-ui"; | ||
import { slide } from "svelte/transition"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AccordionPrimitive.ContentProps; | ||
let className: $$Props["class"] = undefined; | ||
export let transition: $$Props["transition"] = slide; | ||
export let transitionConfig: $$Props["transitionConfig"] = { | ||
duration: 200, | ||
}; | ||
export { className as class }; | ||
</script> | ||
|
||
<AccordionPrimitive.Content | ||
class={cn("overflow-hidden text-sm", className)} | ||
{transition} | ||
{transitionConfig} | ||
{...$$restProps} | ||
> | ||
<!-- | ||
<div class="pb-4 pt-0"> | ||
<slot /> | ||
</div> | ||
--> | ||
<slot /> | ||
</AccordionPrimitive.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,14 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AccordionPrimitive.ItemProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
export let value: $$Props["value"]; | ||
</script> | ||
|
||
<AccordionPrimitive.Item {value} class={cn("border-b", className)} {...$$restProps}> | ||
<slot /> | ||
</AccordionPrimitive.Item> |
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,28 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from "bits-ui"; | ||
import ChevronDown from "svelte-radix/ChevronDown.svelte"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AccordionPrimitive.TriggerProps; | ||
type $$Events = AccordionPrimitive.TriggerEvents; | ||
let className: $$Props["class"] = undefined; | ||
export let level: AccordionPrimitive.HeaderProps["level"] = 3; | ||
export { className as class }; | ||
</script> | ||
|
||
<AccordionPrimitive.Header {level} class="flex"> | ||
<AccordionPrimitive.Trigger | ||
class={cn( | ||
"flex flex-1 items-center justify-between py-4 gap-2 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", | ||
className | ||
)} | ||
{...$$restProps} | ||
on:click | ||
> | ||
<slot /> | ||
<ChevronDown | ||
class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" | ||
/> | ||
</AccordionPrimitive.Trigger> | ||
</AccordionPrimitive.Header> |
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,17 @@ | ||
import { Accordion as AccordionPrimitive } from "bits-ui"; | ||
import Content from "./accordion-content.svelte"; | ||
import Item from "./accordion-item.svelte"; | ||
import Trigger from "./accordion-trigger.svelte"; | ||
|
||
const Root = AccordionPrimitive.Root; | ||
export { | ||
Root, | ||
Content, | ||
Item, | ||
Trigger, | ||
// | ||
Root as Accordion, | ||
Content as AccordionContent, | ||
Item as AccordionItem, | ||
Trigger as AccordionTrigger, | ||
}; |
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
Oops, something went wrong.