Skip to content

Commit 92279d8

Browse files
committed
Added shadcn Card Action component
https://x.com/shadcn/status/1899903600253366659
1 parent e24cbcf commit 92279d8

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script lang="ts">
2+
import type { WithElementRef } from "bits-ui";
3+
import type { HTMLAttributes } from "svelte/elements";
4+
import { cn } from "$lib/utils.js";
5+
6+
let {
7+
ref = $bindable(null),
8+
class: className,
9+
children,
10+
...restProps
11+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
12+
</script>
13+
14+
<div
15+
bind:this={ref}
16+
class={cn("absolute right-6 top-6 flex items-center justify-end", className)}
17+
{...restProps}
18+
>
19+
{@render children?.()}
20+
</div>

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/card/card-header.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
1212
</script>
1313

14-
<div bind:this={ref} class={cn("flex flex-col space-y-1.5 p-6 pb-0", className)} {...restProps}>
14+
<div bind:this={ref} class={cn("flex flex-col space-y-1.5 p-6 pb-0 relative", className)} {...restProps}>
1515
{@render children?.()}
1616
</div>

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/card/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Description from "./card-description.svelte";
44
import Footer from "./card-footer.svelte";
55
import Header from "./card-header.svelte";
66
import Title from "./card-title.svelte";
7+
import Action from "./card-action.svelte";
78

89
export {
910
Root,
@@ -12,11 +13,13 @@ export {
1213
Footer,
1314
Header,
1415
Title,
16+
Action,
1517
//
1618
Root as Card,
1719
Content as CardContent,
1820
Description as CardDescription,
1921
Footer as CardFooter,
2022
Header as CardHeader,
2123
Title as CardTitle,
24+
Action as CardAction,
2225
};

0 commit comments

Comments
 (0)