@neuronection/assistant-ui 0.5.0 → 0.7.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 +37 -0
- package/README.md +4 -0
- package/dist/ai-magic-fill.d.ts +20 -0
- package/dist/ai-magic-fill.js +3 -0
- package/dist/ai-magic-fill.js.map +1 -0
- package/dist/{chunk-BUPMDOVL.js → chunk-2EPZAT3X.js} +2 -2
- package/dist/{chunk-BUPMDOVL.js.map → chunk-2EPZAT3X.js.map} +1 -1
- package/dist/chunk-AHLNXCP2.js +74 -0
- package/dist/chunk-AHLNXCP2.js.map +1 -0
- package/dist/chunk-C74WWM23.js +38 -0
- package/dist/chunk-C74WWM23.js.map +1 -0
- package/dist/chunk-FE26R5RN.js +63 -0
- package/dist/chunk-FE26R5RN.js.map +1 -0
- package/dist/chunk-HTXTVWVG.js +3 -0
- package/dist/chunk-HTXTVWVG.js.map +1 -0
- package/dist/chunk-I2RXO6ZU.js +74 -0
- package/dist/chunk-I2RXO6ZU.js.map +1 -0
- package/dist/chunk-IQKP2BWE.js +78 -0
- package/dist/chunk-IQKP2BWE.js.map +1 -0
- package/dist/chunk-J4OELYDR.js +125 -0
- package/dist/chunk-J4OELYDR.js.map +1 -0
- package/dist/{chunk-COPPAHR5.js → chunk-M4V7XHL7.js} +2 -2
- package/dist/chunk-M4V7XHL7.js.map +1 -0
- package/dist/chunk-PSAJSOXL.js +3 -0
- package/dist/chunk-PSAJSOXL.js.map +1 -0
- package/dist/chunk-RJSN4TVT.js +89 -0
- package/dist/chunk-RJSN4TVT.js.map +1 -0
- package/dist/chunk-RLFND34I.js +3 -0
- package/dist/chunk-RLFND34I.js.map +1 -0
- package/dist/chunk-UWHUCQC6.js +73 -0
- package/dist/chunk-UWHUCQC6.js.map +1 -0
- package/dist/chunk-VKV464ZF.js +3 -0
- package/dist/chunk-VKV464ZF.js.map +1 -0
- package/dist/chunk-W2HORE44.js +92 -0
- package/dist/chunk-W2HORE44.js.map +1 -0
- package/dist/{chunk-W5WDGME5.js → chunk-XHHEAJHN.js} +8 -5
- package/dist/chunk-XHHEAJHN.js.map +1 -0
- package/dist/combobox.d.ts +1 -0
- package/dist/combobox.js +1 -1
- package/dist/connection-test-row.d.ts +23 -0
- package/dist/connection-test-row.js +3 -0
- package/dist/connection-test-row.js.map +1 -0
- package/dist/file-card.d.ts +25 -0
- package/dist/file-card.js +3 -0
- package/dist/file-card.js.map +1 -0
- package/dist/file-queue.d.ts +32 -0
- package/dist/file-queue.js +3 -0
- package/dist/file-queue.js.map +1 -0
- package/dist/form-modal.js +1 -1
- package/dist/index.d.ts +31 -2
- package/dist/index.js +151 -12
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +2 -2
- package/dist/input.js +1 -1
- package/dist/model-picker.d.ts +38 -0
- package/dist/model-picker.js +3 -0
- package/dist/model-picker.js.map +1 -0
- package/dist/provider-form.d.ts +31 -0
- package/dist/provider-form.js +3 -0
- package/dist/provider-form.js.map +1 -0
- package/dist/settings-shell.d.ts +24 -0
- package/dist/settings-shell.js +3 -0
- package/dist/settings-shell.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/task-assignment-picker.d.ts +27 -0
- package/dist/task-assignment-picker.js +3 -0
- package/dist/task-assignment-picker.js.map +1 -0
- package/dist/textarea.d.ts +10 -0
- package/dist/textarea.js +3 -0
- package/dist/textarea.js.map +1 -0
- package/package.json +38 -2
- package/dist/chunk-COPPAHR5.js.map +0 -1
- package/dist/chunk-W5WDGME5.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type ConnectionTestStatus = 'idle' | 'testing' | 'ok' | 'fail';
|
|
4
|
+
interface ConnectionTestRowProps {
|
|
5
|
+
status: ConnectionTestStatus;
|
|
6
|
+
latencyMs?: number | null;
|
|
7
|
+
label?: string;
|
|
8
|
+
testLabel?: string;
|
|
9
|
+
okLabel?: string;
|
|
10
|
+
failLabel?: string;
|
|
11
|
+
latencyLabel?: string;
|
|
12
|
+
errorMessage?: string | null;
|
|
13
|
+
onTest?: () => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Presentational connection-test row (idle/testing/ok/fail + latency).
|
|
19
|
+
* The actual ping is app-side: flip `status` from the test handler.
|
|
20
|
+
*/
|
|
21
|
+
declare const ConnectionTestRow: React.ForwardRefExoticComponent<ConnectionTestRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
|
|
23
|
+
export { ConnectionTestRow, type ConnectionTestRowProps, type ConnectionTestStatus };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"connection-test-row.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type FileCardStatus = 'queued' | 'processing' | 'done' | 'failed';
|
|
4
|
+
declare function formatBytes(bytes: number): string;
|
|
5
|
+
interface FileCardProps {
|
|
6
|
+
name: string;
|
|
7
|
+
sizeBytes?: number;
|
|
8
|
+
status?: FileCardStatus;
|
|
9
|
+
error?: string | null;
|
|
10
|
+
/** Small preview URL (app owns object-URL lifecycle). */
|
|
11
|
+
thumbnailUrl?: string | null;
|
|
12
|
+
included?: boolean;
|
|
13
|
+
onToggleInclude?: () => void;
|
|
14
|
+
onRemove?: () => void;
|
|
15
|
+
onOpen?: () => void;
|
|
16
|
+
draggable?: boolean;
|
|
17
|
+
onDragStart?: () => void;
|
|
18
|
+
onDragEnd?: () => void;
|
|
19
|
+
removeLabel?: string;
|
|
20
|
+
includeLabel?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const FileCard: React.ForwardRefExoticComponent<FileCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
|
|
25
|
+
export { FileCard, type FileCardProps, type FileCardStatus, formatBytes };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"file-card.js"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FileCardStatus } from './file-card.js';
|
|
3
|
+
|
|
4
|
+
interface FileQueueItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
sizeBytes?: number;
|
|
8
|
+
status?: FileCardStatus;
|
|
9
|
+
error?: string | null;
|
|
10
|
+
thumbnailUrl?: string | null;
|
|
11
|
+
included?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface FileQueueProps {
|
|
14
|
+
files: FileQueueItem[];
|
|
15
|
+
onRemove?: (id: string) => void;
|
|
16
|
+
onToggleInclude?: (id: string) => void;
|
|
17
|
+
onOpen?: (id: string) => void;
|
|
18
|
+
onReorder?: (fromId: string, toId: string) => void;
|
|
19
|
+
reorderable?: boolean;
|
|
20
|
+
emptyText?: string;
|
|
21
|
+
summary?: React.ReactNode;
|
|
22
|
+
removeLabel?: string;
|
|
23
|
+
includeLabel?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* FileCard grid with aggregate summary and optional drag-to-reorder
|
|
28
|
+
* (reports intent via `onReorder(fromId, toId)` — the app owns ordering).
|
|
29
|
+
*/
|
|
30
|
+
declare const FileQueue: React.ForwardRefExoticComponent<FileQueueProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
|
|
32
|
+
export { FileQueue, type FileQueueItem, type FileQueueProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"file-queue.js"}
|
package/dist/form-modal.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
2
|
export { ClassValue } from 'clsx';
|
|
3
3
|
export { RawTokenName, SemanticTokenName, ThemeTokenName, ThemeTokens, rawTokens, semanticTokens } from './tokens.js';
|
|
4
|
+
export { FileCard, FileCardProps, FileCardStatus, formatBytes } from './file-card.js';
|
|
5
|
+
export { FileQueue, FileQueueItem, FileQueueProps } from './file-queue.js';
|
|
4
6
|
export { Portal, PortalProps } from './portal.js';
|
|
7
|
+
import * as React from 'react';
|
|
5
8
|
export { ThemeScope, ThemeScopeProps } from './theme-scope.js';
|
|
6
9
|
export { AiAction, AiActionsDropdown, AiActionsDropdownProps } from './ai-actions-dropdown.js';
|
|
7
10
|
export { AiButton, AiButtonProps } from './ai-button.js';
|
|
11
|
+
export { AiMagicFill, AiMagicFillProps } from './ai-magic-fill.js';
|
|
8
12
|
export { Badge, BadgeProps, badgeVariants } from './badge.js';
|
|
9
13
|
export { BreadcrumbItem, BreadcrumbLinkProps, Breadcrumbs, BreadcrumbsProps } from './breadcrumbs.js';
|
|
10
14
|
export { Button, ButtonProps, buttonVariants } from './button.js';
|
|
15
|
+
export { ConnectionTestRow, ConnectionTestRowProps, ConnectionTestStatus } from './connection-test-row.js';
|
|
16
|
+
export { ProviderForm, ProviderFormProps } from './provider-form.js';
|
|
17
|
+
export { SettingsNavItem, SettingsShell, SettingsShellProps } from './settings-shell.js';
|
|
11
18
|
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './card.js';
|
|
12
19
|
export { CheckIndicator, CheckIndicatorProps } from './check-indicator.js';
|
|
13
20
|
export { ChipInput, ChipInputProps } from './chip-input.js';
|
|
@@ -32,14 +39,15 @@ export { PopoverButton, PopoverButtonProps } from './popover-button.js';
|
|
|
32
39
|
export { RangeBar, RangeBarProps } from './range-bar.js';
|
|
33
40
|
export { ScaleSlider, ScaleSliderProps, scaleColorForValue } from './scale-slider.js';
|
|
34
41
|
export { SearchInput, SearchInputProps } from './search-input.js';
|
|
42
|
+
export { ModelPicker, ModelPickerModel, ModelPickerProps, ModelPickerProvider } from './model-picker.js';
|
|
35
43
|
export { SelectionBar, SelectionBarProps } from './selection-bar.js';
|
|
36
44
|
export { Spinner, SpinnerProps } from './spinner.js';
|
|
45
|
+
export { TaskAssignmentPicker, TaskAssignmentPickerProps, TaskAssignmentTask } from './task-assignment-picker.js';
|
|
37
46
|
export { Table, TableProps } from './table.js';
|
|
38
47
|
export { InfoTooltip, InfoTooltipProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip.js';
|
|
39
48
|
export { UndoNotice, UndoNoticeProps } from './undo-notice.js';
|
|
40
49
|
export { ViewToggle, ViewToggleProps, ViewToggleView } from './view-toggle.js';
|
|
41
50
|
export { Stepper, StepperProps, StepperStep, Wizard, WizardContext, WizardProps, WizardStep } from './wizard.js';
|
|
42
|
-
import 'react';
|
|
43
51
|
import 'lucide-react';
|
|
44
52
|
import 'class-variance-authority/types';
|
|
45
53
|
import 'class-variance-authority';
|
|
@@ -50,4 +58,25 @@ import '@radix-ui/react-tooltip';
|
|
|
50
58
|
|
|
51
59
|
declare function cn(...inputs: ClassValue[]): string;
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
interface UploadDropzoneProps {
|
|
62
|
+
onFiles: (files: File[]) => void;
|
|
63
|
+
uploading?: boolean;
|
|
64
|
+
variant?: 'block' | 'row';
|
|
65
|
+
label?: string;
|
|
66
|
+
hint?: string;
|
|
67
|
+
browseLabel?: string;
|
|
68
|
+
folderLabel?: string;
|
|
69
|
+
accept?: string;
|
|
70
|
+
multiple?: boolean;
|
|
71
|
+
allowFolders?: boolean;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Presentational dropzone: drag events and file-picker results go out via
|
|
77
|
+
* `onFiles` — uploading, storage and progress stay app-side. Pass
|
|
78
|
+
* `uploading` to render a busy state and suppress input.
|
|
79
|
+
*/
|
|
80
|
+
declare const UploadDropzone: React.ForwardRefExoticComponent<UploadDropzoneProps & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
|
|
82
|
+
export { UploadDropzone, type UploadDropzoneProps, cn };
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,182 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Stepper, Wizard } from './chunk-75QQR2VT.js';
|
|
2
2
|
export { Table } from './chunk-5LRRVD27.js';
|
|
3
|
+
export { TaskAssignmentPicker } from './chunk-W2HORE44.js';
|
|
4
|
+
export { SettingsShell } from './chunk-AHLNXCP2.js';
|
|
3
5
|
export { ThemeScope } from './chunk-TGU3PKNM.js';
|
|
4
6
|
export { InfoTooltip, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-34NO2UOB.js';
|
|
5
7
|
export { UndoNotice } from './chunk-OUHUVACM.js';
|
|
6
8
|
export { ViewToggle } from './chunk-MXOBOS4Y.js';
|
|
7
|
-
export { Stepper, Wizard } from './chunk-75QQR2VT.js';
|
|
8
|
-
export { PanelModal } from './chunk-BWPNEQ3T.js';
|
|
9
9
|
export { Portal } from './chunk-7YLR4AGA.js';
|
|
10
|
+
export { ProviderForm } from './chunk-RJSN4TVT.js';
|
|
10
11
|
export { RangeBar } from './chunk-5AVBKEDQ.js';
|
|
11
12
|
export { ScaleSlider, scaleColorForValue } from './chunk-UIUALJNR.js';
|
|
12
13
|
export { SearchInput } from './chunk-H5U4KNXF.js';
|
|
14
|
+
export { SelectionBar } from './chunk-HSUCCANX.js';
|
|
15
|
+
export { Input } from './chunk-M4V7XHL7.js';
|
|
16
|
+
export { MarqueeBand, MarqueeSurface, hitTestIds, marqueeRect, rectsIntersect, useMarquee } from './chunk-RU3DEF2O.js';
|
|
17
|
+
export { ModelPicker } from './chunk-FE26R5RN.js';
|
|
18
|
+
export { PanelModal } from './chunk-BWPNEQ3T.js';
|
|
19
|
+
export { ContextMenu } from './chunk-WA7Q4TTA.js';
|
|
20
|
+
export { ActionMenu, Menu, MenuContent, MenuGroup, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from './chunk-JWAX2AOO.js';
|
|
21
|
+
export { DatePicker } from './chunk-UU2V5FGF.js';
|
|
13
22
|
export { EmptyState } from './chunk-KDJLYKR6.js';
|
|
14
23
|
export { ErrorBanner } from './chunk-BJOY3XL7.js';
|
|
15
24
|
export { ExpandableSearch } from './chunk-4SW3ESVI.js';
|
|
25
|
+
export { FileQueue } from './chunk-IQKP2BWE.js';
|
|
26
|
+
export { FileCard, formatBytes } from './chunk-J4OELYDR.js';
|
|
16
27
|
export { FieldLabel } from './chunk-I5J6SDLK.js';
|
|
17
|
-
export { FormModal } from './chunk-BUPMDOVL.js';
|
|
18
28
|
export { InfoButton } from './chunk-OT6EQFMP.js';
|
|
19
29
|
export { PopoverButton } from './chunk-BE3XFZWU.js';
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
30
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-HSWSYEFQ.js';
|
|
31
|
+
export { ConnectionTestRow } from './chunk-UWHUCQC6.js';
|
|
22
32
|
export { CheckIndicator } from './chunk-XE4TFW63.js';
|
|
23
33
|
export { ChipInput } from './chunk-TPLQL62V.js';
|
|
24
34
|
export { ChipList } from './chunk-BN3YHYYL.js';
|
|
25
|
-
export { Combobox, ComboboxMulti } from './chunk-
|
|
35
|
+
export { Combobox, ComboboxMulti } from './chunk-XHHEAJHN.js';
|
|
26
36
|
export { ConfirmationModal } from './chunk-TKKHWO6C.js';
|
|
27
|
-
export { Modal, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, ModalTrigger, modalContentVariants } from './chunk-SXVOJ7WE.js';
|
|
28
37
|
export { CopyButton } from './chunk-CZ2BL2ZL.js';
|
|
29
|
-
export { ContextMenu } from './chunk-WA7Q4TTA.js';
|
|
30
|
-
export { ActionMenu, Menu, MenuContent, MenuGroup, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from './chunk-JWAX2AOO.js';
|
|
31
|
-
export { DatePicker } from './chunk-UU2V5FGF.js';
|
|
32
38
|
export { rawTokens, semanticTokens } from './chunk-GDGKARRB.js';
|
|
33
39
|
export { AiActionsDropdown } from './chunk-I37SYHM7.js';
|
|
34
40
|
export { AiButton } from './chunk-L56KGPGS.js';
|
|
35
41
|
export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger } from './chunk-SIIY2EGI.js';
|
|
42
|
+
export { AiMagicFill } from './chunk-I2RXO6ZU.js';
|
|
43
|
+
export { FormModal } from './chunk-2EPZAT3X.js';
|
|
44
|
+
export { Modal, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, ModalTrigger, modalContentVariants } from './chunk-SXVOJ7WE.js';
|
|
36
45
|
export { Badge, badgeVariants } from './chunk-SKTLC2XY.js';
|
|
37
46
|
export { Breadcrumbs } from './chunk-TFS2NUET.js';
|
|
38
47
|
export { Button, buttonVariants } from './chunk-GTXGTQ6F.js';
|
|
39
48
|
export { Spinner } from './chunk-INTST5VG.js';
|
|
40
|
-
|
|
49
|
+
import { cn } from './chunk-BLJWR4ZV.js';
|
|
41
50
|
export { cn } from './chunk-BLJWR4ZV.js';
|
|
51
|
+
import * as React from 'react';
|
|
52
|
+
import { Loader2, FolderUp, Upload } from 'lucide-react';
|
|
53
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
54
|
+
|
|
55
|
+
var UploadDropzone = React.forwardRef(
|
|
56
|
+
function UploadDropzone2({
|
|
57
|
+
onFiles,
|
|
58
|
+
uploading = false,
|
|
59
|
+
variant = "block",
|
|
60
|
+
label = "Drop files here or click to browse",
|
|
61
|
+
hint,
|
|
62
|
+
browseLabel = "Choose files",
|
|
63
|
+
folderLabel = "Choose folder",
|
|
64
|
+
accept,
|
|
65
|
+
multiple = true,
|
|
66
|
+
allowFolders = false,
|
|
67
|
+
disabled = false,
|
|
68
|
+
className
|
|
69
|
+
}, ref) {
|
|
70
|
+
const [dragging, setDragging] = React.useState(false);
|
|
71
|
+
const fileInput = React.useRef(null);
|
|
72
|
+
const folderInput = React.useRef(null);
|
|
73
|
+
const active = !disabled && !uploading;
|
|
74
|
+
const emit = (list) => {
|
|
75
|
+
if (!active || !list || list.length === 0) return;
|
|
76
|
+
onFiles(Array.from(list));
|
|
77
|
+
};
|
|
78
|
+
const input = allowFolders ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
"input",
|
|
81
|
+
{
|
|
82
|
+
ref: fileInput,
|
|
83
|
+
type: "file",
|
|
84
|
+
accept,
|
|
85
|
+
multiple,
|
|
86
|
+
className: "hidden",
|
|
87
|
+
"aria-hidden": true,
|
|
88
|
+
tabIndex: -1,
|
|
89
|
+
onChange: (event) => {
|
|
90
|
+
emit(event.target.files);
|
|
91
|
+
event.target.value = "";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
"input",
|
|
97
|
+
{
|
|
98
|
+
ref: folderInput,
|
|
99
|
+
type: "file",
|
|
100
|
+
multiple: true,
|
|
101
|
+
className: "hidden",
|
|
102
|
+
webkitdirectory: "",
|
|
103
|
+
"aria-hidden": true,
|
|
104
|
+
tabIndex: -1,
|
|
105
|
+
onChange: (event) => {
|
|
106
|
+
emit(event.target.files);
|
|
107
|
+
event.target.value = "";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] }) : /* @__PURE__ */ jsx(
|
|
112
|
+
"input",
|
|
113
|
+
{
|
|
114
|
+
ref: fileInput,
|
|
115
|
+
type: "file",
|
|
116
|
+
accept,
|
|
117
|
+
multiple,
|
|
118
|
+
className: "hidden",
|
|
119
|
+
"aria-hidden": true,
|
|
120
|
+
tabIndex: -1,
|
|
121
|
+
onChange: (event) => {
|
|
122
|
+
emit(event.target.files);
|
|
123
|
+
event.target.value = "";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
128
|
+
input,
|
|
129
|
+
/* @__PURE__ */ jsxs(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
ref,
|
|
133
|
+
"data-as": "upload-dropzone",
|
|
134
|
+
"data-variant": variant,
|
|
135
|
+
"data-dragging": dragging || void 0,
|
|
136
|
+
role: "button",
|
|
137
|
+
tabIndex: active ? 0 : -1,
|
|
138
|
+
"aria-label": label,
|
|
139
|
+
"aria-disabled": disabled || uploading || void 0,
|
|
140
|
+
onClick: () => active && fileInput.current?.click(),
|
|
141
|
+
onKeyDown: (event) => {
|
|
142
|
+
if (active && (event.key === "Enter" || event.key === " ")) {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
fileInput.current?.click();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
onDragOver: (event) => {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
if (active) setDragging(true);
|
|
150
|
+
},
|
|
151
|
+
onDragLeave: () => setDragging(false),
|
|
152
|
+
onDrop: (event) => {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
setDragging(false);
|
|
155
|
+
emit(event.dataTransfer.files);
|
|
156
|
+
},
|
|
157
|
+
className: cn(
|
|
158
|
+
"flex cursor-pointer items-center justify-center gap-3 border border-dashed border-[var(--as-border)] bg-[var(--as-surface)] text-[var(--as-muted-fg)] transition-colors",
|
|
159
|
+
"hover:border-[var(--as-primary)] hover:text-[var(--as-fg)]",
|
|
160
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--as-focus-ring)]",
|
|
161
|
+
variant === "block" ? "rounded-[var(--as-radius-lg)] p-8" : "rounded-[var(--as-radius)] px-4 py-3",
|
|
162
|
+
dragging && "border-[var(--as-primary)] bg-[color-mix(in_srgb,var(--as-primary)_8%,transparent)] text-[var(--as-fg)]",
|
|
163
|
+
uploading && "cursor-progress opacity-70",
|
|
164
|
+
disabled && "pointer-events-none opacity-50",
|
|
165
|
+
className
|
|
166
|
+
),
|
|
167
|
+
children: [
|
|
168
|
+
uploading ? /* @__PURE__ */ jsx(Loader2, { className: "size-5 shrink-0 animate-spin", "aria-hidden": true }) : allowFolders ? /* @__PURE__ */ jsx(FolderUp, { className: "size-5 shrink-0", "aria-hidden": true }) : /* @__PURE__ */ jsx(Upload, { className: "size-5 shrink-0", "aria-hidden": true }),
|
|
169
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
170
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium", role: uploading ? "status" : void 0, children: uploading ? `${browseLabel}\u2026` : dragging ? folderLabel : label }),
|
|
171
|
+
hint ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs", children: hint }) : null
|
|
172
|
+
] })
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
] });
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
export { UploadDropzone };
|
|
42
181
|
//# sourceMappingURL=index.js.map
|
|
43
182
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../src/components/upload-dropzone/UploadDropzone.tsx"],"names":["UploadDropzone"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAM,cAAA,GAAuB,KAAA,CAAA,UAAA;AAAA,EAClC,SAASA,eAAAA,CACP;AAAA,IACE,OAAA;AAAA,IACA,SAAA,GAAY,KAAA;AAAA,IACZ,OAAA,GAAU,OAAA;AAAA,IACV,KAAA,GAAQ,oCAAA;AAAA,IACR,IAAA;AAAA,IACA,WAAA,GAAc,cAAA;AAAA,IACd,WAAA,GAAc,eAAA;AAAA,IACd,MAAA;AAAA,IACA,QAAA,GAAW,IAAA;AAAA,IACX,YAAA,GAAe,KAAA;AAAA,IACf,QAAA,GAAW,KAAA;AAAA,IACX;AAAA,KAEF,GAAA,EACA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EAC5D,CAAA;AAAA,cACC,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,kBAAA,EAAoB,gBAAK,CAAA,GAAU;AAAA,aAAA,EAC7D;AAAA;AAAA;AAAA;AACF,KAAA,EACF,CAAA;AAAA,EAEJ;AACF","file":"index.js","sourcesContent":["import * as React from 'react'\nimport { FolderUp, Loader2, Upload } from 'lucide-react'\nimport { cn } from '../../lib/utils'\n\nexport interface UploadDropzoneProps {\n onFiles: (files: File[]) => void\n uploading?: boolean\n variant?: 'block' | 'row'\n label?: string\n hint?: string\n browseLabel?: string\n folderLabel?: string\n accept?: string\n multiple?: boolean\n allowFolders?: boolean\n disabled?: boolean\n className?: string\n}\n\n/**\n * Presentational dropzone: drag events and file-picker results go out via\n * `onFiles` — uploading, storage and progress stay app-side. Pass\n * `uploading` to render a busy state and suppress input.\n */\nexport const UploadDropzone = React.forwardRef<HTMLDivElement, UploadDropzoneProps>(\n function UploadDropzone(\n {\n onFiles,\n uploading = false,\n variant = 'block',\n label = 'Drop files here or click to browse',\n hint,\n browseLabel = 'Choose files',\n folderLabel = 'Choose folder',\n accept,\n multiple = true,\n allowFolders = false,\n disabled = false,\n className,\n },\n ref,\n ) {\n const [dragging, setDragging] = React.useState(false)\n const fileInput = React.useRef<HTMLInputElement>(null)\n const folderInput = React.useRef<HTMLInputElement>(null)\n\n const active = !disabled && !uploading\n\n const emit = (list: FileList | null) => {\n if (!active || !list || list.length === 0) return\n onFiles(Array.from(list))\n }\n\n const input = allowFolders ? (\n <>\n <input\n ref={fileInput}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n className=\"hidden\"\n aria-hidden\n tabIndex={-1}\n onChange={(event) => {\n emit(event.target.files)\n event.target.value = ''\n }}\n />\n <input\n ref={folderInput}\n type=\"file\"\n multiple\n className=\"hidden\"\n // @ts-expect-error non-standard but universally supported directory picker\n webkitdirectory=\"\"\n aria-hidden\n tabIndex={-1}\n onChange={(event) => {\n emit(event.target.files)\n event.target.value = ''\n }}\n />\n </>\n ) : (\n <input\n ref={fileInput}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n className=\"hidden\"\n aria-hidden\n tabIndex={-1}\n onChange={(event) => {\n emit(event.target.files)\n event.target.value = ''\n }}\n />\n )\n\n return (\n <>\n {input}\n <div\n ref={ref}\n data-as=\"upload-dropzone\"\n data-variant={variant}\n data-dragging={dragging || undefined}\n role=\"button\"\n tabIndex={active ? 0 : -1}\n aria-label={label}\n aria-disabled={disabled || uploading || undefined}\n onClick={() => active && fileInput.current?.click()}\n onKeyDown={(event) => {\n if (active && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n fileInput.current?.click()\n }\n }}\n onDragOver={(event) => {\n event.preventDefault()\n if (active) setDragging(true)\n }}\n onDragLeave={() => setDragging(false)}\n onDrop={(event) => {\n event.preventDefault()\n setDragging(false)\n emit(event.dataTransfer.files)\n }}\n className={cn(\n 'flex cursor-pointer items-center justify-center gap-3 border border-dashed border-[var(--as-border)] bg-[var(--as-surface)] text-[var(--as-muted-fg)] transition-colors',\n 'hover:border-[var(--as-primary)] hover:text-[var(--as-fg)]',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--as-focus-ring)]',\n variant === 'block' ? 'rounded-[var(--as-radius-lg)] p-8' : 'rounded-[var(--as-radius)] px-4 py-3',\n dragging && 'border-[var(--as-primary)] bg-[color-mix(in_srgb,var(--as-primary)_8%,transparent)] text-[var(--as-fg)]',\n uploading && 'cursor-progress opacity-70',\n disabled && 'pointer-events-none opacity-50',\n className,\n )}\n >\n {uploading ? (\n <Loader2 className=\"size-5 shrink-0 animate-spin\" aria-hidden />\n ) : allowFolders ? (\n <FolderUp className=\"size-5 shrink-0\" aria-hidden />\n ) : (\n <Upload className=\"size-5 shrink-0\" aria-hidden />\n )}\n <span className=\"flex min-w-0 flex-col\">\n <span className=\"truncate text-sm font-medium\" role={uploading ? 'status' : undefined}>\n {uploading ? `${browseLabel}…` : dragging ? folderLabel : label}\n </span>\n {hint ? <span className=\"truncate text-xs\">{hint}</span> : null}\n </span>\n </div>\n </>\n )\n },\n)\n"]}
|
package/dist/input.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
interface InputProps extends React.ComponentProps<'input'> {
|
|
4
|
-
label?:
|
|
5
|
-
hint?:
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
hint?: React.ReactNode;
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
8
|
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
package/dist/input.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModelPickerModel {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Short capability chip, e.g. `vision` or `tools`. */
|
|
7
|
+
capability?: string;
|
|
8
|
+
}
|
|
9
|
+
interface ModelPickerProvider {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
models: ModelPickerModel[];
|
|
13
|
+
}
|
|
14
|
+
interface ModelPickerProps {
|
|
15
|
+
providers: ModelPickerProvider[];
|
|
16
|
+
value?: string;
|
|
17
|
+
onChange: (modelId: string) => void;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
searchPlaceholder?: string;
|
|
20
|
+
searchLabel?: string;
|
|
21
|
+
emptyLabel?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
clearable?: boolean;
|
|
25
|
+
clearLabel?: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
panelClassName?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Grouped, searchable provider → model picker. Presentational: the model
|
|
34
|
+
* list comes in via props, selection goes out via `onChange`.
|
|
35
|
+
*/
|
|
36
|
+
declare const ModelPicker: React.ForwardRefExoticComponent<ModelPickerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
|
|
38
|
+
export { ModelPicker, type ModelPickerModel, type ModelPickerProps, type ModelPickerProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"model-picker.js"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ProviderFormProps extends React.ComponentProps<'div'> {
|
|
4
|
+
name: string;
|
|
5
|
+
onNameChange: (value: string) => void;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
onBaseUrlChange: (value: string) => void;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
onApiKeyChange: (value: string) => void;
|
|
10
|
+
namePlaceholder?: string;
|
|
11
|
+
baseUrlPlaceholder?: string;
|
|
12
|
+
nameLabel?: string;
|
|
13
|
+
baseUrlLabel?: string;
|
|
14
|
+
apiKeyLabel?: string;
|
|
15
|
+
/** Hint under the key field; apps mention keyring storage here. */
|
|
16
|
+
apiKeyHelp?: string;
|
|
17
|
+
/** The provider already stores a key (write-only field shows no value). */
|
|
18
|
+
hasStoredKey?: boolean;
|
|
19
|
+
storedKeyLabel?: string;
|
|
20
|
+
keyPlaceholder?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Standard provider credential fields: name, base URL and a **write-only**
|
|
26
|
+
* masked API key (`onChange` only — the library never renders a stored key;
|
|
27
|
+
* keyring/storage is the app's business, ADR-006).
|
|
28
|
+
*/
|
|
29
|
+
declare const ProviderForm: React.ForwardRefExoticComponent<Omit<ProviderFormProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
|
|
31
|
+
export { ProviderForm, type ProviderFormProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"provider-form.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface SettingsNavItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: LucideIcon;
|
|
9
|
+
}
|
|
10
|
+
interface SettingsShellProps {
|
|
11
|
+
nav: SettingsNavItem[];
|
|
12
|
+
active: string;
|
|
13
|
+
onNavigate: (id: string) => void;
|
|
14
|
+
header?: {
|
|
15
|
+
icon?: LucideIcon;
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
navClassName?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const SettingsShell: React.ForwardRefExoticComponent<SettingsShellProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
|
|
24
|
+
export { type SettingsNavItem, SettingsShell, type SettingsShellProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"settings-shell.js"}
|