@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.
- package/dist/index.d.ts +58 -18
- package/dist/index.js +471 -391
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/assistant-chat/Page.test.tsx +37 -7
- package/src/assistant-chat/Page.tsx +98 -137
- package/src/assistant-chat/data.ts +69 -1
- package/src/assistant-chat/examples/AdapterChat.tsx +9 -0
- package/src/assistant-chat/template.meta.ts +1 -1
- package/src/board/Lane.tsx +1 -1
- package/src/code-editor/Page.test.tsx +12 -0
- package/src/code-editor/Page.tsx +2 -1
- package/src/code-editor/examples/PaletteTypography.tsx +130 -0
- package/src/code-editor/template.meta.ts +1 -1
- package/src/contact/Page.test.tsx +106 -0
- package/src/contact/Page.tsx +21 -3
- package/src/contact/PublicFrame.tsx +2 -17
- package/src/contact/examples/CustomFailure.tsx +24 -0
- package/src/contact/examples/FailedSend.tsx +19 -0
- package/src/contact/template.meta.ts +2 -2
- package/src/docs-article/Page.tsx +1 -1
- package/src/help-home/Page.test.tsx +10 -0
- package/src/help-home/Page.tsx +2 -4
- package/src/incident-console/Page.tsx +1 -1
- package/src/keyboard-shortcuts/Page.test.tsx +23 -1
- package/src/keyboard-shortcuts/Page.tsx +13 -3
- package/src/keyboard-shortcuts/ShortcutSheet.tsx +4 -5
- package/src/landing/Page.tsx +3 -17
- package/src/landing/template.meta.ts +1 -1
- package/src/messaging/Page.test.tsx +20 -3
- package/src/messaging/Page.tsx +15 -43
- package/src/messaging/template.meta.ts +1 -1
- package/src/notification-inbox/Page.tsx +1 -1
- package/src/pending-activation/Page.test.tsx +1 -1
- package/src/pricing/PublicFrame.tsx +2 -17
- package/src/pricing/template.meta.ts +1 -1
- package/src/resource-detail/CustomTabs.tsx +41 -0
- package/src/resource-detail/Page.default.test.tsx +29 -0
- package/src/resource-detail/Page.shell-less.test.tsx +36 -0
- package/src/resource-detail/Page.tabs.test.tsx +116 -0
- package/src/resource-detail/Page.tsx +62 -27
- package/src/resource-detail/__snapshots__/Page.default.test.tsx.snap +5 -0
- package/src/resource-detail/examples/embedded-custom-tabs.tsx +44 -0
- package/src/resource-detail/template.meta.ts +1 -1
- package/src/resource-index/Page.test.tsx +178 -1
- package/src/resource-index/Page.tsx +59 -3
- package/src/resource-index/examples/UrlSynced.tsx +10 -0
- package/src/resource-index/template.meta.ts +1 -1
- package/src/resource-tree/Page.tsx +1 -1
- package/src/run-trace/Page.tsx +2 -2
- package/src/scorecard/Page.test.tsx +54 -0
- package/src/scorecard/Page.tsx +2 -0
- package/src/scorecard/data.ts +1 -1
- package/src/search-results/Page.tsx +3 -6
- package/src/settings-appearance/Page.test.tsx +36 -1
- package/src/settings-appearance/Page.tsx +15 -2
- package/src/settings-appearance/template.meta.ts +2 -1
- package/src/settings-profile/__tests__/dom.ts +4 -2
- package/src/settings-profile/fixtures/editable.snap +1 -1
- package/src/shared/ConsoleShell.context.test.tsx +125 -0
- package/src/shared/ConsoleShell.navigation.test.tsx +100 -0
- package/src/shared/ConsoleShell.tsx +38 -9
- package/src/shell-sidebar/Examples.test.tsx +73 -0
- package/src/shell-sidebar/examples/Brand.tsx +16 -0
- package/src/shell-sidebar/examples/ContextRegion.tsx +26 -0
- package/src/shell-sidebar/examples/PlatformWide.tsx +11 -0
- package/src/shell-sidebar/examples/Tenants.tsx +42 -0
- package/src/shell-sidebar/examples/UserMenuChildren.tsx +23 -0
- package/src/shell-sidebar/template.meta.ts +1 -1
- package/src/sign-in/BrandPanel.tsx +2 -2
- package/src/sign-in/Page.test.tsx +5 -0
- package/src/sso-login/Page.test.tsx +6 -0
- package/src/sso-login/Page.tsx +1 -0
- package/src/test/public-footer.test.tsx +44 -0
- package/src/test/without-forced-colors.test.ts +44 -0
- 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
|
|
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:
|
|
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
|
|
@@ -648,6 +653,17 @@ declare function ResetPasswordPage({ onSubmit, onContinue, error, minPasswordLen
|
|
|
648
653
|
//#region src/reset-password/template.meta.d.ts
|
|
649
654
|
declare const meta$29: TemplateMeta;
|
|
650
655
|
//#endregion
|
|
656
|
+
//#region src/resource-detail/CustomTabs.d.ts
|
|
657
|
+
interface CustomTabsProps {
|
|
658
|
+
tabs: {
|
|
659
|
+
value: string;
|
|
660
|
+
label: string;
|
|
661
|
+
content: ReactNode;
|
|
662
|
+
}[];
|
|
663
|
+
defaultTab?: string;
|
|
664
|
+
onTabChange?: (tab: string) => void;
|
|
665
|
+
}
|
|
666
|
+
//#endregion
|
|
651
667
|
//#region src/resource-detail/data.d.ts
|
|
652
668
|
/** The editable part of the resource (Settings tab). */
|
|
653
669
|
interface ResourceSettings {
|
|
@@ -663,11 +679,11 @@ interface ResourceDetailLabels {
|
|
|
663
679
|
settings: string;
|
|
664
680
|
sections: string;
|
|
665
681
|
}
|
|
666
|
-
interface
|
|
682
|
+
interface ResourceDetailBaseProps {
|
|
667
683
|
/** Per-key copy overrides; explicit props take precedence, then labels, then the active catalog. */
|
|
668
684
|
labels?: Partial<ResourceDetailLabels>;
|
|
669
685
|
/**
|
|
670
|
-
* Optional boolean, default false.
|
|
686
|
+
* Optional boolean, default false. With built-in tabs, shows only the keyboard-accessible Overview tab in
|
|
671
687
|
* the "Resource sections" tablist, using explicit resource props without sample defaults.
|
|
672
688
|
* Ignores activity, events, dangerActions, defaultTab, onSaveSettings and onDangerAction.
|
|
673
689
|
* Explicit actions and onEditDetails are still honored. ConsoleShell defaults are unchanged.
|
|
@@ -696,16 +712,31 @@ interface ResourceDetailProps {
|
|
|
696
712
|
events: readonly StatusEvent[];
|
|
697
713
|
activity: readonly ActivityItem[];
|
|
698
714
|
dangerActions: DangerZoneAction[];
|
|
699
|
-
defaultTab: ResourceDetailTab;
|
|
700
|
-
onTabChange: (tab: ResourceDetailTab) => void;
|
|
701
715
|
onEditDetails: () => void;
|
|
702
716
|
onSaveSettings: (settings: ResourceSettings) => void;
|
|
703
717
|
/** Confirmed Danger zone action id (e.g. `pause`, `delete`). */
|
|
704
718
|
onDangerAction: (actionId: string) => void | Promise<void>;
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
719
|
+
/** null omits ConsoleShell; undefined or an object preserves the default frame. */
|
|
720
|
+
shell: Omit<ConsoleShellProps, 'children'> | null;
|
|
721
|
+
}
|
|
722
|
+
type ResourceDetailTabsProps = {
|
|
723
|
+
tabs?: undefined;
|
|
724
|
+
defaultTab?: ResourceDetailTab;
|
|
725
|
+
onTabChange?: (tab: ResourceDetailTab) => void;
|
|
726
|
+
} |
|
|
727
|
+
/** Replaces the built-in tabs, including in read-only mode; [] hides the tab set. */
|
|
728
|
+
CustomTabsProps;
|
|
729
|
+
type ResourceDetailProps = ResourceDetailBaseProps & ResourceDetailTabsProps;
|
|
730
|
+
/**
|
|
731
|
+
* Resource detail: editable tabs by default, or explicit-only Overview when readOnly is true.
|
|
732
|
+
* Pass tabs to replace the built-in sections with caller labels, values and content; readOnly
|
|
733
|
+
* does not filter custom tabs. An omitted or unknown defaultTab selects the first custom tab.
|
|
734
|
+
* shell={null} renders only Page and its header. The host owns the main landmark and must
|
|
735
|
+
* provide ChartLocaleProvider when its custom chart content needs a locale. Breadcrumbs
|
|
736
|
+
* render in the header in this mode: pass a trail or [] to avoid the editable sample trail.
|
|
737
|
+
* Omitted or object shells and omitted tabs preserve the existing default output.
|
|
738
|
+
*/
|
|
739
|
+
declare function ResourceDetailPage(props: Partial<ResourceDetailBaseProps> & ResourceDetailTabsProps): import("react").JSX.Element;
|
|
709
740
|
//#endregion
|
|
710
741
|
//#region src/resource-detail/template.meta.d.ts
|
|
711
742
|
declare const meta$30: TemplateMeta;
|
|
@@ -803,11 +834,18 @@ interface ResourceIndexProps<T extends object = ResourceRow> {
|
|
|
803
834
|
onBulkAction: (action: ResourceBulkAction, ids: string[]) => void;
|
|
804
835
|
/** Local Archive without `onBulkAction`; defaults to `status: 'paused'` on rows that have a status. */
|
|
805
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;
|
|
806
844
|
loading: boolean;
|
|
807
845
|
shell: Omit<ConsoleShellProps, 'children'>;
|
|
808
846
|
}
|
|
809
847
|
/** Resource index: header, filter bar, selectable sortable table with pagination, bulk action bar and a no-results state. */
|
|
810
|
-
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;
|
|
811
849
|
//#endregion
|
|
812
850
|
//#region src/resource-index/template.meta.d.ts
|
|
813
851
|
declare const meta$33: TemplateMeta;
|
|
@@ -2473,15 +2511,17 @@ interface ContactProps {
|
|
|
2473
2511
|
}>;
|
|
2474
2512
|
offices: Office[];
|
|
2475
2513
|
defaultValues: Partial<ContactValues>;
|
|
2476
|
-
/** Called with valid values;
|
|
2514
|
+
/** Called with valid values; resolution shows success and rejection shows the error alert. */
|
|
2477
2515
|
onSubmit: (values: ContactValues) => void | Promise<void>;
|
|
2516
|
+
/** Visitor-facing send failure message; defaults to the localized contact.sendFailed text. */
|
|
2517
|
+
submitErrorMessage?: ReactNode;
|
|
2478
2518
|
footerLinks: Array<{
|
|
2479
2519
|
label: string;
|
|
2480
2520
|
href: string;
|
|
2481
2521
|
}>;
|
|
2482
2522
|
copyright: ReactNode;
|
|
2483
2523
|
}
|
|
2484
|
-
/** Public contact page:
|
|
2524
|
+
/** Public contact page: validated form with send-failure feedback, a focused success state, and office cards. */
|
|
2485
2525
|
declare function ContactPage(props: Partial<ContactProps>): import("react").JSX.Element;
|
|
2486
2526
|
//#endregion
|
|
2487
2527
|
//#region src/contact/template.meta.d.ts
|