@lindaui/blocks 0.4.2 → 0.5.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/README.md +56 -0
- package/dist/ai-cost-card-f403ypsg.js +99 -0
- package/dist/ai-performance-card-cggm09nc.js +191 -0
- package/dist/analytics/ai-cost-card.d.ts +3 -0
- package/dist/analytics/ai-cost-card.d.ts.map +1 -0
- package/dist/analytics/ai-performance-card.d.ts +3 -0
- package/dist/analytics/ai-performance-card.d.ts.map +1 -0
- package/dist/analytics/analytics-card.d.ts +3 -0
- package/dist/analytics/analytics-card.d.ts.map +1 -0
- package/dist/analytics/analytics-skeleton.d.ts +5 -0
- package/dist/analytics/analytics-skeleton.d.ts.map +1 -0
- package/dist/analytics/entity-health-card.d.ts +3 -0
- package/dist/analytics/entity-health-card.d.ts.map +1 -0
- package/dist/analytics/status-distribution-chart.d.ts +3 -0
- package/dist/analytics/status-distribution-chart.d.ts.map +1 -0
- package/dist/analytics/time-range-picker.d.ts +3 -0
- package/dist/analytics/time-range-picker.d.ts.map +1 -0
- package/dist/analytics/top-entities-table.d.ts +3 -0
- package/dist/analytics/top-entities-table.d.ts.map +1 -0
- package/dist/analytics/types.d.ts +104 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/analytics-card-bcmijpt6.js +38 -0
- package/dist/analytics-skeleton-imve37du.js +164 -0
- package/dist/analytics.d.ts +11 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +8 -0
- package/dist/app-shell/drawer-focus.d.ts +8 -0
- package/dist/app-shell/drawer-focus.d.ts.map +1 -0
- package/dist/app-shell/footer.d.ts +39 -0
- package/dist/app-shell/footer.d.ts.map +1 -0
- package/dist/app-shell/logout-dialog.d.ts +6 -0
- package/dist/app-shell/logout-dialog.d.ts.map +1 -0
- package/dist/app-shell/navigation.d.ts +15 -0
- package/dist/app-shell/navigation.d.ts.map +1 -0
- package/dist/app-shell/types.d.ts +55 -0
- package/dist/app-shell/types.d.ts.map +1 -0
- package/dist/app-shell.d.ts +7 -0
- package/dist/app-shell.d.ts.map +1 -0
- package/dist/app-shell.js +254 -0
- package/dist/channel-settings.d.ts +24 -0
- package/dist/channel-settings.d.ts.map +1 -0
- package/dist/channel-settings.js +60 -0
- package/dist/chat-avatar-jdmeyf2o.js +30 -0
- package/dist/chat-layout-fwx3x26g.js +25 -0
- package/dist/chat.d.ts +22 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +66 -0
- package/dist/command-palette.d.ts +22 -0
- package/dist/command-palette.d.ts.map +1 -0
- package/dist/command-palette.js +141 -0
- package/dist/compat-chat/chat-avatar.d.ts +16 -0
- package/dist/compat-chat/chat-avatar.d.ts.map +1 -0
- package/dist/compat-chat/chat-header.d.ts +9 -0
- package/dist/compat-chat/chat-header.d.ts.map +1 -0
- package/dist/compat-chat/chat-layout.d.ts +10 -0
- package/dist/compat-chat/chat-layout.d.ts.map +1 -0
- package/dist/compat-chat/conversation-list-item.d.ts +10 -0
- package/dist/compat-chat/conversation-list-item.d.ts.map +1 -0
- package/dist/compat-chat/conversation-list.d.ts +24 -0
- package/dist/compat-chat/conversation-list.d.ts.map +1 -0
- package/dist/compat-chat/conversation-thread.d.ts +18 -0
- package/dist/compat-chat/conversation-thread.d.ts.map +1 -0
- package/dist/compat-chat/date-divider.d.ts +5 -0
- package/dist/compat-chat/date-divider.d.ts.map +1 -0
- package/dist/compat-chat/empty-chat-view.d.ts +6 -0
- package/dist/compat-chat/empty-chat-view.d.ts.map +1 -0
- package/dist/compat-chat/image-lightbox.d.ts +7 -0
- package/dist/compat-chat/image-lightbox.d.ts.map +1 -0
- package/dist/compat-chat/message-bubble.d.ts +6 -0
- package/dist/compat-chat/message-bubble.d.ts.map +1 -0
- package/dist/compat-chat/message-composer.d.ts +11 -0
- package/dist/compat-chat/message-composer.d.ts.map +1 -0
- package/dist/compat-chat/time-divider.d.ts +5 -0
- package/dist/compat-chat/time-divider.d.ts.map +1 -0
- package/dist/compat-chat/time-grouping.d.ts +5 -0
- package/dist/compat-chat/time-grouping.d.ts.map +1 -0
- package/dist/compat-chat/types.d.ts +35 -0
- package/dist/compat-chat/types.d.ts.map +1 -0
- package/dist/compat-chat/whatsapp-audio-player.d.ts +7 -0
- package/dist/compat-chat/whatsapp-audio-player.d.ts.map +1 -0
- package/dist/compat.d.ts +9 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +4 -0
- package/dist/connected-panel-lhwy25yk.js +132 -0
- package/dist/connection-panel/connected-panel.d.ts +26 -0
- package/dist/connection-panel/connected-panel.d.ts.map +1 -0
- package/dist/connection-panel/disconnected-panel.d.ts +12 -0
- package/dist/connection-panel/disconnected-panel.d.ts.map +1 -0
- package/dist/connection-panel/instructions.d.ts +5 -0
- package/dist/connection-panel/instructions.d.ts.map +1 -0
- package/dist/connection-panel/qr-panel.d.ts +14 -0
- package/dist/connection-panel/qr-panel.d.ts.map +1 -0
- package/dist/connection-panel/use-qr-refresh.d.ts +18 -0
- package/dist/connection-panel/use-qr-refresh.d.ts.map +1 -0
- package/dist/connection-panel.d.ts +39 -0
- package/dist/connection-panel.d.ts.map +1 -0
- package/dist/connection-panel.js +328 -0
- package/dist/conversation-list-ekq2dzca.js +133 -0
- package/dist/conversation-list-item-fy6t5af2.js +55 -0
- package/dist/conversation-thread-c60431oa.js +205 -0
- package/dist/entity-card.d.ts +17 -0
- package/dist/entity-card.d.ts.map +1 -0
- package/dist/entity-card.js +69 -0
- package/dist/entity-health-card-ggnmrtrq.js +192 -0
- package/dist/entity-switcher.d.ts +33 -0
- package/dist/entity-switcher.d.ts.map +1 -0
- package/dist/entity-switcher.js +137 -0
- package/dist/filter-bar.d.ts +41 -0
- package/dist/filter-bar.d.ts.map +1 -0
- package/dist/filter-bar.js +155 -0
- package/dist/footer-f7r5e42b.js +192 -0
- package/dist/image-lightbox-ci3arb6z.js +62 -0
- package/dist/kanban/drop-utils.d.ts +18 -0
- package/dist/kanban/drop-utils.d.ts.map +1 -0
- package/dist/kanban/navigation-buttons.d.ts +9 -0
- package/dist/kanban/navigation-buttons.d.ts.map +1 -0
- package/dist/kanban/scroll-indicators.d.ts +6 -0
- package/dist/kanban/scroll-indicators.d.ts.map +1 -0
- package/dist/kanban/use-keyboard-navigation.d.ts +4 -0
- package/dist/kanban/use-keyboard-navigation.d.ts.map +1 -0
- package/dist/kanban-board.d.ts +31 -0
- package/dist/kanban-board.d.ts.map +1 -0
- package/dist/kanban-board.js +128 -0
- package/dist/kanban-column.d.ts +13 -0
- package/dist/kanban-column.d.ts.map +1 -0
- package/dist/kanban-column.js +58 -0
- package/dist/legacy-kpi-card.d.ts +16 -0
- package/dist/legacy-kpi-card.d.ts.map +1 -0
- package/dist/legacy-kpi-card.js +4 -0
- package/dist/logout-dialog-bbv59tbi.js +93 -0
- package/dist/message-bubble-odjvhroq.js +110 -0
- package/dist/message-composer-m2n6soo7.js +59 -0
- package/dist/navigation-buttons-e77mshh0.js +65 -0
- package/dist/navigation-hotcrqoq.js +115 -0
- package/dist/save-bar.d.ts +15 -0
- package/dist/save-bar.d.ts.map +1 -0
- package/dist/save-bar.js +38 -0
- package/dist/scroll-indicators-gvxapogd.js +39 -0
- package/dist/settings-layout.d.ts +20 -0
- package/dist/settings-layout.d.ts.map +1 -0
- package/dist/settings-layout.js +56 -0
- package/dist/source-selector.d.ts +18 -0
- package/dist/source-selector.d.ts.map +1 -0
- package/dist/source-selector.js +59 -0
- package/dist/status-distribution-chart-oucedzv7.js +87 -0
- package/dist/status-filters.d.ts +12 -0
- package/dist/status-filters.d.ts.map +1 -0
- package/dist/status-filters.js +31 -0
- package/dist/stepper.d.ts +15 -0
- package/dist/stepper.d.ts.map +1 -0
- package/dist/stepper.js +42 -0
- package/dist/time-range-picker-mu38hul4.js +123 -0
- package/dist/top-entities-table-o7xzpq96.js +78 -0
- package/dist/use-keyboard-navigation-he1xmriz.js +52 -0
- package/dist/whatsapp-audio-player-nooty6jb.js +277 -0
- package/llms.txt +87 -4
- package/package.json +191 -46
- package/src/analytics/ai-cost-card.tsx +31 -0
- package/src/analytics/ai-performance-card.tsx +48 -0
- package/src/analytics/analytics-card.tsx +14 -0
- package/src/analytics/analytics-skeleton.tsx +15 -0
- package/src/analytics/entity-health-card.tsx +50 -0
- package/src/analytics/status-distribution-chart.tsx +20 -0
- package/src/analytics/time-range-picker.tsx +43 -0
- package/src/analytics/top-entities-table.tsx +24 -0
- package/src/analytics/types.ts +43 -0
- package/src/analytics.ts +10 -0
- package/src/app-shell/drawer-focus.ts +42 -0
- package/src/app-shell/footer.tsx +160 -0
- package/src/app-shell/logout-dialog.tsx +68 -0
- package/src/app-shell/navigation.tsx +147 -0
- package/src/app-shell/types.ts +57 -0
- package/src/app-shell.tsx +166 -0
- package/src/area-chart.tsx +85 -0
- package/src/audio-player.tsx +74 -0
- package/src/auth-layout.tsx +132 -0
- package/src/auth-provider.tsx +29 -0
- package/src/bar-chart.tsx +78 -0
- package/src/channel-settings.tsx +76 -0
- package/src/chart-card.tsx +45 -0
- package/src/chat-avatar.tsx +57 -0
- package/src/chat-date-divider.tsx +18 -0
- package/src/chat-header.tsx +24 -0
- package/src/chat-layout.tsx +41 -0
- package/src/chat-time-divider.tsx +20 -0
- package/src/chat-types.ts +32 -0
- package/src/chat.ts +21 -0
- package/src/command-palette.tsx +110 -0
- package/src/compat-chat/chat-avatar.tsx +23 -0
- package/src/compat-chat/chat-header.tsx +12 -0
- package/src/compat-chat/chat-layout.tsx +14 -0
- package/src/compat-chat/conversation-list-item.tsx +27 -0
- package/src/compat-chat/conversation-list.tsx +49 -0
- package/src/compat-chat/conversation-thread.tsx +92 -0
- package/src/compat-chat/date-divider.tsx +7 -0
- package/src/compat-chat/empty-chat-view.tsx +9 -0
- package/src/compat-chat/image-lightbox.tsx +22 -0
- package/src/compat-chat/message-bubble.tsx +28 -0
- package/src/compat-chat/message-composer.tsx +26 -0
- package/src/compat-chat/time-divider.tsx +5 -0
- package/src/compat-chat/time-grouping.ts +19 -0
- package/src/compat-chat/types.ts +31 -0
- package/src/compat-chat/whatsapp-audio-player.tsx +100 -0
- package/src/compat.ts +8 -0
- package/src/confirm-dialog.tsx +85 -0
- package/src/connection-panel/connected-panel.tsx +106 -0
- package/src/connection-panel/disconnected-panel.tsx +48 -0
- package/src/connection-panel/instructions.tsx +9 -0
- package/src/connection-panel/qr-panel.tsx +62 -0
- package/src/connection-panel/use-qr-refresh.ts +52 -0
- package/src/connection-panel.tsx +141 -0
- package/src/conversation-list-item.tsx +53 -0
- package/src/conversation-list.tsx +67 -0
- package/src/conversation-thread.tsx +64 -0
- package/src/detail-panel.tsx +123 -0
- package/src/document-panel.tsx +109 -0
- package/src/document-reader.tsx +29 -0
- package/src/empty-chat-view.tsx +25 -0
- package/src/entity-card.tsx +74 -0
- package/src/entity-health-card.tsx +53 -0
- package/src/entity-switcher.tsx +126 -0
- package/src/fetching-indicator.tsx +16 -0
- package/src/field-array-form.tsx +166 -0
- package/src/filter-bar.tsx +203 -0
- package/src/image-viewer.tsx +129 -0
- package/src/kanban/drop-utils.ts +31 -0
- package/src/kanban/navigation-buttons.tsx +80 -0
- package/src/kanban/scroll-indicators.tsx +47 -0
- package/src/kanban/use-keyboard-navigation.ts +43 -0
- package/src/kanban-board.tsx +160 -0
- package/src/kanban-column.tsx +62 -0
- package/src/legacy-kpi-card.tsx +38 -0
- package/src/line-chart.tsx +58 -0
- package/src/list-item.tsx +63 -0
- package/src/list-pane.tsx +143 -0
- package/src/login-form.tsx +128 -0
- package/src/message-bubble.tsx +70 -0
- package/src/message-composer.tsx +52 -0
- package/src/pie-chart.tsx +70 -0
- package/src/radar-chart.tsx +55 -0
- package/src/radial-chart.tsx +103 -0
- package/src/recording-overlay.tsx +159 -0
- package/src/save-bar.tsx +35 -0
- package/src/settings-layout.tsx +79 -0
- package/src/source-selector.tsx +71 -0
- package/src/split-workspace.tsx +74 -0
- package/src/stat-card.tsx +166 -0
- package/src/stats-grid.tsx +23 -0
- package/src/status-filters.tsx +28 -0
- package/src/stepper.tsx +47 -0
- package/src/table-pane.tsx +194 -0
- package/src/time-range-picker.tsx +89 -0
- package/src/workspace-back-button.tsx +32 -0
- package/dist/chat-types.test.d.ts +0 -2
- package/dist/chat-types.test.d.ts.map +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Tabs } from '@lindaui/ui/compound';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
/** Every panel stays mounted so switching channels preserves form and challenge state. */ function ChannelSettings({ channels, navigationLabel, selected, defaultSelected, onSelect, className = "w-full gap-5", listClassName }) {
|
|
7
|
+
const [localSelected, setLocalSelected] = useState(defaultSelected ?? channels[0]?.id);
|
|
8
|
+
const current = selected ?? localSelected;
|
|
9
|
+
return /*#__PURE__*/ jsxs(Tabs, {
|
|
10
|
+
className: className,
|
|
11
|
+
onSelectionChange: (key)=>{
|
|
12
|
+
const id = String(key);
|
|
13
|
+
if (selected === undefined) setLocalSelected(id);
|
|
14
|
+
onSelect?.(id);
|
|
15
|
+
},
|
|
16
|
+
selectedKey: current,
|
|
17
|
+
variant: "secondary",
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ jsx(Tabs.ListContainer, {
|
|
20
|
+
className: "w-full",
|
|
21
|
+
children: /*#__PURE__*/ jsx(Tabs.List, {
|
|
22
|
+
"aria-label": navigationLabel,
|
|
23
|
+
className: listClassName ?? (channels.length === 2 ? "grid w-full grid-cols-2" : "grid w-full auto-cols-fr grid-flow-col"),
|
|
24
|
+
children: channels.map(({ id, label, status, icon, isDisabled })=>/*#__PURE__*/ jsxs(Tabs.Tab, {
|
|
25
|
+
className: "h-auto min-w-0 justify-start gap-3 px-3 py-4",
|
|
26
|
+
id: id,
|
|
27
|
+
isDisabled: isDisabled,
|
|
28
|
+
children: [
|
|
29
|
+
icon,
|
|
30
|
+
/*#__PURE__*/ jsxs("span", {
|
|
31
|
+
className: "min-w-0 text-left",
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ jsx("span", {
|
|
34
|
+
className: "block font-semibold text-sm",
|
|
35
|
+
children: label
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ jsx("span", {
|
|
38
|
+
className: "block whitespace-normal font-normal text-muted text-xs",
|
|
39
|
+
children: status
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ jsx(Tabs.Indicator, {})
|
|
44
|
+
]
|
|
45
|
+
}, id))
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
[
|
|
49
|
+
...channels
|
|
50
|
+
].sort((a, b)=>(a.panelOrder ?? 0) - (b.panelOrder ?? 0)).map(({ id, panel })=>/*#__PURE__*/ jsx(Tabs.Panel, {
|
|
51
|
+
className: current === id ? "" : "hidden",
|
|
52
|
+
id: id,
|
|
53
|
+
shouldForceMount: true,
|
|
54
|
+
children: typeof panel === "function" ? panel(current === id) : panel
|
|
55
|
+
}, id))
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { ChannelSettings };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Avatar } from '@lindaui/ui/compound';
|
|
4
|
+
|
|
5
|
+
function getInitials(name) {
|
|
6
|
+
return name.split(" ").map((part)=>part[0]).filter(Boolean).join("").toUpperCase().slice(0, 2);
|
|
7
|
+
}
|
|
8
|
+
/** Image refresh stays in the consumer's onError callback. */ function ChatAvatar({ name, src, size, className, classNames, onError }) {
|
|
9
|
+
return /*#__PURE__*/ jsxs(Avatar, {
|
|
10
|
+
className: [
|
|
11
|
+
className,
|
|
12
|
+
classNames?.base
|
|
13
|
+
].filter(Boolean).join(" "),
|
|
14
|
+
size: size,
|
|
15
|
+
children: [
|
|
16
|
+
src ? /*#__PURE__*/ jsx(Avatar.Image, {
|
|
17
|
+
alt: name,
|
|
18
|
+
className: classNames?.img,
|
|
19
|
+
onError: onError,
|
|
20
|
+
src: src
|
|
21
|
+
}) : null,
|
|
22
|
+
/*#__PURE__*/ jsx(Avatar.Fallback, {
|
|
23
|
+
className: classNames?.fallback,
|
|
24
|
+
children: getInitials(name)
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { ChatAvatar as C };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cn } from '@lindaui/ui/cn';
|
|
4
|
+
|
|
5
|
+
/** Mobile selection switching, 350px tablet sidebar, 320px desktop detail. */ function ChatLayout({ sidebar, main, detail, selectedChatId }) {
|
|
6
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: "flex h-full w-full overflow-hidden bg-background",
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx("div", {
|
|
10
|
+
className: cn("border-border border-r", "md:flex md:w-[350px] md:flex-col", selectedChatId ? "hidden" : "flex w-full flex-col"),
|
|
11
|
+
children: sidebar
|
|
12
|
+
}),
|
|
13
|
+
/*#__PURE__*/ jsx("div", {
|
|
14
|
+
className: cn("flex-1 flex-col overflow-hidden", "md:flex", selectedChatId ? "flex" : "hidden"),
|
|
15
|
+
children: main
|
|
16
|
+
}),
|
|
17
|
+
detail && /*#__PURE__*/ jsx("div", {
|
|
18
|
+
className: "hidden w-[320px] flex-col border-border border-l lg:flex",
|
|
19
|
+
children: detail
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { ChatLayout as C };
|
package/dist/chat.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Generic migration API. The existing individual chat entry points are unchanged. */
|
|
2
|
+
export { ChatAvatar } from "./compat-chat/chat-avatar.js";
|
|
3
|
+
export type { ChatAvatarProps, ChatAvatarClassNames } from "./compat-chat/chat-avatar.js";
|
|
4
|
+
export { ChatHeader } from "./compat-chat/chat-header.js";
|
|
5
|
+
export type { ChatHeaderProps } from "./compat-chat/chat-header.js";
|
|
6
|
+
export { ChatLayout } from "./compat-chat/chat-layout.js";
|
|
7
|
+
export type { ChatLayoutProps } from "./compat-chat/chat-layout.js";
|
|
8
|
+
export { ConversationList } from "./compat-chat/conversation-list.js";
|
|
9
|
+
export type { ConversationListProps, ConversationListLabels } from "./compat-chat/conversation-list.js";
|
|
10
|
+
export { ConversationListItem } from "./compat-chat/conversation-list-item.js";
|
|
11
|
+
export type { ConversationListItemProps } from "./compat-chat/conversation-list-item.js";
|
|
12
|
+
export { ConversationThread } from "./compat-chat/conversation-thread.js";
|
|
13
|
+
export type { ConversationThreadProps } from "./compat-chat/conversation-thread.js";
|
|
14
|
+
export { EmptyChatView } from "./compat-chat/empty-chat-view.js";
|
|
15
|
+
export type { EmptyChatViewProps } from "./compat-chat/empty-chat-view.js";
|
|
16
|
+
export { MessageBubble } from "./compat-chat/message-bubble.js";
|
|
17
|
+
export type { MessageBubbleProps } from "./compat-chat/message-bubble.js";
|
|
18
|
+
export { MessageComposer } from "./compat-chat/message-composer.js";
|
|
19
|
+
export type { MessageComposerProps } from "./compat-chat/message-composer.js";
|
|
20
|
+
export type { ConversationSummary, ConversationThreadLabels, GenericMessage, GenericMessageMedia, MessageMediaKind, MessageSide } from "./compat-chat/types.js";
|
|
21
|
+
export type { TimeGroup } from "./compat-chat/time-grouping.js";
|
|
22
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA2B,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA2B,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA2B,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA2B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA2B,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAiC,CAAC;AACnE,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAiC,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAsC,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,MAAM,yCAAsC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAmC,CAAC;AACvE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAmC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAA+B,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,kCAA+B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAA8B,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,iCAA8B,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAgC,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mCAAgC,CAAC;AAC3E,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,wBAAqB,CAAC;AAC7J,YAAY,EAAE,SAAS,EAAE,MAAM,gCAA6B,CAAC"}
|
package/dist/chat.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export { C as ChatAvatar } from './chat-avatar-jdmeyf2o.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
export { C as ChatLayout } from './chat-layout-fwx3x26g.js';
|
|
4
|
+
export { C as ConversationList } from './conversation-list-ekq2dzca.js';
|
|
5
|
+
export { C as ConversationListItem } from './conversation-list-item-fy6t5af2.js';
|
|
6
|
+
export { C as ConversationThread } from './conversation-thread-c60431oa.js';
|
|
7
|
+
import { MessageCircle } from 'lucide-react';
|
|
8
|
+
export { M as MessageBubble } from './message-bubble-odjvhroq.js';
|
|
9
|
+
export { M as MessageComposer } from './message-composer-m2n6soo7.js';
|
|
10
|
+
|
|
11
|
+
function ChatHeader({ title, subtitle, avatar, actions }) {
|
|
12
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
13
|
+
className: "flex items-center justify-between gap-3 border-border border-b px-4 py-3",
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ jsxs("div", {
|
|
16
|
+
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
17
|
+
children: [
|
|
18
|
+
avatar,
|
|
19
|
+
/*#__PURE__*/ jsxs("div", {
|
|
20
|
+
className: "min-w-0 flex-1",
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ jsx("h3", {
|
|
23
|
+
className: "truncate font-medium text-foreground text-sm",
|
|
24
|
+
children: title
|
|
25
|
+
}),
|
|
26
|
+
subtitle && /*#__PURE__*/ jsx("p", {
|
|
27
|
+
className: "truncate text-muted text-xs",
|
|
28
|
+
children: subtitle
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
34
|
+
actions
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function EmptyChatView({ title, description }) {
|
|
40
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
41
|
+
className: "flex h-full flex-col items-center justify-center gap-4 px-6 py-8 text-center",
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ jsx("div", {
|
|
44
|
+
className: "rounded-full bg-surface-secondary p-4",
|
|
45
|
+
children: /*#__PURE__*/ jsx(MessageCircle, {
|
|
46
|
+
className: "h-8 w-8 text-muted"
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsxs("div", {
|
|
50
|
+
className: "space-y-2",
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ jsx("h3", {
|
|
53
|
+
className: "font-semibold text-foreground text-lg",
|
|
54
|
+
children: title
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ jsx("p", {
|
|
57
|
+
className: "text-muted text-sm",
|
|
58
|
+
children: description
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { ChatHeader, EmptyChatView };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface CommandPaletteItem {
|
|
3
|
+
description?: string;
|
|
4
|
+
identifier: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CommandPaletteProps<T extends CommandPaletteItem = CommandPaletteItem> {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
items: T[];
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onSelect: (item: T) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
recentIds?: string[];
|
|
14
|
+
title?: string;
|
|
15
|
+
recentLabel?: string;
|
|
16
|
+
allItemsLabel?: string;
|
|
17
|
+
renderEmptyState?: (query: string) => ReactNode;
|
|
18
|
+
renderAvatar?: (item: T) => ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/** Search names and descriptions, keeping recent items first in their original collection order. */
|
|
21
|
+
export declare function CommandPalette<T extends CommandPaletteItem>({ isOpen, onClose, items, onSelect, placeholder, title, recentIds, recentLabel, allItemsLabel, renderEmptyState, renderAvatar, }: CommandPaletteProps<T>): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=command-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../src/command-palette.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB;IACpF,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;CACvC;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,CAAC,SAAS,kBAAkB,EAAE,EAC3D,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAuB,EAAE,KAAgB,EAC3E,SAAc,EAAE,WAAsB,EAAE,aAA2B,EACnE,gBAAgB,EAAE,YAAY,GAC/B,EAAE,mBAAmB,CAAC,CAAC,CAAC,+BA0ExB"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Modal, TextField, InputGroup, Kbd, ScrollShadow, ListBox, Header, Separator, Avatar, Label, Description } from '@lindaui/ui/compound';
|
|
4
|
+
import { Search } from 'lucide-react';
|
|
5
|
+
import { useState, useMemo, useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
/** Search names and descriptions, keeping recent items first in their original collection order. */ function CommandPalette({ isOpen, onClose, items, onSelect, placeholder = "Search…", title = "Search", recentIds = [], recentLabel = "Recent", allItemsLabel = "All items", renderEmptyState, renderAvatar }) {
|
|
8
|
+
const [query, setQuery] = useState("");
|
|
9
|
+
const filtered = useMemo(()=>{
|
|
10
|
+
if (!query.trim()) return items;
|
|
11
|
+
const search = query.toLowerCase();
|
|
12
|
+
return items.filter((item)=>item.name.toLowerCase().includes(search) || item.description?.toLowerCase().includes(search));
|
|
13
|
+
}, [
|
|
14
|
+
items,
|
|
15
|
+
query
|
|
16
|
+
]);
|
|
17
|
+
const recents = filtered.filter((item)=>recentIds.includes(item.identifier));
|
|
18
|
+
const rest = filtered.filter((item)=>!recentIds.includes(item.identifier));
|
|
19
|
+
const handleClose = useCallback(()=>{
|
|
20
|
+
onClose();
|
|
21
|
+
setQuery("");
|
|
22
|
+
}, [
|
|
23
|
+
onClose
|
|
24
|
+
]);
|
|
25
|
+
const handleSelect = useCallback((key)=>{
|
|
26
|
+
const item = items.find((candidate)=>candidate.identifier === String(key));
|
|
27
|
+
if (item) {
|
|
28
|
+
onSelect(item);
|
|
29
|
+
setQuery("");
|
|
30
|
+
}
|
|
31
|
+
}, [
|
|
32
|
+
items,
|
|
33
|
+
onSelect
|
|
34
|
+
]);
|
|
35
|
+
const renderItem = (item)=>/*#__PURE__*/ jsxs(ListBox.Item, {
|
|
36
|
+
id: item.identifier,
|
|
37
|
+
textValue: item.name,
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ jsx(Avatar, {
|
|
40
|
+
size: "sm",
|
|
41
|
+
children: renderAvatar ? renderAvatar(item) : /*#__PURE__*/ jsx(Avatar.Fallback, {
|
|
42
|
+
children: item.name.charAt(0).toUpperCase()
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ jsx(Label, {
|
|
46
|
+
children: item.name
|
|
47
|
+
}),
|
|
48
|
+
item.description ? /*#__PURE__*/ jsx(Description, {
|
|
49
|
+
children: item.description
|
|
50
|
+
}) : null
|
|
51
|
+
]
|
|
52
|
+
}, item.identifier);
|
|
53
|
+
return /*#__PURE__*/ jsx(Modal.Backdrop, {
|
|
54
|
+
isOpen: isOpen,
|
|
55
|
+
onOpenChange: (open)=>{
|
|
56
|
+
if (!open) handleClose();
|
|
57
|
+
},
|
|
58
|
+
variant: "blur",
|
|
59
|
+
children: /*#__PURE__*/ jsx(Modal.Container, {
|
|
60
|
+
placement: "top",
|
|
61
|
+
size: "lg",
|
|
62
|
+
children: /*#__PURE__*/ jsx(Modal.Dialog, {
|
|
63
|
+
"aria-label": title,
|
|
64
|
+
children: /*#__PURE__*/ jsxs(Modal.Body, {
|
|
65
|
+
className: "gap-0 p-0",
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ jsx(TextField, {
|
|
68
|
+
"aria-label": title,
|
|
69
|
+
value: query,
|
|
70
|
+
children: /*#__PURE__*/ jsxs(InputGroup, {
|
|
71
|
+
className: "rounded-none rounded-t-xl border-b shadow-none",
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ jsx(InputGroup.Prefix, {
|
|
74
|
+
children: /*#__PURE__*/ jsx(Search, {
|
|
75
|
+
className: "text-muted",
|
|
76
|
+
size: 18
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ jsx(InputGroup.Input, {
|
|
80
|
+
autoFocus: true,
|
|
81
|
+
onChange: (event)=>setQuery(event.target.value),
|
|
82
|
+
placeholder: placeholder,
|
|
83
|
+
value: query
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ jsx(InputGroup.Suffix, {
|
|
86
|
+
children: /*#__PURE__*/ jsxs(Kbd, {
|
|
87
|
+
children: [
|
|
88
|
+
/*#__PURE__*/ jsx(Kbd.Abbr, {
|
|
89
|
+
keyValue: "escape"
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ jsx(Kbd.Content, {
|
|
92
|
+
children: "ESC"
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ jsx(ScrollShadow, {
|
|
101
|
+
className: "max-h-[360px]",
|
|
102
|
+
children: /*#__PURE__*/ jsxs(ListBox, {
|
|
103
|
+
"aria-label": title,
|
|
104
|
+
onAction: handleSelect,
|
|
105
|
+
renderEmptyState: ()=>renderEmptyState ? renderEmptyState(query) : /*#__PURE__*/ jsxs("p", {
|
|
106
|
+
className: "py-6 text-center text-muted text-sm",
|
|
107
|
+
children: [
|
|
108
|
+
"No results for “",
|
|
109
|
+
query,
|
|
110
|
+
"”"
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
children: [
|
|
114
|
+
recents.length > 0 ? /*#__PURE__*/ jsxs(ListBox.Section, {
|
|
115
|
+
children: [
|
|
116
|
+
/*#__PURE__*/ jsx(Header, {
|
|
117
|
+
children: recentLabel
|
|
118
|
+
}),
|
|
119
|
+
recents.map(renderItem),
|
|
120
|
+
/*#__PURE__*/ jsx(Separator, {})
|
|
121
|
+
]
|
|
122
|
+
}) : null,
|
|
123
|
+
/*#__PURE__*/ jsxs(ListBox.Section, {
|
|
124
|
+
children: [
|
|
125
|
+
recents.length > 0 ? /*#__PURE__*/ jsx(Header, {
|
|
126
|
+
children: allItemsLabel
|
|
127
|
+
}) : null,
|
|
128
|
+
rest.map(renderItem)
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { CommandPalette };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ChatAvatarClassNames {
|
|
2
|
+
base?: string;
|
|
3
|
+
fallback?: string;
|
|
4
|
+
img?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ChatAvatarProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
classNames?: ChatAvatarClassNames;
|
|
9
|
+
name: string;
|
|
10
|
+
onError?: () => void;
|
|
11
|
+
size?: "lg" | "md" | "sm";
|
|
12
|
+
src?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** Image refresh stays in the consumer's onError callback. */
|
|
15
|
+
export declare function ChatAvatar({ name, src, size, className, classNames, onError }: ChatAvatarProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=chat-avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-avatar.d.ts","sourceRoot":"","sources":["../../src/compat-chat/chat-avatar.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IAAG,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CAAE;AACzF,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAID,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,eAAe,+BAK9F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ChatHeaderProps {
|
|
3
|
+
actions?: ReactNode;
|
|
4
|
+
avatar?: ReactNode;
|
|
5
|
+
subtitle?: ReactNode;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function ChatHeader({ title, subtitle, avatar, actions }: ChatHeaderProps): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=chat-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-header.d.ts","sourceRoot":"","sources":["../../src/compat-chat/chat-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAAG,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;CAAE;AACrH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,eAAe,+BAQ/E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ChatLayoutProps {
|
|
3
|
+
detail?: ReactNode;
|
|
4
|
+
main: ReactNode;
|
|
5
|
+
selectedChatId?: string;
|
|
6
|
+
sidebar: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Mobile selection switching, 350px tablet sidebar, 320px desktop detail. */
|
|
9
|
+
export declare function ChatLayout({ sidebar, main, detail, selectedChatId }: ChatLayoutProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=chat-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-layout.d.ts","sourceRoot":"","sources":["../../src/compat-chat/chat-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,eAAe;IAAG,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAC;CAAE;AACtH,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,eAAe,+BAMpF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ConversationSummary } from "./types.js";
|
|
3
|
+
export interface ConversationListItemProps {
|
|
4
|
+
avatar?: ReactNode;
|
|
5
|
+
emptyPreview?: string;
|
|
6
|
+
item: ConversationSummary;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ConversationListItem: import("react").MemoExoticComponent<({ item, onClick, avatar, emptyPreview }: ConversationListItemProps) => import("react").JSX.Element>;
|
|
10
|
+
//# sourceMappingURL=conversation-list-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-list-item.d.ts","sourceRoot":"","sources":["../../src/compat-chat/conversation-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAS,CAAC;AAEnD,MAAM,WAAW,yBAAyB;IAAG,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAAE;AACzI,eAAO,MAAM,oBAAoB,gFAAkD,yBAAyB,iCAmB1G,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type TimeGroup } from "./time-grouping.js";
|
|
3
|
+
import type { ConversationSummary } from "./types.js";
|
|
4
|
+
export interface ConversationListLabels {
|
|
5
|
+
emptyPreview?: string;
|
|
6
|
+
loading: string;
|
|
7
|
+
periods: Record<TimeGroup, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface ConversationListProps {
|
|
10
|
+
emptyMessage?: ReactNode;
|
|
11
|
+
filters?: ReactNode;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
items: ConversationSummary[];
|
|
14
|
+
labels: ConversationListLabels;
|
|
15
|
+
onItemSelect: (id: string) => void;
|
|
16
|
+
onSearchChange: (value: string) => void;
|
|
17
|
+
renderAvatar?: (item: ConversationSummary) => ReactNode;
|
|
18
|
+
searchPlaceholder?: string;
|
|
19
|
+
searchValue: string;
|
|
20
|
+
/** Optional virtualized list. The consumer owns row placement and group headers. */
|
|
21
|
+
renderItems?: (items: ConversationSummary[], renderItem: (item: ConversationSummary) => ReactNode) => ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function ConversationList({ items, searchValue, onSearchChange, searchPlaceholder, filters, labels, isLoading, emptyMessage, onItemSelect, renderAvatar, renderItems }: ConversationListProps): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=conversation-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-list.d.ts","sourceRoot":"","sources":["../../src/compat-chat/conversation-list.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,oBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAS,CAAC;AAEnD,MAAM,WAAW,sBAAsB;IAAG,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAAE;AACvH,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,SAAS,CAAC;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,SAAS,KAAK,SAAS,CAAC;CACjH;AACD,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,qBAAqB,+BAuB3M"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ConversationThreadLabels, GenericMessage } from "./types.js";
|
|
3
|
+
export interface ConversationThreadProps {
|
|
4
|
+
/** undefined uses the original light/dark pattern; null uses a flat background. */
|
|
5
|
+
backgroundImage?: {
|
|
6
|
+
dark: string;
|
|
7
|
+
light: string;
|
|
8
|
+
} | null;
|
|
9
|
+
isError?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
labels: ConversationThreadLabels;
|
|
12
|
+
messages: GenericMessage[];
|
|
13
|
+
showPollingFallback?: boolean;
|
|
14
|
+
/** Optional virtualizer. The consumer owns row placement and date dividers. */
|
|
15
|
+
renderMessages?: (messages: GenericMessage[], renderMessage: (message: GenericMessage) => ReactNode) => ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function ConversationThread({ messages, isLoading, isError, labels, backgroundImage, showPollingFallback, renderMessages }: ConversationThreadProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=conversation-thread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-thread.d.ts","sourceRoot":"","sources":["../../src/compat-chat/conversation-thread.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA4D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjG,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAExE,MAAM,WAAW,uBAAuB;IACtC,mFAAmF;IACnF,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,wBAAwB,CAAC;IACjC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,aAAa,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,SAAS,KAAK,SAAS,CAAC;CACnH;AAED,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,SAAiB,EAAE,OAAe,EAAE,MAAM,EAAE,eAAe,EAAE,mBAA2B,EAAE,cAAc,EAAE,EAAE,uBAAuB,+BAoEjL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-divider.d.ts","sourceRoot":"","sources":["../../src/compat-chat/date-divider.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAAG,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE;AAC1D,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,+BAErD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-chat-view.d.ts","sourceRoot":"","sources":["../../src/compat-chat/empty-chat-view.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IAAG,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE;AAC3E,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,kBAAkB,+BAKvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-lightbox.d.ts","sourceRoot":"","sources":["../../src/compat-chat/image-lightbox.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IAAG,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;CAAE;AACtF,wBAAgB,aAAa,CAAC,EAAE,GAAG,EAAE,GAAa,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAclF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GenericMessage } from "./types.js";
|
|
2
|
+
export interface MessageBubbleProps {
|
|
3
|
+
message: GenericMessage;
|
|
4
|
+
}
|
|
5
|
+
export declare function MessageBubble({ message }: MessageBubbleProps): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=message-bubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-bubble.d.ts","sourceRoot":"","sources":["../../src/compat-chat/message-bubble.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IAAG,OAAO,EAAE,cAAc,CAAC;CAAE;AAEhE,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,+BAgB5D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MessageComposerProps {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
isSending?: boolean;
|
|
4
|
+
onSend: () => void;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
/** Controlled glass composer; Enter sends and Shift+Enter retains a newline. */
|
|
10
|
+
export declare function MessageComposer({ value, onValueChange, onSend, isSending, placeholder, disabled }: MessageComposerProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=message-composer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-composer.d.ts","sourceRoot":"","sources":["../../src/compat-chat/message-composer.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IAAG,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE;AACnL,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,SAAiB,EAAE,WAAW,EAAE,QAAgB,EAAE,EAAE,oBAAoB,+BAiBvI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-divider.d.ts","sourceRoot":"","sources":["../../src/compat-chat/time-divider.tsx"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAEtF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type TimeGroup = "Hoy" | "Ayer" | "Esta semana" | "Este mes" | "Más antiguos";
|
|
2
|
+
export declare const TIME_GROUP_ORDER: readonly ["Hoy", "Ayer", "Esta semana", "Este mes", "Más antiguos"];
|
|
3
|
+
export declare function getTimeGroup(date: string | Date): TimeGroup;
|
|
4
|
+
export declare function groupByTime<T>(items: T[], getDate: (item: T) => string | Date): Record<TimeGroup, T[]>;
|
|
5
|
+
//# sourceMappingURL=time-grouping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-grouping.d.ts","sourceRoot":"","sources":["../../src/compat-chat/time-grouping.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,cAAc,CAAC;AACrF,eAAO,MAAM,gBAAgB,qEAAqG,CAAC;AACnI,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQ3D;AACD,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAKtG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Presentation-only types: map domain data in the consumer. */
|
|
3
|
+
export type MessageSide = "center" | "left" | "right";
|
|
4
|
+
export type MessageMediaKind = "audio" | "image" | "pdf";
|
|
5
|
+
export interface GenericMessageMedia {
|
|
6
|
+
kind: MessageMediaKind;
|
|
7
|
+
label?: string;
|
|
8
|
+
url: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GenericMessage {
|
|
11
|
+
authorTag?: string;
|
|
12
|
+
id: string;
|
|
13
|
+
media?: GenericMessageMedia;
|
|
14
|
+
side: MessageSide;
|
|
15
|
+
text: string;
|
|
16
|
+
timestamp: Date | string;
|
|
17
|
+
}
|
|
18
|
+
export interface ConversationSummary {
|
|
19
|
+
avatarUrl?: string;
|
|
20
|
+
badge?: ReactNode;
|
|
21
|
+
id: string;
|
|
22
|
+
isSelected?: boolean;
|
|
23
|
+
preview?: string;
|
|
24
|
+
subtitle?: string;
|
|
25
|
+
timestamp?: Date | string;
|
|
26
|
+
title: string;
|
|
27
|
+
unreadCount?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ConversationThreadLabels {
|
|
30
|
+
errorLoading: string;
|
|
31
|
+
loading: string;
|
|
32
|
+
noMessages: string;
|
|
33
|
+
pollingFallback?: string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compat-chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,gEAAgE;AAChE,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AACzD,MAAM,WAAW,mBAAmB;IAAG,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;CAAE;AAC7F,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;CAC1B;AACD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|