indas-ui 0.1.1 → 0.1.2
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/cjs/components/chat/index.js +2 -1
- package/dist/cjs/components/chat/multimodal-input.js +8 -3
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/multimodal-input.d.ts +12 -1
- package/dist/components/chat/multimodal-input.js +8 -4
- package/package.json +187 -187
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
// Hosts that want the full assembly compose it themselves: SidePanel (from 'indas-ui/layout') for
|
|
11
11
|
// the conversation rail, Messages for the transcript, MultimodalInput for the composer.
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ChatPromptNavigator = exports.MultimodalInput = exports.Messages = void 0;
|
|
13
|
+
exports.ChatPromptNavigator = exports.DEFAULT_CHAT_ACCEPT = exports.MultimodalInput = exports.Messages = void 0;
|
|
14
14
|
var ai_messages_1 = require("./ai-messages.js");
|
|
15
15
|
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return ai_messages_1.Messages; } });
|
|
16
16
|
var multimodal_input_1 = require("./multimodal-input.js");
|
|
17
17
|
Object.defineProperty(exports, "MultimodalInput", { enumerable: true, get: function () { return multimodal_input_1.MultimodalInput; } });
|
|
18
|
+
Object.defineProperty(exports, "DEFAULT_CHAT_ACCEPT", { enumerable: true, get: function () { return multimodal_input_1.DEFAULT_CHAT_ACCEPT; } });
|
|
18
19
|
var chat_prompt_navigator_1 = require("./chat-prompt-navigator.js");
|
|
19
20
|
Object.defineProperty(exports, "ChatPromptNavigator", { enumerable: true, get: function () { return chat_prompt_navigator_1.ChatPromptNavigator; } });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DEFAULT_CHAT_ACCEPT = void 0;
|
|
4
5
|
exports.MultimodalInput = MultimodalInput;
|
|
5
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
/**
|
|
@@ -11,7 +12,9 @@ const react_1 = require("react");
|
|
|
11
12
|
const lucide_react_1 = require("lucide-react");
|
|
12
13
|
const utils_1 = require("../../lib/utils.js");
|
|
13
14
|
const LanguageContext_1 = require("../../contexts/LanguageContext.js");
|
|
14
|
-
|
|
15
|
+
/** What the paperclip offers when the host does not say: images, PDFs and documents. */
|
|
16
|
+
exports.DEFAULT_CHAT_ACCEPT = 'image/*,application/pdf,.doc,.docx,.txt';
|
|
17
|
+
function MultimodalInput({ onSubmit, onStop, isLoading = false, placeholder = 'Send a message...', allowFileUpload = true, accept = exports.DEFAULT_CHAT_ACCEPT, multiple = true, attachLabel = 'Attach file', compact = false, disabled = false, disabledReason }) {
|
|
15
18
|
// Optional: the composer is exported for host apps that have no LanguageProvider, and falls
|
|
16
19
|
// back to the English source text rather than throwing.
|
|
17
20
|
const { t } = (0, LanguageContext_1.useOptionalLanguage)();
|
|
@@ -104,12 +107,14 @@ function MultimodalInput({ onSubmit, onStop, isLoading = false, placeholder = 'S
|
|
|
104
107
|
};
|
|
105
108
|
const handleFileSelect = (e) => {
|
|
106
109
|
const selectedFiles = Array.from(e.target.files || []);
|
|
107
|
-
setFiles(prev => [...prev, ...selectedFiles]);
|
|
110
|
+
setFiles(prev => (multiple ? [...prev, ...selectedFiles] : selectedFiles.slice(0, 1)));
|
|
111
|
+
// Cleared so picking the same file again (after removing it) still fires a change.
|
|
112
|
+
e.target.value = '';
|
|
108
113
|
};
|
|
109
114
|
const removeFile = (index) => {
|
|
110
115
|
setFiles(prev => prev.filter((_, i) => i !== index));
|
|
111
116
|
};
|
|
112
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-[rgb(var(--bg-surface))] shrink-0", compact ? "px-1 py-1" : "border-t border-[rgb(var(--bd-default))] px-4 py-2.5"), children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-3xl mx-auto", children: [disabled && disabledReason && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/30 text-xs text-amber-700 dark:text-amber-400 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }), (0, jsx_runtime_1.jsx)("span", { children: disabledReason })] })), files.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap gap-2 mb-3", children: files.map((file, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-3 py-2 bg-[rgb(var(--bg-app))] border border-[rgb(var(--bd-default))] rounded-lg text-sm", children: [file.type.startsWith('image/') ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Image, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.FileIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })), (0, jsx_runtime_1.jsx)("span", { className: "text-[rgb(var(--fg-default))] truncate max-w-[150px]", children: file.name }), (0, jsx_runtime_1.jsx)("button", { onClick: () => removeFile(index), className: "text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-3 h-3" }) })] }, index))) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("relative flex items-center gap-1 bg-[rgb(var(--bg-app))]/60 backdrop-blur-xl border border-[rgb(var(--bd-default))] shadow-lg transition-all duration-250 focus-within:border-[rgb(var(--color-primary))] focus-within:shadow-[0_0_0_4px_rgb(var(--color-primary)/0.12),0_20px_25px_-5px_rgba(0,0,0,0.15)] focus-within:-translate-y-px", compact ? "rounded-xl p-1.5" : "rounded-2xl p-2.5"), children: [allowFileUpload && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", multiple:
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-[rgb(var(--bg-surface))] shrink-0", compact ? "px-1 py-1" : "border-t border-[rgb(var(--bd-default))] px-4 py-2.5"), children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-3xl mx-auto", children: [disabled && disabledReason && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/30 text-xs text-amber-700 dark:text-amber-400 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }), (0, jsx_runtime_1.jsx)("span", { children: disabledReason })] })), files.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap gap-2 mb-3", children: files.map((file, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-3 py-2 bg-[rgb(var(--bg-app))] border border-[rgb(var(--bd-default))] rounded-lg text-sm", children: [file.type.startsWith('image/') ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Image, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : /\.(xlsx|xls|csv)$/i.test(file.name) ? ((0, jsx_runtime_1.jsx)(lucide_react_1.FileSpreadsheet, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.FileIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })), (0, jsx_runtime_1.jsx)("span", { className: "text-[rgb(var(--fg-default))] truncate max-w-[150px]", children: file.name }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => removeFile(index), "aria-label": `Remove ${file.name}`, className: "text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-3 h-3" }) })] }, index))) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("relative flex items-center gap-1 bg-[rgb(var(--bg-app))]/60 backdrop-blur-xl border border-[rgb(var(--bd-default))] shadow-lg transition-all duration-250 focus-within:border-[rgb(var(--color-primary))] focus-within:shadow-[0_0_0_4px_rgb(var(--color-primary)/0.12),0_20px_25px_-5px_rgba(0,0,0,0.15)] focus-within:-translate-y-px", compact ? "rounded-xl p-1.5" : "rounded-2xl p-2.5"), children: [allowFileUpload && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", multiple: multiple, accept: accept, onChange: handleFileSelect, className: "hidden" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => fileInputRef.current?.click(), className: "shrink-0 !min-h-0 w-9 h-9 rounded-lg flex items-center justify-center transition-colors text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]", "aria-label": attachLabel, title: attachLabel, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { className: "w-4 h-4" }) })] })), (0, jsx_runtime_1.jsx)("textarea", { ref: textareaRef, "data-chat-input": true, value: input, onChange: (e) => setInput(e.target.value), onKeyDown: handleKeyDown, placeholder: disabled ? t('Conversation closed — start a new chat')
|
|
113
118
|
: isListening ? t('Listening...')
|
|
114
119
|
: placeholder, disabled: isListening || disabled, autoFocus: !disabled, rows: 1, className: (0, utils_1.cn)('flex-1 bg-transparent text-[rgb(var(--fg-default))] placeholder:text-[rgb(var(--fg-muted))]', 'resize-none outline-none text-sm', compact ? 'px-2 py-1.5 max-h-[120px]' : 'px-3 py-2.5 max-h-[200px]', 'overflow-y-auto', disabled && 'cursor-not-allowed') }), speechSupported && ((0, jsx_runtime_1.jsx)("button", { onClick: handleVoiceInput, className: (0, utils_1.cn)('shrink-0 !min-h-0 w-9 h-9 rounded-lg flex items-center justify-center transition-colors', isListening
|
|
115
120
|
? 'text-red-500 bg-red-500/10 animate-pulse'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Messages } from './ai-messages.js';
|
|
2
2
|
export type { SelectableItem } from './ai-messages.js';
|
|
3
|
-
export { MultimodalInput } from './multimodal-input.js';
|
|
3
|
+
export { MultimodalInput, DEFAULT_CHAT_ACCEPT } from './multimodal-input.js';
|
|
4
4
|
export { ChatPromptNavigator } from './chat-prompt-navigator.js';
|
|
5
5
|
export type { Message, Conversation, UIDataEntry, UIDataItem, TokenUsage } from '../../lib/api/ai/types.js';
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
// Hosts that want the full assembly compose it themselves: SidePanel (from 'indas-ui/layout') for
|
|
10
10
|
// the conversation rail, Messages for the transcript, MultimodalInput for the composer.
|
|
11
11
|
export { Messages } from './ai-messages.js';
|
|
12
|
-
export { MultimodalInput } from './multimodal-input.js';
|
|
12
|
+
export { MultimodalInput, DEFAULT_CHAT_ACCEPT } from './multimodal-input.js';
|
|
13
13
|
export { ChatPromptNavigator } from './chat-prompt-navigator.js';
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
/** What the paperclip offers when the host does not say: images, PDFs and documents. */
|
|
2
|
+
export declare const DEFAULT_CHAT_ACCEPT = "image/*,application/pdf,.doc,.docx,.txt";
|
|
1
3
|
interface MultimodalInputProps {
|
|
2
4
|
onSubmit: (text: string, files?: File[]) => void;
|
|
3
5
|
onStop?: () => void;
|
|
4
6
|
isLoading?: boolean;
|
|
5
7
|
placeholder?: string;
|
|
6
8
|
allowFileUpload?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* File types the paperclip offers, as an `<input accept>` list. Defaults to
|
|
11
|
+
* DEFAULT_CHAT_ACCEPT; a host that reads spreadsheets adds `.xlsx,.xls,.csv`.
|
|
12
|
+
*/
|
|
13
|
+
accept?: string;
|
|
14
|
+
/** Allow several files at once. Default true; false keeps one attachment, replacing the last. */
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
/** Screen-reader name of the paperclip. Default "Attach file". */
|
|
17
|
+
attachLabel?: string;
|
|
7
18
|
compact?: boolean;
|
|
8
19
|
disabled?: boolean;
|
|
9
20
|
disabledReason?: string;
|
|
10
21
|
}
|
|
11
|
-
export declare function MultimodalInput({ onSubmit, onStop, isLoading, placeholder, allowFileUpload, compact, disabled, disabledReason }: MultimodalInputProps): import("react").JSX.Element;
|
|
22
|
+
export declare function MultimodalInput({ onSubmit, onStop, isLoading, placeholder, allowFileUpload, accept, multiple, attachLabel, compact, disabled, disabledReason }: MultimodalInputProps): import("react").JSX.Element;
|
|
12
23
|
export {};
|
|
@@ -5,10 +5,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* Chat input with auto-expanding textarea, file upload, and voice input
|
|
6
6
|
*/
|
|
7
7
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
8
|
-
import { Send, Paperclip, Mic, MicOff, X, FileIcon, Image as ImageIcon } from 'lucide-react';
|
|
8
|
+
import { Send, Paperclip, Mic, MicOff, X, FileIcon, FileSpreadsheet, Image as ImageIcon } from 'lucide-react';
|
|
9
9
|
import { cn } from '../../lib/utils.js';
|
|
10
10
|
import { useOptionalLanguage } from '../../contexts/LanguageContext.js';
|
|
11
|
-
|
|
11
|
+
/** What the paperclip offers when the host does not say: images, PDFs and documents. */
|
|
12
|
+
export const DEFAULT_CHAT_ACCEPT = 'image/*,application/pdf,.doc,.docx,.txt';
|
|
13
|
+
export function MultimodalInput({ onSubmit, onStop, isLoading = false, placeholder = 'Send a message...', allowFileUpload = true, accept = DEFAULT_CHAT_ACCEPT, multiple = true, attachLabel = 'Attach file', compact = false, disabled = false, disabledReason }) {
|
|
12
14
|
// Optional: the composer is exported for host apps that have no LanguageProvider, and falls
|
|
13
15
|
// back to the English source text rather than throwing.
|
|
14
16
|
const { t } = useOptionalLanguage();
|
|
@@ -101,12 +103,14 @@ export function MultimodalInput({ onSubmit, onStop, isLoading = false, placehold
|
|
|
101
103
|
};
|
|
102
104
|
const handleFileSelect = (e) => {
|
|
103
105
|
const selectedFiles = Array.from(e.target.files || []);
|
|
104
|
-
setFiles(prev => [...prev, ...selectedFiles]);
|
|
106
|
+
setFiles(prev => (multiple ? [...prev, ...selectedFiles] : selectedFiles.slice(0, 1)));
|
|
107
|
+
// Cleared so picking the same file again (after removing it) still fires a change.
|
|
108
|
+
e.target.value = '';
|
|
105
109
|
};
|
|
106
110
|
const removeFile = (index) => {
|
|
107
111
|
setFiles(prev => prev.filter((_, i) => i !== index));
|
|
108
112
|
};
|
|
109
|
-
return (_jsx("div", { className: cn("bg-[rgb(var(--bg-surface))] shrink-0", compact ? "px-1 py-1" : "border-t border-[rgb(var(--bd-default))] px-4 py-2.5"), children: _jsxs("div", { className: "max-w-3xl mx-auto", children: [disabled && disabledReason && (_jsxs("div", { className: "mb-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/30 text-xs text-amber-700 dark:text-amber-400 flex items-center gap-2", children: [_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }), _jsx("span", { children: disabledReason })] })), files.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mb-3", children: files.map((file, index) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-2 bg-[rgb(var(--bg-app))] border border-[rgb(var(--bd-default))] rounded-lg text-sm", children: [file.type.startsWith('image/') ? (_jsx(ImageIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : (_jsx(FileIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })), _jsx("span", { className: "text-[rgb(var(--fg-default))] truncate max-w-[150px]", children: file.name }), _jsx("button", { onClick: () => removeFile(index), className: "text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] transition-colors", children: _jsx(X, { className: "w-3 h-3" }) })] }, index))) })), _jsxs("div", { className: cn("relative flex items-center gap-1 bg-[rgb(var(--bg-app))]/60 backdrop-blur-xl border border-[rgb(var(--bd-default))] shadow-lg transition-all duration-250 focus-within:border-[rgb(var(--color-primary))] focus-within:shadow-[0_0_0_4px_rgb(var(--color-primary)/0.12),0_20px_25px_-5px_rgba(0,0,0,0.15)] focus-within:-translate-y-px", compact ? "rounded-xl p-1.5" : "rounded-2xl p-2.5"), children: [allowFileUpload && (_jsxs(_Fragment, { children: [_jsx("input", { ref: fileInputRef, type: "file", multiple:
|
|
113
|
+
return (_jsx("div", { className: cn("bg-[rgb(var(--bg-surface))] shrink-0", compact ? "px-1 py-1" : "border-t border-[rgb(var(--bd-default))] px-4 py-2.5"), children: _jsxs("div", { className: "max-w-3xl mx-auto", children: [disabled && disabledReason && (_jsxs("div", { className: "mb-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/30 text-xs text-amber-700 dark:text-amber-400 flex items-center gap-2", children: [_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }), _jsx("span", { children: disabledReason })] })), files.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mb-3", children: files.map((file, index) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-2 bg-[rgb(var(--bg-app))] border border-[rgb(var(--bd-default))] rounded-lg text-sm", children: [file.type.startsWith('image/') ? (_jsx(ImageIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : /\.(xlsx|xls|csv)$/i.test(file.name) ? (_jsx(FileSpreadsheet, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })) : (_jsx(FileIcon, { className: "w-4 h-4 text-[rgb(var(--fg-muted))]" })), _jsx("span", { className: "text-[rgb(var(--fg-default))] truncate max-w-[150px]", children: file.name }), _jsx("button", { type: "button", onClick: () => removeFile(index), "aria-label": `Remove ${file.name}`, className: "text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] transition-colors", children: _jsx(X, { className: "w-3 h-3" }) })] }, index))) })), _jsxs("div", { className: cn("relative flex items-center gap-1 bg-[rgb(var(--bg-app))]/60 backdrop-blur-xl border border-[rgb(var(--bd-default))] shadow-lg transition-all duration-250 focus-within:border-[rgb(var(--color-primary))] focus-within:shadow-[0_0_0_4px_rgb(var(--color-primary)/0.12),0_20px_25px_-5px_rgba(0,0,0,0.15)] focus-within:-translate-y-px", compact ? "rounded-xl p-1.5" : "rounded-2xl p-2.5"), children: [allowFileUpload && (_jsxs(_Fragment, { children: [_jsx("input", { ref: fileInputRef, type: "file", multiple: multiple, accept: accept, onChange: handleFileSelect, className: "hidden" }), _jsx("button", { onClick: () => fileInputRef.current?.click(), className: "shrink-0 !min-h-0 w-9 h-9 rounded-lg flex items-center justify-center transition-colors text-[rgb(var(--fg-muted))] hover:text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-subtle))]", "aria-label": attachLabel, title: attachLabel, children: _jsx(Paperclip, { className: "w-4 h-4" }) })] })), _jsx("textarea", { ref: textareaRef, "data-chat-input": true, value: input, onChange: (e) => setInput(e.target.value), onKeyDown: handleKeyDown, placeholder: disabled ? t('Conversation closed — start a new chat')
|
|
110
114
|
: isListening ? t('Listening...')
|
|
111
115
|
: placeholder, disabled: isListening || disabled, autoFocus: !disabled, rows: 1, className: cn('flex-1 bg-transparent text-[rgb(var(--fg-default))] placeholder:text-[rgb(var(--fg-muted))]', 'resize-none outline-none text-sm', compact ? 'px-2 py-1.5 max-h-[120px]' : 'px-3 py-2.5 max-h-[200px]', 'overflow-y-auto', disabled && 'cursor-not-allowed') }), speechSupported && (_jsx("button", { onClick: handleVoiceInput, className: cn('shrink-0 !min-h-0 w-9 h-9 rounded-lg flex items-center justify-center transition-colors', isListening
|
|
112
116
|
? 'text-red-500 bg-red-500/10 animate-pulse'
|
package/package.json
CHANGED
|
@@ -1,187 +1,187 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "indas-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Indas UI — React component library for business apps: Tailwind design tokens, Radix primitives, Lucide icons, DataGrid, dashboards and charts.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Indas Analytics Pvt Ltd",
|
|
7
|
-
"contributors": [
|
|
8
|
-
"Shreyansh Patidar",
|
|
9
|
-
"Abhinav"
|
|
10
|
-
],
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/ShreyanshPatidar/indas-ui.git",
|
|
14
|
-
"directory": "packages/indas-ui"
|
|
15
|
-
},
|
|
16
|
-
"homepage": "https://shreyanshpatidar.github.io/indas-ui",
|
|
17
|
-
"type": "module",
|
|
18
|
-
"main": "./dist/cjs/index.js",
|
|
19
|
-
"module": "./dist/index.js",
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/index.js",
|
|
25
|
-
"require": "./dist/cjs/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./ui": {
|
|
28
|
-
"types": "./dist/components/ui/index.d.ts",
|
|
29
|
-
"import": "./dist/components/ui/index.js",
|
|
30
|
-
"require": "./dist/cjs/components/ui/index.js"
|
|
31
|
-
},
|
|
32
|
-
"./layout": {
|
|
33
|
-
"types": "./dist/components/layout/index.d.ts",
|
|
34
|
-
"import": "./dist/components/layout/index.js",
|
|
35
|
-
"require": "./dist/cjs/components/layout/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./datagrid": {
|
|
38
|
-
"types": "./dist/components/datagrid/index.d.ts",
|
|
39
|
-
"import": "./dist/components/datagrid/index.js",
|
|
40
|
-
"require": "./dist/cjs/components/datagrid/index.js"
|
|
41
|
-
},
|
|
42
|
-
"./dashboard": {
|
|
43
|
-
"types": "./dist/components/dashboard/index.d.ts",
|
|
44
|
-
"import": "./dist/components/dashboard/index.js",
|
|
45
|
-
"require": "./dist/cjs/components/dashboard/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./charts": {
|
|
48
|
-
"types": "./dist/components/dashboard/charts/index.d.ts",
|
|
49
|
-
"import": "./dist/components/dashboard/charts/index.js",
|
|
50
|
-
"require": "./dist/cjs/components/dashboard/charts/index.js"
|
|
51
|
-
},
|
|
52
|
-
"./kpi": {
|
|
53
|
-
"types": "./dist/components/dashboard/kpi/index.d.ts",
|
|
54
|
-
"import": "./dist/components/dashboard/kpi/index.js",
|
|
55
|
-
"require": "./dist/cjs/components/dashboard/kpi/index.js"
|
|
56
|
-
},
|
|
57
|
-
"./modals": {
|
|
58
|
-
"types": "./dist/components/modals/index.d.ts",
|
|
59
|
-
"import": "./dist/components/modals/index.js",
|
|
60
|
-
"require": "./dist/cjs/components/modals/index.js"
|
|
61
|
-
},
|
|
62
|
-
"./forms": {
|
|
63
|
-
"types": "./dist/components/forms/index.d.ts",
|
|
64
|
-
"import": "./dist/components/forms/index.js",
|
|
65
|
-
"require": "./dist/cjs/components/forms/index.js"
|
|
66
|
-
},
|
|
67
|
-
"./chat": {
|
|
68
|
-
"types": "./dist/components/chat/index.d.ts",
|
|
69
|
-
"import": "./dist/components/chat/index.js",
|
|
70
|
-
"require": "./dist/cjs/components/chat/index.js"
|
|
71
|
-
},
|
|
72
|
-
"./providers": {
|
|
73
|
-
"types": "./dist/providers.d.ts",
|
|
74
|
-
"import": "./dist/providers.js",
|
|
75
|
-
"require": "./dist/cjs/providers.js"
|
|
76
|
-
},
|
|
77
|
-
"./tokens.css": "./dist/styles/tokens.css",
|
|
78
|
-
"./styles/*": "./dist/styles/*",
|
|
79
|
-
"./package.json": "./package.json"
|
|
80
|
-
},
|
|
81
|
-
"files": [
|
|
82
|
-
"dist"
|
|
83
|
-
],
|
|
84
|
-
"sideEffects": [
|
|
85
|
-
"**/*.css"
|
|
86
|
-
],
|
|
87
|
-
"scripts": {
|
|
88
|
-
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths && tsc -p tsconfig.build.cjs.json && tsc-alias -p tsconfig.build.cjs.json --resolve-full-paths && node scripts/copy-assets.mjs",
|
|
89
|
-
"dev": "node scripts/dev.mjs",
|
|
90
|
-
"type-check": "tsc --noEmit",
|
|
91
|
-
"prepublishOnly": "npm run build"
|
|
92
|
-
},
|
|
93
|
-
"peerDependencies": {
|
|
94
|
-
"react": ">=18.0.0",
|
|
95
|
-
"react-dom": ">=18.0.0"
|
|
96
|
-
},
|
|
97
|
-
"dependencies": {
|
|
98
|
-
"@dnd-kit/core": "^6.3.1",
|
|
99
|
-
"@dnd-kit/modifiers": "^9.0.0",
|
|
100
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
101
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
102
|
-
"@microsoft/signalr": "^10.0.0",
|
|
103
|
-
"@radix-ui/react-collapsible": "^1.1.12",
|
|
104
|
-
"@radix-ui/react-dialog": "^1.1.15",
|
|
105
|
-
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
106
|
-
"@radix-ui/react-icons": "^1.3.2",
|
|
107
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
108
|
-
"@radix-ui/react-progress": "^1.1.7",
|
|
109
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
110
|
-
"@radix-ui/react-separator": "^1.1.7",
|
|
111
|
-
"@radix-ui/react-tabs": "^1.1.13",
|
|
112
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
113
|
-
"@tanstack/react-query": "^5.90.10",
|
|
114
|
-
"@tanstack/react-query-devtools": "^5.90.2",
|
|
115
|
-
"@tanstack/react-table": "^8.21.3",
|
|
116
|
-
"@tanstack/react-virtual": "^3.13.12",
|
|
117
|
-
"class-variance-authority": "^0.7.1",
|
|
118
|
-
"clsx": "^2.1.1",
|
|
119
|
-
"echarts": "^6.0.0",
|
|
120
|
-
"echarts-for-react": "^3.0.5",
|
|
121
|
-
"exceljs": "^4.4.0",
|
|
122
|
-
"file-saver": "^2.0.5",
|
|
123
|
-
"framer-motion": "^12.23.12",
|
|
124
|
-
"jspdf": "^3.0.2",
|
|
125
|
-
"jspdf-autotable": "^5.0.2",
|
|
126
|
-
"ldrs": "^1.1.9",
|
|
127
|
-
"lucide-react": "^0.562.0",
|
|
128
|
-
"next-auth": "^4.24.7",
|
|
129
|
-
"papaparse": "^5.5.3",
|
|
130
|
-
"react-hook-form": "^7.76.1",
|
|
131
|
-
"react-image-crop": "^11.0.10",
|
|
132
|
-
"react-markdown": "^10.1.0",
|
|
133
|
-
"rehype-highlight": "^7.0.2",
|
|
134
|
-
"rehype-raw": "^7.0.0",
|
|
135
|
-
"remark-gfm": "^4.0.1",
|
|
136
|
-
"svg2pdf.js": "^2.7.0",
|
|
137
|
-
"tailwind-merge": "^3.3.1"
|
|
138
|
-
},
|
|
139
|
-
"devDependencies": {
|
|
140
|
-
"@types/react": "^18.3.12",
|
|
141
|
-
"@types/react-dom": "^18.3.1",
|
|
142
|
-
"next": "^16.2.1",
|
|
143
|
-
"tsc-alias": "^1.9.4",
|
|
144
|
-
"typescript": "^5.7.2"
|
|
145
|
-
},
|
|
146
|
-
"keywords": [
|
|
147
|
-
"react",
|
|
148
|
-
"components",
|
|
149
|
-
"ui",
|
|
150
|
-
"tailwind",
|
|
151
|
-
"design-system",
|
|
152
|
-
"datagrid",
|
|
153
|
-
"indas",
|
|
154
|
-
"erp"
|
|
155
|
-
],
|
|
156
|
-
"typesVersions": {
|
|
157
|
-
"*": {
|
|
158
|
-
"ui": [
|
|
159
|
-
"./dist/components/ui/index.d.ts"
|
|
160
|
-
],
|
|
161
|
-
"layout": [
|
|
162
|
-
"./dist/components/layout/index.d.ts"
|
|
163
|
-
],
|
|
164
|
-
"datagrid": [
|
|
165
|
-
"./dist/components/datagrid/index.d.ts"
|
|
166
|
-
],
|
|
167
|
-
"dashboard": [
|
|
168
|
-
"./dist/components/dashboard/index.d.ts"
|
|
169
|
-
],
|
|
170
|
-
"charts": [
|
|
171
|
-
"./dist/components/dashboard/charts/index.d.ts"
|
|
172
|
-
],
|
|
173
|
-
"kpi": [
|
|
174
|
-
"./dist/components/dashboard/kpi/index.d.ts"
|
|
175
|
-
],
|
|
176
|
-
"modals": [
|
|
177
|
-
"./dist/components/modals/index.d.ts"
|
|
178
|
-
],
|
|
179
|
-
"forms": [
|
|
180
|
-
"./dist/components/forms/index.d.ts"
|
|
181
|
-
],
|
|
182
|
-
"providers": [
|
|
183
|
-
"./dist/providers.d.ts"
|
|
184
|
-
]
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "indas-ui",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Indas UI — React component library for business apps: Tailwind design tokens, Radix primitives, Lucide icons, DataGrid, dashboards and charts.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Indas Analytics Pvt Ltd",
|
|
7
|
+
"contributors": [
|
|
8
|
+
"Shreyansh Patidar",
|
|
9
|
+
"Abhinav"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/ShreyanshPatidar/indas-ui.git",
|
|
14
|
+
"directory": "packages/indas-ui"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://shreyanshpatidar.github.io/indas-ui",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/cjs/index.js",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/cjs/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./ui": {
|
|
28
|
+
"types": "./dist/components/ui/index.d.ts",
|
|
29
|
+
"import": "./dist/components/ui/index.js",
|
|
30
|
+
"require": "./dist/cjs/components/ui/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./layout": {
|
|
33
|
+
"types": "./dist/components/layout/index.d.ts",
|
|
34
|
+
"import": "./dist/components/layout/index.js",
|
|
35
|
+
"require": "./dist/cjs/components/layout/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./datagrid": {
|
|
38
|
+
"types": "./dist/components/datagrid/index.d.ts",
|
|
39
|
+
"import": "./dist/components/datagrid/index.js",
|
|
40
|
+
"require": "./dist/cjs/components/datagrid/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./dashboard": {
|
|
43
|
+
"types": "./dist/components/dashboard/index.d.ts",
|
|
44
|
+
"import": "./dist/components/dashboard/index.js",
|
|
45
|
+
"require": "./dist/cjs/components/dashboard/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./charts": {
|
|
48
|
+
"types": "./dist/components/dashboard/charts/index.d.ts",
|
|
49
|
+
"import": "./dist/components/dashboard/charts/index.js",
|
|
50
|
+
"require": "./dist/cjs/components/dashboard/charts/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./kpi": {
|
|
53
|
+
"types": "./dist/components/dashboard/kpi/index.d.ts",
|
|
54
|
+
"import": "./dist/components/dashboard/kpi/index.js",
|
|
55
|
+
"require": "./dist/cjs/components/dashboard/kpi/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./modals": {
|
|
58
|
+
"types": "./dist/components/modals/index.d.ts",
|
|
59
|
+
"import": "./dist/components/modals/index.js",
|
|
60
|
+
"require": "./dist/cjs/components/modals/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./forms": {
|
|
63
|
+
"types": "./dist/components/forms/index.d.ts",
|
|
64
|
+
"import": "./dist/components/forms/index.js",
|
|
65
|
+
"require": "./dist/cjs/components/forms/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./chat": {
|
|
68
|
+
"types": "./dist/components/chat/index.d.ts",
|
|
69
|
+
"import": "./dist/components/chat/index.js",
|
|
70
|
+
"require": "./dist/cjs/components/chat/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./providers": {
|
|
73
|
+
"types": "./dist/providers.d.ts",
|
|
74
|
+
"import": "./dist/providers.js",
|
|
75
|
+
"require": "./dist/cjs/providers.js"
|
|
76
|
+
},
|
|
77
|
+
"./tokens.css": "./dist/styles/tokens.css",
|
|
78
|
+
"./styles/*": "./dist/styles/*",
|
|
79
|
+
"./package.json": "./package.json"
|
|
80
|
+
},
|
|
81
|
+
"files": [
|
|
82
|
+
"dist"
|
|
83
|
+
],
|
|
84
|
+
"sideEffects": [
|
|
85
|
+
"**/*.css"
|
|
86
|
+
],
|
|
87
|
+
"scripts": {
|
|
88
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths && tsc -p tsconfig.build.cjs.json && tsc-alias -p tsconfig.build.cjs.json --resolve-full-paths && node scripts/copy-assets.mjs",
|
|
89
|
+
"dev": "node scripts/dev.mjs",
|
|
90
|
+
"type-check": "tsc --noEmit",
|
|
91
|
+
"prepublishOnly": "npm run build"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"react": ">=18.0.0",
|
|
95
|
+
"react-dom": ">=18.0.0"
|
|
96
|
+
},
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"@dnd-kit/core": "^6.3.1",
|
|
99
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
100
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
101
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
102
|
+
"@microsoft/signalr": "^10.0.0",
|
|
103
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
104
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
105
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
106
|
+
"@radix-ui/react-icons": "^1.3.2",
|
|
107
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
108
|
+
"@radix-ui/react-progress": "^1.1.7",
|
|
109
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
110
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
111
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
112
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
113
|
+
"@tanstack/react-query": "^5.90.10",
|
|
114
|
+
"@tanstack/react-query-devtools": "^5.90.2",
|
|
115
|
+
"@tanstack/react-table": "^8.21.3",
|
|
116
|
+
"@tanstack/react-virtual": "^3.13.12",
|
|
117
|
+
"class-variance-authority": "^0.7.1",
|
|
118
|
+
"clsx": "^2.1.1",
|
|
119
|
+
"echarts": "^6.0.0",
|
|
120
|
+
"echarts-for-react": "^3.0.5",
|
|
121
|
+
"exceljs": "^4.4.0",
|
|
122
|
+
"file-saver": "^2.0.5",
|
|
123
|
+
"framer-motion": "^12.23.12",
|
|
124
|
+
"jspdf": "^3.0.2",
|
|
125
|
+
"jspdf-autotable": "^5.0.2",
|
|
126
|
+
"ldrs": "^1.1.9",
|
|
127
|
+
"lucide-react": "^0.562.0",
|
|
128
|
+
"next-auth": "^4.24.7",
|
|
129
|
+
"papaparse": "^5.5.3",
|
|
130
|
+
"react-hook-form": "^7.76.1",
|
|
131
|
+
"react-image-crop": "^11.0.10",
|
|
132
|
+
"react-markdown": "^10.1.0",
|
|
133
|
+
"rehype-highlight": "^7.0.2",
|
|
134
|
+
"rehype-raw": "^7.0.0",
|
|
135
|
+
"remark-gfm": "^4.0.1",
|
|
136
|
+
"svg2pdf.js": "^2.7.0",
|
|
137
|
+
"tailwind-merge": "^3.3.1"
|
|
138
|
+
},
|
|
139
|
+
"devDependencies": {
|
|
140
|
+
"@types/react": "^18.3.12",
|
|
141
|
+
"@types/react-dom": "^18.3.1",
|
|
142
|
+
"next": "^16.2.1",
|
|
143
|
+
"tsc-alias": "^1.9.4",
|
|
144
|
+
"typescript": "^5.7.2"
|
|
145
|
+
},
|
|
146
|
+
"keywords": [
|
|
147
|
+
"react",
|
|
148
|
+
"components",
|
|
149
|
+
"ui",
|
|
150
|
+
"tailwind",
|
|
151
|
+
"design-system",
|
|
152
|
+
"datagrid",
|
|
153
|
+
"indas",
|
|
154
|
+
"erp"
|
|
155
|
+
],
|
|
156
|
+
"typesVersions": {
|
|
157
|
+
"*": {
|
|
158
|
+
"ui": [
|
|
159
|
+
"./dist/components/ui/index.d.ts"
|
|
160
|
+
],
|
|
161
|
+
"layout": [
|
|
162
|
+
"./dist/components/layout/index.d.ts"
|
|
163
|
+
],
|
|
164
|
+
"datagrid": [
|
|
165
|
+
"./dist/components/datagrid/index.d.ts"
|
|
166
|
+
],
|
|
167
|
+
"dashboard": [
|
|
168
|
+
"./dist/components/dashboard/index.d.ts"
|
|
169
|
+
],
|
|
170
|
+
"charts": [
|
|
171
|
+
"./dist/components/dashboard/charts/index.d.ts"
|
|
172
|
+
],
|
|
173
|
+
"kpi": [
|
|
174
|
+
"./dist/components/dashboard/kpi/index.d.ts"
|
|
175
|
+
],
|
|
176
|
+
"modals": [
|
|
177
|
+
"./dist/components/modals/index.d.ts"
|
|
178
|
+
],
|
|
179
|
+
"forms": [
|
|
180
|
+
"./dist/components/forms/index.d.ts"
|
|
181
|
+
],
|
|
182
|
+
"providers": [
|
|
183
|
+
"./dist/providers.d.ts"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|