-
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.
Merge branch 'ensure-idempotency-when-generating-audiocast' into ensu…
…re-idempotency-alt
- Loading branch information
Showing
22 changed files
with
352 additions
and
53 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
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,46 @@ | ||
<script lang="ts"> | ||
import * as AlertDialog from './ui/alert-dialog'; | ||
import { Trash } from 'lucide-svelte'; | ||
import { createEventDispatcher } from 'svelte'; | ||
const dispatch = createEventDispatcher<{ deleteSession: void }>(); | ||
let openDialog = false; | ||
function dispatchDeleteSession() { | ||
dispatch('deleteSession'); | ||
openDialog = false; | ||
} | ||
</script> | ||
|
||
<div class="hidden h-full z-50 group-hover:flex items-center p-1"> | ||
<button | ||
class="text-gray-400 hover:text-red-500" | ||
on:click|stopPropagation|preventDefault={() => (openDialog = true)} | ||
> | ||
<Trash class="w-4 h-4 inline" /> | ||
</button> | ||
</div> | ||
|
||
{#if openDialog} | ||
<AlertDialog.Root open portal="body" closeOnOutsideClick closeOnEscape> | ||
<AlertDialog.Content class="border-neutral-800 overflow-hidden"> | ||
<AlertDialog.Header> | ||
<AlertDialog.Title>Delete audiocast?</AlertDialog.Title> | ||
<AlertDialog.Description> | ||
This action cannot be undone. This will permanently delete your audiocast data. | ||
</AlertDialog.Description> | ||
</AlertDialog.Header> | ||
|
||
<AlertDialog.Footer> | ||
<AlertDialog.Cancel on:click={() => (openDialog = false)}>Cancel</AlertDialog.Cancel> | ||
<AlertDialog.Action | ||
class="bg-red-700 text-red-100 hover:bg-red-600" | ||
on:click={dispatchDeleteSession} | ||
> | ||
Continue | ||
</AlertDialog.Action> | ||
</AlertDialog.Footer> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> | ||
{/if} |
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> |
Oops, something went wrong.