@gntik-ai/templates 0.11.0 → 0.13.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 +24 -10
- package/dist/index.js +304 -266
- 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/Page.default.test.tsx +3 -2
- package/src/resource-detail/__snapshots__/Page.default.test.tsx.snap +2 -4
- 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
|
@@ -9,8 +9,14 @@ describe('MessagingPage', () => {
|
|
|
9
9
|
render(<MessagingPage />);
|
|
10
10
|
expect(screen.getByRole('main')).toBeInTheDocument();
|
|
11
11
|
expect(screen.getByRole('heading', { level: 1, name: 'Messages' })).toBeInTheDocument();
|
|
12
|
-
const list = screen.getByRole('
|
|
13
|
-
expect(
|
|
12
|
+
const list = screen.getByRole('navigation', { name: 'Conversations' });
|
|
13
|
+
expect(
|
|
14
|
+
within(list)
|
|
15
|
+
.getAllByRole('button')
|
|
16
|
+
.filter((el) => !el.hasAttribute('aria-haspopup')),
|
|
17
|
+
).toHaveLength(conversations.length);
|
|
18
|
+
expect(within(list).queryByRole('heading')).toBeNull();
|
|
19
|
+
expect([...list.querySelectorAll<HTMLElement>('button')].filter((el) => el.tabIndex === 0)).toHaveLength(1);
|
|
14
20
|
expect(within(list).getByText('2')).toBeInTheDocument();
|
|
15
21
|
expect(screen.getByRole('heading', { name: 'Select a conversation' })).toBeInTheDocument();
|
|
16
22
|
await expectNoAxeViolations();
|
|
@@ -20,8 +26,9 @@ describe('MessagingPage', () => {
|
|
|
20
26
|
const onSend = vi.fn();
|
|
21
27
|
render(<MessagingPage onSend={onSend} />);
|
|
22
28
|
await userEvent.click(
|
|
23
|
-
within(screen.getByRole('
|
|
29
|
+
within(screen.getByRole('navigation', { name: 'Conversations' })).getByRole('button', { name: /^Release 2\.14/ }),
|
|
24
30
|
);
|
|
31
|
+
expect(screen.queryByLabelText('2 unread messages')).toBeNull();
|
|
25
32
|
const log = screen.getByRole('log', { name: 'Messages in Release 2.14' });
|
|
26
33
|
expect(within(log).getAllByRole('article')).toHaveLength(4);
|
|
27
34
|
expect(within(log).getByText('rollback-runbook.pdf')).toBeInTheDocument();
|
|
@@ -32,3 +39,13 @@ describe('MessagingPage', () => {
|
|
|
32
39
|
await expectNoAxeViolations();
|
|
33
40
|
});
|
|
34
41
|
});
|
|
42
|
+
|
|
43
|
+
it.each(['dark', 'light', 'high_contrast'])(
|
|
44
|
+
'history and thread are axe clean in %s',
|
|
45
|
+
{ timeout: 15000 },
|
|
46
|
+
async (theme) => {
|
|
47
|
+
document.documentElement.className = theme;
|
|
48
|
+
render(<MessagingPage defaultConversationId="c-release" />);
|
|
49
|
+
await expectNoAxeViolations();
|
|
50
|
+
},
|
|
51
|
+
);
|
package/src/messaging/Page.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { PageHeader } from '@gntik-ai/blocks';
|
|
2
|
-
import { ChatComposer, ChatMessage } from '@gntik-ai/chat';
|
|
2
|
+
import { ChatComposer, ChatMessage, ConversationList } from '@gntik-ai/chat';
|
|
3
3
|
import { MessagesSquare, SquarePen } from '@gntik-ai/icons';
|
|
4
4
|
import {
|
|
5
5
|
Avatar,
|
|
6
6
|
AvatarGroup,
|
|
7
|
-
Badge,
|
|
8
7
|
EmptyState,
|
|
9
8
|
Heading,
|
|
10
9
|
Page,
|
|
@@ -12,9 +11,7 @@ import {
|
|
|
12
11
|
Text,
|
|
13
12
|
Thumbnail,
|
|
14
13
|
ThumbnailList,
|
|
15
|
-
Timestamp,
|
|
16
14
|
TooltipProvider,
|
|
17
|
-
cn,
|
|
18
15
|
type BreadcrumbItem,
|
|
19
16
|
} from '@gntik-ai/ui';
|
|
20
17
|
import { useId, useState } from 'react';
|
|
@@ -86,47 +83,22 @@ export default function MessagingPage(props: Partial<MessagingProps>) {
|
|
|
86
83
|
};
|
|
87
84
|
|
|
88
85
|
const list = (
|
|
89
|
-
<
|
|
90
|
-
{
|
|
86
|
+
<ConversationList
|
|
87
|
+
groupBy={false}
|
|
88
|
+
activeId={selectedId}
|
|
89
|
+
onActiveChange={openConversation}
|
|
90
|
+
items={items.map((c) => {
|
|
91
91
|
const last = c.messages[c.messages.length - 1];
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<Avatar size="sm" name={c.title} aria-hidden />
|
|
101
|
-
<span className="min-w-0 flex-1">
|
|
102
|
-
<span className="flex items-baseline gap-2">
|
|
103
|
-
<span
|
|
104
|
-
className={cn(
|
|
105
|
-
'min-w-0 flex-1 truncate text-[13px] text-foreground',
|
|
106
|
-
c.unread > 0 && 'font-semibold',
|
|
107
|
-
)}
|
|
108
|
-
>
|
|
109
|
-
{c.title}
|
|
110
|
-
</span>
|
|
111
|
-
{last && <Timestamp value={last.at} tooltip={false} className="shrink-0 font-mono text-[11px]" />}
|
|
112
|
-
</span>
|
|
113
|
-
<span className="mt-0.5 flex items-center gap-2">
|
|
114
|
-
<span className="min-w-0 flex-1 truncate text-[12px] text-muted-foreground">
|
|
115
|
-
{last ? `${last.mine ? 'You' : last.author.split(' ')[0]}: ${last.text}` : 'No messages yet'}
|
|
116
|
-
</span>
|
|
117
|
-
{c.unread > 0 && (
|
|
118
|
-
<Badge tone="primary" size="sm">
|
|
119
|
-
{c.unread}
|
|
120
|
-
<span className="sr-only"> unread</span>
|
|
121
|
-
</Badge>
|
|
122
|
-
)}
|
|
123
|
-
</span>
|
|
124
|
-
</span>
|
|
125
|
-
</button>
|
|
126
|
-
</li>
|
|
127
|
-
);
|
|
92
|
+
return {
|
|
93
|
+
id: c.id,
|
|
94
|
+
title: c.title,
|
|
95
|
+
preview: last ? `${last.mine ? 'You' : last.author.split(' ')[0]}: ${last.text}` : 'No messages yet',
|
|
96
|
+
updatedAt: last?.at ?? 0,
|
|
97
|
+
unread: c.unread,
|
|
98
|
+
icon: <Avatar size="sm" name={c.title} aria-hidden />,
|
|
99
|
+
};
|
|
128
100
|
})}
|
|
129
|
-
|
|
101
|
+
/>
|
|
130
102
|
);
|
|
131
103
|
|
|
132
104
|
const detail = selected ? (
|
|
@@ -6,7 +6,7 @@ export const meta: TemplateMeta = {
|
|
|
6
6
|
priority: 'P3',
|
|
7
7
|
status: 'experimental',
|
|
8
8
|
description:
|
|
9
|
-
'Team messaging in the console: SplitLayout
|
|
9
|
+
'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.',
|
|
10
10
|
layout: 'SidebarLayout · Page · SplitLayout',
|
|
11
11
|
blocks: ['app-sidebar', 'app-topbar', 'page-header'],
|
|
12
12
|
};
|
|
@@ -106,7 +106,7 @@ export default function NotificationInboxPage(props: Partial<NotificationInboxPr
|
|
|
106
106
|
type="button"
|
|
107
107
|
aria-current={n.id === selectedId ? 'true' : undefined}
|
|
108
108
|
onClick={() => open(n)}
|
|
109
|
-
className="flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-start hover:bg-accent/55 focus-
|
|
109
|
+
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"
|
|
110
110
|
>
|
|
111
111
|
<span className="mt-1.5 flex w-2 shrink-0 justify-center">
|
|
112
112
|
{!n.read && <StatusDot tone={n.tone} aria-hidden />}
|
|
@@ -65,7 +65,7 @@ describe('PendingActivationPage', () => {
|
|
|
65
65
|
await user.tab();
|
|
66
66
|
const control = screen.getByRole(name === 'Retry' || name === 'Check status' ? 'button' : 'link', { name });
|
|
67
67
|
expect(control).toHaveFocus();
|
|
68
|
-
expect(control).toHaveClass('focus-
|
|
68
|
+
expect(control).toHaveClass('focus-ring');
|
|
69
69
|
}
|
|
70
70
|
await user.tab();
|
|
71
71
|
expect(document.body).toHaveFocus();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { SiteFooter } from '@gntik-ai/blocks';
|
|
1
2
|
import {
|
|
2
3
|
Button,
|
|
3
|
-
Link,
|
|
4
4
|
Logo,
|
|
5
5
|
MegaMenu,
|
|
6
6
|
MobileNav,
|
|
@@ -61,22 +61,7 @@ export function PublicFrame({
|
|
|
61
61
|
</>
|
|
62
62
|
}
|
|
63
63
|
subnav={<MegaMenu items={menu} currentHref={currentHref} label="Primary" className="hidden lg:block" />}
|
|
64
|
-
footer={
|
|
65
|
-
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
66
|
-
<span>{copyright}</span>
|
|
67
|
-
<nav aria-label="Footer">
|
|
68
|
-
<ul className="flex flex-wrap gap-x-4 gap-y-1">
|
|
69
|
-
{footerLinks.map((l) => (
|
|
70
|
-
<li key={l.href}>
|
|
71
|
-
<Link href={l.href} tone="muted" underline="hover">
|
|
72
|
-
{l.label}
|
|
73
|
-
</Link>
|
|
74
|
-
</li>
|
|
75
|
-
))}
|
|
76
|
-
</ul>
|
|
77
|
-
</nav>
|
|
78
|
-
</div>
|
|
79
|
-
}
|
|
64
|
+
footer={<SiteFooter layout="simple" links={footerLinks} copyright={copyright} />}
|
|
80
65
|
>
|
|
81
66
|
{children}
|
|
82
67
|
</StackedLayout>
|
|
@@ -8,5 +8,5 @@ export const meta: TemplateMeta = {
|
|
|
8
8
|
description:
|
|
9
9
|
'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.',
|
|
10
10
|
layout: 'StackedLayout',
|
|
11
|
-
blocks: ['pricing-table', 'feature-grid', 'faq'],
|
|
11
|
+
blocks: ['site-footer', 'pricing-table', 'feature-grid', 'faq'],
|
|
12
12
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
2
|
import ResourceDetailPage from './Page';
|
|
3
3
|
import { shell } from './examples/shell';
|
|
4
|
+
import { withoutForcedColors } from '../test/without-forced-colors';
|
|
4
5
|
|
|
5
6
|
vi.hoisted(() => {
|
|
6
7
|
vi.useFakeTimers({ now: new Date('2026-10-23T12:00:00Z'), toFake: ['Date'] });
|
|
@@ -19,10 +20,10 @@ function stableIds(html: string) {
|
|
|
19
20
|
|
|
20
21
|
it('preserves the original default shell markup', () => {
|
|
21
22
|
const { container } = render(<ResourceDetailPage />);
|
|
22
|
-
expect(stableIds(container.innerHTML)).toMatchSnapshot();
|
|
23
|
+
expect(stableIds(withoutForcedColors(container).innerHTML)).toMatchSnapshot();
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
it('preserves the original explicit shell markup', () => {
|
|
26
27
|
const { container } = render(<ResourceDetailPage shell={shell} />);
|
|
27
|
-
expect(stableIds(container.innerHTML)).toMatchSnapshot();
|
|
28
|
+
expect(stableIds(withoutForcedColors(container).innerHTML)).toMatchSnapshot();
|
|
28
29
|
});
|