Skip to content

Commit 62bc8a7

Browse files
authored
refactor(ui): replaces corvu Drawer with Kobalte Dialog (#44)
* refactor(ui): replaces corvu Drawer with Kobalte Dialog * fix(a11y): adds Dialog.Description and idiomatic test query * fix(test): tightens NotificationDrawer assertions and adds coverage
1 parent 5e6af91 commit 62bc8a7

File tree

7 files changed

+66
-243
lines changed

7 files changed

+66
-243
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"@octokit/plugin-throttling": "11.0.3",
2424
"@sentry/solid": "10.46.0",
2525
"@solidjs/router": "0.16.1",
26-
"corvu": "0.7.2",
2726
"idb": "8.0.3",
2827
"solid-js": "1.9.11",
2928
"zod": "4.3.6"

pnpm-lock.yaml

Lines changed: 0 additions & 206 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/shared/NotificationDrawer.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createMemo, For, Show } from "solid-js";
2-
import Drawer from "corvu/drawer";
2+
import { Dialog } from "@kobalte/core/dialog";
33
import {
44
getNotifications,
55
markAllAsRead,
@@ -25,15 +25,16 @@ export default function NotificationDrawer(props: NotificationDrawerProps) {
2525
}
2626

2727
return (
28-
<Drawer open={props.open} onOpenChange={(open) => !open && props.onClose()} side="right">
29-
<Drawer.Portal>
30-
<Drawer.Overlay class="fixed inset-0 bg-black/50 z-[70]" />
31-
<Drawer.Content class="fixed top-0 right-0 h-full w-80 sm:w-96 bg-base-100 shadow-xl z-[71] flex flex-col">
28+
<Dialog open={props.open} onOpenChange={(open) => !open && props.onClose()} modal>
29+
<Dialog.Portal>
30+
<Dialog.Overlay class="drawer-overlay fixed inset-0 bg-black/50 z-[70]" data-testid="notification-overlay" />
31+
<Dialog.Content class="drawer-content fixed top-0 right-0 h-full w-80 sm:w-96 bg-base-100 shadow-xl z-[71] flex flex-col">
32+
<Dialog.Description class="sr-only">Recent system notifications and errors</Dialog.Description>
3233
{/* Header */}
3334
<div class="flex items-center gap-2 px-4 py-3 border-b border-base-300 shrink-0">
34-
<Drawer.Label class="text-lg font-semibold text-base-content flex-1">
35+
<Dialog.Title class="text-lg font-semibold text-base-content flex-1">
3536
Notifications
36-
</Drawer.Label>
37+
</Dialog.Title>
3738
<button
3839
type="button"
3940
onClick={markAllAsRead}
@@ -48,7 +49,7 @@ export default function NotificationDrawer(props: NotificationDrawerProps) {
4849
>
4950
Dismiss all
5051
</button>
51-
<Drawer.Close
52+
<Dialog.CloseButton
5253
class="btn btn-ghost btn-sm btn-circle ml-1"
5354
aria-label="Close notifications"
5455
>
@@ -59,7 +60,7 @@ export default function NotificationDrawer(props: NotificationDrawerProps) {
5960
clip-rule="evenodd"
6061
/>
6162
</svg>
62-
</Drawer.Close>
63+
</Dialog.CloseButton>
6364
</div>
6465

6566
{/* Notification list */}
@@ -129,8 +130,8 @@ export default function NotificationDrawer(props: NotificationDrawerProps) {
129130
</ul>
130131
</Show>
131132
</div>
132-
</Drawer.Content>
133-
</Drawer.Portal>
134-
</Drawer>
133+
</Dialog.Content>
134+
</Dialog.Portal>
135+
</Dialog>
135136
);
136137
}

0 commit comments

Comments
 (0)