-
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
ca32906
commit 35478e5
Showing
12 changed files
with
203 additions
and
4 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
21 changes: 21 additions & 0 deletions
21
app/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/ui.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
app/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/ui.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
app/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/ui.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( | ||
"bg-background fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg sm:rounded-lg md:w-full", | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</AlertDialogPrimitive.Content> | ||
</AlertDialog.Portal> |
16 changes: 16 additions & 0 deletions
16
app/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/ui.utils.js"; | ||
type $$Props = AlertDialogPrimitive.DescriptionProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AlertDialogPrimitive.Description | ||
class={cn("text-muted-foreground text-sm", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</AlertDialogPrimitive.Description> |
16 changes: 16 additions & 0 deletions
16
app/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/ui.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
app/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/ui.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
app/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/ui.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("bg-background/80 fixed inset-0 z-50 backdrop-blur-sm ", className)} | ||
{...$$restProps} | ||
/> |
9 changes: 9 additions & 0 deletions
9
app/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
app/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/ui.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> |
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,40 @@ | ||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; | ||
|
||
import Title from "./alert-dialog-title.svelte"; | ||
import Action from "./alert-dialog-action.svelte"; | ||
import Cancel from "./alert-dialog-cancel.svelte"; | ||
import Portal from "./alert-dialog-portal.svelte"; | ||
import Footer from "./alert-dialog-footer.svelte"; | ||
import Header from "./alert-dialog-header.svelte"; | ||
import Overlay from "./alert-dialog-overlay.svelte"; | ||
import Content from "./alert-dialog-content.svelte"; | ||
import Description from "./alert-dialog-description.svelte"; | ||
|
||
const Root = AlertDialogPrimitive.Root; | ||
const Trigger = AlertDialogPrimitive.Trigger; | ||
|
||
export { | ||
Root, | ||
Title, | ||
Action, | ||
Cancel, | ||
Portal, | ||
Footer, | ||
Header, | ||
Trigger, | ||
Overlay, | ||
Content, | ||
Description, | ||
// | ||
Root as AlertDialog, | ||
Title as AlertDialogTitle, | ||
Action as AlertDialogAction, | ||
Cancel as AlertDialogCancel, | ||
Portal as AlertDialogPortal, | ||
Footer as AlertDialogFooter, | ||
Header as AlertDialogHeader, | ||
Trigger as AlertDialogTrigger, | ||
Overlay as AlertDialogOverlay, | ||
Content as AlertDialogContent, | ||
Description as AlertDialogDescription, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.