-
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
1 parent
be6495a
commit 84c1bc8
Showing
35 changed files
with
1,278 additions
and
66 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
<script lang="ts"> | ||
import { cn } from "$lib/utils"; | ||
import { badgeVariants, type Variant } from "."; | ||
let className: string | undefined | null = undefined; | ||
export let href: string | undefined = undefined; | ||
export let variant: Variant = "default"; | ||
export { className as class }; | ||
</script> | ||
|
||
<svelte:element | ||
this={href ? "a" : "span"} | ||
{href} | ||
class={cn(badgeVariants({ variant, className }))} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</svelte:element> |
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,22 @@ | ||
import { tv, type VariantProps } from "tailwind-variants"; | ||
export { default as Badge } from "./badge.svelte"; | ||
|
||
export const badgeVariants = tv({ | ||
base: "inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none select-none focus:ring-2 focus:ring-ring focus:ring-offset-2", | ||
variants: { | ||
variant: { | ||
default: | ||
"bg-primary hover:bg-primary/80 border-transparent text-primary-foreground", | ||
secondary: | ||
"bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground", | ||
destructive: | ||
"bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground", | ||
outline: "text-foreground" | ||
} | ||
}, | ||
defaultVariants: { | ||
variant: "default" | ||
} | ||
}); | ||
|
||
export type Variant = VariantProps<typeof badgeVariants>["variant"]; |
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,27 @@ | ||
<script lang="ts"> | ||
import { Button as ButtonPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils"; | ||
import { buttonVariants, type Size, type Variant } from "."; | ||
type $$Props = ButtonPrimitive.Props & { | ||
variant?: Variant; | ||
size?: Size; | ||
}; | ||
type $$Events = ButtonPrimitive.Events; | ||
let className: $$Props["class"] = undefined; | ||
export let variant: $$Props["variant"] = "default"; | ||
export let size: $$Props["size"] = "default"; | ||
export let builders: $$Props["builders"] = []; | ||
export { className as class }; | ||
</script> | ||
|
||
<ButtonPrimitive.Root | ||
{builders} | ||
class={cn(buttonVariants({ variant, size, className }))} | ||
{...$$restProps} | ||
on:click | ||
on:keydown | ||
> | ||
<slot /> | ||
</ButtonPrimitive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Root from "./button.svelte"; | ||
import { tv, type VariantProps } from "tailwind-variants"; | ||
|
||
export const buttonVariants = tv({ | ||
base: "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", | ||
variants: { | ||
variant: { | ||
default: "bg-primary text-primary-foreground hover:bg-primary/90", | ||
destructive: | ||
"bg-destructive text-destructive-foreground hover:bg-destructive/90", | ||
outline: | ||
"border border-input bg-background hover:bg-accent hover:text-accent-foreground", | ||
secondary: | ||
"bg-secondary text-secondary-foreground hover:bg-secondary/80", | ||
ghost: "hover:bg-accent hover:text-accent-foreground", | ||
link: "text-primary underline-offset-4 hover:underline" | ||
}, | ||
size: { | ||
default: "h-10 px-4 py-2", | ||
sm: "h-9 rounded-md px-3", | ||
lg: "h-11 rounded-md px-8", | ||
icon: "h-10 w-10" | ||
} | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
size: "default" | ||
} | ||
}); | ||
|
||
export type Variant = VariantProps<typeof buttonVariants>["variant"]; | ||
export type Size = VariantProps<typeof buttonVariants>["size"]; | ||
|
||
export { | ||
Root, | ||
// | ||
Root as Button | ||
}; |
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,13 @@ | ||
<script lang="ts"> | ||
import { cn } from "$lib/utils"; | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div class={cn("p-6 pt-0", className)} {...$$restProps}> | ||
<slot /> | ||
</div> |
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,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = HTMLAttributes<HTMLParagraphElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<p class={cn("text-sm text-muted-foreground", className)} {...$$restProps}> | ||
<slot /> | ||
</p> |
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,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div class={cn("flex items-center p-6 pt-0", className)} {...$$restProps}> | ||
<slot /> | ||
</div> |
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,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div class={cn("flex flex-col space-y-1.5 p-6", className)} {...$$restProps}> | ||
<slot /> | ||
</div> |
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 type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils"; | ||
import type { HeadingLevel } from "../alert"; | ||
type $$Props = HTMLAttributes<HTMLHeadingElement> & { | ||
level?: HeadingLevel; | ||
}; | ||
let className: $$Props["class"] = undefined; | ||
export let tag: $$Props["level"] = "h3"; | ||
export { className as class }; | ||
</script> | ||
|
||
<svelte:element | ||
this={tag} | ||
class={cn("text-lg font-semibold leading-none tracking-tight", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</svelte:element> |
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 type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div | ||
class={cn( | ||
"rounded-lg border bg-card text-card-foreground shadow-sm", | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</div> |
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,24 @@ | ||
import Root from "./card.svelte"; | ||
import Content from "./card-content.svelte"; | ||
import Description from "./card-description.svelte"; | ||
import Footer from "./card-footer.svelte"; | ||
import Header from "./card-header.svelte"; | ||
import Title from "./card-title.svelte"; | ||
|
||
export { | ||
Root, | ||
Content, | ||
Description, | ||
Footer, | ||
Header, | ||
Title, | ||
// | ||
Root as Card, | ||
Content as CardContent, | ||
Description as CardDescription, | ||
Footer as CardFooter, | ||
Header as CardHeader, | ||
Title as CardTitle | ||
}; | ||
|
||
export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; |
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,34 @@ | ||
<script lang="ts"> | ||
import { Checkbox as CheckboxPrimitive } from "bits-ui"; | ||
import { Check, Minus } from "lucide-svelte"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = CheckboxPrimitive.Props; | ||
type $$Events = CheckboxPrimitive.Events; | ||
let className: $$Props["class"] = undefined; | ||
export let checked: $$Props["checked"] = false; | ||
export { className as class }; | ||
</script> | ||
|
||
<CheckboxPrimitive.Root | ||
bind:checked | ||
class={cn( | ||
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", | ||
className | ||
)} | ||
{...$$restProps} | ||
on:m-click | ||
> | ||
<CheckboxPrimitive.Indicator | ||
class={cn("flex items-center justify-center text-current")} | ||
let:isChecked | ||
let:isIndeterminate | ||
> | ||
{#if isChecked} | ||
<Check class="h-4 w-4" /> | ||
{:else if isIndeterminate} | ||
<Minus class="h-4 w-4" /> | ||
{/if} | ||
</CheckboxPrimitive.Indicator> | ||
</CheckboxPrimitive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Root from "./checkbox.svelte"; | ||
export { | ||
Root, | ||
// | ||
Root as Checkbox | ||
}; |
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,30 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import * as Dialog from "."; | ||
import { cn } from "$lib/utils"; | ||
import { X } from "lucide-svelte"; | ||
type $$Props = DialogPrimitive.ContentProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<Dialog.Portal> | ||
<Dialog.Overlay /> | ||
<DialogPrimitive.Content | ||
class={cn( | ||
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full", | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
<DialogPrimitive.Close | ||
class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" | ||
> | ||
<X class="h-4 w-4" /> | ||
<span class="sr-only">Close</span> | ||
</DialogPrimitive.Close> | ||
</DialogPrimitive.Content> | ||
</Dialog.Portal> |
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,16 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = DialogPrimitive.DescriptionProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<DialogPrimitive.Description | ||
class={cn("text-sm text-muted-foreground", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</DialogPrimitive.Description> |
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 { cn } from "$lib/utils"; | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div | ||
class={cn( | ||
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</div> |
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,16 @@ | ||
<script lang="ts"> | ||
import { cn } from "$lib/utils"; | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div | ||
class={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</div> |
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 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils"; | ||
type $$Props = DialogPrimitive.OverlayProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<DialogPrimitive.Overlay | ||
class={cn( | ||
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", | ||
className | ||
)} | ||
{...$$restProps} | ||
/> |
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,8 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
type $$Props = DialogPrimitive.PortalProps; | ||
</script> | ||
|
||
<DialogPrimitive.Portal {...$$restProps}> | ||
<slot /> | ||
</DialogPrimitive.Portal> |
Oops, something went wrong.