tembro 4.0.1 → 4.1.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/CHANGELOG.md +15 -0
- package/dist/components/display/chat.cjs +1 -0
- package/dist/components/display/chat.d.ts +94 -0
- package/dist/components/display/chat.js +1 -0
- package/dist/components/display/index.d.ts +1 -0
- package/dist/components/display/kanban.d.ts +33 -1
- package/dist/components/layout/sidebar.d.ts +24 -2
- package/dist/components/modern/rich-text-editor.d.ts +13 -1
- package/dist/components/theme-provider.d.ts +19 -6
- package/dist/components/ui/badge/index.d.ts +8 -2
- package/dist/src/components/display/activity-feed.cjs +1 -1
- package/dist/src/components/display/activity-feed.js +4 -1
- package/dist/src/components/display/chat.cjs +1 -0
- package/dist/src/components/display/chat.js +372 -0
- package/dist/src/components/display/index.cjs +1 -1
- package/dist/src/components/display/index.js +17 -16
- package/dist/src/components/display/kanban.cjs +1 -1
- package/dist/src/components/display/kanban.js +321 -176
- package/dist/src/components/display/timeline.cjs +1 -1
- package/dist/src/components/display/timeline.js +5 -5
- package/dist/src/components/inputs/tag-input.cjs +1 -1
- package/dist/src/components/inputs/tag-input.js +6 -2
- package/dist/src/components/layout/index.cjs +1 -1
- package/dist/src/components/layout/index.js +4 -4
- package/dist/src/components/layout/public.cjs +1 -1
- package/dist/src/components/layout/public.js +4 -4
- package/dist/src/components/layout/sidebar.cjs +1 -1
- package/dist/src/components/layout/sidebar.js +326 -228
- package/dist/src/components/modern/rich-text-editor.cjs +1 -1
- package/dist/src/components/modern/rich-text-editor.js +216 -89
- package/dist/src/components/theme-provider.cjs +1 -1
- package/dist/src/components/theme-provider.js +58 -36
- package/dist/src/components/ui/badge/index.cjs +1 -1
- package/dist/src/components/ui/badge/index.js +59 -47
- package/dist/src/components/ui/input/clearable.cjs +1 -1
- package/dist/src/components/ui/input/clearable.js +5 -2
- package/dist/src/components/ui/input/primitive.cjs +1 -1
- package/dist/src/components/ui/input/primitive.js +1 -1
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +87 -86
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +5 -0
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +3 -3
- package/packages/cli/vendor/src/components/display/activity-feed.tsx +1 -1
- package/packages/cli/vendor/src/components/display/chat.tsx +237 -0
- package/packages/cli/vendor/src/components/display/index.ts +1 -0
- package/packages/cli/vendor/src/components/display/kanban.tsx +219 -72
- package/packages/cli/vendor/src/components/display/timeline.tsx +10 -10
- package/packages/cli/vendor/src/components/inputs/tag-input.tsx +3 -2
- package/packages/cli/vendor/src/components/layout/sidebar.tsx +212 -51
- package/packages/cli/vendor/src/components/modern/rich-text-editor.tsx +115 -32
- package/packages/cli/vendor/src/components/theme-provider.tsx +82 -36
- package/packages/cli/vendor/src/components/ui/badge/index.tsx +29 -8
- package/packages/cli/vendor/src/components/ui/input/clearable.tsx +2 -2
- package/packages/cli/vendor/src/components/ui/input/primitive.tsx +1 -1
- package/packages/cli/vendor/src/public-component-surface.ts +1 -0
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/styles/globals.css +91 -10
- package/registry.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 4.1.0 - 2026-07-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added reusable chat workspace primitives for conversation lists, messages, replies, attachments, reactions, typing states, delivery status, and message composition.
|
|
10
|
+
- Added named theme support with `data-theme`, color-scheme mapping, system mode, theme cycling, and built-in light, dark, and dim presets.
|
|
11
|
+
- Added Kanban WIP limits, controlled selection, rich task metadata, add-card/add-column actions, density, column sizing, and move policies.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Expanded Sidebar with inset/floating/offcanvas variants, search, persistence, keyboard collapse, item actions, accessible collapsed labels, and corrected mobile drawer geometry.
|
|
16
|
+
- Expanded RichTextEditor with grouped responsive controls, headings, block tools, link actions, format clearing, sticky/compact toolbar modes, and word/character counts.
|
|
17
|
+
- Improved Badge dot, pulse, avatar, icon, remove, focus, and interactive states; centered tag and clear icons and removed duplicate native search cancel controls.
|
|
18
|
+
- Corrected ActivityFeed and Timeline connector alignment and strengthened viewport-only sidebar/main scrolling behavior.
|
|
19
|
+
|
|
5
20
|
## 4.0.1 - 2026-07-17
|
|
6
21
|
|
|
7
22
|
### Changed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/display/chat.cjs")
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ChatMessageStatus = "sending" | "sent" | "delivered" | "read" | "failed";
|
|
3
|
+
export type ChatAttachmentData = {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
size?: React.ReactNode;
|
|
7
|
+
type?: React.ReactNode;
|
|
8
|
+
href?: string;
|
|
9
|
+
preview?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ChatParticipant = {
|
|
12
|
+
name: string;
|
|
13
|
+
avatar?: string;
|
|
14
|
+
fallback?: React.ReactNode;
|
|
15
|
+
status?: "online" | "offline" | "busy" | "away";
|
|
16
|
+
};
|
|
17
|
+
export type ChatShellProps = React.ComponentProps<"section"> & {
|
|
18
|
+
sidebar?: React.ReactNode;
|
|
19
|
+
details?: React.ReactNode;
|
|
20
|
+
};
|
|
21
|
+
declare function ChatShell({ sidebar, details, children, className, ...props }: ChatShellProps): React.JSX.Element;
|
|
22
|
+
export type ChatHeaderProps = React.ComponentProps<"header"> & {
|
|
23
|
+
participant: ChatParticipant;
|
|
24
|
+
description?: React.ReactNode;
|
|
25
|
+
actions?: React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
declare function ChatHeader({ participant, description, actions, className, ...props }: ChatHeaderProps): React.JSX.Element;
|
|
28
|
+
export type ConversationItem = {
|
|
29
|
+
key: string;
|
|
30
|
+
participant: ChatParticipant;
|
|
31
|
+
preview?: React.ReactNode;
|
|
32
|
+
time?: React.ReactNode;
|
|
33
|
+
unread?: number;
|
|
34
|
+
muted?: boolean;
|
|
35
|
+
pinned?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type ConversationListProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
38
|
+
items: ConversationItem[];
|
|
39
|
+
selectedKey?: string;
|
|
40
|
+
defaultSelectedKey?: string;
|
|
41
|
+
onSelect?: (item: ConversationItem) => void;
|
|
42
|
+
searchable?: boolean;
|
|
43
|
+
searchPlaceholder?: string;
|
|
44
|
+
empty?: React.ReactNode;
|
|
45
|
+
};
|
|
46
|
+
declare function ConversationList({ items, selectedKey, defaultSelectedKey, onSelect, searchable, searchPlaceholder, empty, className, ...props }: ConversationListProps): React.JSX.Element;
|
|
47
|
+
export type ChatMessageListProps = React.ComponentProps<"div"> & {
|
|
48
|
+
autoScroll?: boolean;
|
|
49
|
+
empty?: React.ReactNode;
|
|
50
|
+
};
|
|
51
|
+
declare function ChatMessageList({ autoScroll, empty, children, className, ...props }: ChatMessageListProps): React.JSX.Element;
|
|
52
|
+
export type ChatAttachmentProps = React.ComponentProps<"div"> & Omit<ChatAttachmentData, "key"> & {
|
|
53
|
+
attachmentKey?: string;
|
|
54
|
+
onRemove?: () => void;
|
|
55
|
+
};
|
|
56
|
+
declare function ChatAttachment({ name, size, type, href, preview, onRemove, attachmentKey: _attachmentKey, className, ...props }: ChatAttachmentProps): React.JSX.Element;
|
|
57
|
+
export type ChatMessageProps = React.ComponentProps<"article"> & {
|
|
58
|
+
participant?: ChatParticipant;
|
|
59
|
+
outgoing?: boolean;
|
|
60
|
+
time?: React.ReactNode;
|
|
61
|
+
status?: ChatMessageStatus;
|
|
62
|
+
replyTo?: React.ReactNode;
|
|
63
|
+
attachments?: ChatAttachmentData[];
|
|
64
|
+
reactions?: Array<{
|
|
65
|
+
key: string;
|
|
66
|
+
label: React.ReactNode;
|
|
67
|
+
count?: number;
|
|
68
|
+
active?: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
onReaction?: (key: string) => void;
|
|
71
|
+
actions?: React.ReactNode;
|
|
72
|
+
};
|
|
73
|
+
declare function ChatMessage({ participant, outgoing, time, status, replyTo, attachments, reactions, onReaction, actions, children, className, ...props }: ChatMessageProps): React.JSX.Element;
|
|
74
|
+
declare function ChatTypingIndicator({ participant, className, ...props }: React.ComponentProps<"div"> & {
|
|
75
|
+
participant?: ChatParticipant;
|
|
76
|
+
}): React.JSX.Element;
|
|
77
|
+
export type ChatComposerProps = Omit<React.ComponentProps<"form">, "onSubmit"> & {
|
|
78
|
+
value?: string;
|
|
79
|
+
defaultValue?: string;
|
|
80
|
+
onValueChange?: (value: string) => void;
|
|
81
|
+
onSend: (value: string) => void | Promise<void>;
|
|
82
|
+
placeholder?: string;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
sending?: boolean;
|
|
85
|
+
attachments?: ChatAttachmentData[];
|
|
86
|
+
onRemoveAttachment?: (key: string) => void;
|
|
87
|
+
onAttachmentClick?: () => void;
|
|
88
|
+
onEmojiClick?: () => void;
|
|
89
|
+
maxLength?: number;
|
|
90
|
+
submitLabel?: string;
|
|
91
|
+
};
|
|
92
|
+
declare function ChatComposer({ value, defaultValue, onValueChange, onSend, placeholder, disabled, sending, attachments, onRemoveAttachment, onAttachmentClick, onEmojiClick, maxLength, submitLabel, className, ...props }: ChatComposerProps): React.JSX.Element;
|
|
93
|
+
declare function ChatHeaderActions(): React.JSX.Element;
|
|
94
|
+
export { ChatAttachment, ChatComposer, ChatHeader, ChatHeaderActions, ChatMessage, ChatMessageList, ChatShell, ChatTypingIndicator, ConversationList, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/display/chat.js"
|
|
@@ -6,6 +6,19 @@ export type KanbanCard = {
|
|
|
6
6
|
meta?: React.ReactNode;
|
|
7
7
|
extra?: React.ReactNode;
|
|
8
8
|
actions?: React.ReactNode;
|
|
9
|
+
labels?: Array<React.ReactNode | {
|
|
10
|
+
key: string;
|
|
11
|
+
label: React.ReactNode;
|
|
12
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger" | "muted";
|
|
13
|
+
}>;
|
|
14
|
+
priority?: "low" | "medium" | "high" | "urgent";
|
|
15
|
+
assignee?: {
|
|
16
|
+
name: string;
|
|
17
|
+
src?: string;
|
|
18
|
+
fallback?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
dueDate?: React.ReactNode;
|
|
21
|
+
selected?: boolean;
|
|
9
22
|
disabled?: boolean;
|
|
10
23
|
};
|
|
11
24
|
export type KanbanColumn = {
|
|
@@ -14,12 +27,18 @@ export type KanbanColumn = {
|
|
|
14
27
|
description?: React.ReactNode;
|
|
15
28
|
cards: KanbanCard[];
|
|
16
29
|
count?: React.ReactNode;
|
|
30
|
+
limit?: number;
|
|
31
|
+
color?: string;
|
|
32
|
+
actions?: React.ReactNode;
|
|
33
|
+
footer?: React.ReactNode;
|
|
17
34
|
disabled?: boolean;
|
|
18
35
|
};
|
|
19
36
|
export type KanbanCardRenderContext = {
|
|
20
37
|
index: number;
|
|
21
38
|
isDragging: boolean;
|
|
22
39
|
isDropTarget: boolean;
|
|
40
|
+
selected: boolean;
|
|
41
|
+
selectControl: React.ReactNode;
|
|
23
42
|
handle: React.ReactNode;
|
|
24
43
|
};
|
|
25
44
|
export type KanbanCardMove = {
|
|
@@ -34,8 +53,21 @@ export type KanbanBoardProps = Omit<React.ComponentProps<"div">, "defaultValue">
|
|
|
34
53
|
defaultColumns?: KanbanColumn[];
|
|
35
54
|
onColumnsChange?: (columns: KanbanColumn[], change: KanbanCardMove) => void;
|
|
36
55
|
onCardMove?: (change: KanbanCardMove) => void;
|
|
56
|
+
canMoveCard?: (change: KanbanCardMove) => boolean;
|
|
37
57
|
renderCard?: (card: KanbanCard, column: KanbanColumn, context: KanbanCardRenderContext) => React.ReactNode;
|
|
38
58
|
onCardClick?: (card: KanbanCard, column: KanbanColumn) => void;
|
|
59
|
+
onAddCard?: (column: KanbanColumn) => void;
|
|
60
|
+
onAddColumn?: () => void;
|
|
61
|
+
renderColumnHeader?: (column: KanbanColumn) => React.ReactNode;
|
|
62
|
+
renderColumnFooter?: (column: KanbanColumn) => React.ReactNode;
|
|
63
|
+
selectionMode?: "none" | "single" | "multiple";
|
|
64
|
+
selectedCardKeys?: string[];
|
|
65
|
+
defaultSelectedCardKeys?: string[];
|
|
66
|
+
onSelectionChange?: (keys: string[], cards: KanbanCard[]) => void;
|
|
67
|
+
allowCrossColumn?: boolean;
|
|
68
|
+
allowReorder?: boolean;
|
|
69
|
+
density?: "compact" | "comfortable";
|
|
70
|
+
columnWidth?: number | string;
|
|
39
71
|
disabled?: boolean;
|
|
40
72
|
emptyColumn?: React.ReactNode;
|
|
41
73
|
dragHandleLabel?: (card: KanbanCard, column: KanbanColumn) => string;
|
|
@@ -43,5 +75,5 @@ export type KanbanBoardProps = Omit<React.ComponentProps<"div">, "defaultValue">
|
|
|
43
75
|
cardClassName?: string;
|
|
44
76
|
overlayClassName?: string;
|
|
45
77
|
};
|
|
46
|
-
declare function KanbanBoard({ columns: columnsProp, defaultColumns, onColumnsChange, onCardMove, renderCard, onCardClick, disabled, emptyColumn, dragHandleLabel, columnClassName, cardClassName, overlayClassName, className, "aria-label": ariaLabel, ...props }: KanbanBoardProps): React.JSX.Element;
|
|
78
|
+
declare function KanbanBoard({ columns: columnsProp, defaultColumns, onColumnsChange, onCardMove, canMoveCard, renderCard, onCardClick, onAddCard, onAddColumn, renderColumnHeader, renderColumnFooter, selectionMode, selectedCardKeys, defaultSelectedCardKeys, onSelectionChange, allowCrossColumn, allowReorder, density, columnWidth, disabled, emptyColumn, dragHandleLabel, columnClassName, cardClassName, overlayClassName, className, "aria-label": ariaLabel, ...props }: KanbanBoardProps): React.JSX.Element;
|
|
47
79
|
export { KanbanBoard };
|
|
@@ -16,6 +16,18 @@ export type SidebarItem = {
|
|
|
16
16
|
current?: React.AriaAttributes["aria-current"];
|
|
17
17
|
tooltip?: React.ReactNode;
|
|
18
18
|
onSelect?: () => void;
|
|
19
|
+
keywords?: string[];
|
|
20
|
+
action?: React.ReactNode;
|
|
21
|
+
actionLabel?: string;
|
|
22
|
+
onAction?: () => void;
|
|
23
|
+
};
|
|
24
|
+
export type SidebarSearch = {
|
|
25
|
+
value?: string;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
onValueChange?: (value: string) => void;
|
|
30
|
+
empty?: React.ReactNode;
|
|
19
31
|
};
|
|
20
32
|
export type SidebarFooterAccount = {
|
|
21
33
|
label: React.ReactNode;
|
|
@@ -30,6 +42,11 @@ export type SidebarProps = React.ComponentProps<"aside"> & {
|
|
|
30
42
|
footer?: React.ReactNode;
|
|
31
43
|
items?: SidebarItem[];
|
|
32
44
|
collapsed?: boolean;
|
|
45
|
+
defaultCollapsed?: boolean;
|
|
46
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
47
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
48
|
+
side?: "left" | "right";
|
|
49
|
+
collapsible?: "icon" | "offcanvas" | "none";
|
|
33
50
|
width?: React.CSSProperties["width"];
|
|
34
51
|
collapsedWidth?: React.CSSProperties["width"];
|
|
35
52
|
mobileWidth?: React.CSSProperties["width"];
|
|
@@ -43,6 +60,10 @@ export type SidebarProps = React.ComponentProps<"aside"> & {
|
|
|
43
60
|
itemSize?: "sm" | "md" | "lg";
|
|
44
61
|
activeIndicator?: "none" | "bar" | "pill";
|
|
45
62
|
navigationLabel?: string;
|
|
63
|
+
search?: SidebarSearch | React.ReactNode;
|
|
64
|
+
hideScrollbar?: boolean;
|
|
65
|
+
keyboardShortcut?: string | false;
|
|
66
|
+
persistKey?: string;
|
|
46
67
|
responsive?: boolean;
|
|
47
68
|
mobileBreakpoint?: number;
|
|
48
69
|
mobileOpen?: boolean;
|
|
@@ -72,5 +93,6 @@ export type SidebarProps = React.ComponentProps<"aside"> & {
|
|
|
72
93
|
[key: `data-${string}`]: string | boolean | undefined;
|
|
73
94
|
}) => React.ReactNode;
|
|
74
95
|
};
|
|
75
|
-
declare function Sidebar({ className, header, footer, items, collapsed: collapsedProp, width, collapsedWidth, mobileWidth, collapsedRail, railItems, footerAccount, secondaryActions, footerSecondary, tooltipOnCollapsed, showSectionLabels, itemSize, activeIndicator, navigationLabel, responsive, mobileBreakpoint, mobileOpen: mobileOpenProp, defaultMobileOpen, onMobileOpenChange, mobileTitle, mobileDescription, mobileToggleLabel, mobileCloseLabel, mobileToggleIcon, showMobileToggle, closeOnSelect, mobileToggleClassName, mobilePanelClassName, mobileOverlayClassName, renderMobileToggle, onItemSelect, renderItem, renderLink, children, ...props }: SidebarProps): React.JSX.Element;
|
|
76
|
-
|
|
96
|
+
declare function Sidebar({ className, header, footer, items, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, variant, side, collapsible, width, collapsedWidth, mobileWidth, collapsedRail, railItems, footerAccount, secondaryActions, footerSecondary, tooltipOnCollapsed, showSectionLabels, itemSize, activeIndicator, navigationLabel, search, hideScrollbar, keyboardShortcut, persistKey, responsive, mobileBreakpoint, mobileOpen: mobileOpenProp, defaultMobileOpen, onMobileOpenChange, mobileTitle, mobileDescription, mobileToggleLabel, mobileCloseLabel, mobileToggleIcon, showMobileToggle, closeOnSelect, mobileToggleClassName, mobilePanelClassName, mobileOverlayClassName, renderMobileToggle, onItemSelect, renderItem, renderLink, children, ...props }: SidebarProps): React.JSX.Element;
|
|
97
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
|
|
98
|
+
export { Sidebar, SidebarInset };
|
|
@@ -9,16 +9,28 @@ export type RichTextEditorProps = Omit<React.ComponentProps<"div">, "defaultValu
|
|
|
9
9
|
editable?: boolean;
|
|
10
10
|
autoFocus?: boolean;
|
|
11
11
|
minHeight?: number;
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
toolbar?: boolean;
|
|
15
|
+
stickyToolbar?: boolean;
|
|
16
|
+
toolbarSize?: "compact" | "default";
|
|
17
|
+
features?: RichTextFeature[];
|
|
18
|
+
showCharacterCount?: boolean;
|
|
19
|
+
showWordCount?: boolean;
|
|
12
20
|
onLinkRequest?: (currentHref?: string) => string | null | undefined;
|
|
13
21
|
labels?: {
|
|
14
22
|
editor?: string;
|
|
15
23
|
toolbar?: string;
|
|
16
24
|
};
|
|
17
25
|
};
|
|
18
|
-
|
|
26
|
+
export type RichTextFeature = "history" | "bold" | "italic" | "strike" | "code" | "heading1" | "heading2" | "heading3" | "paragraph" | "bulletList" | "orderedList" | "blockquote" | "codeBlock" | "horizontalRule" | "link" | "clearFormatting";
|
|
27
|
+
declare function EditorToolbar({ editor, onLinkRequest, label, features, sticky, size }: {
|
|
19
28
|
editor: Editor;
|
|
20
29
|
onLinkRequest?: RichTextEditorProps["onLinkRequest"];
|
|
21
30
|
label: string;
|
|
31
|
+
features?: RichTextFeature[];
|
|
32
|
+
sticky?: boolean;
|
|
33
|
+
size?: "compact" | "default";
|
|
22
34
|
}): React.JSX.Element;
|
|
23
35
|
declare function RichTextEditor(props: RichTextEditorProps): React.JSX.Element;
|
|
24
36
|
export { EditorToolbar, RichTextEditor };
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
type
|
|
3
|
-
type
|
|
2
|
+
export type ThemeName = string;
|
|
3
|
+
export type ThemeMode = ThemeName | "system";
|
|
4
|
+
export type ThemeColorScheme = "light" | "dark";
|
|
5
|
+
export type ThemeProviderProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
themes?: ThemeName[];
|
|
8
|
+
defaultTheme?: ThemeMode;
|
|
9
|
+
forcedTheme?: ThemeName;
|
|
10
|
+
storageKey?: string;
|
|
11
|
+
enableSystem?: boolean;
|
|
12
|
+
attribute?: "class" | "data-theme" | "both";
|
|
13
|
+
colorSchemes?: Record<ThemeName, ThemeColorScheme>;
|
|
14
|
+
disableTransitionOnChange?: boolean;
|
|
15
|
+
onThemeChange?: (theme: ThemeMode, resolvedTheme: ThemeName) => void;
|
|
16
|
+
};
|
|
4
17
|
type ThemeContextValue = {
|
|
5
18
|
theme: ThemeMode;
|
|
6
|
-
resolvedTheme:
|
|
19
|
+
resolvedTheme: ThemeName;
|
|
20
|
+
systemTheme: ThemeColorScheme;
|
|
21
|
+
themes: ThemeName[];
|
|
7
22
|
mounted: boolean;
|
|
8
23
|
setTheme: (theme: ThemeMode) => void;
|
|
9
24
|
toggleTheme: () => void;
|
|
10
25
|
};
|
|
11
|
-
export declare function ThemeProvider({ children }:
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}): React.JSX.Element;
|
|
26
|
+
export declare function ThemeProvider({ children, themes, defaultTheme, forcedTheme, storageKey, enableSystem, attribute, colorSchemes, disableTransitionOnChange, onThemeChange, }: ThemeProviderProps): React.JSX.Element;
|
|
14
27
|
export declare function useTheme(): ThemeContextValue;
|
|
15
28
|
export {};
|
|
@@ -7,7 +7,7 @@ declare const badgeVariants: (props?: ({
|
|
|
7
7
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
dot?: boolean | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
-
type BadgeProps = useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
10
|
+
type BadgeProps = useRender.ComponentProps<"span"> & Omit<VariantProps<typeof badgeVariants>, "dot"> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
count?: React.ReactNode;
|
|
13
13
|
status?: "neutral" | "info" | "success" | "warning" | "danger" | "muted";
|
|
@@ -17,6 +17,12 @@ type BadgeProps = useRender.ComponentProps<"span"> & VariantProps<typeof badgeVa
|
|
|
17
17
|
removeLabel?: string;
|
|
18
18
|
leftIcon?: React.ReactNode;
|
|
19
19
|
rightIcon?: React.ReactNode;
|
|
20
|
+
avatar?: React.ReactNode;
|
|
21
|
+
dot?: boolean | React.ReactNode;
|
|
22
|
+
showDot?: boolean;
|
|
23
|
+
dotPosition?: "start" | "end";
|
|
24
|
+
pulse?: boolean;
|
|
25
|
+
interactive?: boolean;
|
|
20
26
|
};
|
|
21
|
-
declare function Badge({ className, variant, tone, size, dot, label, count, status, removable, selected, onRemove, removeLabel, leftIcon, rightIcon, children, render, onKeyDown, ...props }: BadgeProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
27
|
+
declare function Badge({ className, variant, tone, size, dot, label, count, status, removable, selected, onRemove, removeLabel, leftIcon, rightIcon, avatar, showDot, dotPosition, pulse, interactive, children, render, onKeyDown, ...props }: BadgeProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
22
28
|
export { Badge, badgeVariants, type BadgeProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={default:`bg-primary`,success:`bg-emerald-500`,warning:`bg-amber-500`,danger:`bg-destructive`,info:`bg-blue-500`,muted:`bg-muted-foreground`};function o({className:e,title:r,description:o,actions:s,items:c,empty:l=`No activity yet.`,compact:u=!1,density:d,showConnector:f=!0,connectorClassName:p,contentClassName:m,itemClassName:h,...g}){let _=c.filter(e=>!e.hidden),v=!!(r||o||s),y=d?d===`compact`:u;return(0,i.jsxs)(n.Card,{"data-slot":`activity-feed`,className:t.cn(`min-w-0`,e),...g,children:[v&&(0,i.jsx)(n.CardHeader,{children:(0,i.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r&&(0,i.jsx)(n.CardTitle,{children:r}),o&&(0,i.jsx)(n.CardDescription,{children:o})]}),s&&(0,i.jsx)(`div`,{className:`shrink-0`,children:s})]})}),(0,i.jsx)(n.CardContent,{className:t.cn(`grid gap-0`,m),children:_.length===0?(0,i.jsx)(`div`,{className:`rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground`,children:l}):_.map((e,n)=>{let r=e.interactive??!!(e.href||e.onSelect),o=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:t.cn(`relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border bg-background`,e.unread&&`border-primary/45 bg-primary/8 shadow-[0_0_0_3px_color-mix(in_oklch,var(--primary),transparent_88%)]`),children:e.icon??(0,i.jsx)(`span`,{className:t.cn(`size-2 rounded-full`,a[e.tone??`default`])})}),(0,i.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,i.jsx)(`div`,{className:`min-w-0 text-sm font-medium leading-5 text-foreground`,children:e.title}),e.meta&&(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.meta})]}),(0,i.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e.badge,e.time&&(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.time})]})]}),e.description&&(0,i.jsx)(`div`,{className:`text-sm leading-5 text-muted-foreground`,children:e.description}),e.actions&&(0,i.jsx)(`div`,{className:`pt-1`,children:e.actions})]})]});return(0,i.jsxs)(`div`,{"data-slot":`activity-feed-item`,className:t.cn(`relative flex gap-3 pb-4 last:pb-0`,y&&`gap-2 pb-3`,h,e.className),children:[f&&n<_.length-1&&(0,i.jsx)(`div`,{className:t.cn(`absolute left-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={default:`bg-primary`,success:`bg-emerald-500`,warning:`bg-amber-500`,danger:`bg-destructive`,info:`bg-blue-500`,muted:`bg-muted-foreground`};function o({className:e,title:r,description:o,actions:s,items:c,empty:l=`No activity yet.`,compact:u=!1,density:d,showConnector:f=!0,connectorClassName:p,contentClassName:m,itemClassName:h,...g}){let _=c.filter(e=>!e.hidden),v=!!(r||o||s),y=d?d===`compact`:u;return(0,i.jsxs)(n.Card,{"data-slot":`activity-feed`,className:t.cn(`min-w-0`,e),...g,children:[v&&(0,i.jsx)(n.CardHeader,{children:(0,i.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r&&(0,i.jsx)(n.CardTitle,{children:r}),o&&(0,i.jsx)(n.CardDescription,{children:o})]}),s&&(0,i.jsx)(`div`,{className:`shrink-0`,children:s})]})}),(0,i.jsx)(n.CardContent,{className:t.cn(`grid gap-0`,m),children:_.length===0?(0,i.jsx)(`div`,{className:`rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground`,children:l}):_.map((e,n)=>{let r=e.interactive??!!(e.href||e.onSelect),o=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:t.cn(`relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border bg-background`,e.unread&&`border-primary/45 bg-primary/8 shadow-[0_0_0_3px_color-mix(in_oklch,var(--primary),transparent_88%)]`),children:e.icon??(0,i.jsx)(`span`,{className:t.cn(`size-2 rounded-full`,a[e.tone??`default`])})}),(0,i.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,i.jsx)(`div`,{className:`min-w-0 text-sm font-medium leading-5 text-foreground`,children:e.title}),e.meta&&(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.meta})]}),(0,i.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e.badge,e.time&&(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.time})]})]}),e.description&&(0,i.jsx)(`div`,{className:`text-sm leading-5 text-muted-foreground`,children:e.description}),e.actions&&(0,i.jsx)(`div`,{className:`pt-1`,children:e.actions})]})]});return(0,i.jsxs)(`div`,{"data-slot":`activity-feed-item`,className:t.cn(`relative flex gap-3 pb-4 last:pb-0`,y&&`gap-2 pb-3`,h,e.className),children:[f&&n<_.length-1&&(0,i.jsx)(`div`,{"data-slot":`activity-feed-connector`,className:t.cn(`absolute left-5 top-8 h-[calc(100%-2rem)] w-px bg-border`,p)}),e.href?(0,i.jsx)(`a`,{href:e.href,target:e.target,rel:e.rel,className:t.cn(`flex min-w-0 flex-1 gap-3 rounded-[var(--radius-lg)] px-2 py-1.5 transition-[background-color,border-color,box-shadow]`,r&&`hover:bg-muted/35 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`),children:o}):r?(0,i.jsx)(`button`,{type:`button`,className:`flex min-w-0 flex-1 gap-3 rounded-[var(--radius-lg)] px-2 py-1.5 text-left transition-[background-color,border-color,box-shadow] hover:bg-muted/35 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,onClick:e.onSelect,children:o}):(0,i.jsx)(`div`,{className:`flex min-w-0 flex-1 gap-3 px-2 py-1.5`,children:o})]},e.id)})})]})}exports.ActivityFeed=o;
|
|
@@ -70,7 +70,10 @@ function u({ className: u, title: d, description: f, actions: p, items: m, empty
|
|
|
70
70
|
return /* @__PURE__ */ c("div", {
|
|
71
71
|
"data-slot": "activity-feed-item",
|
|
72
72
|
className: e("relative flex gap-3 pb-4 last:pb-0", T && "gap-2 pb-3", x, t.className),
|
|
73
|
-
children: [v && n < C.length - 1 && /* @__PURE__ */ s("div", {
|
|
73
|
+
children: [v && n < C.length - 1 && /* @__PURE__ */ s("div", {
|
|
74
|
+
"data-slot": "activity-feed-connector",
|
|
75
|
+
className: e("absolute left-5 top-8 h-[calc(100%-2rem)] w-px bg-border", y)
|
|
76
|
+
}), t.href ? /* @__PURE__ */ s("a", {
|
|
74
77
|
href: t.href,
|
|
75
78
|
target: t.target,
|
|
76
79
|
rel: t.rel,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/badge/index.cjs"),i=require("../ui/textarea/index.cjs"),a=require("../ui/input/index.cjs"),o=require("./avatar.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("lucide-react"),l=require("react/jsx-runtime");function u({sidebar:e,details:n,children:r,className:i,...a}){return(0,l.jsxs)(`section`,{"data-slot":`chat-shell`,className:t.cn(`grid min-h-[34rem] overflow-hidden rounded-lg border bg-background shadow-sm lg:grid-cols-[18rem_minmax(0,1fr)]`,n&&`xl:grid-cols-[18rem_minmax(0,1fr)_17rem]`,i),...a,children:[e?(0,l.jsx)(`aside`,{"data-slot":`chat-sidebar`,className:`min-h-0 border-b lg:border-b-0 lg:border-r`,children:e}):null,(0,l.jsx)(`div`,{"data-slot":`chat-main`,className:`grid min-h-0 min-w-0 grid-rows-[auto_minmax(0,1fr)_auto]`,children:r}),n?(0,l.jsx)(`aside`,{"data-slot":`chat-details`,className:`hidden min-h-0 border-l xl:block`,children:n}):null]})}function d({participant:e,description:n,actions:r,className:i,...a}){return(0,l.jsxs)(`header`,{"data-slot":`chat-header`,className:t.cn(`flex min-h-16 items-center gap-3 border-b px-4 py-2.5`,i),...a,children:[(0,l.jsx)(o.Avatar,{size:`sm`,name:e.name,src:e.avatar,fallback:e.fallback,status:e.status}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,l.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:n??(e.status===`online`?`Online`:e.status)})]}),(0,l.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:r})]})}function f({items:e,selectedKey:n,defaultSelectedKey:i,onSelect:u,searchable:d=!0,searchPlaceholder:f=`Search conversations...`,empty:p=`No conversations found.`,className:m,...h}){let[g,_]=s.useState(i),[v,y]=s.useState(``),b=n??g,x=e.filter(e=>`${e.participant.name} ${String(e.preview??``)}`.toLowerCase().includes(v.trim().toLowerCase()));return(0,l.jsxs)(`div`,{"data-slot":`conversation-list`,className:t.cn(`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]`,m),...h,children:[d?(0,l.jsx)(`div`,{className:`border-b p-3`,children:(0,l.jsx)(a.Input,{type:`search`,value:v,onValueChange:y,placeholder:f,leading:(0,l.jsx)(c.SearchIcon,{}),clearable:!0,"aria-label":f})}):(0,l.jsx)(`span`,{}),(0,l.jsx)(`div`,{role:`listbox`,"aria-label":`Conversations`,className:`min-h-0 overflow-y-auto p-2`,children:x.length?x.map(e=>{let t=e.key===b;return(0,l.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,"data-selected":t||void 0,className:`flex w-full items-start gap-3 rounded-md px-2.5 py-2.5 text-left outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring data-[selected=true]:bg-accent`,onClick:()=>{n===void 0&&_(e.key),u?.(e)},children:[(0,l.jsx)(o.Avatar,{size:`sm`,name:e.participant.name,src:e.participant.avatar,fallback:e.participant.fallback,status:e.participant.status}),(0,l.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,l.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.participant.name}),(0,l.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:e.time})]}),(0,l.jsxs)(`span`,{className:`mt-0.5 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:e.preview}),e.unread?(0,l.jsx)(r.Badge,{size:`sm`,label:e.unread}):null]})]})]},e.key)}):(0,l.jsx)(`div`,{className:`grid min-h-32 place-items-center px-4 text-center text-sm text-muted-foreground`,children:p})})]})}function p({autoScroll:e=!0,empty:n=`No messages yet.`,children:r,className:i,...a}){let o=s.useRef(null);return s.useEffect(()=>{let t=o.current;!e||!t||(typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:`smooth`}):t.scrollTop=t.scrollHeight)},[e,r]),(0,l.jsx)(`div`,{ref:o,"data-slot":`chat-message-list`,role:`log`,"aria-live":`polite`,className:t.cn(`min-h-0 overflow-y-auto bg-muted/15 px-4 py-5`,i),...a,children:s.Children.count(r)?(0,l.jsx)(`div`,{className:`mx-auto grid w-full max-w-3xl gap-4`,children:r}):(0,l.jsx)(`div`,{className:`grid h-full place-items-center text-sm text-muted-foreground`,children:n})})}function m({name:e,size:r,type:i,href:a,preview:o,onRemove:s,attachmentKey:u,className:d,...f}){let p=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center overflow-hidden rounded-md bg-muted`,children:o?(0,l.jsx)(`img`,{src:o,alt:``,className:`size-full object-cover`}):(0,l.jsx)(c.FileIcon,{className:`size-4`})}),(0,l.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:e}),(0,l.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:[i,r].filter(Boolean).join(` · `)})]})]});return(0,l.jsxs)(`div`,{"data-slot":`chat-attachment`,className:t.cn(`flex min-w-0 items-center gap-2 rounded-md border bg-background p-2`,d),...f,children:[a?(0,l.jsx)(`a`,{href:a,className:`flex min-w-0 flex-1 items-center gap-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:p}):p,s?(0,l.jsx)(n.Button,{type:`button`,size:`icon-xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Remove ${e}`,onClick:s,children:(0,l.jsx)(c.XIcon,{})}):null]})}function h({participant:e,outgoing:n=!1,time:r,status:i,replyTo:a,attachments:s,reactions:u,onReaction:d,actions:f,children:p,className:h,...g}){let _=i===`delivered`||i===`read`?c.CheckCheckIcon:c.CheckIcon;return(0,l.jsxs)(`article`,{"data-slot":`chat-message`,"data-outgoing":n||void 0,className:t.cn(`group flex max-w-[88%] items-end gap-2 justify-self-start data-[outgoing=true]:justify-self-end data-[outgoing=true]:flex-row-reverse sm:max-w-[75%]`,h),...g,children:[e?(0,l.jsx)(o.Avatar,{size:`xs`,name:e.name,src:e.avatar,fallback:e.fallback}):null,(0,l.jsxs)(`div`,{className:`min-w-0`,children:[e&&!n?(0,l.jsx)(`div`,{className:`mb-1 px-1 text-[11px] font-medium text-muted-foreground`,children:e.name}):null,(0,l.jsxs)(`div`,{className:t.cn(`rounded-lg rounded-bl-sm border bg-background px-3 py-2 text-sm leading-5 shadow-sm`,n&&`rounded-bl-lg rounded-br-sm border-primary bg-primary text-primary-foreground`),children:[a?(0,l.jsx)(`div`,{className:t.cn(`mb-2 border-l-2 pl-2 text-xs opacity-75`,n?`border-primary-foreground/60`:`border-primary`),children:a}):null,(0,l.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:p}),s?.length?(0,l.jsx)(`div`,{className:`mt-2 grid gap-1.5`,children:s.map(({key:e,...t})=>(0,l.jsx)(m,{attachmentKey:e,...t,className:n?`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`:void 0},e))}):null,(0,l.jsxs)(`div`,{className:t.cn(`mt-1 flex items-center justify-end gap-1 text-[10px] text-muted-foreground`,n&&`text-primary-foreground/75`),children:[(0,l.jsx)(`span`,{children:r}),i&&i!==`failed`&&i!==`sending`?(0,l.jsx)(_,{className:t.cn(`size-3`,i===`read`&&`text-sky-300`)}):null,i===`sending`?(0,l.jsx)(`span`,{children:`Sending...`}):null,i===`failed`?(0,l.jsx)(`span`,{className:`font-medium text-destructive`,children:`Failed`}):null]})]}),u?.length?(0,l.jsx)(`div`,{className:t.cn(`mt-1 flex flex-wrap gap-1`,n&&`justify-end`),children:u.map(e=>(0,l.jsxs)(`button`,{type:`button`,"aria-pressed":e.active,className:`rounded-full border bg-background px-2 py-0.5 text-[11px] shadow-sm outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-primary aria-pressed:bg-primary/10`,onClick:()=>d?.(e.key),children:[e.label,e.count?` ${e.count}`:``]},e.key))}):null]}),f?(0,l.jsx)(`div`,{className:`self-center opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`,children:f}):null]})}function g({participant:e,className:n,...r}){return(0,l.jsxs)(`div`,{"data-slot":`chat-typing`,className:t.cn(`flex items-center gap-2 text-xs text-muted-foreground`,n),...r,children:[e?(0,l.jsx)(o.Avatar,{size:`xs`,name:e.name,src:e.avatar,fallback:e.fallback}):null,(0,l.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full border bg-background px-3 py-2`,children:[(0,l.jsx)(`span`,{className:`size-1.5 animate-bounce rounded-full bg-current [animation-delay:-0.2s]`}),(0,l.jsx)(`span`,{className:`size-1.5 animate-bounce rounded-full bg-current [animation-delay:-0.1s]`}),(0,l.jsx)(`span`,{className:`size-1.5 animate-bounce rounded-full bg-current`})]})]})}function _({value:e,defaultValue:r=``,onValueChange:a,onSend:o,placeholder:u=`Write a message...`,disabled:d=!1,sending:f=!1,attachments:p,onRemoveAttachment:h,onAttachmentClick:g,onEmojiClick:_,maxLength:v,submitLabel:y=`Send message`,className:b,...x}){let[S,C]=s.useState(r),w=e??S,T=t=>{e===void 0&&C(t),a?.(t)},E=async()=>{let e=w.trim();!e||d||f||(await o(e),T(``))};return(0,l.jsxs)(`form`,{"data-slot":`chat-composer`,className:t.cn(`border-t bg-background p-3`,b),onSubmit:e=>{e.preventDefault(),E()},...x,children:[p?.length?(0,l.jsx)(`div`,{className:`mb-2 grid gap-2 sm:grid-cols-2`,children:p.map(({key:e,...t})=>(0,l.jsx)(m,{attachmentKey:e,...t,onRemove:h?()=>h(e):void 0},e))}):null,(0,l.jsxs)(`div`,{className:`flex items-end gap-2 rounded-lg border bg-background p-1.5 shadow-sm transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20`,children:[g?(0,l.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Attach file`,onClick:g,children:(0,l.jsx)(c.PaperclipIcon,{})}):null,(0,l.jsx)(i.Textarea,{value:w,onValueChange:T,rows:1,maxLength:v,disabled:d,placeholder:u,"aria-label":u,className:`max-h-36 min-h-9 resize-none border-0 bg-transparent px-2 py-2 font-normal shadow-none focus-visible:shadow-none`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),E())}}),_?(0,l.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Choose emoji`,onClick:_,children:(0,l.jsx)(c.SmileIcon,{})}):null,(0,l.jsx)(n.Button,{type:`submit`,size:`icon-sm`,iconOnly:!0,"aria-label":y,loading:f,disabled:d||!w.trim(),children:(0,l.jsx)(c.SendIcon,{})})]})]})}function v(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.Button,{size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Search conversation`,children:(0,l.jsx)(c.SearchIcon,{})}),(0,l.jsx)(n.Button,{size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":`More conversation actions`,children:(0,l.jsx)(c.MoreHorizontalIcon,{})})]})}exports.ChatAttachment=m,exports.ChatComposer=_,exports.ChatHeader=d,exports.ChatHeaderActions=v,exports.ChatMessage=h,exports.ChatMessageList=p,exports.ChatShell=u,exports.ChatTypingIndicator=g,exports.ConversationList=f;
|