@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.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import { ActiveFilter, ActivityItem, ApiKeyExpiry, ApiKeyScope, AppSidebarFooterProps, AppSidebarHeaderProps, AppTopbarProps, BillingCycle, BillingPlan, ChartCardProps, ChartCardRange, CodeFile, CodePanelProps, CodeProblem, CommentAuthor, ConsoleEntry, CostPoint, CreateApiKeyInput, DangerZoneAction, DataTableColumn, DeploymentRow, DescriptionItem, DeviceSession, EvalMetric, EvalRow, FaqItem, Feature, FeedbackAction, FilterField, FlowBuilderProps, FlowEdge, FlowGraph, FlowNode, FlowNodeKind, ForgotPasswordFormProps, Invitation as Invitation$1, InvitePayload, Invoice, KpiItem, LogLine, MarketingAction, Member, MfaMethod, ModelKey, NotificationChannel, NotificationEvent, NotificationMatrixValue, PageChromeAction, PageHeaderMetaItem, PaletteItem, PaymentMethod, PricingCycle, PricingTier, Profile, PromptRunInput, Quota, ResourceAction, ResourceCard, RoleOption, SavedView, SignInFormProps, SignInValues, SignUpValues, SsoProvider, StatusEvent, ThreadComment, TokenUsagePeriod, TraceSpan } from "@gntik-ai/blocks";
3
3
  import { BreadcrumbItem, DateRange, KanbanCard, KanbanColumn, KanbanMove, ListInputPair, MegaMenuItem, NavGroup, NavItem, NotificationItem, OutlineItem, PowerSearchField, PowerSearchQuery, SettingsLayoutProps, SidebarLayoutProps, StatusDotTone, StepItem, StepStatus, TransferListItem, UserMenuUser, WizardLayoutProps, Workspace } from "@gntik-ai/ui";
4
4
  import { MouseEventHandler, ReactElement, ReactNode } from "react";
5
- import { ChatFeedback, CitationSource, Suggestion } from "@gntik-ai/chat";
5
+ import { ChatAdapter, ChatFeedback, CitationSource, Suggestion } from "@gntik-ai/chat";
6
6
  import { LucideIcon } from "@gntik-ai/icons";
7
7
  import { MonacoLoader } from "@gntik-ai/editor";
8
8
  //#region src/meta.d.ts
@@ -21,13 +21,14 @@ interface TemplateMeta {
21
21
  }
22
22
  //#endregion
23
23
  //#region src/shared/ConsoleShell.d.ts
24
- interface ConsoleShellProps extends Pick<AppSidebarHeaderProps, 'currentWorkspaceId' | 'onWorkspaceChange' | 'onCreateWorkspace'>, Pick<AppSidebarFooterProps, 'usage' | 'helpHref' | 'helpLabel' | 'userMenuItems' | 'onSignOut'>, Pick<SidebarLayoutProps, 'sidebarLabel' | 'collapseMode'> {
24
+ interface ConsoleShellProps extends Omit<AppSidebarHeaderProps, 'collapsed' | 'className' | 'workspaces'>, Pick<AppSidebarFooterProps, 'usage' | 'helpHref' | 'helpLabel' | 'userMenuItems' | 'userMenuChildren' | 'onSignOut'>, Pick<SidebarLayoutProps, 'sidebarLabel' | 'collapseMode'> {
25
25
  /** Page content (usually a <Page>). */
26
26
  children: ReactNode;
27
- /** Sidebar navigation; defaults to the AppSidebar sample groups. */
27
+ /** Sidebar navigation; defaults to the NavigationProvider's groups, else the AppSidebar sample groups. */
28
28
  nav?: NavGroup[];
29
- /** Href of the current page, marks the active nav item. */
29
+ /** Href of the current page, marks the active nav item; defaults to the NavigationProvider's active menu item. */
30
30
  currentHref?: string;
31
+ /** Topbar trail; defaults to the NavigationProvider's active page. `null` hides it. */
31
32
  breadcrumbs?: BreadcrumbItem[] | null;
32
33
  workspaces?: Workspace[] | null;
33
34
  user?: UserMenuUser | null;
@@ -40,9 +41,11 @@ interface ConsoleShellProps extends Pick<AppSidebarHeaderProps, 'currentWorkspac
40
41
  * The console frame shared by the templates: SidebarLayout with the AppSidebar header, nav and
41
42
  * footer, and the AppTopbar (breadcrumb, ⌘K search, notifications, theme, user menu).
42
43
  * Templates fill it with a Page; products swap the nav, workspaces, user, usage meter, help
43
- * link and user-menu items.
44
+ * link and user-menu items. Inside a NavigationProvider, an omitted `nav`, `currentHref` or
45
+ * `breadcrumbs` comes from the route tree; explicit props always win, and without a provider the
46
+ * defaults are unchanged.
44
47
  */
45
- export declare function ConsoleShell({ children, nav, currentHref, breadcrumbs, workspaces, currentWorkspaceId, onWorkspaceChange, onCreateWorkspace, user, usage, helpHref, helpLabel, userMenuItems, onSignOut, topbar, storageKey, sidebarLabel, collapseMode }: ConsoleShellProps): import("react").JSX.Element;
48
+ export declare 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 }: ConsoleShellProps): import("react").JSX.Element;
46
49
  //#endregion
47
50
  //#region src/accept-invitation/data.d.ts
48
51
  /** Sample invitation: who invited whom, to which workspace and with what role. */
@@ -91,6 +94,8 @@ interface AssistantTool {
91
94
  //#endregion
92
95
  //#region src/assistant-chat/Page.d.ts
93
96
  interface AssistantChatProps {
97
+ /** Experimental runtime adapter. Its URL must be the product backend; provider keys stay server-side. */
98
+ adapter?: ChatAdapter;
94
99
  title: string;
95
100
  suggestions: Suggestion[];
96
101
  /** Sources cited under the reply and listed in the details panel. */
@@ -111,7 +116,7 @@ interface AssistantChatProps {
111
116
  /** ConsoleShell props (app nav, user, workspaces, sidebar footer, topbar…). */
112
117
  shell: Omit<ConsoleShellProps, 'children'>;
113
118
  }
114
- /** Assistant chat: ConsoleShell + Page + ChatLayout with a mock-streamed reply (timers cleared on Stop and unmount). */
119
+ /** Assistant chat: streams a backend adapter, or an abortable scripted demo when no adapter is supplied. */
115
120
  declare function AssistantChatPage(props: Partial<AssistantChatProps>): import("react").JSX.Element;
116
121
  //#endregion
117
122
  //#region src/assistant-chat/template.meta.d.ts
@@ -829,11 +834,18 @@ interface ResourceIndexProps<T extends object = ResourceRow> {
829
834
  onBulkAction: (action: ResourceBulkAction, ids: string[]) => void;
830
835
  /** Local Archive without `onBulkAction`; defaults to `status: 'paused'` on rows that have a status. */
831
836
  archiveRow: (row: T) => T;
837
+ /**
838
+ * Keep q, repeated f=field:value and sort=column:asc|desc in the URL (default false).
839
+ * Filters push history; query and sort replace. Use UrlStateProvider with a router.
840
+ * Saved-view selection itself is local and may show a stale label after Back.
841
+ * Page and page size remain local. Default-adapter SSR initially renders unfiltered rows.
842
+ */
843
+ syncUrl?: boolean;
832
844
  loading: boolean;
833
845
  shell: Omit<ConsoleShellProps, 'children'>;
834
846
  }
835
847
  /** Resource index: header, filter bar, selectable sortable table with pagination, bulk action bar and a no-results state. */
836
- declare function ResourceIndexPage<T extends object = ResourceRow>({ title, description, breadcrumbs, rows: initialRows, columns, filterFields, savedViews, getRowId, getRowHref, onRowClick, linkColumnId, noun, createLabel, onCreate, onOpen, onBulkAction, archiveRow, loading, shell }: Partial<ResourceIndexProps<T>>): import("react").JSX.Element;
848
+ declare function ResourceIndexPage<T extends object = ResourceRow>({ title, description, breadcrumbs, rows: initialRows, columns, filterFields, savedViews, getRowId, getRowHref, onRowClick, linkColumnId, noun, createLabel, onCreate, onOpen, onBulkAction, archiveRow, loading, syncUrl, shell }: Partial<ResourceIndexProps<T>>): import("react").JSX.Element;
837
849
  //#endregion
838
850
  //#region src/resource-index/template.meta.d.ts
839
851
  declare const meta$33: TemplateMeta;
@@ -2499,15 +2511,17 @@ interface ContactProps {
2499
2511
  }>;
2500
2512
  offices: Office[];
2501
2513
  defaultValues: Partial<ContactValues>;
2502
- /** Called with valid values; the page shows the success state once it resolves. */
2514
+ /** Called with valid values; resolution shows success and rejection shows the error alert. */
2503
2515
  onSubmit: (values: ContactValues) => void | Promise<void>;
2516
+ /** Visitor-facing send failure message; defaults to the localized contact.sendFailed text. */
2517
+ submitErrorMessage?: ReactNode;
2504
2518
  footerLinks: Array<{
2505
2519
  label: string;
2506
2520
  href: string;
2507
2521
  }>;
2508
2522
  copyright: ReactNode;
2509
2523
  }
2510
- /** Public contact page: StackedLayout + MegaMenu, a validated form with a success state, and office cards. */
2524
+ /** Public contact page: validated form with send-failure feedback, a focused success state, and office cards. */
2511
2525
  declare function ContactPage(props: Partial<ContactProps>): import("react").JSX.Element;
2512
2526
  //#endregion
2513
2527
  //#region src/contact/template.meta.d.ts