@krak-stack/registry 0.10.7 → 0.10.8
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.
package/CHANGELOG.md
CHANGED
|
@@ -145,7 +145,7 @@ declare const RevertButton: ({ locale, messages, original, }: {
|
|
|
145
145
|
messages?: FormMessageTranslations;
|
|
146
146
|
original: string;
|
|
147
147
|
}) => JSX.Element | undefined;
|
|
148
|
-
declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tanstack/
|
|
148
|
+
declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TSubmitMeta>(props: import("@tanstack/form-core").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
149
149
|
readonly TextField: typeof TextField;
|
|
150
150
|
readonly TextAreaField: typeof TextAreaField;
|
|
151
151
|
readonly SelectField: typeof SelectField;
|
|
@@ -161,7 +161,7 @@ declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tans
|
|
|
161
161
|
readonly FormError: typeof FormError;
|
|
162
162
|
readonly FieldWrapper: typeof FieldWrapper;
|
|
163
163
|
readonly BlockNavigation: typeof BlockNavigation;
|
|
164
|
-
}>, withForm: <TFormData, TOnMount extends undefined | import("@tanstack/
|
|
164
|
+
}>, withForm: <TFormData, TOnMount extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: import("@tanstack/react-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
165
165
|
readonly TextField: typeof TextField;
|
|
166
166
|
readonly TextAreaField: typeof TextAreaField;
|
|
167
167
|
readonly SelectField: typeof SelectField;
|
|
@@ -178,7 +178,7 @@ declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tans
|
|
|
178
178
|
readonly FieldWrapper: typeof FieldWrapper;
|
|
179
179
|
readonly BlockNavigation: typeof BlockNavigation;
|
|
180
180
|
}, TRenderProps>) => import("react").FunctionComponent<import("react").PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
181
|
-
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/
|
|
181
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
182
182
|
readonly TextField: typeof TextField;
|
|
183
183
|
readonly TextAreaField: typeof TextAreaField;
|
|
184
184
|
readonly SelectField: typeof SelectField;
|
|
@@ -211,8 +211,8 @@ declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tans
|
|
|
211
211
|
readonly FormError: typeof FormError;
|
|
212
212
|
readonly FieldWrapper: typeof FieldWrapper;
|
|
213
213
|
readonly BlockNavigation: typeof BlockNavigation;
|
|
214
|
-
}, TSubmitMeta, TRenderProps>) => <TFormData, TFields extends import("@tanstack/
|
|
215
|
-
form: import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/
|
|
214
|
+
}, TSubmitMeta, TRenderProps>) => <TFormData, TFields extends import("@tanstack/form-core").DeepKeysOfType<TFormData, TFieldGroupData | null | undefined> | import("@tanstack/form-core").FieldsMap<TFormData, TFieldGroupData>, TOnMount extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/form-core").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData>, TFormSubmitMeta>(params: import("react").PropsWithChildren<NoInfer<TRenderProps> & {
|
|
215
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/form-core").FieldsMap<unknown, TFormData>, any, any, any, any, any, any, any, any, any, any, unknown extends TSubmitMeta ? TFormSubmitMeta : TSubmitMeta, {
|
|
216
216
|
readonly TextField: typeof TextField;
|
|
217
217
|
readonly TextAreaField: typeof TextAreaField;
|
|
218
218
|
readonly SelectField: typeof SelectField;
|
|
@@ -601,11 +601,27 @@ var VisitorEventSession = Schema6.Struct({
|
|
|
601
601
|
}).annotate({ identifier: "VisitorEventSession" });
|
|
602
602
|
|
|
603
603
|
// ../../src/services/events/request-context.ts
|
|
604
|
+
var utf8HeaderDecoder = new TextDecoder("utf-8", {
|
|
605
|
+
fatal: true,
|
|
606
|
+
ignoreBOM: true
|
|
607
|
+
});
|
|
608
|
+
var decodeCloudflareCity = (city) => {
|
|
609
|
+
if (city === undefined)
|
|
610
|
+
return;
|
|
611
|
+
const codes = Array.from(city, (char) => char.charCodeAt(0));
|
|
612
|
+
if (codes.some((code) => code > 255))
|
|
613
|
+
return city;
|
|
614
|
+
try {
|
|
615
|
+
return utf8HeaderDecoder.decode(Uint8Array.from(codes));
|
|
616
|
+
} catch {
|
|
617
|
+
return city;
|
|
618
|
+
}
|
|
619
|
+
};
|
|
604
620
|
var cloudflareGeolocation = (headers) => ({
|
|
605
621
|
ip: Option4.getOrUndefined(Schema7.decodeUnknownOption(EventIpAddress)(headers["cf-connecting-ip"])),
|
|
606
622
|
country: Option4.getOrUndefined(Schema7.decodeUnknownOption(EventCountry)(headers["cf-ipcountry"])),
|
|
607
623
|
region: Option4.getOrUndefined(Schema7.decodeUnknownOption(EventRegion)(headers["cf-region-code"])),
|
|
608
|
-
city: Option4.getOrUndefined(Schema7.decodeUnknownOption(EventCity)(headers["cf-ipcity"]))
|
|
624
|
+
city: Option4.getOrUndefined(Schema7.decodeUnknownOption(EventCity)(decodeCloudflareCity(headers["cf-ipcity"])))
|
|
609
625
|
});
|
|
610
626
|
var geolocationAttributes = (location2) => {
|
|
611
627
|
const attributes = {};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Inbox,
|
|
8
8
|
TriangleAlert
|
|
9
9
|
} from "lucide-react";
|
|
10
|
-
import {
|
|
10
|
+
import { useState } from "react";
|
|
11
11
|
import { Schema } from "effect";
|
|
12
12
|
|
|
13
13
|
// ../../src/components/ui/badge.tsx
|
|
@@ -245,26 +245,10 @@ function ScrollBar({
|
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
// ../../src/components/ui/separator.tsx
|
|
249
|
-
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
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
248
|
// ../../src/components/ui/skeleton.tsx
|
|
265
|
-
import { jsx as
|
|
249
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
266
250
|
function Skeleton({ className, ...props }) {
|
|
267
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
268
252
|
"data-slot": "skeleton",
|
|
269
253
|
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
270
254
|
...props
|
|
@@ -274,13 +258,13 @@ function Skeleton({ className, ...props }) {
|
|
|
274
258
|
// ../../src/components/ui/tabs.tsx
|
|
275
259
|
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
276
260
|
import { cva as cva4 } from "class-variance-authority";
|
|
277
|
-
import { jsx as
|
|
261
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
278
262
|
function Tabs({
|
|
279
263
|
className,
|
|
280
264
|
orientation = "horizontal",
|
|
281
265
|
...props
|
|
282
266
|
}) {
|
|
283
|
-
return /* @__PURE__ */
|
|
267
|
+
return /* @__PURE__ */ jsx6(TabsPrimitive.Root, {
|
|
284
268
|
"data-slot": "tabs",
|
|
285
269
|
"data-orientation": orientation,
|
|
286
270
|
className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className),
|
|
@@ -303,7 +287,7 @@ function TabsList({
|
|
|
303
287
|
variant = "default",
|
|
304
288
|
...props
|
|
305
289
|
}) {
|
|
306
|
-
return /* @__PURE__ */
|
|
290
|
+
return /* @__PURE__ */ jsx6(TabsPrimitive.List, {
|
|
307
291
|
"data-slot": "tabs-list",
|
|
308
292
|
"data-variant": variant,
|
|
309
293
|
className: cn(tabsListVariants({ variant }), className),
|
|
@@ -311,7 +295,7 @@ function TabsList({
|
|
|
311
295
|
});
|
|
312
296
|
}
|
|
313
297
|
function TabsTrigger({ className, ...props }) {
|
|
314
|
-
return /* @__PURE__ */
|
|
298
|
+
return /* @__PURE__ */ jsx6(TabsPrimitive.Tab, {
|
|
315
299
|
"data-slot": "tabs-trigger",
|
|
316
300
|
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),
|
|
317
301
|
...props
|
|
@@ -320,7 +304,7 @@ function TabsTrigger({ className, ...props }) {
|
|
|
320
304
|
|
|
321
305
|
// ../../src/services/notification/client/notification-menu.tsx
|
|
322
306
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
323
|
-
import { jsx as
|
|
307
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
324
308
|
var defaultMessages = {
|
|
325
309
|
en: {
|
|
326
310
|
archive: "Archive",
|
|
@@ -402,9 +386,9 @@ function NotificationMenu({
|
|
|
402
386
|
open,
|
|
403
387
|
onOpenChange: handleOpenChange,
|
|
404
388
|
children: [
|
|
405
|
-
renderTrigger ? /* @__PURE__ */
|
|
389
|
+
renderTrigger ? /* @__PURE__ */ jsx7(PopoverTrigger, {
|
|
406
390
|
render: renderTrigger(triggerState)
|
|
407
|
-
}) : /* @__PURE__ */
|
|
391
|
+
}) : /* @__PURE__ */ jsx7(NotificationMenuTrigger, {
|
|
408
392
|
labels,
|
|
409
393
|
unreadCount: unreadIds.length
|
|
410
394
|
}),
|
|
@@ -412,9 +396,9 @@ function NotificationMenu({
|
|
|
412
396
|
align: "end",
|
|
413
397
|
className: cn("max-h-[min(32rem,80svh,var(--available-height))] w-96 max-w-[calc(100vw-1rem)] gap-0 overflow-hidden p-0", className),
|
|
414
398
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ jsx7(PopoverHeader, {
|
|
416
400
|
className: "shrink-0 border-b px-4 py-3",
|
|
417
|
-
children: /* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ jsx7(PopoverTitle, {
|
|
418
402
|
children: labels.notifications
|
|
419
403
|
})
|
|
420
404
|
}),
|
|
@@ -433,14 +417,14 @@ function NotificationMenu({
|
|
|
433
417
|
className: "min-w-0",
|
|
434
418
|
value: "inbox",
|
|
435
419
|
children: [
|
|
436
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ jsx7(Inbox, {
|
|
437
421
|
"data-icon": "inline-start"
|
|
438
422
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ jsx7("span", {
|
|
440
424
|
className: "truncate",
|
|
441
425
|
children: labels.inbox
|
|
442
426
|
}),
|
|
443
|
-
inbox.length > 0 ? /* @__PURE__ */
|
|
427
|
+
inbox.length > 0 ? /* @__PURE__ */ jsx7(Badge, {
|
|
444
428
|
className: "shrink-0 tabular-nums",
|
|
445
429
|
variant: "secondary",
|
|
446
430
|
children: inbox.length
|
|
@@ -451,10 +435,10 @@ function NotificationMenu({
|
|
|
451
435
|
className: "min-w-0",
|
|
452
436
|
value: "archive",
|
|
453
437
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ jsx7(ArchiveRestore, {
|
|
455
439
|
"data-icon": "inline-start"
|
|
456
440
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ jsx7("span", {
|
|
458
442
|
className: "truncate",
|
|
459
443
|
children: labels.archived
|
|
460
444
|
})
|
|
@@ -462,7 +446,7 @@ function NotificationMenu({
|
|
|
462
446
|
})
|
|
463
447
|
]
|
|
464
448
|
}),
|
|
465
|
-
tab === "inbox" && inbox.length > 0 && onArchive ? /* @__PURE__ */
|
|
449
|
+
tab === "inbox" && inbox.length > 0 && onArchive ? /* @__PURE__ */ jsx7(ArchiveButton, {
|
|
466
450
|
showLabel: true,
|
|
467
451
|
className: "w-full",
|
|
468
452
|
label: labels.archiveAll,
|
|
@@ -471,7 +455,7 @@ function NotificationMenu({
|
|
|
471
455
|
}) : null
|
|
472
456
|
]
|
|
473
457
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ jsx7(NotificationList, {
|
|
475
459
|
error,
|
|
476
460
|
isLoading,
|
|
477
461
|
labels,
|
|
@@ -502,8 +486,8 @@ function NotificationMenuTrigger({
|
|
|
502
486
|
className: cn(buttonVariants({ variant: "outline", size: "icon" }), "relative"),
|
|
503
487
|
type: "button",
|
|
504
488
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
unreadCount > 0 ? /* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ jsx7(Bell, {}),
|
|
490
|
+
unreadCount > 0 ? /* @__PURE__ */ jsx7(Badge, {
|
|
507
491
|
"aria-hidden": "true",
|
|
508
492
|
className: "absolute -top-1 -right-1 min-w-5 px-1 tabular-nums",
|
|
509
493
|
children: unreadCount > 99 ? "99+" : unreadCount
|
|
@@ -523,39 +507,34 @@ function NotificationList({
|
|
|
523
507
|
tab
|
|
524
508
|
}) {
|
|
525
509
|
if (isLoading)
|
|
526
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ jsx7(NotificationListLoading, {
|
|
527
511
|
label: labels.loading
|
|
528
512
|
});
|
|
529
513
|
if (error) {
|
|
530
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsx7(NotificationEmpty, {
|
|
531
515
|
description: labels.errorDescription,
|
|
532
|
-
icon: /* @__PURE__ */
|
|
516
|
+
icon: /* @__PURE__ */ jsx7(TriangleAlert, {}),
|
|
533
517
|
title: labels.errorTitle
|
|
534
518
|
});
|
|
535
519
|
}
|
|
536
520
|
if (notifications.length === 0) {
|
|
537
|
-
return /* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ jsx7(NotificationEmpty, {
|
|
538
522
|
description: tab === "inbox" ? labels.emptyInboxDescription : labels.emptyArchiveDescription,
|
|
539
|
-
icon: tab === "inbox" ? /* @__PURE__ */
|
|
523
|
+
icon: tab === "inbox" ? /* @__PURE__ */ jsx7(BellDot, {}) : /* @__PURE__ */ jsx7(Archive, {}),
|
|
540
524
|
title: tab === "inbox" ? labels.emptyInboxTitle : labels.emptyArchiveTitle
|
|
541
525
|
});
|
|
542
526
|
}
|
|
543
|
-
return /* @__PURE__ */
|
|
544
|
-
className: "h-[min(24rem,60svh)] min-h-0 min-w-0 flex-
|
|
545
|
-
children: /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ jsx7(ScrollArea, {
|
|
528
|
+
className: "flex max-h-[min(24rem,60svh)] min-h-0 min-w-0 flex-auto flex-col overflow-hidden [&>[data-slot=scroll-area-viewport]]:h-auto [&>[data-slot=scroll-area-viewport]]:min-h-0 [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:[--notification-scrollbar-gutter:0.375rem]",
|
|
529
|
+
children: /* @__PURE__ */ jsx7("div", {
|
|
546
530
|
className: "flex min-w-0 flex-col",
|
|
547
|
-
children: notifications.map((notification
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
onArchive,
|
|
555
|
-
onNavigate,
|
|
556
|
-
renderItem
|
|
557
|
-
})
|
|
558
|
-
]
|
|
531
|
+
children: notifications.map((notification) => /* @__PURE__ */ jsx7(NotificationListItem, {
|
|
532
|
+
labels,
|
|
533
|
+
locale,
|
|
534
|
+
notification,
|
|
535
|
+
onArchive,
|
|
536
|
+
onNavigate,
|
|
537
|
+
renderItem
|
|
559
538
|
}, notification.id))
|
|
560
539
|
})
|
|
561
540
|
});
|
|
@@ -584,21 +563,21 @@ function NotificationListItem({
|
|
|
584
563
|
/* @__PURE__ */ jsxs2("span", {
|
|
585
564
|
className: "flex min-w-0 items-start gap-2",
|
|
586
565
|
children: [
|
|
587
|
-
unread ? /* @__PURE__ */
|
|
566
|
+
unread ? /* @__PURE__ */ jsx7("span", {
|
|
588
567
|
"aria-hidden": "true",
|
|
589
568
|
className: "bg-primary mt-1.5 size-2 shrink-0 rounded-full"
|
|
590
569
|
}) : null,
|
|
591
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ jsx7("span", {
|
|
592
571
|
className: "min-w-0 flex-1 font-medium",
|
|
593
572
|
children: notification.title
|
|
594
573
|
})
|
|
595
574
|
]
|
|
596
575
|
}),
|
|
597
|
-
notification.description ? /* @__PURE__ */
|
|
576
|
+
notification.description ? /* @__PURE__ */ jsx7("span", {
|
|
598
577
|
className: "text-muted-foreground line-clamp-2 text-xs font-normal",
|
|
599
578
|
children: notification.description
|
|
600
579
|
}) : null,
|
|
601
|
-
notification.timestampLabel || notification.createdAt ? /* @__PURE__ */
|
|
580
|
+
notification.timestampLabel || notification.createdAt ? /* @__PURE__ */ jsx7("span", {
|
|
602
581
|
className: "text-muted-foreground text-xs font-normal",
|
|
603
582
|
children: notification.timestampLabel ?? formatNotificationDate(notification.createdAt, locale)
|
|
604
583
|
}) : null
|
|
@@ -608,16 +587,16 @@ function NotificationListItem({
|
|
|
608
587
|
className: cn("group relative min-w-0", unread && "bg-muted/70"),
|
|
609
588
|
"data-unread": unread || undefined,
|
|
610
589
|
children: [
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
className: cn("h-auto w-full min-w-0 cursor-pointer justify-start rounded-none border-0 px-3 py-4 text-left [overflow-wrap:anywhere] whitespace-normal", !notification.archivedAt && onArchive && "pr-
|
|
590
|
+
/* @__PURE__ */ jsx7(Button, {
|
|
591
|
+
className: cn("h-auto w-full min-w-0 cursor-pointer justify-start rounded-none border-0 border-b border-border px-3 py-4 pr-[calc(0.75rem+var(--notification-scrollbar-gutter,0px))] text-left [overflow-wrap:anywhere] whitespace-normal group-last:border-b-0", !notification.archivedAt && onArchive && "pr-[calc(3.5rem+var(--notification-scrollbar-gutter,0px))]"),
|
|
613
592
|
onClick: selectNotification,
|
|
614
593
|
type: "button",
|
|
615
594
|
variant: "ghost",
|
|
616
595
|
children: content
|
|
617
596
|
}),
|
|
618
|
-
!notification.archivedAt && onArchive ? /* @__PURE__ */
|
|
619
|
-
className: "absolute top-3 right-
|
|
620
|
-
children: /* @__PURE__ */
|
|
597
|
+
!notification.archivedAt && onArchive ? /* @__PURE__ */ jsx7("div", {
|
|
598
|
+
className: "absolute top-3 right-[calc(0.5rem+var(--notification-scrollbar-gutter,0px))]",
|
|
599
|
+
children: /* @__PURE__ */ jsx7(ArchiveButton, {
|
|
621
600
|
label: labels.archiveItem(notificationTitle(notification)),
|
|
622
601
|
notificationIds: [notification.id],
|
|
623
602
|
onArchive
|
|
@@ -631,19 +610,19 @@ function NotificationEmpty({
|
|
|
631
610
|
icon,
|
|
632
611
|
title
|
|
633
612
|
}) {
|
|
634
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ jsx7(Empty, {
|
|
635
614
|
className: "min-h-48 p-6",
|
|
636
615
|
children: /* @__PURE__ */ jsxs2(EmptyHeader, {
|
|
637
616
|
children: [
|
|
638
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ jsx7(EmptyMedia, {
|
|
639
618
|
variant: "icon",
|
|
640
619
|
children: icon
|
|
641
620
|
}),
|
|
642
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ jsx7(EmptyTitle, {
|
|
643
622
|
className: "text-sm",
|
|
644
623
|
children: title
|
|
645
624
|
}),
|
|
646
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ jsx7(EmptyDescription, {
|
|
647
626
|
className: "text-xs",
|
|
648
627
|
children: description
|
|
649
628
|
})
|
|
@@ -677,7 +656,7 @@ function ArchiveButton({
|
|
|
677
656
|
type: "button",
|
|
678
657
|
variant: showLabel ? "outline" : "ghost",
|
|
679
658
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ jsx7(Archive, {
|
|
681
660
|
"data-icon": showLabel ? "inline-start" : undefined
|
|
682
661
|
}),
|
|
683
662
|
showLabel ? label : null
|
|
@@ -685,23 +664,23 @@ function ArchiveButton({
|
|
|
685
664
|
});
|
|
686
665
|
}
|
|
687
666
|
function NotificationListLoading({ label }) {
|
|
688
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
689
668
|
"aria-label": label,
|
|
690
669
|
className: "flex flex-col gap-2 p-3",
|
|
691
670
|
role: "status",
|
|
692
671
|
children: [0, 1, 2].map((item) => /* @__PURE__ */ jsxs2("div", {
|
|
693
672
|
className: "flex items-center gap-3 p-2",
|
|
694
673
|
children: [
|
|
695
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ jsx7(Skeleton, {
|
|
696
675
|
className: "size-2 shrink-0 rounded-full"
|
|
697
676
|
}),
|
|
698
677
|
/* @__PURE__ */ jsxs2("div", {
|
|
699
678
|
className: "flex flex-1 flex-col gap-2",
|
|
700
679
|
children: [
|
|
701
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ jsx7(Skeleton, {
|
|
702
681
|
className: "h-4 w-4/5"
|
|
703
682
|
}),
|
|
704
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ jsx7(Skeleton, {
|
|
705
684
|
className: "h-3 w-2/5"
|
|
706
685
|
})
|
|
707
686
|
]
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
Inbox,
|
|
101
101
|
TriangleAlert
|
|
102
102
|
} from "lucide-react";
|
|
103
|
-
import {
|
|
103
|
+
import { useState } from "react";
|
|
104
104
|
import { Schema as Schema2 } from "effect";
|
|
105
105
|
|
|
106
106
|
// ../../src/components/ui/badge.tsx
|
|
@@ -338,26 +338,10 @@ function ScrollBar({
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
// ../../src/components/ui/separator.tsx
|
|
342
|
-
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
343
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
344
|
-
function Separator({
|
|
345
|
-
className,
|
|
346
|
-
orientation = "horizontal",
|
|
347
|
-
...props
|
|
348
|
-
}) {
|
|
349
|
-
return /* @__PURE__ */ jsx5(SeparatorPrimitive, {
|
|
350
|
-
"data-slot": "separator",
|
|
351
|
-
orientation,
|
|
352
|
-
className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className),
|
|
353
|
-
...props
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
|
|
357
341
|
// ../../src/components/ui/skeleton.tsx
|
|
358
|
-
import { jsx as
|
|
342
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
359
343
|
function Skeleton({ className, ...props }) {
|
|
360
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
361
345
|
"data-slot": "skeleton",
|
|
362
346
|
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
363
347
|
...props
|
|
@@ -367,13 +351,13 @@ function Skeleton({ className, ...props }) {
|
|
|
367
351
|
// ../../src/components/ui/tabs.tsx
|
|
368
352
|
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
369
353
|
import { cva as cva4 } from "class-variance-authority";
|
|
370
|
-
import { jsx as
|
|
354
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
371
355
|
function Tabs({
|
|
372
356
|
className,
|
|
373
357
|
orientation = "horizontal",
|
|
374
358
|
...props
|
|
375
359
|
}) {
|
|
376
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ jsx6(TabsPrimitive.Root, {
|
|
377
361
|
"data-slot": "tabs",
|
|
378
362
|
"data-orientation": orientation,
|
|
379
363
|
className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className),
|
|
@@ -396,7 +380,7 @@ function TabsList({
|
|
|
396
380
|
variant = "default",
|
|
397
381
|
...props
|
|
398
382
|
}) {
|
|
399
|
-
return /* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ jsx6(TabsPrimitive.List, {
|
|
400
384
|
"data-slot": "tabs-list",
|
|
401
385
|
"data-variant": variant,
|
|
402
386
|
className: cn(tabsListVariants({ variant }), className),
|
|
@@ -404,7 +388,7 @@ function TabsList({
|
|
|
404
388
|
});
|
|
405
389
|
}
|
|
406
390
|
function TabsTrigger({ className, ...props }) {
|
|
407
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ jsx6(TabsPrimitive.Tab, {
|
|
408
392
|
"data-slot": "tabs-trigger",
|
|
409
393
|
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),
|
|
410
394
|
...props
|
|
@@ -413,7 +397,7 @@ function TabsTrigger({ className, ...props }) {
|
|
|
413
397
|
|
|
414
398
|
// ../../src/services/notification/client/notification-menu.tsx
|
|
415
399
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
416
|
-
import { jsx as
|
|
400
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
417
401
|
var defaultMessages = {
|
|
418
402
|
en: {
|
|
419
403
|
archive: "Archive",
|
|
@@ -495,9 +479,9 @@ function NotificationMenu({
|
|
|
495
479
|
open,
|
|
496
480
|
onOpenChange: handleOpenChange,
|
|
497
481
|
children: [
|
|
498
|
-
renderTrigger ? /* @__PURE__ */
|
|
482
|
+
renderTrigger ? /* @__PURE__ */ jsx7(PopoverTrigger, {
|
|
499
483
|
render: renderTrigger(triggerState)
|
|
500
|
-
}) : /* @__PURE__ */
|
|
484
|
+
}) : /* @__PURE__ */ jsx7(NotificationMenuTrigger, {
|
|
501
485
|
labels,
|
|
502
486
|
unreadCount: unreadIds.length
|
|
503
487
|
}),
|
|
@@ -505,9 +489,9 @@ function NotificationMenu({
|
|
|
505
489
|
align: "end",
|
|
506
490
|
className: cn("max-h-[min(32rem,80svh,var(--available-height))] w-96 max-w-[calc(100vw-1rem)] gap-0 overflow-hidden p-0", className),
|
|
507
491
|
children: [
|
|
508
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ jsx7(PopoverHeader, {
|
|
509
493
|
className: "shrink-0 border-b px-4 py-3",
|
|
510
|
-
children: /* @__PURE__ */
|
|
494
|
+
children: /* @__PURE__ */ jsx7(PopoverTitle, {
|
|
511
495
|
children: labels.notifications
|
|
512
496
|
})
|
|
513
497
|
}),
|
|
@@ -526,14 +510,14 @@ function NotificationMenu({
|
|
|
526
510
|
className: "min-w-0",
|
|
527
511
|
value: "inbox",
|
|
528
512
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ jsx7(Inbox, {
|
|
530
514
|
"data-icon": "inline-start"
|
|
531
515
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ jsx7("span", {
|
|
533
517
|
className: "truncate",
|
|
534
518
|
children: labels.inbox
|
|
535
519
|
}),
|
|
536
|
-
inbox.length > 0 ? /* @__PURE__ */
|
|
520
|
+
inbox.length > 0 ? /* @__PURE__ */ jsx7(Badge, {
|
|
537
521
|
className: "shrink-0 tabular-nums",
|
|
538
522
|
variant: "secondary",
|
|
539
523
|
children: inbox.length
|
|
@@ -544,10 +528,10 @@ function NotificationMenu({
|
|
|
544
528
|
className: "min-w-0",
|
|
545
529
|
value: "archive",
|
|
546
530
|
children: [
|
|
547
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ jsx7(ArchiveRestore, {
|
|
548
532
|
"data-icon": "inline-start"
|
|
549
533
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ jsx7("span", {
|
|
551
535
|
className: "truncate",
|
|
552
536
|
children: labels.archived
|
|
553
537
|
})
|
|
@@ -555,7 +539,7 @@ function NotificationMenu({
|
|
|
555
539
|
})
|
|
556
540
|
]
|
|
557
541
|
}),
|
|
558
|
-
tab === "inbox" && inbox.length > 0 && onArchive ? /* @__PURE__ */
|
|
542
|
+
tab === "inbox" && inbox.length > 0 && onArchive ? /* @__PURE__ */ jsx7(ArchiveButton, {
|
|
559
543
|
showLabel: true,
|
|
560
544
|
className: "w-full",
|
|
561
545
|
label: labels.archiveAll,
|
|
@@ -564,7 +548,7 @@ function NotificationMenu({
|
|
|
564
548
|
}) : null
|
|
565
549
|
]
|
|
566
550
|
}),
|
|
567
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ jsx7(NotificationList, {
|
|
568
552
|
error,
|
|
569
553
|
isLoading,
|
|
570
554
|
labels,
|
|
@@ -595,8 +579,8 @@ function NotificationMenuTrigger({
|
|
|
595
579
|
className: cn(buttonVariants({ variant: "outline", size: "icon" }), "relative"),
|
|
596
580
|
type: "button",
|
|
597
581
|
children: [
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
unreadCount > 0 ? /* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ jsx7(Bell, {}),
|
|
583
|
+
unreadCount > 0 ? /* @__PURE__ */ jsx7(Badge, {
|
|
600
584
|
"aria-hidden": "true",
|
|
601
585
|
className: "absolute -top-1 -right-1 min-w-5 px-1 tabular-nums",
|
|
602
586
|
children: unreadCount > 99 ? "99+" : unreadCount
|
|
@@ -616,39 +600,34 @@ function NotificationList({
|
|
|
616
600
|
tab
|
|
617
601
|
}) {
|
|
618
602
|
if (isLoading)
|
|
619
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ jsx7(NotificationListLoading, {
|
|
620
604
|
label: labels.loading
|
|
621
605
|
});
|
|
622
606
|
if (error) {
|
|
623
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ jsx7(NotificationEmpty, {
|
|
624
608
|
description: labels.errorDescription,
|
|
625
|
-
icon: /* @__PURE__ */
|
|
609
|
+
icon: /* @__PURE__ */ jsx7(TriangleAlert, {}),
|
|
626
610
|
title: labels.errorTitle
|
|
627
611
|
});
|
|
628
612
|
}
|
|
629
613
|
if (notifications.length === 0) {
|
|
630
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ jsx7(NotificationEmpty, {
|
|
631
615
|
description: tab === "inbox" ? labels.emptyInboxDescription : labels.emptyArchiveDescription,
|
|
632
|
-
icon: tab === "inbox" ? /* @__PURE__ */
|
|
616
|
+
icon: tab === "inbox" ? /* @__PURE__ */ jsx7(BellDot, {}) : /* @__PURE__ */ jsx7(Archive, {}),
|
|
633
617
|
title: tab === "inbox" ? labels.emptyInboxTitle : labels.emptyArchiveTitle
|
|
634
618
|
});
|
|
635
619
|
}
|
|
636
|
-
return /* @__PURE__ */
|
|
637
|
-
className: "h-[min(24rem,60svh)] min-h-0 min-w-0 flex-
|
|
638
|
-
children: /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ jsx7(ScrollArea, {
|
|
621
|
+
className: "flex max-h-[min(24rem,60svh)] min-h-0 min-w-0 flex-auto flex-col overflow-hidden [&>[data-slot=scroll-area-viewport]]:h-auto [&>[data-slot=scroll-area-viewport]]:min-h-0 [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:[--notification-scrollbar-gutter:0.375rem]",
|
|
622
|
+
children: /* @__PURE__ */ jsx7("div", {
|
|
639
623
|
className: "flex min-w-0 flex-col",
|
|
640
|
-
children: notifications.map((notification
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
onArchive,
|
|
648
|
-
onNavigate,
|
|
649
|
-
renderItem
|
|
650
|
-
})
|
|
651
|
-
]
|
|
624
|
+
children: notifications.map((notification) => /* @__PURE__ */ jsx7(NotificationListItem, {
|
|
625
|
+
labels,
|
|
626
|
+
locale,
|
|
627
|
+
notification,
|
|
628
|
+
onArchive,
|
|
629
|
+
onNavigate,
|
|
630
|
+
renderItem
|
|
652
631
|
}, notification.id))
|
|
653
632
|
})
|
|
654
633
|
});
|
|
@@ -677,21 +656,21 @@ function NotificationListItem({
|
|
|
677
656
|
/* @__PURE__ */ jsxs2("span", {
|
|
678
657
|
className: "flex min-w-0 items-start gap-2",
|
|
679
658
|
children: [
|
|
680
|
-
unread ? /* @__PURE__ */
|
|
659
|
+
unread ? /* @__PURE__ */ jsx7("span", {
|
|
681
660
|
"aria-hidden": "true",
|
|
682
661
|
className: "bg-primary mt-1.5 size-2 shrink-0 rounded-full"
|
|
683
662
|
}) : null,
|
|
684
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ jsx7("span", {
|
|
685
664
|
className: "min-w-0 flex-1 font-medium",
|
|
686
665
|
children: notification.title
|
|
687
666
|
})
|
|
688
667
|
]
|
|
689
668
|
}),
|
|
690
|
-
notification.description ? /* @__PURE__ */
|
|
669
|
+
notification.description ? /* @__PURE__ */ jsx7("span", {
|
|
691
670
|
className: "text-muted-foreground line-clamp-2 text-xs font-normal",
|
|
692
671
|
children: notification.description
|
|
693
672
|
}) : null,
|
|
694
|
-
notification.timestampLabel || notification.createdAt ? /* @__PURE__ */
|
|
673
|
+
notification.timestampLabel || notification.createdAt ? /* @__PURE__ */ jsx7("span", {
|
|
695
674
|
className: "text-muted-foreground text-xs font-normal",
|
|
696
675
|
children: notification.timestampLabel ?? formatNotificationDate(notification.createdAt, locale)
|
|
697
676
|
}) : null
|
|
@@ -701,16 +680,16 @@ function NotificationListItem({
|
|
|
701
680
|
className: cn("group relative min-w-0", unread && "bg-muted/70"),
|
|
702
681
|
"data-unread": unread || undefined,
|
|
703
682
|
children: [
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
className: cn("h-auto w-full min-w-0 cursor-pointer justify-start rounded-none border-0 px-3 py-4 text-left [overflow-wrap:anywhere] whitespace-normal", !notification.archivedAt && onArchive && "pr-
|
|
683
|
+
/* @__PURE__ */ jsx7(Button, {
|
|
684
|
+
className: cn("h-auto w-full min-w-0 cursor-pointer justify-start rounded-none border-0 border-b border-border px-3 py-4 pr-[calc(0.75rem+var(--notification-scrollbar-gutter,0px))] text-left [overflow-wrap:anywhere] whitespace-normal group-last:border-b-0", !notification.archivedAt && onArchive && "pr-[calc(3.5rem+var(--notification-scrollbar-gutter,0px))]"),
|
|
706
685
|
onClick: selectNotification,
|
|
707
686
|
type: "button",
|
|
708
687
|
variant: "ghost",
|
|
709
688
|
children: content
|
|
710
689
|
}),
|
|
711
|
-
!notification.archivedAt && onArchive ? /* @__PURE__ */
|
|
712
|
-
className: "absolute top-3 right-
|
|
713
|
-
children: /* @__PURE__ */
|
|
690
|
+
!notification.archivedAt && onArchive ? /* @__PURE__ */ jsx7("div", {
|
|
691
|
+
className: "absolute top-3 right-[calc(0.5rem+var(--notification-scrollbar-gutter,0px))]",
|
|
692
|
+
children: /* @__PURE__ */ jsx7(ArchiveButton, {
|
|
714
693
|
label: labels.archiveItem(notificationTitle(notification)),
|
|
715
694
|
notificationIds: [notification.id],
|
|
716
695
|
onArchive
|
|
@@ -724,19 +703,19 @@ function NotificationEmpty({
|
|
|
724
703
|
icon,
|
|
725
704
|
title
|
|
726
705
|
}) {
|
|
727
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ jsx7(Empty, {
|
|
728
707
|
className: "min-h-48 p-6",
|
|
729
708
|
children: /* @__PURE__ */ jsxs2(EmptyHeader, {
|
|
730
709
|
children: [
|
|
731
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ jsx7(EmptyMedia, {
|
|
732
711
|
variant: "icon",
|
|
733
712
|
children: icon
|
|
734
713
|
}),
|
|
735
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsx7(EmptyTitle, {
|
|
736
715
|
className: "text-sm",
|
|
737
716
|
children: title
|
|
738
717
|
}),
|
|
739
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ jsx7(EmptyDescription, {
|
|
740
719
|
className: "text-xs",
|
|
741
720
|
children: description
|
|
742
721
|
})
|
|
@@ -770,7 +749,7 @@ function ArchiveButton({
|
|
|
770
749
|
type: "button",
|
|
771
750
|
variant: showLabel ? "outline" : "ghost",
|
|
772
751
|
children: [
|
|
773
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ jsx7(Archive, {
|
|
774
753
|
"data-icon": showLabel ? "inline-start" : undefined
|
|
775
754
|
}),
|
|
776
755
|
showLabel ? label : null
|
|
@@ -778,23 +757,23 @@ function ArchiveButton({
|
|
|
778
757
|
});
|
|
779
758
|
}
|
|
780
759
|
function NotificationListLoading({ label }) {
|
|
781
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
782
761
|
"aria-label": label,
|
|
783
762
|
className: "flex flex-col gap-2 p-3",
|
|
784
763
|
role: "status",
|
|
785
764
|
children: [0, 1, 2].map((item) => /* @__PURE__ */ jsxs2("div", {
|
|
786
765
|
className: "flex items-center gap-3 p-2",
|
|
787
766
|
children: [
|
|
788
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ jsx7(Skeleton, {
|
|
789
768
|
className: "size-2 shrink-0 rounded-full"
|
|
790
769
|
}),
|
|
791
770
|
/* @__PURE__ */ jsxs2("div", {
|
|
792
771
|
className: "flex flex-1 flex-col gap-2",
|
|
793
772
|
children: [
|
|
794
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ jsx7(Skeleton, {
|
|
795
774
|
className: "h-4 w-4/5"
|
|
796
775
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ jsx7(Skeleton, {
|
|
798
777
|
className: "h-3 w-2/5"
|
|
799
778
|
})
|
|
800
779
|
]
|