@gntik-ai/templates 0.11.0 → 0.12.0

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 (70) hide show
  1. package/dist/index.d.ts +24 -10
  2. package/dist/index.js +304 -266
  3. package/dist/index.js.map +1 -1
  4. package/package.json +8 -8
  5. package/src/assistant-chat/Page.test.tsx +37 -7
  6. package/src/assistant-chat/Page.tsx +98 -137
  7. package/src/assistant-chat/data.ts +69 -1
  8. package/src/assistant-chat/examples/AdapterChat.tsx +9 -0
  9. package/src/assistant-chat/template.meta.ts +1 -1
  10. package/src/board/Lane.tsx +1 -1
  11. package/src/code-editor/Page.test.tsx +12 -0
  12. package/src/code-editor/Page.tsx +2 -1
  13. package/src/code-editor/examples/PaletteTypography.tsx +130 -0
  14. package/src/code-editor/template.meta.ts +1 -1
  15. package/src/contact/Page.test.tsx +106 -0
  16. package/src/contact/Page.tsx +21 -3
  17. package/src/contact/PublicFrame.tsx +2 -17
  18. package/src/contact/examples/CustomFailure.tsx +24 -0
  19. package/src/contact/examples/FailedSend.tsx +19 -0
  20. package/src/contact/template.meta.ts +2 -2
  21. package/src/docs-article/Page.tsx +1 -1
  22. package/src/help-home/Page.test.tsx +10 -0
  23. package/src/help-home/Page.tsx +2 -4
  24. package/src/incident-console/Page.tsx +1 -1
  25. package/src/keyboard-shortcuts/Page.test.tsx +23 -1
  26. package/src/keyboard-shortcuts/Page.tsx +13 -3
  27. package/src/keyboard-shortcuts/ShortcutSheet.tsx +4 -5
  28. package/src/landing/Page.tsx +3 -17
  29. package/src/landing/template.meta.ts +1 -1
  30. package/src/messaging/Page.test.tsx +20 -3
  31. package/src/messaging/Page.tsx +15 -43
  32. package/src/messaging/template.meta.ts +1 -1
  33. package/src/notification-inbox/Page.tsx +1 -1
  34. package/src/pending-activation/Page.test.tsx +1 -1
  35. package/src/pricing/PublicFrame.tsx +2 -17
  36. package/src/pricing/template.meta.ts +1 -1
  37. package/src/resource-detail/Page.default.test.tsx +3 -2
  38. package/src/resource-detail/__snapshots__/Page.default.test.tsx.snap +2 -4
  39. package/src/resource-index/Page.test.tsx +178 -1
  40. package/src/resource-index/Page.tsx +59 -3
  41. package/src/resource-index/examples/UrlSynced.tsx +10 -0
  42. package/src/resource-index/template.meta.ts +1 -1
  43. package/src/resource-tree/Page.tsx +1 -1
  44. package/src/run-trace/Page.tsx +2 -2
  45. package/src/scorecard/Page.test.tsx +54 -0
  46. package/src/scorecard/Page.tsx +2 -0
  47. package/src/scorecard/data.ts +1 -1
  48. package/src/search-results/Page.tsx +3 -6
  49. package/src/settings-appearance/Page.test.tsx +36 -1
  50. package/src/settings-appearance/Page.tsx +15 -2
  51. package/src/settings-appearance/template.meta.ts +2 -1
  52. package/src/settings-profile/__tests__/dom.ts +4 -2
  53. package/src/settings-profile/fixtures/editable.snap +1 -1
  54. package/src/shared/ConsoleShell.context.test.tsx +125 -0
  55. package/src/shared/ConsoleShell.navigation.test.tsx +100 -0
  56. package/src/shared/ConsoleShell.tsx +38 -9
  57. package/src/shell-sidebar/Examples.test.tsx +73 -0
  58. package/src/shell-sidebar/examples/Brand.tsx +16 -0
  59. package/src/shell-sidebar/examples/ContextRegion.tsx +26 -0
  60. package/src/shell-sidebar/examples/PlatformWide.tsx +11 -0
  61. package/src/shell-sidebar/examples/Tenants.tsx +42 -0
  62. package/src/shell-sidebar/examples/UserMenuChildren.tsx +23 -0
  63. package/src/shell-sidebar/template.meta.ts +1 -1
  64. package/src/sign-in/BrandPanel.tsx +2 -2
  65. package/src/sign-in/Page.test.tsx +5 -0
  66. package/src/sso-login/Page.test.tsx +6 -0
  67. package/src/sso-login/Page.tsx +1 -0
  68. package/src/test/public-footer.test.tsx +44 -0
  69. package/src/test/without-forced-colors.test.ts +44 -0
  70. package/src/test/without-forced-colors.ts +14 -0
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { ChartLocaleProvider, Heatmap, MiniBar, RadarChart, chartFmt } from "@gntik-ai/charts";
3
- import { ActivityFeed, AppSidebarFooter, AppSidebarHeader, AppSidebarNav, AppTopbar, AuthHeader, BulkActionBar, ChartCard, CodePanel, CommentThread, ConfirmDestructive, CreateApiKeyDialog, DEPLOYMENT_COLUMNS, DEPLOYMENT_DETAILS, DEPLOYMENT_EVENTS, DEPLOYMENT_ROWS, DangerZone, DataTable, DateRangeFilter, DescriptionListCard, ErrorPanel, EvaluationScorecard, Faq, FeatureGrid, FileUploadPanel, FilterBar, FirstRunEmpty, FlowBuilder, ForgotPasswordForm, FormSection, Hero, InlineCallout, InviteMembersDialog, InvoiceTable, KPI_ITEMS, KpiRow, ListSkeleton, LogViewer, MembersTable, MfaChallenge, ModelKeysList, NoResultsEmpty, NotificationMatrix, PROJECT_ACTIVITY, PageHeader, PageToolbar, PaymentMethodCard, PendingInvitations, PlanCard, PricingTable, ProfileHeader, PromptEditor, QuotaMeters, RESOURCE_CARDS, ResetPasswordForm, ResourceCardGrid, SectionHeader, SessionsDevices, SettingsRow, SignInForm, SignUpForm, SsoButtons, StatusTimeline, StickyActionBar, SystemBanner, TokenCostCard, TraceWaterfall, TrendDelta, ValidationSummary, apiKeyExpiries, apiKeyScopes, appSidebarNavGroups, appSidebarUser, appSidebarUser as appSidebarUser$1, appSidebarWorkspaces, appTopbarNotifications, builderEdges, builderNodes, cleanFlowGraph, firstRunSteps, formatSpanDuration, generateDemoSecret, memberRoles, noAccessSample, notificationChannels, notificationDefaults, notificationEvents, sampleDeviceSessions, sampleInvitations, sampleInvoices, sampleMembers, samplePaymentMethod, samplePlan, samplePricingTiers, sampleProfile, sampleQuotas, ssoProviders, ssoProviders as ssoProviders$1 } from "@gntik-ai/blocks";
4
- import { Alert, AuthLayout, Avatar, AvatarGroup, Badge, Blockquote, Breadcrumbs, Button, CanvasLayout, Card, CardBody, CardDescription, CardHeader, CardTitle, Checkbox, CheckboxGroup, ClickableCard, CodeBlock, ContextMenu, ContextMenuContent, ContextMenuTrigger, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, Drawer, DrawerBody, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle, EmptyState, Field, FieldDescription, FieldError, FieldLabel, Grid, GridItem, HStack, Heading, IconButton, Input, InspectorLayout, InspectorToggle, JsonViewer, KanbanBoard, Kbd, KbdCombo, Link, ListInput, LiveAnnouncer, Logo, MegaMenu, MenuItem, MenuSeparator, Meter, MobileNav, NavList, OtpInput, OverflowList, Page, PasswordInput, PowerSearch, Progress, Section, Select, SelectContent, SelectItem, SelectTrigger, SelectableCard, SelectableCardGroup, Separator, SettingsLayout, SidebarLayout, SimpleSelect, Skeleton, Spinner, SplitLayout, Stack, StackedLayout, StatusDot, StatusLayout, StatusTag, Switch, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Text, Textarea, ThemeSwitcher, Thumbnail, ThumbnailList, Timer, Timestamp, Toggle, ToggleGroup, TokenInput, TooltipProvider, TransferList, TreeList, VisuallyHidden, WizardLayout, cn, emptyPowerSearchQuery, formatPowerSearch, matchPowerSearch, matchText, megaMenuNavItems, moveKanbanCard, parsePowerSearch, useAnnounce, useHasLiveAnnouncer, useI18n, useInspectorLayout, useOs, useTheme } from "@gntik-ai/ui";
3
+ import { ActivityFeed, AppSidebarFooter, AppSidebarHeader, AppSidebarNav, AppTopbar, AuthHeader, BulkActionBar, ChartCard, CodePanel, CommentThread, ConfirmDestructive, CreateApiKeyDialog, DEPLOYMENT_COLUMNS, DEPLOYMENT_DETAILS, DEPLOYMENT_EVENTS, DEPLOYMENT_ROWS, DangerZone, DataTable, DateRangeFilter, DescriptionListCard, ErrorPanel, EvaluationScorecard, Faq, FeatureGrid, FileUploadPanel, FilterBar, FirstRunEmpty, FlowBuilder, ForgotPasswordForm, FormSection, Hero, InlineCallout, InviteMembersDialog, InvoiceTable, KPI_ITEMS, KpiRow, ListSkeleton, LogViewer, MembersTable, MfaChallenge, ModelKeysList, NoResultsEmpty, NotificationMatrix, PROJECT_ACTIVITY, PageHeader, PageToolbar, PaymentMethodCard, PendingInvitations, PlanCard, PricingTable, ProfileHeader, PromptEditor, QuotaMeters, RESOURCE_CARDS, ResetPasswordForm, ResourceCardGrid, SectionHeader, SessionsDevices, SettingsRow, SignInForm, SignUpForm, SiteFooter, SsoButtons, StatusTimeline, StickyActionBar, SystemBanner, TokenCostCard, TraceWaterfall, TrendDelta, ValidationSummary, apiKeyExpiries, apiKeyScopes, appSidebarNavGroups, appSidebarUser, appSidebarUser as appSidebarUser$1, appSidebarWorkspaces, appTopbarNotifications, builderEdges, builderNodes, cleanFlowGraph, firstRunSteps, formatSpanDuration, generateDemoSecret, memberRoles, noAccessSample, notificationChannels, notificationDefaults, notificationEvents, sampleDeviceSessions, sampleInvitations, sampleInvoices, sampleMembers, samplePaymentMethod, samplePlan, samplePricingTiers, sampleProfile, sampleQuotas, ssoProviders, ssoProviders as ssoProviders$1 } from "@gntik-ai/blocks";
4
+ import { Alert, AuthLayout, Avatar, AvatarGroup, Badge, Blockquote, Breadcrumbs, Button, CanvasLayout, Card, CardBody, CardDescription, CardHeader, CardTitle, Checkbox, CheckboxGroup, ClickableCard, CodeBlock, ContextMenu, ContextMenuContent, ContextMenuTrigger, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, Drawer, DrawerBody, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle, EmptyState, Field, FieldDescription, FieldError, FieldLabel, Grid, GridItem, HStack, Heading, IconButton, Input, InspectorLayout, InspectorToggle, JsonViewer, KanbanBoard, Kbd, KbdCombo, Link, ListInput, LiveAnnouncer, Logo, MegaMenu, MenuItem, MenuSeparator, Meter, MobileNav, NavList, OtpInput, OverflowList, Page, PasswordInput, PowerSearch, Progress, SearchField, Section, Select, SelectContent, SelectItem, SelectTrigger, SelectableCard, SelectableCardGroup, Separator, SettingsLayout, SidebarLayout, SimpleSelect, Skeleton, Spinner, SplitLayout, Stack, StackedLayout, StatusDot, StatusLayout, StatusTag, Switch, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Text, Textarea, ThemeSwitcher, Thumbnail, ThumbnailList, Timer, Timestamp, Toggle, ToggleGroup, TokenInput, TooltipProvider, TransferList, TreeList, VisuallyHidden, WizardLayout, cn, copyToClipboard, emptyPowerSearchQuery, formatPowerSearch, matchPowerSearch, matchText, megaMenuNavItems, moveKanbanCard, parsePowerSearch, urlParam, useAnnounce, useHasLiveAnnouncer, useHotkeys, useI18n, useInspectorLayout, useNavigation, useOs, useTheme, useUrlState } from "@gntik-ai/ui";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Fragment as Fragment$1, createElement, useEffect, useEffectEvent, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
7
- import { ChatAnnouncer, ChatComposer, ChatLayout, ChatMessage, CitationList, Markdown, SuggestionChips, ToolCallCard } from "@gntik-ai/chat";
7
+ import { AttachmentList, ChatAnnouncer, ChatComposer, ChatLayout, ChatMessage, CitationList, ConversationList, Markdown, ReasoningBlock, SuggestionChips, ToolCallCard, useChat } from "@gntik-ai/chat";
8
8
  import { Archive, ArrowLeft, ArrowRight, BarChart3, Bell, BellOff, BellRing, BookOpen, Braces, Building2, CalendarClock, Check, CheckCheck, CircleCheck, Clock, Code2, Columns3, Copy, Cpu, CreditCard, Database, Download, ExternalLink, FileCode, FileDiff, FileJson, FileQuestion, FileSearch, FileText, Folder, FolderKanban, FolderOpen, GitBranch, Globe, GripVertical, Hand, HardDrive, Home, KeyRound, Keyboard, LayoutGrid, LayoutTemplate, LifeBuoy, ListOrdered, ListTodo, Lock, Mail, MailOpen, MapPin, MessageSquare, MessagesSquare, Minus, Palette, Phone, Play, PlayCircle, Plug, Plus, RefreshCw, Rocket, RotateCcw, RotateCw, Rss, Save, Search, SearchX, Send, Server, ServerCrash, Shield, ShieldCheck, Square, SquarePen, Table2, ThumbsDown, ThumbsUp, Trash2, Upload, User, UserPlus, Users, Wrench, X } from "@gntik-ai/icons";
9
9
  import { DiffEditor } from "@gntik-ai/editor";
10
10
  import { flushSync } from "react-dom";
@@ -13,10 +13,16 @@ import { flushSync } from "react-dom";
13
13
  * The console frame shared by the templates: SidebarLayout with the AppSidebar header, nav and
14
14
  * footer, and the AppTopbar (breadcrumb, ⌘K search, notifications, theme, user menu).
15
15
  * Templates fill it with a Page; products swap the nav, workspaces, user, usage meter, help
16
- * link and user-menu items.
16
+ * link and user-menu items. Inside a NavigationProvider, an omitted `nav`, `currentHref` or
17
+ * `breadcrumbs` comes from the route tree; explicit props always win, and without a provider the
18
+ * defaults are unchanged.
17
19
  */
18
- function ConsoleShell({ children, nav, currentHref, breadcrumbs, workspaces, currentWorkspaceId, onWorkspaceChange, onCreateWorkspace, user, usage, helpHref, helpLabel, userMenuItems, onSignOut, topbar, storageKey, sidebarLabel, collapseMode }) {
20
+ function ConsoleShell({ children, nav: navProp, currentHref: currentHrefProp, breadcrumbs: breadcrumbsProp, workspaces, currentWorkspaceId, onWorkspaceChange, onCreateWorkspace, user, usage, helpHref, helpLabel, userMenuItems, userMenuChildren, brand, onSignOut, topbar, storageKey, sidebarLabel, collapseMode, ...contextProps }) {
19
21
  const { locale } = useI18n();
22
+ const navigation = useNavigation();
23
+ const nav = navProp ?? navigation?.groups;
24
+ const currentHref = currentHrefProp ?? (navigation ? navigation.activePage?.menuHref ?? "" : void 0);
25
+ const breadcrumbs = breadcrumbsProp === void 0 && navigation ? navigation.activePage?.breadcrumbs ?? null : breadcrumbsProp;
20
26
  return /* @__PURE__ */ jsx(ChartLocaleProvider, {
21
27
  locale,
22
28
  children: /* @__PURE__ */ jsx(SidebarLayout, {
@@ -29,7 +35,9 @@ function ConsoleShell({ children, nav, currentHref, breadcrumbs, workspaces, cur
29
35
  workspaces,
30
36
  currentWorkspaceId,
31
37
  onWorkspaceChange,
32
- onCreateWorkspace
38
+ onCreateWorkspace,
39
+ brand,
40
+ ...contextProps
33
41
  }),
34
42
  sidebar: ({ collapsed }) => /* @__PURE__ */ jsx(AppSidebarNav, {
35
43
  groups: nav,
@@ -43,13 +51,21 @@ function ConsoleShell({ children, nav, currentHref, breadcrumbs, workspaces, cur
43
51
  helpHref,
44
52
  helpLabel,
45
53
  userMenuItems,
54
+ userMenuChildren,
46
55
  onSignOut
47
56
  }),
48
- topbar: /* @__PURE__ */ jsx(AppTopbar, {
57
+ topbar: brand == null ? /* @__PURE__ */ jsx(AppTopbar, {
49
58
  breadcrumbs,
50
59
  user,
51
60
  ...topbar
52
- }),
61
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
62
+ className: "min-w-0 shrink-0 lg:hidden",
63
+ children: brand
64
+ }), /* @__PURE__ */ jsx(AppTopbar, {
65
+ breadcrumbs,
66
+ user,
67
+ ...topbar
68
+ })] }),
53
69
  children
54
70
  })
55
71
  });
@@ -331,114 +347,102 @@ function chunkReply(text, size = 6) {
331
347
  for (let i = 0; i < text.length; i += size) out.push(text.slice(i, i + size));
332
348
  return out;
333
349
  }
350
+ /** Demo-only backend substitute. All chunk timers are scheduled eagerly and cleared on abort. */
351
+ function createScriptedAdapter(reply, tool, tickMs, sources) {
352
+ return { async sendMessage({ signal }) {
353
+ const timers = /* @__PURE__ */ new Set();
354
+ let close;
355
+ const clear = () => {
356
+ timers.forEach(clearTimeout);
357
+ timers.clear();
358
+ signal.removeEventListener("abort", abort);
359
+ };
360
+ const abort = () => {
361
+ clear();
362
+ close?.();
363
+ close = void 0;
364
+ };
365
+ return new ReadableStream({
366
+ start(controller) {
367
+ close = () => controller.close();
368
+ if (signal.aborted) {
369
+ abort();
370
+ return;
371
+ }
372
+ signal.addEventListener("abort", abort, { once: true });
373
+ const later = (chunk, ms) => {
374
+ const timer = setTimeout(() => {
375
+ timers.delete(timer);
376
+ controller.enqueue(chunk);
377
+ if (chunk.type === "finish") {
378
+ clear();
379
+ close?.();
380
+ close = void 0;
381
+ }
382
+ }, ms);
383
+ timers.add(timer);
384
+ };
385
+ controller.enqueue({ type: "start" });
386
+ controller.enqueue({
387
+ type: "tool-input-available",
388
+ toolCallId: "scripted-tool",
389
+ toolName: tool.name,
390
+ input: tool.args
391
+ });
392
+ later({
393
+ type: "tool-output-available",
394
+ toolCallId: "scripted-tool",
395
+ output: tool.result
396
+ }, tool.durationMs);
397
+ const pieces = chunkReply(reply);
398
+ pieces.forEach((delta, i) => later({
399
+ type: "text-delta",
400
+ id: "reply",
401
+ delta
402
+ }, tool.durationMs + (i + 1) * tickMs));
403
+ const end = tool.durationMs + (pieces.length + 1) * tickMs;
404
+ sources.forEach((source, i) => later({
405
+ type: "source-url",
406
+ sourceId: String(i),
407
+ title: source.title,
408
+ url: source.url ?? ""
409
+ }, end));
410
+ later({ type: "finish" }, end);
411
+ },
412
+ cancel() {
413
+ clear();
414
+ close = void 0;
415
+ }
416
+ });
417
+ } };
418
+ }
334
419
  //#endregion
335
420
  //#region src/assistant-chat/Page.tsx
336
- /** Assistant chat: ConsoleShell + Page + ChatLayout with a mock-streamed reply (timers cleared on Stop and unmount). */
421
+ /** Assistant chat: streams a backend adapter, or an abortable scripted demo when no adapter is supplied. */
337
422
  function AssistantChatPage(props) {
338
- const { title = "Assistant", suggestions = assistantSuggestions, sources = assistantSources, tool = assistantTool, reply = assistantReply, tickMs = 30, withPanel = true, onSend, onFeedback, breadcrumbs = assistantBreadcrumbs, currentHref = "/assistant", shell } = props;
339
- const [turns, setTurns] = useState([]);
340
- const [streaming, setStreaming] = useState(false);
341
- const nextId = useRef(1);
342
- const [timers] = useState(() => /* @__PURE__ */ new Set());
343
- const clearTimers = () => {
344
- timers.forEach((t) => clearTimeout(t));
345
- timers.clear();
346
- };
347
- useEffect(() => () => {
348
- timers.forEach((t) => clearTimeout(t));
349
- timers.clear();
350
- }, [timers]);
351
- const later = (fn, ms) => {
352
- const t = setTimeout(() => {
353
- timers.delete(t);
354
- fn();
355
- }, ms);
356
- timers.add(t);
357
- };
358
- const patch = (id, fn) => setTurns((ts) => ts.map((t) => t.id === id ? fn(t) : t));
359
- const respond = () => {
360
- clearTimers();
361
- const toolId = nextId.current++;
362
- const replyId = nextId.current++;
363
- const now = /* @__PURE__ */ new Date();
364
- setStreaming(true);
365
- setTurns((ts) => [
366
- ...ts,
367
- {
368
- id: toolId,
369
- role: "tool",
370
- text: "",
371
- time: now,
372
- tool: { status: "running" }
373
- },
374
- {
375
- id: replyId,
376
- role: "assistant",
377
- text: "",
378
- time: now,
379
- streaming: true
380
- }
381
- ]);
382
- const pieces = chunkReply(reply);
383
- const startAt = tool.durationMs;
384
- later(() => patch(toolId, (t) => ({
385
- ...t,
386
- tool: {
387
- status: "succeeded",
388
- durationMs: tool.durationMs
389
- }
390
- })), startAt);
391
- pieces.forEach((piece, i) => later(() => patch(replyId, (t) => ({
392
- ...t,
393
- text: t.text + piece
394
- })), startAt + (i + 1) * tickMs));
395
- later(() => {
396
- patch(replyId, (t) => ({
397
- ...t,
398
- streaming: false,
399
- sources: true
400
- }));
401
- setStreaming(false);
402
- }, startAt + (pieces.length + 1) * tickMs);
403
- };
404
- const send = (text) => {
405
- setTurns((ts) => [...ts, {
406
- id: nextId.current++,
407
- role: "user",
408
- text,
409
- time: /* @__PURE__ */ new Date()
410
- }]);
423
+ const { adapter, title = "Assistant", suggestions = assistantSuggestions, sources = assistantSources, tool = assistantTool, reply = assistantReply, tickMs = 30, withPanel = true, onSend, onFeedback, breadcrumbs = assistantBreadcrumbs, currentHref = "/assistant", shell } = props;
424
+ const scripted = useMemo(() => createScriptedAdapter(reply, tool, tickMs, sources), [
425
+ reply,
426
+ tool,
427
+ tickMs,
428
+ sources
429
+ ]);
430
+ const { messages: turns, isStreaming: streaming, sendMessage, stop, regenerate, setMessages } = useChat({
431
+ adapter: adapter ?? scripted,
432
+ flushIntervalMs: 0
433
+ });
434
+ const [feedback, setFeedback] = useState({});
435
+ const send = (text, attachments = []) => {
436
+ if (streaming) return;
437
+ sendMessage(text, attachments);
411
438
  onSend?.(text);
412
- respond();
413
- };
414
- const stop = () => {
415
- clearTimers();
416
- setTurns((ts) => ts.map((t) => t.streaming ? {
417
- ...t,
418
- streaming: false
419
- } : t.tool?.status === "running" ? {
420
- ...t,
421
- tool: {
422
- status: "failed",
423
- durationMs: 0
424
- }
425
- } : t));
426
- setStreaming(false);
427
- };
428
- const retry = (id) => {
429
- setTurns((ts) => {
430
- const at = ts.findIndex((t) => t.id === id);
431
- const cut = at > 0 && ts[at - 1]?.role === "tool" ? at - 1 : at;
432
- return ts.slice(0, cut);
433
- });
434
- respond();
435
439
  };
436
440
  const newConversation = () => {
437
- clearTimers();
438
- setTurns([]);
439
- setStreaming(false);
441
+ stop();
442
+ setMessages([]);
443
+ setFeedback({});
440
444
  };
441
- const lastReply = [...turns].reverse().find((t) => t.role === "assistant" && !t.streaming)?.text;
445
+ const lastReply = [...turns].reverse().find((t) => t.role === "assistant" && t.status === "done")?.parts.filter((p) => p.type === "text").map((p) => p.text).join("");
442
446
  return /* @__PURE__ */ jsx(ConsoleShell, {
443
447
  breadcrumbs,
444
448
  currentHref,
@@ -494,50 +498,60 @@ function AssistantChatPage(props) {
494
498
  children: "How can I help?"
495
499
  }), /* @__PURE__ */ jsx(SuggestionChips, {
496
500
  suggestions,
497
- onSelect: send
501
+ onSelect: (text) => send(text)
498
502
  })]
499
503
  }),
500
504
  turns.map((t) => {
501
- if (t.role === "tool" && t.tool) return /* @__PURE__ */ jsx(ChatMessage, {
505
+ const text = t.parts.filter((p) => p.type === "text").map((p) => p.text).join("");
506
+ const files = t.parts.filter((p) => p.type === "file").map((p) => p.file);
507
+ const citations = t.parts.filter((p) => p.type === "source").map((p) => p.source);
508
+ const busy = t.status === "pending" || t.status === "streaming";
509
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [t.parts.filter((p) => p.type === "tool").map((part) => /* @__PURE__ */ jsx(ChatMessage, {
502
510
  role: "tool",
503
- author: "Tool",
504
- timestamp: t.time,
511
+ timestamp: t.createdAt,
505
512
  children: /* @__PURE__ */ jsx(ToolCallCard, {
506
- name: tool.name,
507
- status: t.tool.status,
508
- durationMs: t.tool.durationMs,
509
- args: tool.args,
510
- result: t.tool.status === "succeeded" ? tool.result : void 0,
511
- error: t.tool.status === "failed" ? "Stopped by the user." : void 0
513
+ name: part.toolName,
514
+ status: part.status,
515
+ durationMs: !adapter ? part.status === "succeeded" ? tool.durationMs : part.status === "failed" ? 0 : void 0 : void 0,
516
+ args: part.input,
517
+ result: part.output,
518
+ error: part.errorText ?? (!adapter && part.status === "failed" ? "Stopped by the user." : void 0)
512
519
  })
513
- }, t.id);
514
- if (t.role === "assistant") return /* @__PURE__ */ jsxs(ChatMessage, {
515
- role: "assistant",
516
- timestamp: t.time,
517
- streaming: t.streaming,
518
- copyText: t.text,
519
- onRetry: streaming ? void 0 : () => retry(t.id),
520
- feedback: t.feedback ?? null,
521
- onFeedback: (f) => {
522
- patch(t.id, (x) => ({
523
- ...x,
524
- feedback: f
520
+ }, part.toolCallId)), /* @__PURE__ */ jsxs(ChatMessage, {
521
+ role: t.role,
522
+ timestamp: t.createdAt,
523
+ streaming: busy,
524
+ copyText: t.role === "assistant" ? text : void 0,
525
+ onRetry: t.role === "assistant" && !streaming ? () => regenerate(t.id) : void 0,
526
+ feedback: feedback[t.id] ?? null,
527
+ onFeedback: t.role === "assistant" ? (f) => {
528
+ setFeedback((previous) => ({
529
+ ...previous,
530
+ [t.id]: f
525
531
  }));
526
532
  onFeedback?.(f);
527
- },
528
- children: [t.text && /* @__PURE__ */ jsx(Markdown, {
529
- streaming: t.streaming,
530
- children: t.text
531
- }), t.sources && /* @__PURE__ */ jsx(CitationList, {
532
- sources,
533
- className: "mt-3"
534
- })]
535
- }, t.id);
536
- return /* @__PURE__ */ jsx(ChatMessage, {
537
- role: t.role,
538
- timestamp: t.time,
539
- children: t.text
540
- }, t.id);
533
+ } : void 0,
534
+ children: [
535
+ t.parts.filter((p) => p.type === "reasoning").map((part) => /* @__PURE__ */ jsx(ReasoningBlock, {
536
+ streaming: busy && part.state === "streaming",
537
+ children: part.text
538
+ }, part.id)),
539
+ text && (t.role === "assistant" ? /* @__PURE__ */ jsx(Markdown, {
540
+ streaming: busy,
541
+ children: text
542
+ }) : text),
543
+ files.length > 0 && /* @__PURE__ */ jsx(AttachmentList, { attachments: files }),
544
+ citations.length > 0 && /* @__PURE__ */ jsx(CitationList, {
545
+ sources: citations,
546
+ className: "mt-3"
547
+ }),
548
+ t.error && /* @__PURE__ */ jsx("p", {
549
+ role: "alert",
550
+ className: "text-destructive-text",
551
+ children: t.error
552
+ })
553
+ ]
554
+ })] }, t.id);
541
555
  }),
542
556
  /* @__PURE__ */ jsx(ChatAnnouncer, {
543
557
  streaming,
@@ -556,7 +570,7 @@ const meta$1 = {
556
570
  family: "AI",
557
571
  priority: "P3",
558
572
  status: "experimental",
559
- description: "Workspace assistant in the console: @gntik-ai/chat ChatLayout with suggestions, ChatMessage turns, a ToolCallCard, a mock-streamed markdown reply with Citations, Stop / Retry / feedback and a ChatComposer; a details panel lists the context sources. Streaming timers are cleared on Stop and unmount.",
573
+ description: "Workspace assistant in the console: @gntik-ai/chat ChatLayout with suggestions, ChatMessage turns, a ToolCallCard, adapter-streamed markdown replies with Citations, Stop / Retry / feedback and a ChatComposer; a details panel lists the context sources. Pass an optional adapter for a backend, or use the scripted demo; Stop and unmount abort both.",
560
574
  layout: "SidebarLayout · Page · ChatLayout",
561
575
  blocks: [
562
576
  "app-sidebar",
@@ -2536,20 +2550,10 @@ function LandingPage(props) {
2536
2550
  children: "Get started"
2537
2551
  })
2538
2552
  ] }),
2539
- footer: /* @__PURE__ */ jsxs("div", {
2540
- className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
2541
- children: [/* @__PURE__ */ jsx("span", { children: copyright }), /* @__PURE__ */ jsx("nav", {
2542
- "aria-label": "Footer",
2543
- children: /* @__PURE__ */ jsx("ul", {
2544
- className: "flex flex-wrap gap-x-4 gap-y-1",
2545
- children: footerLinks.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
2546
- href: l.href,
2547
- tone: "muted",
2548
- underline: "hover",
2549
- children: l.label
2550
- }) }, l.href))
2551
- })
2552
- })]
2553
+ footer: /* @__PURE__ */ jsx(SiteFooter, {
2554
+ layout: "simple",
2555
+ links: footerLinks,
2556
+ copyright
2553
2557
  }),
2554
2558
  children: [
2555
2559
  /* @__PURE__ */ jsx(Hero, {
@@ -2590,6 +2594,7 @@ const meta$19 = {
2590
2594
  description: "Public landing: Hero, FeatureGrid, PricingTable, Faq",
2591
2595
  layout: "StackedLayout",
2592
2596
  blocks: [
2597
+ "site-footer",
2593
2598
  "hero",
2594
2599
  "feature-grid",
2595
2600
  "pricing-table",
@@ -2791,7 +2796,7 @@ function NotificationInboxPage(props) {
2791
2796
  type: "button",
2792
2797
  "aria-current": n.id === selectedId ? "true" : void 0,
2793
2798
  onClick: () => open(n),
2794
- className: "flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-start hover:bg-accent/55 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring aria-[current=true]:bg-accent",
2799
+ className: "flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-start hover:bg-accent/55 focus-ring aria-[current=true]:bg-accent",
2795
2800
  children: [/* @__PURE__ */ jsx("span", {
2796
2801
  className: "mt-1.5 flex w-2 shrink-0 justify-center",
2797
2802
  children: !n.read && /* @__PURE__ */ jsx(StatusDot, {
@@ -3810,6 +3815,16 @@ function filterResources(rows, query, filters, columns, locale) {
3810
3815
  }
3811
3816
  //#endregion
3812
3817
  //#region src/resource-index/Page.tsx
3818
+ const urlSchema = {
3819
+ q: urlParam.string(),
3820
+ f: urlParam.array(urlParam.string(), { history: "push" }),
3821
+ sort: urlParam.string()
3822
+ };
3823
+ const inertAdapter = {
3824
+ getSearch: () => "",
3825
+ subscribe: () => () => {},
3826
+ setSearch: () => {}
3827
+ };
3813
3828
  const defaultRowId = (row) => {
3814
3829
  const id = row.id;
3815
3830
  return typeof id === "string" || typeof id === "number" ? String(id) : "";
@@ -3819,11 +3834,17 @@ const defaultArchive = (row) => "status" in row ? {
3819
3834
  status: "paused"
3820
3835
  } : row;
3821
3836
  /** Resource index: header, filter bar, selectable sortable table with pagination, bulk action bar and a no-results state. */
3822
- function ResourceIndexPage({ title = "Deployments", description = "Every service deployed in this workspace, across regions.", breadcrumbs = resourceBreadcrumbs, rows: initialRows = resourceRows, columns = resourceColumns, filterFields = resourceFilterFields, savedViews = resourceSavedViews, getRowId = defaultRowId, getRowHref, onRowClick, linkColumnId, noun = ["deployment", "deployments"], createLabel = "New deployment", onCreate, onOpen, onBulkAction, archiveRow = defaultArchive, loading = false, shell }) {
3837
+ function ResourceIndexPage({ title = "Deployments", description = "Every service deployed in this workspace, across regions.", breadcrumbs = resourceBreadcrumbs, rows: initialRows = resourceRows, columns = resourceColumns, filterFields = resourceFilterFields, savedViews = resourceSavedViews, getRowId = defaultRowId, getRowHref, onRowClick, linkColumnId, noun = ["deployment", "deployments"], createLabel = "New deployment", onCreate, onOpen, onBulkAction, archiveRow = defaultArchive, loading = false, syncUrl = false, shell }) {
3823
3838
  const { locale } = useI18n();
3824
3839
  const [rows, setRows] = useState(initialRows);
3825
- const [query, setQuery] = useState("");
3826
- const [filters, setFilters] = useState([]);
3840
+ const [localQuery, setLocalQuery] = useState("");
3841
+ const [localFilters, setLocalFilters] = useState([]);
3842
+ const [url, setUrl] = useUrlState(urlSchema, { adapter: syncUrl ? void 0 : inertAdapter });
3843
+ const query = syncUrl ? url.q : localQuery;
3844
+ const filters = syncUrl ? decodeFilters(url.f, filterFields) : localFilters;
3845
+ const sort = syncUrl ? decodeSort(url.sort, columns) : void 0;
3846
+ const setQuery = (q) => syncUrl ? setUrl({ q }) : setLocalQuery(q);
3847
+ const setFilters = (next) => syncUrl ? setUrl({ f: next.map(({ field, value }) => `${field}:${value}`) }) : setLocalFilters(next);
3827
3848
  const [selected, setSelected] = useState([]);
3828
3849
  const visible = filterResources(rows, query, filters, columns, locale);
3829
3850
  const visibleSelected = selected.filter((id) => visible.some((r) => getRowId(r) === id));
@@ -3903,6 +3924,8 @@ function ResourceIndexPage({ title = "Deployments", description = "Every service
3903
3924
  rows: visible,
3904
3925
  columns: tableColumns,
3905
3926
  getRowId,
3927
+ sort,
3928
+ onSortChange: syncUrl ? (next) => setUrl({ sort: `${next.columnId}:${next.direction === "ascending" ? "asc" : "desc"}` }) : void 0,
3906
3929
  caption: title,
3907
3930
  loading,
3908
3931
  selectedIds: visibleSelected,
@@ -3961,6 +3984,29 @@ function linkColumns(columns, columnId, getRowHref, onRowClick) {
3961
3984
  };
3962
3985
  });
3963
3986
  }
3987
+ function decodeFilters(raw, fields) {
3988
+ return raw.flatMap((entry) => {
3989
+ const colon = entry.indexOf(":");
3990
+ if (colon < 0) return [];
3991
+ const field = fields.find((field) => field.id === entry.slice(0, colon));
3992
+ const value = field?.options.find((option) => option.toLowerCase() === entry.slice(colon + 1).toLowerCase());
3993
+ return field && value !== void 0 ? [{
3994
+ field: field.id,
3995
+ value
3996
+ }] : [];
3997
+ }).filter((filter, index, all) => all.findIndex((other) => other.field === filter.field && other.value === filter.value) === index);
3998
+ }
3999
+ function decodeSort(raw, columns) {
4000
+ const colon = raw.lastIndexOf(":");
4001
+ const columnId = raw.slice(0, colon);
4002
+ const direction = raw.slice(colon + 1);
4003
+ if (colon < 0 || direction !== "asc" && direction !== "desc") return null;
4004
+ const column = columns.find((column) => column.id === columnId && column.sortable && column.accessor);
4005
+ return column ? {
4006
+ columnId: column.id,
4007
+ direction: direction === "asc" ? "ascending" : "descending"
4008
+ } : null;
4009
+ }
3964
4010
  //#endregion
3965
4011
  //#region src/resource-index/template.meta.ts
3966
4012
  const meta$33 = {
@@ -3968,7 +4014,7 @@ const meta$33 = {
3968
4014
  family: "Resources",
3969
4015
  priority: "P1",
3970
4016
  status: "beta",
3971
- description: "List page for any resource: header with the create action, filter bar with saved views, a selectable sortable table with pagination, a sticky bulk action bar and a no-results state.",
4017
+ description: "List page for any resource: header with the create action, filter bar with saved views, a selectable sortable table with pagination, a sticky bulk action bar and a no-results state. Opt-in syncUrl preserves query, filters and sort in shared links and browser history.",
3972
4018
  layout: "SidebarLayout + Page",
3973
4019
  blocks: [
3974
4020
  "app-sidebar",
@@ -4173,11 +4219,9 @@ function SearchResultsPage(props) {
4173
4219
  children: [/* @__PURE__ */ jsxs("div", {
4174
4220
  role: "search",
4175
4221
  "aria-label": "Workspace search",
4176
- children: [/* @__PURE__ */ jsx(Input, {
4177
- type: "search",
4222
+ children: [/* @__PURE__ */ jsx(SearchField, {
4178
4223
  "aria-label": "Search the workspace",
4179
4224
  "aria-describedby": `${id}-hint`,
4180
- leadingIcon: Search,
4181
4225
  value: query,
4182
4226
  onValueChange: (v) => changeQuery(String(v)),
4183
4227
  onKeyDown: (e) => {
@@ -4217,7 +4261,7 @@ function SearchResultsPage(props) {
4217
4261
  gap: 6,
4218
4262
  children: facets.map((facet) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
4219
4263
  id: `${id}-${facet.id}`,
4220
- className: "mb-2.5 font-mono text-[10.5px] font-medium tracking-[0.12em] text-muted-foreground uppercase",
4264
+ className: "mb-2.5 font-mono text-[10.5px] font-medium tracking-[0.12em] text-muted-foreground label-case",
4221
4265
  children: facet.label
4222
4266
  }), /* @__PURE__ */ jsx(CheckboxGroup, {
4223
4267
  "aria-labelledby": `${id}-${facet.id}`,
@@ -4696,7 +4740,8 @@ const THEME_LABELS = {
4696
4740
  * app's ThemeProvider), density ToggleGroup and language Select, laid out as SettingsRows.
4697
4741
  */
4698
4742
  function SettingsAppearancePage({ density: initialDensity = "comfortable", onDensityChange, language: initialLanguage = "en", languages: languages$1 = languages, onLanguageChange, ...frame }) {
4699
- const { mode, resolved } = useTheme();
4743
+ const { mode, resolved, motion, setMotion } = useTheme();
4744
+ const { t } = useI18n();
4700
4745
  const [density, setDensity] = useState(initialDensity);
4701
4746
  const [language, setLanguage] = useState(initialLanguage);
4702
4747
  return /* @__PURE__ */ jsx(SettingsFrame, {
@@ -4712,6 +4757,16 @@ function SettingsAppearancePage({ density: initialDensity = "comfortable", onDen
4712
4757
  description: mode === "system" ? `Follows your system setting (now ${THEME_LABELS[resolved]}).` : "Dark is the default. High contrast strengthens borders and text.",
4713
4758
  control: /* @__PURE__ */ jsx(ThemeSwitcher, { label: "Theme" })
4714
4759
  }),
4760
+ /* @__PURE__ */ jsx(SettingsRow, {
4761
+ label: t("motion.reduce"),
4762
+ description: t("motion.description"),
4763
+ control: ({ labelId, descriptionId }) => /* @__PURE__ */ jsx(Switch, {
4764
+ "aria-labelledby": labelId,
4765
+ "aria-describedby": descriptionId,
4766
+ checked: motion === "reduce",
4767
+ onCheckedChange: (checked) => setMotion(checked ? "reduce" : "system")
4768
+ })
4769
+ }),
4715
4770
  /* @__PURE__ */ jsx(SettingsRow, {
4716
4771
  label: "Density",
4717
4772
  description: "Compact fits more rows in tables and lists.",
@@ -4759,7 +4814,7 @@ const meta$39 = {
4759
4814
  family: "Settings",
4760
4815
  priority: "P2",
4761
4816
  status: "beta",
4762
- description: "Theme switcher wired to the ThemeProvider, table density and interface language.",
4817
+ description: "Theme switcher wired to the ThemeProvider, an in-app Reduce motion switch, table density and interface language.",
4763
4818
  layout: "SettingsLayout",
4764
4819
  blocks: [
4765
4820
  "app-sidebar",
@@ -6122,7 +6177,7 @@ const meta$47 = {
6122
6177
  family: "Shells",
6123
6178
  priority: "P1",
6124
6179
  status: "stable",
6125
- description: "Console starter: app sidebar, topbar and an empty Page with a title, description and a first-run empty state.",
6180
+ description: "Console starter: app sidebar, topbar and an empty Page. Optional tenant selection, workspace context, a named busy region, account-menu content and a brand slot are shared through ConsoleShell.",
6126
6181
  layout: "SidebarLayout",
6127
6182
  blocks: [
6128
6183
  "app-sidebar",
@@ -6243,11 +6298,11 @@ function BrandPanel({ eyebrow, headline, features }) {
6243
6298
  children: [/* @__PURE__ */ jsx(Text, {
6244
6299
  variant: "caption",
6245
6300
  tone: "primary",
6246
- className: "font-mono tracking-[0.18em] uppercase",
6301
+ className: "font-mono tracking-[0.18em] label-case",
6247
6302
  children: eyebrow
6248
6303
  }), /* @__PURE__ */ jsx(Text, {
6249
6304
  variant: "display",
6250
- className: "text-[32px] text-balance",
6305
+ className: "text-[32px] font-bold tracking-tight text-balance",
6251
6306
  children: headline
6252
6307
  })]
6253
6308
  }), /* @__PURE__ */ jsx(Stack, {
@@ -6721,6 +6776,7 @@ function SsoLoginPage({ onSubmit, onCancel, defaultEmail = ssoLoginSample.defaul
6721
6776
  children: [
6722
6777
  /* @__PURE__ */ jsx(FieldLabel, { children: "Work email" }),
6723
6778
  /* @__PURE__ */ jsx(Input, {
6779
+ size: "lg",
6724
6780
  type: "email",
6725
6781
  leadingIcon: Building2,
6726
6782
  autoComplete: "email",
@@ -8289,7 +8345,7 @@ function SpanPanel({ span, detail, runStart }) {
8289
8345
  /* @__PURE__ */ jsxs("section", {
8290
8346
  "aria-label": "Input",
8291
8347
  children: [/* @__PURE__ */ jsx("h3", {
8292
- className: "mb-2 text-[12px] font-semibold tracking-wide text-muted-foreground uppercase",
8348
+ className: "mb-2 text-[12px] font-semibold tracking-wide text-muted-foreground label-case",
8293
8349
  children: "Input"
8294
8350
  }), detail?.input === void 0 ? /* @__PURE__ */ jsx("p", {
8295
8351
  className: "text-[12.5px] text-muted-foreground",
@@ -8304,7 +8360,7 @@ function SpanPanel({ span, detail, runStart }) {
8304
8360
  /* @__PURE__ */ jsxs("section", {
8305
8361
  "aria-label": "Output",
8306
8362
  children: [/* @__PURE__ */ jsx("h3", {
8307
- className: "mb-2 text-[12px] font-semibold tracking-wide text-muted-foreground uppercase",
8363
+ className: "mb-2 text-[12px] font-semibold tracking-wide text-muted-foreground label-case",
8308
8364
  children: "Output"
8309
8365
  }), detail?.output === void 0 ? /* @__PURE__ */ jsx("p", {
8310
8366
  className: "text-[12.5px] text-muted-foreground",
@@ -9680,7 +9736,7 @@ function CodeEditorPage(props) {
9680
9736
  };
9681
9737
  const copyPath = async (path) => {
9682
9738
  try {
9683
- await navigator.clipboard.writeText(path);
9739
+ await copyToClipboard(path);
9684
9740
  setNote(`Copied ${path}`);
9685
9741
  } catch {
9686
9742
  setNote("Copy failed");
@@ -9812,7 +9868,7 @@ const meta$5 = {
9812
9868
  family: "Builders",
9813
9869
  priority: "P3",
9814
9870
  status: "experimental",
9815
- description: "Full-screen code editor: CanvasLayout top bar (breadcrumb, title, status, branch, Save), a file TreeList with a context menu (open, copy path, close tab, delete) in the palette, and the CodePanel block (file tabs, Monaco editor or diff, problems list) as the canvas.",
9871
+ description: "Full-screen code editor: CanvasLayout top bar (breadcrumb, title, status, branch, Save), a file TreeList with a context menu (open, copy path, close tab, delete) in the palette, and the CodePanel block (file tabs, Monaco editor or diff, problems list) as the canvas. The Typography in palettes example demonstrates opt-in Inter, upright emphasis, sentence-case labels, scoped and nested editor mono fonts, and shared page-theme editor colours.",
9816
9872
  layout: "CanvasLayout",
9817
9873
  blocks: ["code-panel"]
9818
9874
  };
@@ -10353,7 +10409,7 @@ const scorecardComments = [
10353
10409
  {
10354
10410
  id: "c1",
10355
10411
  author: { name: "Priya Natarajan" },
10356
- body: "Latency is finally under target after the cache rollout in August. Keep an eye on the EU region.",
10412
+ body: "Latency is finally under target after the cache rollout in August. See [runbook](https://example.test/runbook) for `backoff` settings. Keep an eye on the EU region.",
10357
10413
  at: Date.now() - 3 * DAY
10358
10414
  },
10359
10415
  {
@@ -10618,6 +10674,10 @@ function ScorecardPage(props) {
10618
10674
  }), /* @__PURE__ */ jsx(CardDescription, { children: "Notes from the review, newest last." })]
10619
10675
  }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(CommentThread, {
10620
10676
  comments,
10677
+ renderBody: (comment) => /* @__PURE__ */ jsx(Markdown, {
10678
+ className: "text-[13px]",
10679
+ children: comment.body
10680
+ }),
10621
10681
  currentUser,
10622
10682
  onSubmit: onComment,
10623
10683
  label: "Scorecard commentary",
@@ -10888,7 +10948,7 @@ function IncidentConsolePage(props) {
10888
10948
  setSelectedId(i.id);
10889
10949
  setShowDetail(true);
10890
10950
  },
10891
- className: "flex w-full flex-col gap-1.5 rounded-lg px-3 py-2.5 text-start hover:bg-accent/55 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring aria-[current=true]:bg-accent",
10951
+ className: "flex w-full flex-col gap-1.5 rounded-lg px-3 py-2.5 text-start hover:bg-accent/55 focus-ring aria-[current=true]:bg-accent",
10892
10952
  children: [/* @__PURE__ */ jsxs("span", {
10893
10953
  className: "flex items-center gap-2",
10894
10954
  children: [/* @__PURE__ */ jsx(Badge, {
@@ -11305,7 +11365,7 @@ function columns(onOpen) {
11305
11365
  }), onOpen ? /* @__PURE__ */ jsx("button", {
11306
11366
  type: "button",
11307
11367
  onClick: () => onOpen(r),
11308
- className: "font-medium text-foreground underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
11368
+ className: "font-medium text-foreground underline-offset-2 hover:underline focus-ring",
11309
11369
  children: r.name
11310
11370
  }) : /* @__PURE__ */ jsx("span", {
11311
11371
  className: "font-medium text-foreground",
@@ -11672,7 +11732,7 @@ function Lane({ column, cards, headingId, instructionsId, grabbedId, draggingId,
11672
11732
  onKeyUp: onCardKeyUp,
11673
11733
  onDragStart: onDragStart(card.id),
11674
11734
  onDragEnd,
11675
- className: cn("group flex w-full cursor-grab flex-col gap-2 rounded-lg border border-border bg-card p-3 text-start shadow-sm transition-colors motion-reduce:transition-none hover:border-primary/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring", "aria-pressed:border-primary aria-pressed:bg-accent", draggingId === card.id && "opacity-50"),
11735
+ className: cn("group flex w-full cursor-grab flex-col gap-2 rounded-lg border border-border bg-card p-3 text-start shadow-sm transition-colors motion-reduce:transition-none hover:border-primary/40 focus-ring", "aria-pressed:border-primary aria-pressed:bg-accent", draggingId === card.id && "opacity-50"),
11676
11736
  children: [
11677
11737
  /* @__PURE__ */ jsxs("span", {
11678
11738
  className: "flex items-start gap-2",
@@ -12160,48 +12220,24 @@ function MessagingPage(props) {
12160
12220
  setPending([]);
12161
12221
  onSend?.(selected.id, text, attachments);
12162
12222
  };
12163
- const list = /* @__PURE__ */ jsx("ul", {
12164
- "aria-label": "Conversations",
12165
- className: "flex flex-col gap-0.5 p-2",
12166
- children: items.map((c) => {
12223
+ const list = /* @__PURE__ */ jsx(ConversationList, {
12224
+ groupBy: false,
12225
+ activeId: selectedId,
12226
+ onActiveChange: openConversation,
12227
+ items: items.map((c) => {
12167
12228
  const last = c.messages[c.messages.length - 1];
12168
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
12169
- type: "button",
12170
- "aria-current": c.id === selectedId ? "true" : void 0,
12171
- onClick: () => openConversation(c.id),
12172
- className: "flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-start hover:bg-accent/55 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring aria-[current=true]:bg-accent",
12173
- children: [/* @__PURE__ */ jsx(Avatar, {
12229
+ return {
12230
+ id: c.id,
12231
+ title: c.title,
12232
+ preview: last ? `${last.mine ? "You" : last.author.split(" ")[0]}: ${last.text}` : "No messages yet",
12233
+ updatedAt: last?.at ?? 0,
12234
+ unread: c.unread,
12235
+ icon: /* @__PURE__ */ jsx(Avatar, {
12174
12236
  size: "sm",
12175
12237
  name: c.title,
12176
12238
  "aria-hidden": true
12177
- }), /* @__PURE__ */ jsxs("span", {
12178
- className: "min-w-0 flex-1",
12179
- children: [/* @__PURE__ */ jsxs("span", {
12180
- className: "flex items-baseline gap-2",
12181
- children: [/* @__PURE__ */ jsx("span", {
12182
- className: cn("min-w-0 flex-1 truncate text-[13px] text-foreground", c.unread > 0 && "font-semibold"),
12183
- children: c.title
12184
- }), last && /* @__PURE__ */ jsx(Timestamp, {
12185
- value: last.at,
12186
- tooltip: false,
12187
- className: "shrink-0 font-mono text-[11px]"
12188
- })]
12189
- }), /* @__PURE__ */ jsxs("span", {
12190
- className: "mt-0.5 flex items-center gap-2",
12191
- children: [/* @__PURE__ */ jsx("span", {
12192
- className: "min-w-0 flex-1 truncate text-[12px] text-muted-foreground",
12193
- children: last ? `${last.mine ? "You" : last.author.split(" ")[0]}: ${last.text}` : "No messages yet"
12194
- }), c.unread > 0 && /* @__PURE__ */ jsxs(Badge, {
12195
- tone: "primary",
12196
- size: "sm",
12197
- children: [c.unread, /* @__PURE__ */ jsx("span", {
12198
- className: "sr-only",
12199
- children: " unread"
12200
- })]
12201
- })]
12202
- })]
12203
- })]
12204
- }) }, c.id);
12239
+ })
12240
+ };
12205
12241
  })
12206
12242
  });
12207
12243
  const detail = selected ? /* @__PURE__ */ jsxs("section", {
@@ -12325,7 +12361,7 @@ const meta$21 = {
12325
12361
  family: "Work",
12326
12362
  priority: "P3",
12327
12363
  status: "experimental",
12328
- description: "Team messaging in the console: SplitLayout conversation list (unread counts, last message) → thread of ChatMessages with Thumbnail attachments, participants AvatarGroup, and a ChatComposer with file attachments; Back on small screens.",
12364
+ description: "Team messaging in the console: SplitLayout with ConversationList (roving focus, unread counts, last message) → thread of ChatMessages with Thumbnail attachments, participants AvatarGroup, and a ChatComposer with file attachments; Back on small screens.",
12329
12365
  layout: "SidebarLayout · Page · SplitLayout",
12330
12366
  blocks: [
12331
12367
  "app-sidebar",
@@ -12547,12 +12583,10 @@ function HelpHomePage(props) {
12547
12583
  "aria-label": "Help articles",
12548
12584
  onSubmit: submit,
12549
12585
  className: "max-w-xl",
12550
- children: /* @__PURE__ */ jsx(Input, {
12551
- type: "search",
12586
+ children: /* @__PURE__ */ jsx(SearchField, {
12552
12587
  "aria-label": "Search help articles",
12553
12588
  "aria-describedby": `${ids}-count`,
12554
12589
  placeholder: "Search articles…",
12555
- leadingIcon: Search,
12556
12590
  value: query,
12557
12591
  onValueChange: setQuery
12558
12592
  })
@@ -13032,7 +13066,7 @@ function DocsArticlePage(props) {
13032
13066
  className: "mb-4"
13033
13067
  }),
13034
13068
  /* @__PURE__ */ jsx("p", {
13035
- className: "font-mono text-[11px] tracking-[0.18em] text-primary-text uppercase",
13069
+ className: "font-mono text-[11px] tracking-[0.18em] text-primary-text label-case",
13036
13070
  children: eyebrow
13037
13071
  }),
13038
13072
  /* @__PURE__ */ jsx("h1", {
@@ -13465,12 +13499,11 @@ function ShortcutSheet({ groups, headingLevel = 2, columns = 2, autoFocus }) {
13465
13499
  gap: 5,
13466
13500
  children: [/* @__PURE__ */ jsxs(Stack, {
13467
13501
  gap: 2,
13468
- children: [/* @__PURE__ */ jsx(Input, {
13469
- type: "search",
13502
+ children: [/* @__PURE__ */ jsx(SearchField, {
13470
13503
  "aria-label": "Search shortcuts",
13471
13504
  "aria-describedby": countId,
13472
13505
  placeholder: "Search shortcuts…",
13473
- leadingIcon: Search,
13506
+ shortcut: "/",
13474
13507
  value: query,
13475
13508
  onValueChange: setQuery,
13476
13509
  autoFocus,
@@ -13534,7 +13567,7 @@ function KeyboardShortcutsPage(props) {
13534
13567
  breadcrumbs,
13535
13568
  currentHref,
13536
13569
  ...shell,
13537
- children: /* @__PURE__ */ jsx(Page, {
13570
+ children: /* @__PURE__ */ jsxs(Page, {
13538
13571
  header: /* @__PURE__ */ jsx(PageHeader, {
13539
13572
  breadcrumbs: null,
13540
13573
  title,
@@ -13544,7 +13577,11 @@ function KeyboardShortcutsPage(props) {
13544
13577
  tabs: null,
13545
13578
  actions: []
13546
13579
  }),
13547
- children: /* @__PURE__ */ jsx(ShortcutSheet, { groups })
13580
+ children: [/* @__PURE__ */ jsx(ShortcutSheet, { groups }), /* @__PURE__ */ jsx(KeyboardShortcutsDialog, {
13581
+ groups,
13582
+ title,
13583
+ trigger: null
13584
+ })]
13548
13585
  })
13549
13586
  });
13550
13587
  }
@@ -13553,15 +13590,23 @@ function KeyboardShortcutsDialog({ groups = shortcutGroups, open, defaultOpen, o
13553
13590
  variant: "secondary",
13554
13591
  icon: Keyboard
13555
13592
  }), title = "Keyboard shortcuts" }) {
13593
+ const [openState, setOpenState] = useState(defaultOpen ?? false);
13594
+ const content = useRef(null);
13595
+ const setOpen = (next) => {
13596
+ setOpenState(next);
13597
+ onOpenChange?.(next);
13598
+ };
13599
+ useHotkeys({ "?": () => setOpen(true) });
13600
+ useHotkeys({ "/": () => content.current?.querySelector("input")?.focus() }, { ref: content });
13556
13601
  return /* @__PURE__ */ jsxs(Dialog, {
13557
- open,
13558
- defaultOpen,
13559
- onOpenChange,
13602
+ open: open ?? openState,
13603
+ onOpenChange: setOpen,
13560
13604
  children: [trigger && /* @__PURE__ */ jsx(DialogTrigger, {
13561
13605
  render: trigger,
13562
13606
  children: title
13563
13607
  }), /* @__PURE__ */ jsxs(DialogContent, {
13564
13608
  size: "lg",
13609
+ ref: content,
13565
13610
  children: [/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: "Search by action or key." })] }), /* @__PURE__ */ jsx(DialogBody, {
13566
13611
  className: "max-h-[70vh] overflow-y-auto",
13567
13612
  children: /* @__PURE__ */ jsx(ShortcutSheet, {
@@ -13865,20 +13910,10 @@ function PublicFrame$1({ brand = /* @__PURE__ */ jsx(Logo, {
13865
13910
  label: "Primary",
13866
13911
  className: "hidden lg:block"
13867
13912
  }),
13868
- footer: /* @__PURE__ */ jsxs("div", {
13869
- className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
13870
- children: [/* @__PURE__ */ jsx("span", { children: copyright }), /* @__PURE__ */ jsx("nav", {
13871
- "aria-label": "Footer",
13872
- children: /* @__PURE__ */ jsx("ul", {
13873
- className: "flex flex-wrap gap-x-4 gap-y-1",
13874
- children: footerLinks.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
13875
- href: l.href,
13876
- tone: "muted",
13877
- underline: "hover",
13878
- children: l.label
13879
- }) }, l.href))
13880
- })
13881
- })]
13913
+ footer: /* @__PURE__ */ jsx(SiteFooter, {
13914
+ layout: "simple",
13915
+ links: footerLinks,
13916
+ copyright
13882
13917
  }),
13883
13918
  children
13884
13919
  });
@@ -13940,6 +13975,7 @@ const meta$26 = {
13940
13975
  description: "Public pricing page: StackedLayout with a MegaMenu (MobileNav below lg), PricingTable with the monthly / annual toggle, FeatureGrid highlights, a plan comparison table grouped by section, and Faq.",
13941
13976
  layout: "StackedLayout",
13942
13977
  blocks: [
13978
+ "site-footer",
13943
13979
  "pricing-table",
13944
13980
  "feature-grid",
13945
13981
  "faq"
@@ -14132,20 +14168,10 @@ function PublicFrame({ brand = /* @__PURE__ */ jsx(Logo, {
14132
14168
  label: "Primary",
14133
14169
  className: "hidden lg:block"
14134
14170
  }),
14135
- footer: /* @__PURE__ */ jsxs("div", {
14136
- className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
14137
- children: [/* @__PURE__ */ jsx("span", { children: copyright }), /* @__PURE__ */ jsx("nav", {
14138
- "aria-label": "Footer",
14139
- children: /* @__PURE__ */ jsx("ul", {
14140
- className: "flex flex-wrap gap-x-4 gap-y-1",
14141
- children: footerLinks.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
14142
- href: l.href,
14143
- tone: "muted",
14144
- underline: "hover",
14145
- children: l.label
14146
- }) }, l.href))
14147
- })
14148
- })]
14171
+ footer: /* @__PURE__ */ jsx(SiteFooter, {
14172
+ layout: "simple",
14173
+ links: footerLinks,
14174
+ copyright
14149
14175
  }),
14150
14176
  children
14151
14177
  });
@@ -14159,9 +14185,10 @@ const LABELS = {
14159
14185
  topic: "Topic",
14160
14186
  message: "Message"
14161
14187
  };
14162
- /** Public contact page: StackedLayout + MegaMenu, a validated form with a success state, and office cards. */
14188
+ /** Public contact page: validated form with send-failure feedback, a focused success state, and office cards. */
14163
14189
  function ContactPage(props) {
14164
- const { brand, menu = publicMenu, currentHref = "/contact", title = "Talk to us", description = "Questions about plans, billing or a technical issue? We answer within one business day.", topics = contactTopics, offices: officeList = offices, defaultValues, onSubmit, footerLinks = publicFooterLinks, copyright = publicCopyright } = props;
14190
+ const { brand, menu = publicMenu, currentHref = "/contact", title = "Talk to us", description = "Questions about plans, billing or a technical issue? We answer within one business day.", topics = contactTopics, offices: officeList = offices, defaultValues, onSubmit, submitErrorMessage, footerLinks = publicFooterLinks, copyright = publicCopyright } = props;
14191
+ const { t } = useI18n();
14165
14192
  const [values, setValues] = useState({
14166
14193
  ...emptyContact,
14167
14194
  ...defaultValues
@@ -14169,6 +14196,7 @@ function ContactPage(props) {
14169
14196
  const [submitCount, setSubmitCount] = useState(0);
14170
14197
  const [sending, setSending] = useState(false);
14171
14198
  const [sent, setSent] = useState(false);
14199
+ const [submitError, setSubmitError] = useState(false);
14172
14200
  const ids = useId();
14173
14201
  const fieldId = (k) => `${ids}-${k}`;
14174
14202
  const errors = submitCount > 0 ? validateContact(values) : {};
@@ -14184,10 +14212,15 @@ function ContactPage(props) {
14184
14212
  const submit = async () => {
14185
14213
  setSubmitCount((n) => n + 1);
14186
14214
  if (Object.keys(validateContact(values)).length > 0) return;
14187
- setSending(true);
14215
+ flushSync(() => {
14216
+ setSubmitError(false);
14217
+ setSending(true);
14218
+ });
14188
14219
  try {
14189
14220
  await onSubmit?.(values);
14190
14221
  setSent(true);
14222
+ } catch {
14223
+ setSubmitError(true);
14191
14224
  } finally {
14192
14225
  setSending(false);
14193
14226
  }
@@ -14199,6 +14232,7 @@ function ContactPage(props) {
14199
14232
  });
14200
14233
  setSubmitCount(0);
14201
14234
  setSent(false);
14235
+ setSubmitError(false);
14202
14236
  };
14203
14237
  return /* @__PURE__ */ jsx(PublicFrame, {
14204
14238
  brand,
@@ -14393,6 +14427,10 @@ function ContactPage(props) {
14393
14427
  "."
14394
14428
  ]
14395
14429
  }),
14430
+ submitError && /* @__PURE__ */ jsx(Alert, {
14431
+ tone: "destructive",
14432
+ description: submitErrorMessage ?? t("contact.sendFailed")
14433
+ }),
14396
14434
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
14397
14435
  type: "submit",
14398
14436
  icon: Send,
@@ -14485,9 +14523,9 @@ const meta$6 = {
14485
14523
  family: "Overview",
14486
14524
  priority: "P3",
14487
14525
  status: "experimental",
14488
- description: "Public contact page: StackedLayout with a MegaMenu (MobileNav below lg), a validated contact form (Field, Input, Select, Textarea, ValidationSummary) with a focused success state, and office cards with address, email, phone and hours.",
14526
+ description: "Public contact page: StackedLayout with a MegaMenu (MobileNav below lg), a validated contact form (Field, Input, Select, Textarea, ValidationSummary) with a focused success state and a destructive Alert on failed sends. Failed sends keep all values and use submitErrorMessage or localized contact.sendFailed text without exposing backend errors. Includes office cards with address, email, phone and hours.",
14489
14527
  layout: "StackedLayout",
14490
- blocks: ["validation-summary"]
14528
+ blocks: ["site-footer", "validation-summary"]
14491
14529
  };
14492
14530
  //#endregion
14493
14531
  //#region src/incident-board/data.ts