@krak-stack/registry 0.1.32 → 0.1.34

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.
Files changed (46) hide show
  1. package/dist/components/ui/code-block.d.ts +8 -6
  2. package/dist/components/ui/code-block.js +44 -19
  3. package/dist/components/ui/copy-button.d.ts +9 -6
  4. package/dist/components/ui/copy-button.js +17 -8
  5. package/dist/components/ui/data-table.d.ts +9 -5
  6. package/dist/components/ui/data-table.js +90 -486
  7. package/dist/components/ui/editing-locale-switcher.d.ts +8 -4
  8. package/dist/components/ui/editing-locale-switcher.js +26 -448
  9. package/dist/components/ui/effect-form.d.ts +39 -10
  10. package/dist/components/ui/effect-form.js +171 -541
  11. package/dist/components/ui/error-component.d.ts +4 -2
  12. package/dist/components/ui/error-component.js +28 -450
  13. package/dist/components/ui/file-picker.d.ts +4 -2
  14. package/dist/components/ui/file-picker.js +27 -452
  15. package/dist/components/ui/form.d.ts +123 -71
  16. package/dist/components/ui/form.js +95 -476
  17. package/dist/components/ui/google-map.d.ts +3 -2
  18. package/dist/components/ui/google-map.js +6 -439
  19. package/dist/components/ui/icon-input.d.ts +50 -1
  20. package/dist/components/ui/icon-input.js +38 -448
  21. package/dist/components/ui/krakstack-provider.d.ts +9 -0
  22. package/dist/components/ui/krakstack-provider.js +28 -0
  23. package/dist/components/ui/loading.d.ts +7 -1
  24. package/dist/components/ui/loading.js +6 -438
  25. package/dist/components/ui/locale-switcher.d.ts +8 -4
  26. package/dist/components/ui/locale-switcher.js +35 -453
  27. package/dist/components/ui/pagination.d.ts +5 -3
  28. package/dist/components/ui/pagination.js +7 -439
  29. package/dist/components/ui/search-menu.d.ts +4 -2
  30. package/dist/components/ui/search-menu.js +8 -440
  31. package/dist/components/ui/theme-switcher.d.ts +5 -3
  32. package/dist/components/ui/theme-switcher.js +8 -440
  33. package/dist/components/ui/virtualized-combobox.d.ts +4 -2
  34. package/dist/components/ui/virtualized-combobox.js +17 -445
  35. package/dist/lib/docs.d.ts +2 -0
  36. package/dist/lib/docs.js +92 -481
  37. package/dist/lib/docs.server.js +4 -20
  38. package/dist/lib/documentation-toolkit.js +4 -20
  39. package/dist/lib/markdown/content.d.ts +4 -5
  40. package/dist/services/agent/client/index.js +81 -463
  41. package/dist/services/agent/client/widget.d.ts +6 -3
  42. package/dist/services/notification/client/index.js +11 -440
  43. package/dist/services/notification/client/notification-menu.d.ts +7 -4
  44. package/dist/services/notification/public.js +11 -440
  45. package/package.json +5 -1
  46. package/dist/paraglide/runtime.d.ts +0 -978
@@ -12,6 +12,7 @@ export type AgentWidgetMessages = {
12
12
  approvalRequired: string;
13
13
  cancel: string;
14
14
  close: string;
15
+ codeDescription: (language: string) => string;
15
16
  copied: string;
16
17
  copy: string;
17
18
  description: string;
@@ -38,11 +39,13 @@ export type AgentWidgetMessages = {
38
39
  viewMore: string;
39
40
  welcome: string;
40
41
  };
41
- export declare const agentWidgetMessages: (locale?: "en" | "fr", overrides?: Partial<AgentWidgetMessages>) => AgentWidgetMessages;
42
- export declare function AgentWidget<Resource = never>({ availableReferences, context, messages: messageOverrides, onInterrupt, onRemoveContext, onReset, onSubmit, state, }: {
42
+ export type AgentWidgetMessageTranslations = Partial<Record<string, Partial<AgentWidgetMessages>>>;
43
+ export declare const agentWidgetMessages: (locale?: string, translations?: AgentWidgetMessageTranslations) => AgentWidgetMessages;
44
+ export declare function AgentWidget<Resource = never>({ availableReferences, context, locale: localeOverride, messages: messageOverrides, onInterrupt, onRemoveContext, onReset, onSubmit, state, }: {
43
45
  readonly availableReferences?: ReadonlyArray<AgentWidgetReference<Resource>>;
44
46
  readonly context?: AgentWidgetReference<Resource>;
45
- readonly messages?: Partial<AgentWidgetMessages>;
47
+ readonly locale?: string;
48
+ readonly messages?: AgentWidgetMessageTranslations;
46
49
  readonly onInterrupt: () => void;
47
50
  readonly onRemoveContext?: () => void;
48
51
  readonly onReset: () => void;
@@ -302,443 +302,8 @@ function TabsTrigger({ className, ...props }) {
302
302
  });
303
303
  }
304
304
 
305
- // ../../src/paraglide/runtime.js
306
- import"@inlang/paraglide-js/urlpattern-polyfill";
307
- var baseLocale = "en";
308
- var locales = ["en", "fr"];
309
- var cookieName = "locale";
310
- var cookieMaxAge = 34560000;
311
- var cookieDomain = "";
312
- var localStorageKey = "PARAGLIDE_LOCALE";
313
- var strategy = [
314
- "url",
315
- "cookie",
316
- "preferredLanguage",
317
- "baseLocale"
318
- ];
319
- var routeStrategies = [
320
- {
321
- match: "/api/:path(.*)?",
322
- exclude: true
323
- },
324
- {
325
- match: "/sitemap.xml",
326
- exclude: true
327
- },
328
- {
329
- match: "/llms.txt",
330
- exclude: true
331
- }
332
- ];
333
- var urlPatterns = [
334
- {
335
- pattern: "/:path(.*)?",
336
- localized: [
337
- [
338
- "en",
339
- "/en/:path(.*)?"
340
- ],
341
- [
342
- "fr",
343
- "/fr/:path(.*)?"
344
- ]
345
- ]
346
- }
347
- ];
348
- var cachedRouteStrategyUrl;
349
- var cachedRouteStrategy;
350
- function findMatchingRouteStrategy(url) {
351
- if (routeStrategies.length === 0) {
352
- return;
353
- }
354
- const urlString = typeof url === "string" ? url : url.href;
355
- if (cachedRouteStrategyUrl === urlString) {
356
- return cachedRouteStrategy;
357
- }
358
- const urlObject = new URL(urlString, "http://dummy.com");
359
- let match;
360
- for (const routeStrategy of routeStrategies) {
361
- const pattern = new URLPattern(routeStrategy.match, urlObject.href);
362
- if (pattern.exec(urlObject.href)) {
363
- match = routeStrategy;
364
- break;
365
- }
366
- }
367
- cachedRouteStrategyUrl = urlString;
368
- cachedRouteStrategy = match;
369
- return match;
370
- }
371
- function getStrategyForUrl(url) {
372
- const routeStrategy = findMatchingRouteStrategy(url);
373
- if (routeStrategy && routeStrategy.exclude !== true && Array.isArray(routeStrategy.strategy)) {
374
- return routeStrategy.strategy;
375
- }
376
- return strategy;
377
- }
378
- var serverAsyncLocalStorage = undefined;
379
- var isServer = import.meta.env?.SSR ?? typeof window === "undefined";
380
- var experimentalStaticLocale = undefined;
381
- var TREE_SHAKE_COOKIE_STRATEGY_USED = true;
382
- var TREE_SHAKE_URL_STRATEGY_USED = true;
383
- var TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = false;
384
- var TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = true;
385
- var TREE_SHAKE_DEFAULT_URL_PATTERN_USED = false;
386
- var TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;
387
- globalThis.__paraglide = globalThis.__paraglide ?? {};
388
- globalThis.__paraglide.ssr = globalThis.__paraglide.ssr ?? {};
389
- var _locale;
390
- var localeInitiallySet = false;
391
- var getLocale = () => {
392
- if (experimentalStaticLocale !== undefined) {
393
- return experimentalStaticLocale;
394
- }
395
- if (serverAsyncLocalStorage) {
396
- const locale = serverAsyncLocalStorage?.getStore()?.locale;
397
- if (locale) {
398
- return locale;
399
- }
400
- }
401
- let strategyToUse = strategy;
402
- if (!isServer && typeof window !== "undefined" && window.location?.href) {
403
- strategyToUse = getStrategyForUrl(window.location.href);
404
- }
405
- const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== "undefined" ? window.location?.href : undefined);
406
- if (resolved) {
407
- if (!localeInitiallySet) {
408
- _locale = resolved;
409
- localeInitiallySet = true;
410
- setLocale(resolved, { reload: false });
411
- }
412
- return resolved;
413
- }
414
- throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
415
- };
416
- function resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {
417
- let locale;
418
- for (const strat of strategyToUse) {
419
- if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
420
- locale = extractLocaleFromCookie();
421
- } else if (strat === "baseLocale") {
422
- locale = baseLocale;
423
- } else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && !isServer && typeof urlForUrlStrategy === "string") {
424
- locale = extractLocaleFromUrl(urlForUrlStrategy);
425
- } else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable" && _locale !== undefined) {
426
- locale = _locale;
427
- } else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED && strat === "preferredLanguage" && !isServer) {
428
- locale = extractLocaleFromNavigator();
429
- } else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && !isServer) {
430
- locale = localStorage.getItem(localStorageKey) ?? undefined;
431
- } else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
432
- const handler = customClientStrategies.get(strat);
433
- if (handler) {
434
- const result = handler.getLocale();
435
- if (result instanceof Promise) {
436
- continue;
437
- }
438
- if (result !== undefined) {
439
- return assertIsLocale(result);
440
- }
441
- }
442
- }
443
- const matchedLocale = toLocale(locale);
444
- if (matchedLocale) {
445
- return matchedLocale;
446
- }
447
- }
448
- return;
449
- }
450
- var rtlLanguages = new Set([
451
- "ar",
452
- "dv",
453
- "fa",
454
- "he",
455
- "ks",
456
- "ku",
457
- "ps",
458
- "sd",
459
- "ug",
460
- "ur",
461
- "yi"
462
- ]);
463
- var navigateOrReload = (newLocation) => {
464
- if (newLocation) {
465
- window.location.href = newLocation;
466
- } else {
467
- window.location.reload();
468
- }
469
- };
470
- var setLocale = (newLocale, options) => {
471
- const optionsWithDefaults = {
472
- reload: true,
473
- ...options
474
- };
475
- let currentLocale;
476
- try {
477
- currentLocale = getLocale();
478
- } catch {}
479
- const customSetLocalePromises = [];
480
- let newLocation = undefined;
481
- let strategyToUse = strategy;
482
- if (!isServer && typeof window !== "undefined" && window.location?.href) {
483
- strategyToUse = getStrategyForUrl(window.location.href);
484
- }
485
- for (const strat of strategyToUse) {
486
- if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable") {
487
- _locale = newLocale;
488
- } else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
489
- if (isServer || typeof document === "undefined" || typeof window === "undefined") {
490
- continue;
491
- }
492
- const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;
493
- document.cookie = cookieDomain ? `${cookieString}; domain=${cookieDomain}` : cookieString;
494
- } else if (strat === "baseLocale") {
495
- continue;
496
- } else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && typeof window !== "undefined") {
497
- newLocation = localizeUrl(window.location.href, {
498
- locale: newLocale
499
- }).href;
500
- } else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && typeof window !== "undefined") {
501
- localStorage.setItem(localStorageKey, newLocale);
502
- } else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
503
- const handler = customClientStrategies.get(strat);
504
- if (handler) {
505
- let result = handler.setLocale(newLocale);
506
- if (result instanceof Promise) {
507
- result = result.catch((error) => {
508
- throw new Error(`Custom strategy "${strat}" setLocale failed.`, {
509
- cause: error
510
- });
511
- });
512
- customSetLocalePromises.push(result);
513
- }
514
- }
515
- }
516
- }
517
- const runReload = () => {
518
- if (!isServer && optionsWithDefaults.reload && window.location && newLocale !== currentLocale) {
519
- navigateOrReload(newLocation);
520
- }
521
- };
522
- if (customSetLocalePromises.length) {
523
- return Promise.all(customSetLocalePromises).then(() => {
524
- runReload();
525
- });
526
- }
527
- runReload();
528
- return;
529
- };
530
- var getUrlOrigin = () => {
531
- if (serverAsyncLocalStorage) {
532
- return serverAsyncLocalStorage.getStore()?.origin ?? "http://fallback.com";
533
- } else if (typeof window !== "undefined") {
534
- return window.location.origin;
535
- }
536
- return "http://fallback.com";
537
- };
538
- function toLocale(value) {
539
- if (typeof value !== "string") {
540
- return;
541
- }
542
- const lowerValue = value.toLowerCase();
543
- for (const locale of locales) {
544
- if (locale.toLowerCase() === lowerValue) {
545
- return locale;
546
- }
547
- }
548
- return;
549
- }
550
- function assertIsLocale(input) {
551
- const locale = toLocale(input);
552
- if (locale)
553
- return locale;
554
- throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(", ")}`);
555
- }
556
- function extractLocaleFromCookie() {
557
- if (typeof document === "undefined" || !document.cookie) {
558
- return;
559
- }
560
- const match = document.cookie.match(new RegExp(`(^| )${cookieName}=([^;]+)`));
561
- const locale = match?.[2];
562
- return toLocale(locale);
563
- }
564
- function extractLocaleFromNavigator() {
565
- if (!navigator?.languages?.length) {
566
- return;
567
- }
568
- const languages = navigator.languages.map((lang) => ({
569
- fullTag: lang,
570
- baseTag: lang.split("-")[0]
571
- }));
572
- for (const lang of languages) {
573
- const fullLocale = toLocale(lang.fullTag);
574
- if (fullLocale) {
575
- return fullLocale;
576
- }
577
- const baseLocale2 = toLocale(lang.baseTag);
578
- if (baseLocale2) {
579
- return baseLocale2;
580
- }
581
- }
582
- return;
583
- }
584
- var cachedUrl;
585
- var cachedLocale;
586
- function extractLocaleFromUrl(url) {
587
- const urlString = typeof url === "string" ? url : url.href;
588
- if (cachedUrl === urlString) {
589
- return cachedLocale;
590
- }
591
- let result;
592
- if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
593
- result = defaultUrlPatternExtractLocale(url);
594
- } else {
595
- const urlObj = typeof url === "string" ? new URL(url) : url;
596
- for (const element of urlPatterns) {
597
- for (const [locale, localizedPattern] of element.localized) {
598
- const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
599
- if (match) {
600
- result = locale;
601
- break;
602
- }
603
- }
604
- if (result)
605
- break;
606
- }
607
- }
608
- cachedUrl = urlString;
609
- cachedLocale = result;
610
- return result;
611
- }
612
- function defaultUrlPatternExtractLocale(url) {
613
- const urlObj = new URL(url, "http://dummy.com");
614
- const pathSegments = urlObj.pathname.split("/").filter(Boolean);
615
- return toLocale(pathSegments[0]) || baseLocale;
616
- }
617
- function localizeUrl(url, options) {
618
- const targetLocale = options?.locale ? assertIsLocale(options?.locale) : getLocale();
619
- if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
620
- return localizeUrlDefaultPattern(url, targetLocale);
621
- }
622
- const urlObj = typeof url === "string" ? new URL(url) : url;
623
- for (const element of urlPatterns) {
624
- for (const [, localizedPattern] of element.localized) {
625
- const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
626
- if (!match) {
627
- continue;
628
- }
629
- const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
630
- if (!targetPattern) {
631
- continue;
632
- }
633
- const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);
634
- return fillMissingUrlParts(localizedUrl, match);
635
- }
636
- const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);
637
- if (unlocalizedMatch) {
638
- const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
639
- if (targetPattern) {
640
- const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);
641
- return fillMissingUrlParts(localizedUrl, unlocalizedMatch);
642
- }
643
- }
644
- }
645
- return urlObj;
646
- }
647
- function localizeUrlDefaultPattern(url, locale) {
648
- const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
649
- const currentLocale = extractLocaleFromUrl(urlObj);
650
- if (currentLocale === locale) {
651
- return urlObj;
652
- }
653
- const pathSegments = urlObj.pathname.split("/").filter(Boolean);
654
- if (pathSegments.length > 0 && toLocale(pathSegments[0])) {
655
- pathSegments.shift();
656
- }
657
- if (locale === baseLocale) {
658
- urlObj.pathname = "/" + pathSegments.join("/");
659
- } else {
660
- urlObj.pathname = "/" + locale + "/" + pathSegments.join("/");
661
- }
662
- return urlObj;
663
- }
664
- function fillMissingUrlParts(url, match) {
665
- if (match.protocol.groups["0"]) {
666
- url.protocol = match.protocol.groups["0"] ?? "";
667
- }
668
- if (match.hostname.groups["0"]) {
669
- url.hostname = match.hostname.groups["0"] ?? "";
670
- }
671
- if (match.username.groups["0"]) {
672
- url.username = match.username.groups["0"] ?? "";
673
- }
674
- if (match.password.groups["0"]) {
675
- url.password = match.password.groups["0"] ?? "";
676
- }
677
- if (match.port.groups["0"]) {
678
- url.port = match.port.groups["0"] ?? "";
679
- }
680
- if (match.pathname.groups["0"]) {
681
- url.pathname = match.pathname.groups["0"] ?? "";
682
- }
683
- if (match.search.groups["0"]) {
684
- url.search = match.search.groups["0"] ?? "";
685
- }
686
- if (match.hash.groups["0"]) {
687
- url.hash = match.hash.groups["0"] ?? "";
688
- }
689
- return url;
690
- }
691
- function fillPattern(pattern, values, origin) {
692
- let processedPattern = pattern.replace(/(https?:\/\/[^:/]+):(\d+)(\/|$)/g, (_, protocol, port, slash) => {
693
- return `${protocol}#PORT-${port}#${slash}`;
694
- });
695
- let processedGroupDelimiters = processedPattern.replace(/\{([^{}]*)\}([?+*]?)/g, (_, content, modifier) => {
696
- if (modifier === "?") {
697
- return content;
698
- }
699
- return content;
700
- });
701
- let filled = processedGroupDelimiters.replace(/(\/?):([a-zA-Z0-9_]+)(\([^)]*\))?([?+*]?)/g, (_, slash, name, __, modifier) => {
702
- const value = values[name];
703
- if (value === null) {
704
- return "";
705
- }
706
- if (modifier === "?") {
707
- return value !== undefined ? `${slash}${value}` : "";
708
- }
709
- if (modifier === "+" || modifier === "*") {
710
- if (value === undefined && modifier === "+") {
711
- throw new Error(`Missing value for "${name}" (one or more required)`);
712
- }
713
- return value ? `${slash}${value}` : "";
714
- }
715
- if (value === undefined) {
716
- throw new Error(`Missing value for "${name}"`);
717
- }
718
- return `${slash}${value}`;
719
- });
720
- filled = filled.replace(/#PORT-(\d+)#/g, ":$1");
721
- return new URL(filled, origin);
722
- }
723
- function aggregateGroups(match) {
724
- return {
725
- ...match.hash.groups,
726
- ...match.hostname.groups,
727
- ...match.password.groups,
728
- ...match.pathname.groups,
729
- ...match.port.groups,
730
- ...match.protocol.groups,
731
- ...match.search.groups,
732
- ...match.username.groups
733
- };
734
- }
735
- var customServerStrategies = new Map;
736
- var customClientStrategies = new Map;
737
- function isCustomStrategy(strategy2) {
738
- return typeof strategy2 === "string" && /^custom-[A-Za-z0-9_-]+$/.test(strategy2);
739
- }
740
-
741
305
  // ../../src/services/notification/client/notification-menu.tsx
306
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
742
307
  import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
743
308
  var defaultMessages = {
744
309
  en: {
@@ -774,16 +339,17 @@ var defaultMessages = {
774
339
  unread: (count) => `${count} notification${count === 1 ? "" : "s"} non lue${count === 1 ? "" : "s"}`
775
340
  }
776
341
  };
777
- var notificationMenuMessages = (locale = getLocale(), overrides) => ({
342
+ var notificationMenuMessages = (locale = "en", translations) => ({
778
343
  ...locale.startsWith("fr") ? defaultMessages.fr : defaultMessages.en,
779
- ...overrides
344
+ ...translations?.[locale.split("-")[0] ?? locale],
345
+ ...translations?.[locale]
780
346
  });
781
347
  function NotificationMenu({
782
348
  className,
783
349
  defaultOpen = false,
784
350
  error = false,
785
351
  isLoading = false,
786
- locale = getLocale(),
352
+ locale: localeOverride,
787
353
  markReadOnOpen = true,
788
354
  messages: messageOverrides,
789
355
  notifications,
@@ -795,6 +361,7 @@ function NotificationMenu({
795
361
  renderItem,
796
362
  renderTrigger
797
363
  }) {
364
+ const locale = useKrakstackLocale(localeOverride);
798
365
  const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
799
366
  const [tab, setTab] = useState("inbox");
800
367
  const open = controlledOpen ?? uncontrolledOpen;
@@ -896,9 +463,13 @@ function NotificationMenu({
896
463
  });
897
464
  }
898
465
  function NotificationMenuTrigger({
899
- labels = notificationMenuMessages(),
466
+ labels: providedLabels,
467
+ locale: localeOverride,
468
+ messages,
900
469
  unreadCount
901
470
  }) {
471
+ const locale = useKrakstackLocale(localeOverride);
472
+ const labels = providedLabels ?? notificationMenuMessages(locale, messages);
902
473
  return /* @__PURE__ */ jsxs2(PopoverTrigger, {
903
474
  "aria-label": unreadCount > 0 ? `${labels.notifications}, ${labels.unread(unreadCount)}` : labels.notifications,
904
475
  className: cn(buttonVariants({ variant: "outline", size: "icon" }), "relative rounded-full"),
@@ -26,7 +26,8 @@ export type NotificationMenuMessages = {
26
26
  notifications: string;
27
27
  unread: (count: number) => string;
28
28
  };
29
- export declare const notificationMenuMessages: (locale?: string, overrides?: Partial<NotificationMenuMessages>) => NotificationMenuMessages;
29
+ export type NotificationMenuMessageTranslations = Partial<Record<string, Partial<NotificationMenuMessages>>>;
30
+ export declare const notificationMenuMessages: (locale?: string, translations?: NotificationMenuMessageTranslations) => NotificationMenuMessages;
30
31
  export type NotificationMenuState = {
31
32
  archivedCount: number;
32
33
  open: boolean;
@@ -40,7 +41,7 @@ export type NotificationMenuProps<ActionResult = ErrorOptions["cause"]> = {
40
41
  isLoading?: boolean | undefined;
41
42
  locale?: string | undefined;
42
43
  markReadOnOpen?: boolean | undefined;
43
- messages?: Partial<NotificationMenuMessages> | undefined;
44
+ messages?: NotificationMenuMessageTranslations | undefined;
44
45
  notifications: readonly NotificationItem[];
45
46
  onArchive?: NotificationAction<ActionResult> | undefined;
46
47
  onMarkRead?: NotificationAction<ActionResult> | undefined;
@@ -50,9 +51,11 @@ export type NotificationMenuProps<ActionResult = ErrorOptions["cause"]> = {
50
51
  renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
51
52
  renderTrigger?: ((state: NotificationMenuState) => ReactElement) | undefined;
52
53
  };
53
- export declare function NotificationMenu<ActionResult = ErrorOptions["cause"]>({ className, defaultOpen, error, isLoading, locale, markReadOnOpen, messages: messageOverrides, notifications, onArchive, onMarkRead, onNavigate, onOpenChange, open: controlledOpen, renderItem, renderTrigger, }: NotificationMenuProps<ActionResult>): import("react").JSX.Element;
54
- export declare function NotificationMenuTrigger({ labels, unreadCount, }: {
54
+ export declare function NotificationMenu<ActionResult = ErrorOptions["cause"]>({ className, defaultOpen, error, isLoading, locale: localeOverride, markReadOnOpen, messages: messageOverrides, notifications, onArchive, onMarkRead, onNavigate, onOpenChange, open: controlledOpen, renderItem, renderTrigger, }: NotificationMenuProps<ActionResult>): import("react").JSX.Element;
55
+ export declare function NotificationMenuTrigger({ labels: providedLabels, locale: localeOverride, messages, unreadCount, }: {
55
56
  labels?: NotificationMenuMessages | undefined;
57
+ locale?: string | undefined;
58
+ messages?: NotificationMenuMessageTranslations | undefined;
56
59
  unreadCount: number;
57
60
  }): import("react").JSX.Element;
58
61
  export declare function NotificationList<ActionResult>({ error, isLoading, labels, locale, notifications, onArchive, onNavigate, renderItem, tab, }: {