@krak-stack/registry 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2095,6 +2095,8 @@ function AgentWidget({
2095
2095
  /* @__PURE__ */ jsx19(PopoverTrigger, {
2096
2096
  id: referenceInputId,
2097
2097
  nativeButton: false,
2098
+ onKeyDown: (event) => event.preventBaseUIHandler(),
2099
+ onKeyUp: (event) => event.preventBaseUIHandler(),
2098
2100
  render: /* @__PURE__ */ jsx19(InputGroupTextarea, {
2099
2101
  ref: inputRef,
2100
2102
  className: "caret-foreground selection:bg-primary selection:text-primary-foreground relative max-h-32 w-full [scrollbar-width:thin] [scrollbar-color:var(--border)_transparent] [scrollbar-gutter:stable] overflow-y-auto overscroll-contain text-left text-transparent",
@@ -7,7 +7,7 @@ import {
7
7
  Inbox,
8
8
  TriangleAlert
9
9
  } from "lucide-react";
10
- import { useState } from "react";
10
+ import { Fragment, useState } from "react";
11
11
  import { Schema } from "effect";
12
12
 
13
13
  // ../../src/components/ui/badge.tsx
@@ -245,10 +245,26 @@ function ScrollBar({
245
245
  });
246
246
  }
247
247
 
248
- // ../../src/components/ui/skeleton.tsx
248
+ // ../../src/components/ui/separator.tsx
249
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
249
250
  import { jsx as jsx5 } from "react/jsx-runtime";
251
+ function Separator({
252
+ className,
253
+ orientation = "horizontal",
254
+ ...props
255
+ }) {
256
+ return /* @__PURE__ */ jsx5(SeparatorPrimitive, {
257
+ "data-slot": "separator",
258
+ orientation,
259
+ className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className),
260
+ ...props
261
+ });
262
+ }
263
+
264
+ // ../../src/components/ui/skeleton.tsx
265
+ import { jsx as jsx6 } from "react/jsx-runtime";
250
266
  function Skeleton({ className, ...props }) {
251
- return /* @__PURE__ */ jsx5("div", {
267
+ return /* @__PURE__ */ jsx6("div", {
252
268
  "data-slot": "skeleton",
253
269
  className: cn("animate-pulse rounded-md bg-muted", className),
254
270
  ...props
@@ -258,13 +274,13 @@ function Skeleton({ className, ...props }) {
258
274
  // ../../src/components/ui/tabs.tsx
259
275
  import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
260
276
  import { cva as cva4 } from "class-variance-authority";
261
- import { jsx as jsx6 } from "react/jsx-runtime";
277
+ import { jsx as jsx7 } from "react/jsx-runtime";
262
278
  function Tabs({
263
279
  className,
264
280
  orientation = "horizontal",
265
281
  ...props
266
282
  }) {
267
- return /* @__PURE__ */ jsx6(TabsPrimitive.Root, {
283
+ return /* @__PURE__ */ jsx7(TabsPrimitive.Root, {
268
284
  "data-slot": "tabs",
269
285
  "data-orientation": orientation,
270
286
  className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className),
@@ -287,7 +303,7 @@ function TabsList({
287
303
  variant = "default",
288
304
  ...props
289
305
  }) {
290
- return /* @__PURE__ */ jsx6(TabsPrimitive.List, {
306
+ return /* @__PURE__ */ jsx7(TabsPrimitive.List, {
291
307
  "data-slot": "tabs-list",
292
308
  "data-variant": variant,
293
309
  className: cn(tabsListVariants({ variant }), className),
@@ -295,7 +311,7 @@ function TabsList({
295
311
  });
296
312
  }
297
313
  function TabsTrigger({ className, ...props }) {
298
- return /* @__PURE__ */ jsx6(TabsPrimitive.Tab, {
314
+ return /* @__PURE__ */ jsx7(TabsPrimitive.Tab, {
299
315
  "data-slot": "tabs-trigger",
300
316
  className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className),
301
317
  ...props
@@ -304,7 +320,7 @@ function TabsTrigger({ className, ...props }) {
304
320
 
305
321
  // ../../src/services/notification/client/notification-menu.tsx
306
322
  import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
307
- import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
323
+ import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
308
324
  var defaultMessages = {
309
325
  en: {
310
326
  archive: "Archive",
@@ -386,65 +402,76 @@ function NotificationMenu({
386
402
  open,
387
403
  onOpenChange: handleOpenChange,
388
404
  children: [
389
- renderTrigger ? /* @__PURE__ */ jsx7(PopoverTrigger, {
405
+ renderTrigger ? /* @__PURE__ */ jsx8(PopoverTrigger, {
390
406
  render: renderTrigger(triggerState)
391
- }) : /* @__PURE__ */ jsx7(NotificationMenuTrigger, {
407
+ }) : /* @__PURE__ */ jsx8(NotificationMenuTrigger, {
392
408
  labels,
393
409
  unreadCount: unreadIds.length
394
410
  }),
395
411
  /* @__PURE__ */ jsxs2(PopoverContent, {
396
412
  align: "end",
397
- className: cn("max-h-[min(32rem,80svh)] w-96 max-w-[calc(100vw-1rem)] gap-0 p-0", className),
413
+ className: cn("max-h-[min(32rem,80svh,var(--available-height))] w-96 max-w-[calc(100vw-1rem)] gap-0 overflow-hidden p-0", className),
398
414
  children: [
399
- /* @__PURE__ */ jsx7(PopoverHeader, {
400
- className: "border-b px-4 py-3",
401
- children: /* @__PURE__ */ jsx7(PopoverTitle, {
415
+ /* @__PURE__ */ jsx8(PopoverHeader, {
416
+ className: "shrink-0 border-b px-4 py-3",
417
+ children: /* @__PURE__ */ jsx8(PopoverTitle, {
402
418
  children: labels.notifications
403
419
  })
404
420
  }),
405
421
  /* @__PURE__ */ jsxs2(Tabs, {
406
422
  value: tab,
407
423
  onValueChange: (value) => setTab(value === "archive" ? "archive" : "inbox"),
408
- className: "min-h-0 gap-0",
424
+ className: "min-h-0 min-w-0 flex-1 gap-0",
409
425
  children: [
410
426
  /* @__PURE__ */ jsxs2("div", {
411
- className: "flex items-center gap-2 border-b p-2",
427
+ className: "flex shrink-0 flex-col gap-2 border-b p-2",
412
428
  children: [
413
429
  /* @__PURE__ */ jsxs2(TabsList, {
414
- className: "grid flex-1 grid-cols-2",
430
+ className: "grid w-full min-w-0 grid-cols-2",
415
431
  children: [
416
432
  /* @__PURE__ */ jsxs2(TabsTrigger, {
433
+ className: "min-w-0",
417
434
  value: "inbox",
418
435
  children: [
419
- /* @__PURE__ */ jsx7(Inbox, {
436
+ /* @__PURE__ */ jsx8(Inbox, {
420
437
  "data-icon": "inline-start"
421
438
  }),
422
- labels.inbox,
423
- inbox.length > 0 ? /* @__PURE__ */ jsx7(Badge, {
439
+ /* @__PURE__ */ jsx8("span", {
440
+ className: "truncate",
441
+ children: labels.inbox
442
+ }),
443
+ inbox.length > 0 ? /* @__PURE__ */ jsx8(Badge, {
444
+ className: "shrink-0 tabular-nums",
424
445
  variant: "secondary",
425
446
  children: inbox.length
426
447
  }) : null
427
448
  ]
428
449
  }),
429
450
  /* @__PURE__ */ jsxs2(TabsTrigger, {
451
+ className: "min-w-0",
430
452
  value: "archive",
431
453
  children: [
432
- /* @__PURE__ */ jsx7(ArchiveRestore, {
454
+ /* @__PURE__ */ jsx8(ArchiveRestore, {
433
455
  "data-icon": "inline-start"
434
456
  }),
435
- labels.archived
457
+ /* @__PURE__ */ jsx8("span", {
458
+ className: "truncate",
459
+ children: labels.archived
460
+ })
436
461
  ]
437
462
  })
438
463
  ]
439
464
  }),
440
- tab === "inbox" && inbox.length > 0 && onArchive ? /* @__PURE__ */ jsx7(ArchiveButton, {
465
+ tab === "inbox" && inbox.length > 0 && onArchive ? /* @__PURE__ */ jsx8(ArchiveButton, {
466
+ showLabel: true,
467
+ className: "w-full",
441
468
  label: labels.archiveAll,
442
469
  notificationIds: inbox.map((notification) => notification.id),
443
470
  onArchive
444
471
  }) : null
445
472
  ]
446
473
  }),
447
- /* @__PURE__ */ jsx7(NotificationList, {
474
+ /* @__PURE__ */ jsx8(NotificationList, {
448
475
  error,
449
476
  isLoading,
450
477
  labels,
@@ -472,11 +499,11 @@ function NotificationMenuTrigger({
472
499
  const labels = providedLabels ?? notificationMenuMessages(locale, messages);
473
500
  return /* @__PURE__ */ jsxs2(PopoverTrigger, {
474
501
  "aria-label": unreadCount > 0 ? `${labels.notifications}, ${labels.unread(unreadCount)}` : labels.notifications,
475
- className: cn(buttonVariants({ variant: "outline", size: "icon" }), "relative rounded-full"),
502
+ className: cn(buttonVariants({ variant: "outline", size: "icon" }), "relative"),
476
503
  type: "button",
477
504
  children: [
478
- /* @__PURE__ */ jsx7(Bell, {}),
479
- unreadCount > 0 ? /* @__PURE__ */ jsx7(Badge, {
505
+ /* @__PURE__ */ jsx8(Bell, {}),
506
+ unreadCount > 0 ? /* @__PURE__ */ jsx8(Badge, {
480
507
  "aria-hidden": "true",
481
508
  className: "absolute -top-1 -right-1 min-w-5 px-1 tabular-nums",
482
509
  children: unreadCount > 99 ? "99+" : unreadCount
@@ -496,34 +523,39 @@ function NotificationList({
496
523
  tab
497
524
  }) {
498
525
  if (isLoading)
499
- return /* @__PURE__ */ jsx7(NotificationListLoading, {
526
+ return /* @__PURE__ */ jsx8(NotificationListLoading, {
500
527
  label: labels.loading
501
528
  });
502
529
  if (error) {
503
- return /* @__PURE__ */ jsx7(NotificationEmpty, {
530
+ return /* @__PURE__ */ jsx8(NotificationEmpty, {
504
531
  description: labels.errorDescription,
505
- icon: /* @__PURE__ */ jsx7(TriangleAlert, {}),
532
+ icon: /* @__PURE__ */ jsx8(TriangleAlert, {}),
506
533
  title: labels.errorTitle
507
534
  });
508
535
  }
509
536
  if (notifications.length === 0) {
510
- return /* @__PURE__ */ jsx7(NotificationEmpty, {
537
+ return /* @__PURE__ */ jsx8(NotificationEmpty, {
511
538
  description: tab === "inbox" ? labels.emptyInboxDescription : labels.emptyArchiveDescription,
512
- icon: tab === "inbox" ? /* @__PURE__ */ jsx7(BellDot, {}) : /* @__PURE__ */ jsx7(Archive, {}),
539
+ icon: tab === "inbox" ? /* @__PURE__ */ jsx8(BellDot, {}) : /* @__PURE__ */ jsx8(Archive, {}),
513
540
  title: tab === "inbox" ? labels.emptyInboxTitle : labels.emptyArchiveTitle
514
541
  });
515
542
  }
516
- return /* @__PURE__ */ jsx7(ScrollArea, {
517
- className: "h-[min(24rem,60svh)]",
518
- children: /* @__PURE__ */ jsx7("div", {
519
- className: "flex flex-col gap-1 p-2",
520
- children: notifications.map((notification) => /* @__PURE__ */ jsx7(NotificationListItem, {
521
- labels,
522
- locale,
523
- notification,
524
- onArchive,
525
- onNavigate,
526
- renderItem
543
+ return /* @__PURE__ */ jsx8(ScrollArea, {
544
+ className: "h-[min(24rem,60svh)] min-h-0 min-w-0 flex-1",
545
+ children: /* @__PURE__ */ jsx8("div", {
546
+ className: "flex min-w-0 flex-col",
547
+ children: notifications.map((notification, index) => /* @__PURE__ */ jsxs2(Fragment, {
548
+ children: [
549
+ index > 0 ? /* @__PURE__ */ jsx8(Separator, {}) : null,
550
+ /* @__PURE__ */ jsx8(NotificationListItem, {
551
+ labels,
552
+ locale,
553
+ notification,
554
+ onArchive,
555
+ onNavigate,
556
+ renderItem
557
+ })
558
+ ]
527
559
  }, notification.id))
528
560
  })
529
561
  });
@@ -546,48 +578,53 @@ function NotificationListItem({
546
578
  window.location.assign(notification.href);
547
579
  }
548
580
  };
581
+ const content = renderItem?.(notification) ?? /* @__PURE__ */ jsxs2("span", {
582
+ className: "flex min-w-0 flex-1 flex-col gap-1",
583
+ children: [
584
+ /* @__PURE__ */ jsxs2("span", {
585
+ className: "flex min-w-0 items-start gap-2",
586
+ children: [
587
+ unread ? /* @__PURE__ */ jsx8("span", {
588
+ "aria-hidden": "true",
589
+ className: "bg-primary mt-1.5 size-2 shrink-0 rounded-full"
590
+ }) : null,
591
+ /* @__PURE__ */ jsx8("span", {
592
+ className: "min-w-0 flex-1 font-medium",
593
+ children: notification.title
594
+ })
595
+ ]
596
+ }),
597
+ notification.description ? /* @__PURE__ */ jsx8("span", {
598
+ className: "text-muted-foreground line-clamp-2 text-xs font-normal",
599
+ children: notification.description
600
+ }) : null,
601
+ notification.timestampLabel || notification.createdAt ? /* @__PURE__ */ jsx8("span", {
602
+ className: "text-muted-foreground text-xs font-normal",
603
+ children: notification.timestampLabel ?? formatNotificationDate(notification.createdAt, locale)
604
+ }) : null
605
+ ]
606
+ });
549
607
  return /* @__PURE__ */ jsxs2("div", {
550
- className: cn("group flex min-w-0 items-start gap-1 rounded-lg", unread && "bg-muted/70"),
608
+ className: cn("group grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-start py-2", unread && "bg-muted/70"),
551
609
  "data-unread": unread || undefined,
552
610
  children: [
553
- /* @__PURE__ */ jsx7(Button, {
554
- className: "h-auto min-w-0 flex-1 justify-start px-3 py-2.5 text-left whitespace-normal",
555
- disabled: !notification.href && !onNavigate,
611
+ notification.href || onNavigate ? /* @__PURE__ */ jsx8(Button, {
612
+ className: "h-auto w-full min-w-0 justify-start px-3 py-2.5 text-left [overflow-wrap:anywhere] whitespace-normal",
556
613
  onClick: selectNotification,
557
614
  type: "button",
558
615
  variant: "ghost",
559
- children: renderItem?.(notification) ?? /* @__PURE__ */ jsxs2("span", {
560
- className: "flex min-w-0 flex-1 flex-col gap-1",
561
- children: [
562
- /* @__PURE__ */ jsxs2("span", {
563
- className: "flex min-w-0 items-start gap-2",
564
- children: [
565
- unread ? /* @__PURE__ */ jsx7("span", {
566
- "aria-hidden": "true",
567
- className: "bg-primary mt-1.5 size-2 shrink-0 rounded-full"
568
- }) : null,
569
- /* @__PURE__ */ jsx7("span", {
570
- className: "min-w-0 flex-1 font-medium",
571
- children: notification.title
572
- })
573
- ]
574
- }),
575
- notification.description ? /* @__PURE__ */ jsx7("span", {
576
- className: "text-muted-foreground line-clamp-2 text-xs font-normal",
577
- children: notification.description
578
- }) : null,
579
- notification.timestampLabel || notification.createdAt ? /* @__PURE__ */ jsx7("span", {
580
- className: "text-muted-foreground text-xs font-normal",
581
- children: notification.timestampLabel ?? formatNotificationDate(notification.createdAt, locale)
582
- }) : null
583
- ]
584
- })
616
+ children: content
617
+ }) : /* @__PURE__ */ jsx8("div", {
618
+ className: "flex min-w-0 px-3 py-2.5 [overflow-wrap:anywhere]",
619
+ children: content
585
620
  }),
586
- !notification.archivedAt && onArchive ? /* @__PURE__ */ jsx7(ArchiveButton, {
587
- className: "mt-2 mr-2 shrink-0",
588
- label: labels.archiveItem(notificationTitle(notification)),
589
- notificationIds: [notification.id],
590
- onArchive
621
+ !notification.archivedAt && onArchive ? /* @__PURE__ */ jsx8("div", {
622
+ className: "pt-2 pr-2",
623
+ children: /* @__PURE__ */ jsx8(ArchiveButton, {
624
+ label: labels.archiveItem(notificationTitle(notification)),
625
+ notificationIds: [notification.id],
626
+ onArchive
627
+ })
591
628
  }) : null
592
629
  ]
593
630
  });
@@ -597,19 +634,20 @@ function NotificationEmpty({
597
634
  icon,
598
635
  title
599
636
  }) {
600
- return /* @__PURE__ */ jsx7(Empty, {
637
+ return /* @__PURE__ */ jsx8(Empty, {
601
638
  className: "min-h-48 p-6",
602
639
  children: /* @__PURE__ */ jsxs2(EmptyHeader, {
603
640
  children: [
604
- /* @__PURE__ */ jsx7(EmptyMedia, {
641
+ /* @__PURE__ */ jsx8(EmptyMedia, {
605
642
  variant: "icon",
606
643
  children: icon
607
644
  }),
608
- /* @__PURE__ */ jsx7(EmptyTitle, {
609
- className: "text-base",
645
+ /* @__PURE__ */ jsx8(EmptyTitle, {
646
+ className: "text-sm",
610
647
  children: title
611
648
  }),
612
- /* @__PURE__ */ jsx7(EmptyDescription, {
649
+ /* @__PURE__ */ jsx8(EmptyDescription, {
650
+ className: "text-xs",
613
651
  children: description
614
652
  })
615
653
  ]
@@ -619,6 +657,7 @@ function NotificationEmpty({
619
657
  function ArchiveButton({
620
658
  className,
621
659
  label,
660
+ showLabel = false,
622
661
  notificationIds,
623
662
  onArchive
624
663
  }) {
@@ -631,36 +670,41 @@ function ArchiveButton({
631
670
  setPending(false);
632
671
  }
633
672
  };
634
- return /* @__PURE__ */ jsx7(Button, {
673
+ return /* @__PURE__ */ jsxs2(Button, {
635
674
  "aria-label": label,
636
675
  className,
637
676
  disabled: pending,
638
677
  onClick: () => void archiveNotifications(),
639
- size: "icon-sm",
678
+ size: showLabel ? "sm" : "icon-sm",
640
679
  title: label,
641
680
  type: "button",
642
- variant: "ghost",
643
- children: /* @__PURE__ */ jsx7(Archive, {})
681
+ variant: showLabel ? "outline" : "ghost",
682
+ children: [
683
+ /* @__PURE__ */ jsx8(Archive, {
684
+ "data-icon": showLabel ? "inline-start" : undefined
685
+ }),
686
+ showLabel ? label : null
687
+ ]
644
688
  });
645
689
  }
646
690
  function NotificationListLoading({ label }) {
647
- return /* @__PURE__ */ jsx7("div", {
691
+ return /* @__PURE__ */ jsx8("div", {
648
692
  "aria-label": label,
649
693
  className: "flex flex-col gap-2 p-3",
650
694
  role: "status",
651
695
  children: [0, 1, 2].map((item) => /* @__PURE__ */ jsxs2("div", {
652
696
  className: "flex items-center gap-3 p-2",
653
697
  children: [
654
- /* @__PURE__ */ jsx7(Skeleton, {
698
+ /* @__PURE__ */ jsx8(Skeleton, {
655
699
  className: "size-2 shrink-0 rounded-full"
656
700
  }),
657
701
  /* @__PURE__ */ jsxs2("div", {
658
702
  className: "flex flex-1 flex-col gap-2",
659
703
  children: [
660
- /* @__PURE__ */ jsx7(Skeleton, {
704
+ /* @__PURE__ */ jsx8(Skeleton, {
661
705
  className: "h-4 w-4/5"
662
706
  }),
663
- /* @__PURE__ */ jsx7(Skeleton, {
707
+ /* @__PURE__ */ jsx8(Skeleton, {
664
708
  className: "h-3 w-2/5"
665
709
  })
666
710
  ]