@gntik-ai/templates 0.10.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 (76) hide show
  1. package/dist/index.d.ts +58 -18
  2. package/dist/index.js +471 -391
  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/CustomTabs.tsx +41 -0
  38. package/src/resource-detail/Page.default.test.tsx +29 -0
  39. package/src/resource-detail/Page.shell-less.test.tsx +36 -0
  40. package/src/resource-detail/Page.tabs.test.tsx +116 -0
  41. package/src/resource-detail/Page.tsx +62 -27
  42. package/src/resource-detail/__snapshots__/Page.default.test.tsx.snap +5 -0
  43. package/src/resource-detail/examples/embedded-custom-tabs.tsx +44 -0
  44. package/src/resource-detail/template.meta.ts +1 -1
  45. package/src/resource-index/Page.test.tsx +178 -1
  46. package/src/resource-index/Page.tsx +59 -3
  47. package/src/resource-index/examples/UrlSynced.tsx +10 -0
  48. package/src/resource-index/template.meta.ts +1 -1
  49. package/src/resource-tree/Page.tsx +1 -1
  50. package/src/run-trace/Page.tsx +2 -2
  51. package/src/scorecard/Page.test.tsx +54 -0
  52. package/src/scorecard/Page.tsx +2 -0
  53. package/src/scorecard/data.ts +1 -1
  54. package/src/search-results/Page.tsx +3 -6
  55. package/src/settings-appearance/Page.test.tsx +36 -1
  56. package/src/settings-appearance/Page.tsx +15 -2
  57. package/src/settings-appearance/template.meta.ts +2 -1
  58. package/src/settings-profile/__tests__/dom.ts +4 -2
  59. package/src/settings-profile/fixtures/editable.snap +1 -1
  60. package/src/shared/ConsoleShell.context.test.tsx +125 -0
  61. package/src/shared/ConsoleShell.navigation.test.tsx +100 -0
  62. package/src/shared/ConsoleShell.tsx +38 -9
  63. package/src/shell-sidebar/Examples.test.tsx +73 -0
  64. package/src/shell-sidebar/examples/Brand.tsx +16 -0
  65. package/src/shell-sidebar/examples/ContextRegion.tsx +26 -0
  66. package/src/shell-sidebar/examples/PlatformWide.tsx +11 -0
  67. package/src/shell-sidebar/examples/Tenants.tsx +42 -0
  68. package/src/shell-sidebar/examples/UserMenuChildren.tsx +23 -0
  69. package/src/shell-sidebar/template.meta.ts +1 -1
  70. package/src/sign-in/BrandPanel.tsx +2 -2
  71. package/src/sign-in/Page.test.tsx +5 -0
  72. package/src/sso-login/Page.test.tsx +6 -0
  73. package/src/sso-login/Page.tsx +1 -0
  74. package/src/test/public-footer.test.tsx +44 -0
  75. package/src/test/without-forced-colors.test.ts +44 -0
  76. 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, {
@@ -3003,6 +3008,33 @@ const meta$29 = {
3003
3008
  blocks: ["reset-password-form"]
3004
3009
  };
3005
3010
  //#endregion
3011
+ //#region src/resource-detail/CustomTabs.tsx
3012
+ function CustomTabs({ tabs, defaultTab, onTabChange, label }) {
3013
+ const [selected, setSelected] = useState(defaultTab);
3014
+ const value = tabs.find((tab) => tab.value === selected)?.value ?? tabs[0]?.value ?? null;
3015
+ if (tabs.length === 0) return null;
3016
+ return /* @__PURE__ */ jsxs(Tabs, {
3017
+ value,
3018
+ onValueChange: (next) => {
3019
+ const tab = tabs.find((tab) => tab.value === next);
3020
+ if (tab) {
3021
+ setSelected(tab.value);
3022
+ onTabChange?.(tab.value);
3023
+ }
3024
+ },
3025
+ children: [/* @__PURE__ */ jsx(TabsList, {
3026
+ "aria-label": label,
3027
+ children: tabs.map((tab) => /* @__PURE__ */ jsx(TabsTab, {
3028
+ value: tab.value,
3029
+ children: tab.label
3030
+ }, tab.value))
3031
+ }), tabs.map((tab) => /* @__PURE__ */ jsx(TabsPanel, {
3032
+ value: tab.value,
3033
+ children: tab.content
3034
+ }, tab.value))]
3035
+ });
3036
+ }
3037
+ //#endregion
3006
3038
  //#region src/resource-detail/data.ts
3007
3039
  const detailResource = {
3008
3040
  name: "orders-api",
@@ -3058,11 +3090,19 @@ const TABS = [
3058
3090
  "activity",
3059
3091
  "settings"
3060
3092
  ];
3061
- /** Resource detail: editable tabs by default, or explicit-only Overview when readOnly is true. */
3093
+ /**
3094
+ * Resource detail: editable tabs by default, or explicit-only Overview when readOnly is true.
3095
+ * Pass tabs to replace the built-in sections with caller labels, values and content; readOnly
3096
+ * does not filter custom tabs. An omitted or unknown defaultTab selects the first custom tab.
3097
+ * shell={null} renders only Page and its header. The host owns the main landmark and must
3098
+ * provide ChartLocaleProvider when its custom chart content needs a locale. Breadcrumbs
3099
+ * render in the header in this mode: pass a trail or [] to avoid the editable sample trail.
3100
+ * Omitted or object shells and omitted tabs preserve the existing default output.
3101
+ */
3062
3102
  function ResourceDetailPage(props) {
3063
3103
  const { t } = useI18n();
3064
3104
  const readOnly = props.readOnly ?? false;
3065
- const { name = readOnly ? "" : detailResource.name, description = readOnly ? "" : detailResource.description, status = readOnly ? "" : detailResource.status, breadcrumbs = readOnly ? [] : detailBreadcrumbs, meta: metaProp, actions: actionsProp, details: detailsProp, overviewTitle = "Configuration", overviewDescription = readOnly ? "" : "Settings of this resource.", historyTitle = "Status history", events = readOnly ? [] : detailEvents, activity = readOnly ? [] : detailActivity, dangerActions = readOnly ? [] : detailDangerActions, defaultTab = "overview", onTabChange, onEditDetails, onSaveSettings, onDangerAction, shell, labels } = props;
3105
+ const { name = readOnly ? "" : detailResource.name, description = readOnly ? "" : detailResource.description, status = readOnly ? "" : detailResource.status, breadcrumbs = readOnly ? [] : detailBreadcrumbs, meta: metaProp, actions: actionsProp, details: detailsProp, overviewTitle = "Configuration", overviewDescription = readOnly ? "" : "Settings of this resource.", historyTitle = "Status history", events = readOnly ? [] : detailEvents, activity = readOnly ? [] : detailActivity, dangerActions = readOnly ? [] : detailDangerActions, defaultTab = "overview", onEditDetails, onSaveSettings, onDangerAction, shell, labels } = props;
3066
3106
  const meta = metaProp ?? (readOnly ? [] : detailMeta);
3067
3107
  const actions = actionsProp ?? (readOnly ? [] : [{
3068
3108
  label: "View logs",
@@ -3089,139 +3129,146 @@ function ResourceDetailPage(props) {
3089
3129
  value,
3090
3130
  label: labels?.[value] ?? t(`resourceDetail.${value}`)
3091
3131
  }));
3092
- return /* @__PURE__ */ jsx(ConsoleShell, {
3093
- currentHref: "/deployments",
3094
- breadcrumbs,
3095
- ...shell,
3096
- children: /* @__PURE__ */ jsx(Page, {
3097
- width: "wide",
3098
- header: /* @__PURE__ */ jsx(PageHeader, {
3099
- breadcrumbs: null,
3100
- title: name,
3101
- description,
3102
- status,
3103
- meta,
3104
- actions,
3105
- tabs: null
3106
- }),
3107
- children: /* @__PURE__ */ jsxs(Tabs, {
3108
- value: readOnly ? "overview" : tab,
3109
- onValueChange: (v) => {
3110
- const next = tabs.find((t) => t.value === v)?.value ?? "overview";
3111
- setTab(next);
3112
- onTabChange?.(next);
3113
- },
3114
- children: [
3115
- /* @__PURE__ */ jsx(TabsList, {
3116
- "aria-label": labels?.sections ?? t("resourceDetail.sections"),
3117
- children: tabs.map((t) => /* @__PURE__ */ jsx(TabsTab, {
3118
- value: t.value,
3119
- children: t.label
3120
- }, t.value))
3121
- }),
3122
- /* @__PURE__ */ jsx(TabsPanel, {
3123
- value: "overview",
3124
- children: /* @__PURE__ */ jsxs(Grid, {
3125
- cols: historyEvents === void 0 ? 1 : {
3126
- base: 1,
3127
- lg: 5
3128
- },
3129
- gap: 6,
3130
- align: "start",
3131
- children: [/* @__PURE__ */ jsx(DescriptionListCard, {
3132
- className: historyEvents === void 0 ? void 0 : "lg:col-span-3",
3133
- titleAs: "h2",
3134
- title: overviewTitle,
3135
- description: overviewDescription,
3136
- items: details,
3137
- onEdit: onEditDetails
3138
- }), historyEvents !== void 0 && /* @__PURE__ */ jsx(Section, {
3139
- role: readOnly ? "group" : void 0,
3140
- variant: "card",
3141
- padding: "md",
3142
- title: historyTitle,
3143
- className: "lg:col-span-2",
3144
- children: /* @__PURE__ */ jsx(StatusTimeline, {
3145
- events: historyEvents,
3146
- maxVisible: readOnly ? void 0 : 4
3147
- })
3148
- })]
3149
- })
3150
- }),
3151
- !readOnly && /* @__PURE__ */ jsx(TabsPanel, {
3152
- value: "activity",
3153
- children: /* @__PURE__ */ jsx(Section, {
3132
+ const content = /* @__PURE__ */ jsx(Page, {
3133
+ width: "wide",
3134
+ header: /* @__PURE__ */ jsx(PageHeader, {
3135
+ as: shell === null ? "div" : void 0,
3136
+ breadcrumbs: shell === null ? breadcrumbs : null,
3137
+ title: name,
3138
+ description,
3139
+ status,
3140
+ meta,
3141
+ actions,
3142
+ tabs: null
3143
+ }),
3144
+ children: props.tabs !== void 0 ? /* @__PURE__ */ jsx(CustomTabs, {
3145
+ tabs: props.tabs,
3146
+ defaultTab: props.defaultTab,
3147
+ onTabChange: props.onTabChange,
3148
+ label: labels?.sections ?? t("resourceDetail.sections")
3149
+ }) : /* @__PURE__ */ jsxs(Tabs, {
3150
+ value: readOnly ? "overview" : tab,
3151
+ onValueChange: (v) => {
3152
+ const next = tabs.find((t) => t.value === v)?.value ?? "overview";
3153
+ setTab(next);
3154
+ if (props.tabs === void 0) props.onTabChange?.(next);
3155
+ },
3156
+ children: [
3157
+ /* @__PURE__ */ jsx(TabsList, {
3158
+ "aria-label": labels?.sections ?? t("resourceDetail.sections"),
3159
+ children: tabs.map((t) => /* @__PURE__ */ jsx(TabsTab, {
3160
+ value: t.value,
3161
+ children: t.label
3162
+ }, t.value))
3163
+ }),
3164
+ /* @__PURE__ */ jsx(TabsPanel, {
3165
+ value: "overview",
3166
+ children: /* @__PURE__ */ jsxs(Grid, {
3167
+ cols: historyEvents === void 0 ? 1 : {
3168
+ base: 1,
3169
+ lg: 5
3170
+ },
3171
+ gap: 6,
3172
+ align: "start",
3173
+ children: [/* @__PURE__ */ jsx(DescriptionListCard, {
3174
+ className: historyEvents === void 0 ? void 0 : "lg:col-span-3",
3175
+ titleAs: "h2",
3176
+ title: overviewTitle,
3177
+ description: overviewDescription,
3178
+ items: details,
3179
+ onEdit: onEditDetails
3180
+ }), historyEvents !== void 0 && /* @__PURE__ */ jsx(Section, {
3181
+ role: readOnly ? "group" : void 0,
3154
3182
  variant: "card",
3155
3183
  padding: "md",
3156
- title: "Activity",
3157
- description: "Changes made to this resource by people and automations.",
3158
- children: /* @__PURE__ */ jsx(ActivityFeed, {
3159
- items: activity,
3160
- label: "Activity, newest first"
3184
+ title: historyTitle,
3185
+ className: "lg:col-span-2",
3186
+ children: /* @__PURE__ */ jsx(StatusTimeline, {
3187
+ events: historyEvents,
3188
+ maxVisible: readOnly ? void 0 : 4
3161
3189
  })
3190
+ })]
3191
+ })
3192
+ }),
3193
+ !readOnly && /* @__PURE__ */ jsx(TabsPanel, {
3194
+ value: "activity",
3195
+ children: /* @__PURE__ */ jsx(Section, {
3196
+ variant: "card",
3197
+ padding: "md",
3198
+ title: "Activity",
3199
+ description: "Changes made to this resource by people and automations.",
3200
+ children: /* @__PURE__ */ jsx(ActivityFeed, {
3201
+ items: activity,
3202
+ label: "Activity, newest first"
3162
3203
  })
3163
- }),
3164
- !readOnly && /* @__PURE__ */ jsx(TabsPanel, {
3165
- value: "settings",
3166
- children: /* @__PURE__ */ jsxs(Stack, {
3167
- gap: 8,
3168
- children: [/* @__PURE__ */ jsx("form", {
3169
- noValidate: true,
3170
- onSubmit: (e) => {
3171
- e.preventDefault();
3172
- setSaved(settings);
3173
- onSaveSettings?.(settings);
3174
- },
3175
- children: /* @__PURE__ */ jsx(FormSection, {
3176
- title: "General",
3177
- description: "Name and description shown across the console.",
3178
- actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
3179
- variant: "ghost",
3180
- disabled: !dirty,
3181
- onClick: () => setSettings(saved),
3182
- children: "Discard"
3183
- }), /* @__PURE__ */ jsx(Button, {
3184
- type: "submit",
3185
- disabled: !dirty,
3186
- children: "Save changes"
3187
- })] }),
3188
- children: /* @__PURE__ */ jsxs(Stack, {
3189
- gap: 4,
3190
- children: [/* @__PURE__ */ jsxs(Field, { children: [
3191
- /* @__PURE__ */ jsx(FieldLabel, {
3192
- required: true,
3193
- children: "Name"
3194
- }),
3195
- /* @__PURE__ */ jsx(Input, {
3196
- required: true,
3197
- value: settings.name,
3198
- onValueChange: (v) => setSettings((s) => ({
3199
- ...s,
3200
- name: v
3201
- }))
3202
- }),
3203
- /* @__PURE__ */ jsx(FieldDescription, { children: "Lowercase letters, numbers and dashes." })
3204
- ] }), /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Description" }), /* @__PURE__ */ jsx(Textarea, {
3205
- rows: 3,
3206
- value: settings.description,
3204
+ })
3205
+ }),
3206
+ !readOnly && /* @__PURE__ */ jsx(TabsPanel, {
3207
+ value: "settings",
3208
+ children: /* @__PURE__ */ jsxs(Stack, {
3209
+ gap: 8,
3210
+ children: [/* @__PURE__ */ jsx("form", {
3211
+ noValidate: true,
3212
+ onSubmit: (e) => {
3213
+ e.preventDefault();
3214
+ setSaved(settings);
3215
+ onSaveSettings?.(settings);
3216
+ },
3217
+ children: /* @__PURE__ */ jsx(FormSection, {
3218
+ title: "General",
3219
+ description: "Name and description shown across the console.",
3220
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
3221
+ variant: "ghost",
3222
+ disabled: !dirty,
3223
+ onClick: () => setSettings(saved),
3224
+ children: "Discard"
3225
+ }), /* @__PURE__ */ jsx(Button, {
3226
+ type: "submit",
3227
+ disabled: !dirty,
3228
+ children: "Save changes"
3229
+ })] }),
3230
+ children: /* @__PURE__ */ jsxs(Stack, {
3231
+ gap: 4,
3232
+ children: [/* @__PURE__ */ jsxs(Field, { children: [
3233
+ /* @__PURE__ */ jsx(FieldLabel, {
3234
+ required: true,
3235
+ children: "Name"
3236
+ }),
3237
+ /* @__PURE__ */ jsx(Input, {
3238
+ required: true,
3239
+ value: settings.name,
3207
3240
  onValueChange: (v) => setSettings((s) => ({
3208
3241
  ...s,
3209
- description: v
3242
+ name: v
3210
3243
  }))
3211
- })] })]
3212
- })
3244
+ }),
3245
+ /* @__PURE__ */ jsx(FieldDescription, { children: "Lowercase letters, numbers and dashes." })
3246
+ ] }), /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Description" }), /* @__PURE__ */ jsx(Textarea, {
3247
+ rows: 3,
3248
+ value: settings.description,
3249
+ onValueChange: (v) => setSettings((s) => ({
3250
+ ...s,
3251
+ description: v
3252
+ }))
3253
+ })] })]
3213
3254
  })
3214
- }), /* @__PURE__ */ jsx(DangerZone, {
3215
- description: "These actions affect everyone who uses this resource.",
3216
- actions: dangerActions,
3217
- onConfirm: onDangerAction
3218
- })]
3219
- })
3255
+ })
3256
+ }), /* @__PURE__ */ jsx(DangerZone, {
3257
+ description: "These actions affect everyone who uses this resource.",
3258
+ actions: dangerActions,
3259
+ onConfirm: onDangerAction
3260
+ })]
3220
3261
  })
3221
- ]
3222
- })
3262
+ })
3263
+ ]
3223
3264
  })
3224
3265
  });
3266
+ return shell === null ? content : /* @__PURE__ */ jsx(ConsoleShell, {
3267
+ currentHref: "/deployments",
3268
+ breadcrumbs,
3269
+ ...shell,
3270
+ children: content
3271
+ });
3225
3272
  }
3226
3273
  //#endregion
3227
3274
  //#region src/resource-detail/template.meta.ts
@@ -3230,7 +3277,7 @@ const meta$30 = {
3230
3277
  family: "Resources",
3231
3278
  priority: "P1",
3232
3279
  status: "beta",
3233
- description: "Resource detail with editable Overview, Activity and Settings tabs by default; optional readOnly (boolean, default false) uses only explicit header and detail props and one Overview tab, with optional history (readonly StatusEvent[], default undefined): omitted hides the history card, [] shows the named empty state, and events render exactly as supplied without invented actors. Read-only ignores activity, events, dangerActions, defaultTab, onSaveSettings and onDangerAction; explicit actions and onEditDetails are honored. The Resource sections tablist retains Tab, arrow, Home/End and Enter/Space keyboard navigation; history is a named group containing the Status history list or empty-state region. Uses token styling in dark (default), light and high_contrast. Examples: runtime-with-transition maps state and lastTransitionAt to one actor-free event, runtime-without-transition maps null to [], and realtime-configuration and postgres-table-detail omit history. Optional labels?: Partial<ResourceDetailLabels> overrides overview, activity, settings and sections (all strings). Unset keys use I18nProvider (en/es); no provider keeps English. Only the tabs and tablist are localized by this template; fixtures and other section text are unchanged. readOnly keeps only the localized overview tab. See the Catalog labels live preview. ConsoleShell retains sample frame defaults unless explicit shell props are supplied, as in the examples.",
3280
+ description: "Resource detail with editable Overview, Activity and Settings tabs by default; optional readOnly (boolean, default false) uses only explicit header and detail props and one Overview tab, with optional history (readonly StatusEvent[], default undefined): omitted hides the history card, [] shows the named empty state, and events render exactly as supplied without invented actors. Read-only ignores activity, events, dangerActions, defaultTab, onSaveSettings and onDangerAction; explicit actions and onEditDetails are honored. The Resource sections tablist retains Tab, arrow, Home/End and Enter/Space keyboard navigation; history is a named group containing the Status history list or empty-state region. Uses token styling in dark (default), light and high_contrast. Examples: runtime-with-transition maps state and lastTransitionAt to one actor-free event, runtime-without-transition maps null to [], and realtime-configuration and postgres-table-detail omit history. Optional labels?: Partial<ResourceDetailLabels> overrides overview, activity, settings and sections (all strings). Unset keys use I18nProvider (en/es); no provider keeps English. Only the tabs and tablist are localized by this template; fixtures and other section text are unchanged. readOnly keeps only the localized overview tab. See the Catalog labels live preview. ConsoleShell retains sample frame defaults when shell is omitted or an object. shell={null} renders only Page and PageHeader, with breadcrumbs in the header; pass breadcrumbs or [] to avoid the editable sample trail. The host owns main and provides ChartLocaleProvider for custom chart locales. Optional tabs?: { value: string; label: string; content: ReactNode }[] replaces the built-in tabs in caller order, even with readOnly; [] hides the tab set. With custom tabs, defaultTab and onTabChange use string values; an omitted or unknown defaultTab selects the first tab. Without tabs they retain ResourceDetailTab values. Custom tabs use the same Base UI keyboard navigation and panel mounting. See the embedded-custom-tabs live preview for shell-less composition inside a host main.",
3234
3281
  layout: "SidebarLayout + Page",
3235
3282
  blocks: [
3236
3283
  "app-sidebar",
@@ -3768,6 +3815,16 @@ function filterResources(rows, query, filters, columns, locale) {
3768
3815
  }
3769
3816
  //#endregion
3770
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
+ };
3771
3828
  const defaultRowId = (row) => {
3772
3829
  const id = row.id;
3773
3830
  return typeof id === "string" || typeof id === "number" ? String(id) : "";
@@ -3777,11 +3834,17 @@ const defaultArchive = (row) => "status" in row ? {
3777
3834
  status: "paused"
3778
3835
  } : row;
3779
3836
  /** Resource index: header, filter bar, selectable sortable table with pagination, bulk action bar and a no-results state. */
3780
- 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 }) {
3781
3838
  const { locale } = useI18n();
3782
3839
  const [rows, setRows] = useState(initialRows);
3783
- const [query, setQuery] = useState("");
3784
- 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);
3785
3848
  const [selected, setSelected] = useState([]);
3786
3849
  const visible = filterResources(rows, query, filters, columns, locale);
3787
3850
  const visibleSelected = selected.filter((id) => visible.some((r) => getRowId(r) === id));
@@ -3861,6 +3924,8 @@ function ResourceIndexPage({ title = "Deployments", description = "Every service
3861
3924
  rows: visible,
3862
3925
  columns: tableColumns,
3863
3926
  getRowId,
3927
+ sort,
3928
+ onSortChange: syncUrl ? (next) => setUrl({ sort: `${next.columnId}:${next.direction === "ascending" ? "asc" : "desc"}` }) : void 0,
3864
3929
  caption: title,
3865
3930
  loading,
3866
3931
  selectedIds: visibleSelected,
@@ -3919,6 +3984,29 @@ function linkColumns(columns, columnId, getRowHref, onRowClick) {
3919
3984
  };
3920
3985
  });
3921
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
+ }
3922
4010
  //#endregion
3923
4011
  //#region src/resource-index/template.meta.ts
3924
4012
  const meta$33 = {
@@ -3926,7 +4014,7 @@ const meta$33 = {
3926
4014
  family: "Resources",
3927
4015
  priority: "P1",
3928
4016
  status: "beta",
3929
- 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.",
3930
4018
  layout: "SidebarLayout + Page",
3931
4019
  blocks: [
3932
4020
  "app-sidebar",
@@ -4131,11 +4219,9 @@ function SearchResultsPage(props) {
4131
4219
  children: [/* @__PURE__ */ jsxs("div", {
4132
4220
  role: "search",
4133
4221
  "aria-label": "Workspace search",
4134
- children: [/* @__PURE__ */ jsx(Input, {
4135
- type: "search",
4222
+ children: [/* @__PURE__ */ jsx(SearchField, {
4136
4223
  "aria-label": "Search the workspace",
4137
4224
  "aria-describedby": `${id}-hint`,
4138
- leadingIcon: Search,
4139
4225
  value: query,
4140
4226
  onValueChange: (v) => changeQuery(String(v)),
4141
4227
  onKeyDown: (e) => {
@@ -4175,7 +4261,7 @@ function SearchResultsPage(props) {
4175
4261
  gap: 6,
4176
4262
  children: facets.map((facet) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
4177
4263
  id: `${id}-${facet.id}`,
4178
- 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",
4179
4265
  children: facet.label
4180
4266
  }), /* @__PURE__ */ jsx(CheckboxGroup, {
4181
4267
  "aria-labelledby": `${id}-${facet.id}`,
@@ -4654,7 +4740,8 @@ const THEME_LABELS = {
4654
4740
  * app's ThemeProvider), density ToggleGroup and language Select, laid out as SettingsRows.
4655
4741
  */
4656
4742
  function SettingsAppearancePage({ density: initialDensity = "comfortable", onDensityChange, language: initialLanguage = "en", languages: languages$1 = languages, onLanguageChange, ...frame }) {
4657
- const { mode, resolved } = useTheme();
4743
+ const { mode, resolved, motion, setMotion } = useTheme();
4744
+ const { t } = useI18n();
4658
4745
  const [density, setDensity] = useState(initialDensity);
4659
4746
  const [language, setLanguage] = useState(initialLanguage);
4660
4747
  return /* @__PURE__ */ jsx(SettingsFrame, {
@@ -4670,6 +4757,16 @@ function SettingsAppearancePage({ density: initialDensity = "comfortable", onDen
4670
4757
  description: mode === "system" ? `Follows your system setting (now ${THEME_LABELS[resolved]}).` : "Dark is the default. High contrast strengthens borders and text.",
4671
4758
  control: /* @__PURE__ */ jsx(ThemeSwitcher, { label: "Theme" })
4672
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
+ }),
4673
4770
  /* @__PURE__ */ jsx(SettingsRow, {
4674
4771
  label: "Density",
4675
4772
  description: "Compact fits more rows in tables and lists.",
@@ -4717,7 +4814,7 @@ const meta$39 = {
4717
4814
  family: "Settings",
4718
4815
  priority: "P2",
4719
4816
  status: "beta",
4720
- 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.",
4721
4818
  layout: "SettingsLayout",
4722
4819
  blocks: [
4723
4820
  "app-sidebar",
@@ -6080,7 +6177,7 @@ const meta$47 = {
6080
6177
  family: "Shells",
6081
6178
  priority: "P1",
6082
6179
  status: "stable",
6083
- 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.",
6084
6181
  layout: "SidebarLayout",
6085
6182
  blocks: [
6086
6183
  "app-sidebar",
@@ -6201,11 +6298,11 @@ function BrandPanel({ eyebrow, headline, features }) {
6201
6298
  children: [/* @__PURE__ */ jsx(Text, {
6202
6299
  variant: "caption",
6203
6300
  tone: "primary",
6204
- className: "font-mono tracking-[0.18em] uppercase",
6301
+ className: "font-mono tracking-[0.18em] label-case",
6205
6302
  children: eyebrow
6206
6303
  }), /* @__PURE__ */ jsx(Text, {
6207
6304
  variant: "display",
6208
- className: "text-[32px] text-balance",
6305
+ className: "text-[32px] font-bold tracking-tight text-balance",
6209
6306
  children: headline
6210
6307
  })]
6211
6308
  }), /* @__PURE__ */ jsx(Stack, {
@@ -6679,6 +6776,7 @@ function SsoLoginPage({ onSubmit, onCancel, defaultEmail = ssoLoginSample.defaul
6679
6776
  children: [
6680
6777
  /* @__PURE__ */ jsx(FieldLabel, { children: "Work email" }),
6681
6778
  /* @__PURE__ */ jsx(Input, {
6779
+ size: "lg",
6682
6780
  type: "email",
6683
6781
  leadingIcon: Building2,
6684
6782
  autoComplete: "email",
@@ -8247,7 +8345,7 @@ function SpanPanel({ span, detail, runStart }) {
8247
8345
  /* @__PURE__ */ jsxs("section", {
8248
8346
  "aria-label": "Input",
8249
8347
  children: [/* @__PURE__ */ jsx("h3", {
8250
- 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",
8251
8349
  children: "Input"
8252
8350
  }), detail?.input === void 0 ? /* @__PURE__ */ jsx("p", {
8253
8351
  className: "text-[12.5px] text-muted-foreground",
@@ -8262,7 +8360,7 @@ function SpanPanel({ span, detail, runStart }) {
8262
8360
  /* @__PURE__ */ jsxs("section", {
8263
8361
  "aria-label": "Output",
8264
8362
  children: [/* @__PURE__ */ jsx("h3", {
8265
- 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",
8266
8364
  children: "Output"
8267
8365
  }), detail?.output === void 0 ? /* @__PURE__ */ jsx("p", {
8268
8366
  className: "text-[12.5px] text-muted-foreground",
@@ -9638,7 +9736,7 @@ function CodeEditorPage(props) {
9638
9736
  };
9639
9737
  const copyPath = async (path) => {
9640
9738
  try {
9641
- await navigator.clipboard.writeText(path);
9739
+ await copyToClipboard(path);
9642
9740
  setNote(`Copied ${path}`);
9643
9741
  } catch {
9644
9742
  setNote("Copy failed");
@@ -9770,7 +9868,7 @@ const meta$5 = {
9770
9868
  family: "Builders",
9771
9869
  priority: "P3",
9772
9870
  status: "experimental",
9773
- 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.",
9774
9872
  layout: "CanvasLayout",
9775
9873
  blocks: ["code-panel"]
9776
9874
  };
@@ -10311,7 +10409,7 @@ const scorecardComments = [
10311
10409
  {
10312
10410
  id: "c1",
10313
10411
  author: { name: "Priya Natarajan" },
10314
- 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.",
10315
10413
  at: Date.now() - 3 * DAY
10316
10414
  },
10317
10415
  {
@@ -10576,6 +10674,10 @@ function ScorecardPage(props) {
10576
10674
  }), /* @__PURE__ */ jsx(CardDescription, { children: "Notes from the review, newest last." })]
10577
10675
  }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(CommentThread, {
10578
10676
  comments,
10677
+ renderBody: (comment) => /* @__PURE__ */ jsx(Markdown, {
10678
+ className: "text-[13px]",
10679
+ children: comment.body
10680
+ }),
10579
10681
  currentUser,
10580
10682
  onSubmit: onComment,
10581
10683
  label: "Scorecard commentary",
@@ -10846,7 +10948,7 @@ function IncidentConsolePage(props) {
10846
10948
  setSelectedId(i.id);
10847
10949
  setShowDetail(true);
10848
10950
  },
10849
- 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",
10850
10952
  children: [/* @__PURE__ */ jsxs("span", {
10851
10953
  className: "flex items-center gap-2",
10852
10954
  children: [/* @__PURE__ */ jsx(Badge, {
@@ -11263,7 +11365,7 @@ function columns(onOpen) {
11263
11365
  }), onOpen ? /* @__PURE__ */ jsx("button", {
11264
11366
  type: "button",
11265
11367
  onClick: () => onOpen(r),
11266
- 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",
11267
11369
  children: r.name
11268
11370
  }) : /* @__PURE__ */ jsx("span", {
11269
11371
  className: "font-medium text-foreground",
@@ -11630,7 +11732,7 @@ function Lane({ column, cards, headingId, instructionsId, grabbedId, draggingId,
11630
11732
  onKeyUp: onCardKeyUp,
11631
11733
  onDragStart: onDragStart(card.id),
11632
11734
  onDragEnd,
11633
- 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"),
11634
11736
  children: [
11635
11737
  /* @__PURE__ */ jsxs("span", {
11636
11738
  className: "flex items-start gap-2",
@@ -12118,48 +12220,24 @@ function MessagingPage(props) {
12118
12220
  setPending([]);
12119
12221
  onSend?.(selected.id, text, attachments);
12120
12222
  };
12121
- const list = /* @__PURE__ */ jsx("ul", {
12122
- "aria-label": "Conversations",
12123
- className: "flex flex-col gap-0.5 p-2",
12124
- children: items.map((c) => {
12223
+ const list = /* @__PURE__ */ jsx(ConversationList, {
12224
+ groupBy: false,
12225
+ activeId: selectedId,
12226
+ onActiveChange: openConversation,
12227
+ items: items.map((c) => {
12125
12228
  const last = c.messages[c.messages.length - 1];
12126
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
12127
- type: "button",
12128
- "aria-current": c.id === selectedId ? "true" : void 0,
12129
- onClick: () => openConversation(c.id),
12130
- 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",
12131
- 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, {
12132
12236
  size: "sm",
12133
12237
  name: c.title,
12134
12238
  "aria-hidden": true
12135
- }), /* @__PURE__ */ jsxs("span", {
12136
- className: "min-w-0 flex-1",
12137
- children: [/* @__PURE__ */ jsxs("span", {
12138
- className: "flex items-baseline gap-2",
12139
- children: [/* @__PURE__ */ jsx("span", {
12140
- className: cn("min-w-0 flex-1 truncate text-[13px] text-foreground", c.unread > 0 && "font-semibold"),
12141
- children: c.title
12142
- }), last && /* @__PURE__ */ jsx(Timestamp, {
12143
- value: last.at,
12144
- tooltip: false,
12145
- className: "shrink-0 font-mono text-[11px]"
12146
- })]
12147
- }), /* @__PURE__ */ jsxs("span", {
12148
- className: "mt-0.5 flex items-center gap-2",
12149
- children: [/* @__PURE__ */ jsx("span", {
12150
- className: "min-w-0 flex-1 truncate text-[12px] text-muted-foreground",
12151
- children: last ? `${last.mine ? "You" : last.author.split(" ")[0]}: ${last.text}` : "No messages yet"
12152
- }), c.unread > 0 && /* @__PURE__ */ jsxs(Badge, {
12153
- tone: "primary",
12154
- size: "sm",
12155
- children: [c.unread, /* @__PURE__ */ jsx("span", {
12156
- className: "sr-only",
12157
- children: " unread"
12158
- })]
12159
- })]
12160
- })]
12161
- })]
12162
- }) }, c.id);
12239
+ })
12240
+ };
12163
12241
  })
12164
12242
  });
12165
12243
  const detail = selected ? /* @__PURE__ */ jsxs("section", {
@@ -12283,7 +12361,7 @@ const meta$21 = {
12283
12361
  family: "Work",
12284
12362
  priority: "P3",
12285
12363
  status: "experimental",
12286
- 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.",
12287
12365
  layout: "SidebarLayout · Page · SplitLayout",
12288
12366
  blocks: [
12289
12367
  "app-sidebar",
@@ -12505,12 +12583,10 @@ function HelpHomePage(props) {
12505
12583
  "aria-label": "Help articles",
12506
12584
  onSubmit: submit,
12507
12585
  className: "max-w-xl",
12508
- children: /* @__PURE__ */ jsx(Input, {
12509
- type: "search",
12586
+ children: /* @__PURE__ */ jsx(SearchField, {
12510
12587
  "aria-label": "Search help articles",
12511
12588
  "aria-describedby": `${ids}-count`,
12512
12589
  placeholder: "Search articles…",
12513
- leadingIcon: Search,
12514
12590
  value: query,
12515
12591
  onValueChange: setQuery
12516
12592
  })
@@ -12990,7 +13066,7 @@ function DocsArticlePage(props) {
12990
13066
  className: "mb-4"
12991
13067
  }),
12992
13068
  /* @__PURE__ */ jsx("p", {
12993
- 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",
12994
13070
  children: eyebrow
12995
13071
  }),
12996
13072
  /* @__PURE__ */ jsx("h1", {
@@ -13423,12 +13499,11 @@ function ShortcutSheet({ groups, headingLevel = 2, columns = 2, autoFocus }) {
13423
13499
  gap: 5,
13424
13500
  children: [/* @__PURE__ */ jsxs(Stack, {
13425
13501
  gap: 2,
13426
- children: [/* @__PURE__ */ jsx(Input, {
13427
- type: "search",
13502
+ children: [/* @__PURE__ */ jsx(SearchField, {
13428
13503
  "aria-label": "Search shortcuts",
13429
13504
  "aria-describedby": countId,
13430
13505
  placeholder: "Search shortcuts…",
13431
- leadingIcon: Search,
13506
+ shortcut: "/",
13432
13507
  value: query,
13433
13508
  onValueChange: setQuery,
13434
13509
  autoFocus,
@@ -13492,7 +13567,7 @@ function KeyboardShortcutsPage(props) {
13492
13567
  breadcrumbs,
13493
13568
  currentHref,
13494
13569
  ...shell,
13495
- children: /* @__PURE__ */ jsx(Page, {
13570
+ children: /* @__PURE__ */ jsxs(Page, {
13496
13571
  header: /* @__PURE__ */ jsx(PageHeader, {
13497
13572
  breadcrumbs: null,
13498
13573
  title,
@@ -13502,7 +13577,11 @@ function KeyboardShortcutsPage(props) {
13502
13577
  tabs: null,
13503
13578
  actions: []
13504
13579
  }),
13505
- children: /* @__PURE__ */ jsx(ShortcutSheet, { groups })
13580
+ children: [/* @__PURE__ */ jsx(ShortcutSheet, { groups }), /* @__PURE__ */ jsx(KeyboardShortcutsDialog, {
13581
+ groups,
13582
+ title,
13583
+ trigger: null
13584
+ })]
13506
13585
  })
13507
13586
  });
13508
13587
  }
@@ -13511,15 +13590,23 @@ function KeyboardShortcutsDialog({ groups = shortcutGroups, open, defaultOpen, o
13511
13590
  variant: "secondary",
13512
13591
  icon: Keyboard
13513
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 });
13514
13601
  return /* @__PURE__ */ jsxs(Dialog, {
13515
- open,
13516
- defaultOpen,
13517
- onOpenChange,
13602
+ open: open ?? openState,
13603
+ onOpenChange: setOpen,
13518
13604
  children: [trigger && /* @__PURE__ */ jsx(DialogTrigger, {
13519
13605
  render: trigger,
13520
13606
  children: title
13521
13607
  }), /* @__PURE__ */ jsxs(DialogContent, {
13522
13608
  size: "lg",
13609
+ ref: content,
13523
13610
  children: [/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: "Search by action or key." })] }), /* @__PURE__ */ jsx(DialogBody, {
13524
13611
  className: "max-h-[70vh] overflow-y-auto",
13525
13612
  children: /* @__PURE__ */ jsx(ShortcutSheet, {
@@ -13823,20 +13910,10 @@ function PublicFrame$1({ brand = /* @__PURE__ */ jsx(Logo, {
13823
13910
  label: "Primary",
13824
13911
  className: "hidden lg:block"
13825
13912
  }),
13826
- footer: /* @__PURE__ */ jsxs("div", {
13827
- className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
13828
- children: [/* @__PURE__ */ jsx("span", { children: copyright }), /* @__PURE__ */ jsx("nav", {
13829
- "aria-label": "Footer",
13830
- children: /* @__PURE__ */ jsx("ul", {
13831
- className: "flex flex-wrap gap-x-4 gap-y-1",
13832
- children: footerLinks.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
13833
- href: l.href,
13834
- tone: "muted",
13835
- underline: "hover",
13836
- children: l.label
13837
- }) }, l.href))
13838
- })
13839
- })]
13913
+ footer: /* @__PURE__ */ jsx(SiteFooter, {
13914
+ layout: "simple",
13915
+ links: footerLinks,
13916
+ copyright
13840
13917
  }),
13841
13918
  children
13842
13919
  });
@@ -13898,6 +13975,7 @@ const meta$26 = {
13898
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.",
13899
13976
  layout: "StackedLayout",
13900
13977
  blocks: [
13978
+ "site-footer",
13901
13979
  "pricing-table",
13902
13980
  "feature-grid",
13903
13981
  "faq"
@@ -14090,20 +14168,10 @@ function PublicFrame({ brand = /* @__PURE__ */ jsx(Logo, {
14090
14168
  label: "Primary",
14091
14169
  className: "hidden lg:block"
14092
14170
  }),
14093
- footer: /* @__PURE__ */ jsxs("div", {
14094
- className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
14095
- children: [/* @__PURE__ */ jsx("span", { children: copyright }), /* @__PURE__ */ jsx("nav", {
14096
- "aria-label": "Footer",
14097
- children: /* @__PURE__ */ jsx("ul", {
14098
- className: "flex flex-wrap gap-x-4 gap-y-1",
14099
- children: footerLinks.map((l) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
14100
- href: l.href,
14101
- tone: "muted",
14102
- underline: "hover",
14103
- children: l.label
14104
- }) }, l.href))
14105
- })
14106
- })]
14171
+ footer: /* @__PURE__ */ jsx(SiteFooter, {
14172
+ layout: "simple",
14173
+ links: footerLinks,
14174
+ copyright
14107
14175
  }),
14108
14176
  children
14109
14177
  });
@@ -14117,9 +14185,10 @@ const LABELS = {
14117
14185
  topic: "Topic",
14118
14186
  message: "Message"
14119
14187
  };
14120
- /** 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. */
14121
14189
  function ContactPage(props) {
14122
- 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();
14123
14192
  const [values, setValues] = useState({
14124
14193
  ...emptyContact,
14125
14194
  ...defaultValues
@@ -14127,6 +14196,7 @@ function ContactPage(props) {
14127
14196
  const [submitCount, setSubmitCount] = useState(0);
14128
14197
  const [sending, setSending] = useState(false);
14129
14198
  const [sent, setSent] = useState(false);
14199
+ const [submitError, setSubmitError] = useState(false);
14130
14200
  const ids = useId();
14131
14201
  const fieldId = (k) => `${ids}-${k}`;
14132
14202
  const errors = submitCount > 0 ? validateContact(values) : {};
@@ -14142,10 +14212,15 @@ function ContactPage(props) {
14142
14212
  const submit = async () => {
14143
14213
  setSubmitCount((n) => n + 1);
14144
14214
  if (Object.keys(validateContact(values)).length > 0) return;
14145
- setSending(true);
14215
+ flushSync(() => {
14216
+ setSubmitError(false);
14217
+ setSending(true);
14218
+ });
14146
14219
  try {
14147
14220
  await onSubmit?.(values);
14148
14221
  setSent(true);
14222
+ } catch {
14223
+ setSubmitError(true);
14149
14224
  } finally {
14150
14225
  setSending(false);
14151
14226
  }
@@ -14157,6 +14232,7 @@ function ContactPage(props) {
14157
14232
  });
14158
14233
  setSubmitCount(0);
14159
14234
  setSent(false);
14235
+ setSubmitError(false);
14160
14236
  };
14161
14237
  return /* @__PURE__ */ jsx(PublicFrame, {
14162
14238
  brand,
@@ -14351,6 +14427,10 @@ function ContactPage(props) {
14351
14427
  "."
14352
14428
  ]
14353
14429
  }),
14430
+ submitError && /* @__PURE__ */ jsx(Alert, {
14431
+ tone: "destructive",
14432
+ description: submitErrorMessage ?? t("contact.sendFailed")
14433
+ }),
14354
14434
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
14355
14435
  type: "submit",
14356
14436
  icon: Send,
@@ -14443,9 +14523,9 @@ const meta$6 = {
14443
14523
  family: "Overview",
14444
14524
  priority: "P3",
14445
14525
  status: "experimental",
14446
- 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.",
14447
14527
  layout: "StackedLayout",
14448
- blocks: ["validation-summary"]
14528
+ blocks: ["site-footer", "validation-summary"]
14449
14529
  };
14450
14530
  //#endregion
14451
14531
  //#region src/incident-board/data.ts