-
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
26 changed files
with
526 additions
and
122 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
21 changes: 21 additions & 0 deletions
21
src/lib/components/ui/alert-dialog/alert-dialog-action.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,21 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
import { buttonVariants } from "$lib/components/ui/button/index.js"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AlertDialogPrimitive.ActionProps; | ||
type $$Events = AlertDialogPrimitive.ActionEvents; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Action | ||
class={cn(buttonVariants(), className)} | ||
{...$$restProps} | ||
on:click | ||
on:keydown | ||
let:builder | ||
> | ||
<slot {builder} /> | ||
</AlertDialogPrimitive.Action> |
21 changes: 21 additions & 0 deletions
21
src/lib/components/ui/alert-dialog/alert-dialog-cancel.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,21 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
import { buttonVariants } from "$lib/components/ui/button/index.js"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AlertDialogPrimitive.CancelProps; | ||
type $$Events = AlertDialogPrimitive.CancelEvents; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Cancel | ||
class={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)} | ||
{...$$restProps} | ||
on:click | ||
on:keydown | ||
let:builder | ||
> | ||
<slot {builder} /> | ||
</AlertDialogPrimitive.Cancel> |
28 changes: 28 additions & 0 deletions
28
src/lib/components/ui/alert-dialog/alert-dialog-content.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,28 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
import * as AlertDialog from "./index.js"; | ||
import { cn, flyAndScale } from "$lib/utils.js"; | ||
type $$Props = AlertDialogPrimitive.ContentProps; | ||
export let transition: $$Props["transition"] = flyAndScale; | ||
export let transitionConfig: $$Props["transitionConfig"] = undefined; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialog.Portal> | ||
<AlertDialog.Overlay /> | ||
<AlertDialogPrimitive.Content | ||
{transition} | ||
{transitionConfig} | ||
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 sm:rounded-lg md:w-full", | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</AlertDialogPrimitive.Content> | ||
</AlertDialog.Portal> |
16 changes: 16 additions & 0 deletions
16
src/lib/components/ui/alert-dialog/alert-dialog-description.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,16 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AlertDialogPrimitive.DescriptionProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Description | ||
class={cn("text-sm text-muted-foreground", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</AlertDialogPrimitive.Description> |
16 changes: 16 additions & 0 deletions
16
src/lib/components/ui/alert-dialog/alert-dialog-footer.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,16 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils.js"; | ||
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> |
13 changes: 13 additions & 0 deletions
13
src/lib/components/ui/alert-dialog/alert-dialog-header.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,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div class={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...$$restProps}> | ||
<slot /> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
src/lib/components/ui/alert-dialog/alert-dialog-overlay.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,21 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
import { fade } from "svelte/transition"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AlertDialogPrimitive.OverlayProps; | ||
let className: $$Props["class"] = undefined; | ||
export let transition: $$Props["transition"] = fade; | ||
export let transitionConfig: $$Props["transitionConfig"] = { | ||
duration: 150, | ||
}; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Overlay | ||
{transition} | ||
{transitionConfig} | ||
class={cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ", className)} | ||
{...$$restProps} | ||
/> |
9 changes: 9 additions & 0 deletions
9
src/lib/components/ui/alert-dialog/alert-dialog-portal.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,9 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
type $$Props = AlertDialogPrimitive.PortalProps; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Portal {...$$restProps}> | ||
<slot /> | ||
</AlertDialogPrimitive.Portal> |
14 changes: 14 additions & 0 deletions
14
src/lib/components/ui/alert-dialog/alert-dialog-title.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,14 @@ | ||
<script lang="ts"> | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = AlertDialogPrimitive.TitleProps; | ||
let className: $$Props["class"] = undefined; | ||
export let level: $$Props["level"] = "h3"; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Title class={cn("text-lg font-semibold", className)} {level} {...$$restProps}> | ||
<slot /> | ||
</AlertDialogPrimitive.Title> |
Oops, something went wrong.