@homecode/ui 5.17.0 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +2 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +3 -1
- package/dist/esm/src/components/Chat/ChatPrompt.js +21 -15
- package/dist/esm/src/components/Chat/ChatPrompt.styl.js +2 -2
- package/dist/esm/src/components/Chat/ChatSelector.js +89 -0
- package/dist/esm/src/components/Chat/ChatSelector.styl.js +7 -0
- package/dist/esm/src/components/Chat/ChatView.js +2 -1
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js +5 -2
- package/dist/esm/src/components/InputFile/InputFile.js +3 -1
- package/dist/esm/src/components/Resizer/Resizer.helpers.js +58 -0
- package/dist/esm/src/components/Resizer/Resizer.js +120 -0
- package/dist/esm/src/components/Resizer/Resizer.styl.js +7 -0
- package/dist/esm/src/components/Select/Select.styl.js +2 -2
- package/dist/esm/src/components/Select/Select2.js +10 -8
- package/dist/esm/src/components/Tabs/Tabs.js +1 -1
- package/dist/esm/src/components/Tabs/Tabs.styl.js +2 -2
- package/dist/esm/src/components/ThinkingOutline/ThinkingOutline.styl.js +1 -1
- package/dist/esm/types/src/components/Chat/Chat.types.d.ts +28 -2
- package/dist/esm/types/src/components/Chat/ChatPrompt.d.ts +1 -1
- package/dist/esm/types/src/components/Chat/ChatSelector.d.ts +2 -0
- package/dist/esm/types/src/components/Chat/index.d.ts +2 -1
- package/dist/esm/types/src/components/Chat/types.d.ts +1 -1
- package/dist/esm/types/src/components/Resizer/Resizer.d.ts +3 -0
- package/dist/esm/types/src/components/Resizer/Resizer.helpers.d.ts +13 -0
- package/dist/esm/types/src/components/Resizer/Resizer.helpers.test.d.ts +1 -0
- package/dist/esm/types/src/components/Resizer/Resizer.types.d.ts +10 -0
- package/dist/esm/types/src/components/Select/Select.types.d.ts +1 -1
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
|
|
|
9
9
|
export { ChatFormattedText } from './src/components/Chat/ChatFormattedText.js';
|
|
10
10
|
export { ChatMessage } from './src/components/Chat/ChatMessage.js';
|
|
11
11
|
export { ChatPrompt } from './src/components/Chat/ChatPrompt.js';
|
|
12
|
+
export { ChatSelector } from './src/components/Chat/ChatSelector.js';
|
|
12
13
|
export { ChatView } from './src/components/Chat/ChatView.js';
|
|
13
14
|
export { getDisplayContent, getDisplayParts, isPlanMessageContent, parseSystemEvent } from './src/components/Chat/content.js';
|
|
14
15
|
export { Container } from './src/components/Container/Container.js';
|
|
@@ -51,6 +52,7 @@ export { RadioButton } from './src/components/RadioButton/RadioButton.js';
|
|
|
51
52
|
export { RadioGroup } from './src/components/RadioGroup/RadioGroup.js';
|
|
52
53
|
export { Router, RouterContext, RouterStore } from './src/components/Router/Router.js';
|
|
53
54
|
export { RequiredStar } from './src/components/RequiredStar/RequiredStar.js';
|
|
55
|
+
export { Resizer } from './src/components/Resizer/Resizer.js';
|
|
54
56
|
export { Select, SelectHelpers } from './src/components/Select/Select.js';
|
|
55
57
|
export { Select2 } from './src/components/Select/Select2.js';
|
|
56
58
|
export { Scroll } from './src/components/Scroll/Scroll.js';
|
|
@@ -39,6 +39,8 @@ import '../PromptComposer/PromptComposer.js';
|
|
|
39
39
|
import '../Chat/ChatPrompt.styl.js';
|
|
40
40
|
import '../TextShimmer/TextShimmer.js';
|
|
41
41
|
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
42
|
+
import { Menu } from '../Menu/Menu.js';
|
|
43
|
+
import '../Chat/ChatSelector.styl.js';
|
|
42
44
|
import '../Chat/ChatView.styl.js';
|
|
43
45
|
import '../Container/Container.js';
|
|
44
46
|
import '../DatePicker/DatePicker.styl.js';
|
|
@@ -67,7 +69,6 @@ import '@tiptap/core';
|
|
|
67
69
|
import '@tiptap/extension-mention';
|
|
68
70
|
import '@tiptap/pm/state';
|
|
69
71
|
import '@tiptap/react';
|
|
70
|
-
import { Menu } from '../Menu/Menu.js';
|
|
71
72
|
import '../../tiptap/slash-mention/SlashSuggestionList.styl.js';
|
|
72
73
|
import '../../services/i18n.js';
|
|
73
74
|
import '../LightBox/LightBox.styl.js';
|
|
@@ -83,6 +84,7 @@ import '../RadioGroup/RadioGroupContext.js';
|
|
|
83
84
|
import '../RadioButton/RadioButton.styl.js';
|
|
84
85
|
import '../RadioGroup/RadioGroup.styl.js';
|
|
85
86
|
import '../Router/Router.js';
|
|
87
|
+
import '../Resizer/Resizer.styl.js';
|
|
86
88
|
import '../Tabs/Tabs.styl.js';
|
|
87
89
|
import '../TextWithDeferTooltip/TextWithDeferTooltip.styl.js';
|
|
88
90
|
import '../Text/Text.js';
|
|
@@ -13,7 +13,7 @@ import cn from 'classnames';
|
|
|
13
13
|
const DEFAULT_MODELS = [
|
|
14
14
|
{ id: 'auto', label: 'Auto Router' },
|
|
15
15
|
];
|
|
16
|
-
function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, status, promptingLabel = 'Thinking…', placeholder = 'Message', className, showAttach = true, onAttach, attachAccept, showModelSelector = true, models = DEFAULT_MODELS, model, onModelChange, }) {
|
|
16
|
+
function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, status, promptingLabel = 'Thinking…', placeholder = 'Message', className, showAttach = true, onAttach, attachAccept, livePanel, showModelSelector = true, models = DEFAULT_MODELS, model, onModelChange, }) {
|
|
17
17
|
const fileInputRef = useRef(null);
|
|
18
18
|
const composerRef = useRef(null);
|
|
19
19
|
const [uncontrolledModel, setUncontrolledModel] = useState(model ?? models[0]?.id ?? 'auto');
|
|
@@ -37,24 +37,30 @@ function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, status,
|
|
|
37
37
|
if (!next || disabled)
|
|
38
38
|
return;
|
|
39
39
|
onSubmit(next);
|
|
40
|
-
} }), jsxs("div", { className: S.buttons, onClick: onButtonsWrapperClick, children: [
|
|
41
|
-
const files = e.target.files;
|
|
42
|
-
if (files?.length)
|
|
43
|
-
onAttach?.(Array.from(files));
|
|
44
|
-
e.target.value = '';
|
|
45
|
-
} }), jsx(Tooltip, { content: "Attach", direction: "right", children: jsx(Button, { variant: "text", className: S.attachButton, disabled: disabled, "aria-label": "Attach", onClick: () => fileInputRef.current?.click(), children: jsx(Icon, { size: "m", type: "plus" }) }) })] })), statusNode && (jsx("div", { className: S.status, children: jsx(TextShimmer, { children: statusNode }) })), jsx("div", { className: S.gap }), showModelSelector && !isPrompting && (jsx(Select2, { className: S.promptModelSelector, label: "", size: "s", disableLabel: true, hideRequiredStar: true, round: true, options: models, value: modelId, disabled: disabled, triggerProps: { variant: 'clear' }, popupProps: {
|
|
46
|
-
direction: 'top-right',
|
|
47
|
-
round: true,
|
|
48
|
-
}, onChange: next => {
|
|
49
|
-
if (next == null || Array.isArray(next))
|
|
50
|
-
return;
|
|
51
|
-
setModel(String(next));
|
|
52
|
-
} })), jsx(Button, { className: cn(S.button, S.submit), variant: "text", type: "submit", round: true, square: true, disabled: !canSubmit, "aria-label": "Send", onClick: () => {
|
|
40
|
+
} }), jsxs("div", { className: S.buttons, onClick: onButtonsWrapperClick, children: [jsx(Button, { className: cn(S.button, S.submit), variant: "text", type: "submit", round: true, square: true, disabled: !canSubmit, "aria-label": "Send", onClick: () => {
|
|
53
41
|
const next = value.trim();
|
|
54
42
|
if (!next || disabled)
|
|
55
43
|
return;
|
|
56
44
|
onSubmit(next);
|
|
57
|
-
}, children: jsx(Icon, { type: "arrowUp", className: S.submitIcon }) })
|
|
45
|
+
}, children: jsx(Icon, { type: "arrowUp", className: S.submitIcon }) }), livePanel && jsx("div", { className: S.livePanel, children: livePanel }), jsx("div", { className: S.gap }), statusNode && (jsx("div", { className: S.status, children: jsx(TextShimmer, { children: statusNode }) })), showAttach && (jsxs(Fragment, { children: [jsx("input", { ref: fileInputRef, type: "file", accept: attachAccept, multiple: true, className: S.fileInput, disabled: disabled, onChange: e => {
|
|
46
|
+
const files = e.target.files;
|
|
47
|
+
if (files?.length)
|
|
48
|
+
onAttach?.(Array.from(files));
|
|
49
|
+
e.target.value = '';
|
|
50
|
+
} }), jsx(Tooltip, { content: "Attach", direction: "right", children: jsx(Button, { variant: "text", className: S.attachButton, disabled: disabled, "aria-label": "Attach", onClick: () => fileInputRef.current?.click(), children: jsx(Icon, { size: "m", type: "plus" }) }) })] }))] }), showModelSelector && !isPrompting && (jsx(Select2, { className: S.promptModelSelector, label: "", size: "xs", variant: "clear", disableLabel: true, hideRequiredStar: true, round: true, isSearchable: true, options: models, value: modelId, disabled: disabled, inputProps: {
|
|
51
|
+
variant: 'clean',
|
|
52
|
+
autoComplete: 'off',
|
|
53
|
+
spellCheck: false,
|
|
54
|
+
round: true,
|
|
55
|
+
fitContentWidth: true,
|
|
56
|
+
}, popupProps: {
|
|
57
|
+
direction: 'top-right',
|
|
58
|
+
round: true,
|
|
59
|
+
}, onChange: next => {
|
|
60
|
+
if (next == null || Array.isArray(next))
|
|
61
|
+
return;
|
|
62
|
+
setModel(String(next));
|
|
63
|
+
} }))] }));
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
export { ChatPrompt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".ChatPrompt_root__jEydp{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background-color:var(--decent-color-alpha-500);background-color:var(--accent-color-alpha-50);border-radius:var(--p-5);box-shadow:0 0 0 1px var(--active-color-alpha-100);display:flex;flex-direction:column;flex-wrap:wrap;font-size:80%;font-size:calc(80%*var(--dialogue-text-scale, 1));margin:2px auto;max-width:600px;min-height:76px;min-height:calc(var(--prompt-height, 80px) - 4px);position:relative;transition:box-shadow .4s ease-out,border-top-left-radius .2s ease,border-top-right-radius .2s ease,background-color .5s ease;width:100%}.ChatPrompt_root__jEydp:after{border-radius:inherit;box-shadow:inset 0 0 0 1px var(--accent-color-alpha-100),0 0 0 2px var(--decent-color-alpha-800),0 0 30px 0 var(--decent-color-alpha-500);content:\"\";height:100%;left:0;pointer-events:none;position:absolute;top:0;transition:box-shadow .4s ease-out;width:100%;z-index:-2}.ChatPrompt_root__jEydp:focus-within:after,.ChatPrompt_root__jEydp:hover:after{box-shadow:0 0 0 2px var(--decent-color-alpha-500),0 0 50px 0 var(--decent-color-alpha-500)}.ChatPrompt_root__jEydp:focus-within,.ChatPrompt_root__jEydp:hover{box-shadow:inset 0 0 0 1px var(--decent-color-alpha-500)}.ChatPrompt_root__jEydp:hover{box-shadow:inset 0 0 0 1px var(--active-color-alpha-300)}.ChatPrompt_root__jEydp:focus-within{box-shadow:inset 0 0 0 1px var(--active-color-alpha-500)}.ChatPrompt_composer__uWvF4{background-color:transparent!important;position:relative;transition:opacity .2s ease-out;width:100%;z-index:1}.ChatPrompt_composer__uWvF4 .ProseMirror,.ChatPrompt_composer__uWvF4 .editorMount .promptComposerEditor{caret-color:var(--accent-color);font-size:16px!important;font-size:calc(16px*var(--dialogue-text-scale, 1))!important;min-height:1.5em!important;padding:10px var(--p-7) 0 14px!important}.ChatPrompt_composer__uWvF4 .ProseMirror:focus{box-shadow:inset 0 0 0 2px none}.ChatPrompt_composer__uWvF4 .promptComposerEmptyEditor .promptComposerEmptyNode:before{color:var(--accent-color-alpha-500)}.ChatPrompt_buttons__gm2Lm{align-items:center;cursor:text;display:flex;flex-direction:row;flex-shrink:0;flex-wrap:
|
|
4
|
-
var S = {"root":"ChatPrompt_root__jEydp","composer":"ChatPrompt_composer__uWvF4","buttons":"ChatPrompt_buttons__gm2Lm","button":"ChatPrompt_button__h1lLp","submit":"ChatPrompt_submit__CICZy","submitIcon":"ChatPrompt_submitIcon__yqHzk","gap":"ChatPrompt_gap__xkA50","promptModelSelector":"ChatPrompt_promptModelSelector__RZpMR","fileInput":"ChatPrompt_fileInput__l36Lj","attachButton":"ChatPrompt_attachButton__vLVfy","status":"ChatPrompt_status__RpNcl"};
|
|
3
|
+
var css_248z = ".ChatPrompt_root__jEydp{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background-color:var(--decent-color-alpha-500);background-color:var(--accent-color-alpha-50);border-radius:var(--p-5);box-shadow:0 0 0 1px var(--active-color-alpha-100);display:flex;flex-direction:column;flex-wrap:wrap;font-size:80%;font-size:calc(80%*var(--dialogue-text-scale, 1));margin:2px auto;max-width:600px;min-height:76px;min-height:calc(var(--prompt-height, 80px) - 4px);position:relative;transition:box-shadow .4s ease-out,border-top-left-radius .2s ease,border-top-right-radius .2s ease,background-color .5s ease;width:100%}.ChatPrompt_root__jEydp:after{border-radius:inherit;box-shadow:inset 0 0 0 1px var(--accent-color-alpha-100),0 0 0 2px var(--decent-color-alpha-800),0 0 30px 0 var(--decent-color-alpha-500);content:\"\";height:100%;left:0;pointer-events:none;position:absolute;top:0;transition:box-shadow .4s ease-out;width:100%;z-index:-2}.ChatPrompt_root__jEydp:focus-within:after,.ChatPrompt_root__jEydp:hover:after{box-shadow:0 0 0 2px var(--decent-color-alpha-500),0 0 50px 0 var(--decent-color-alpha-500)}.ChatPrompt_root__jEydp:focus-within,.ChatPrompt_root__jEydp:hover{box-shadow:inset 0 0 0 1px var(--decent-color-alpha-500)}.ChatPrompt_root__jEydp:hover{box-shadow:inset 0 0 0 1px var(--active-color-alpha-300)}.ChatPrompt_root__jEydp:focus-within{box-shadow:inset 0 0 0 1px var(--active-color-alpha-500)}.ChatPrompt_composer__uWvF4{background-color:transparent!important;position:relative;transition:opacity .2s ease-out;width:100%;z-index:1}.ChatPrompt_composer__uWvF4 .ProseMirror,.ChatPrompt_composer__uWvF4 .editorMount .promptComposerEditor{caret-color:var(--accent-color);font-size:16px!important;font-size:calc(16px*var(--dialogue-text-scale, 1))!important;min-height:1.5em!important;padding:10px var(--p-7) 0 14px!important}.ChatPrompt_composer__uWvF4 .ProseMirror:focus{box-shadow:inset 0 0 0 2px none}.ChatPrompt_composer__uWvF4 .promptComposerEmptyEditor .promptComposerEmptyNode:before{color:var(--accent-color-alpha-500)}.ChatPrompt_buttons__gm2Lm{align-items:center;cursor:text;display:flex;flex-direction:row-reverse;flex-shrink:0;flex-wrap:nowrap;gap:6px;justify-content:flex-start;padding:0 2px 0 6px;transform:translateY(-2px);width:100%;z-index:1}.ChatPrompt_buttons__gm2Lm svg{transition:.2s ease-out;transition-property:filter,scale}.ChatPrompt_button__h1lLp{background-color:transparent!important;padding:0 var(--p-2);position:relative}.ChatPrompt_button__h1lLp:focus,.ChatPrompt_button__h1lLp:hover{opacity:1}.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy{background-color:var(--active-color)!important;box-shadow:0 1px 1px 0 rgba(0,0,0,.6);color:var(--decent-color)!important;margin-left:var(--p-2);transition:filter .2s ease-out,opacity .5s ease-out}.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy svg{color:var(--decent-color)!important}.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy:focus,.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy:focus-visible,.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy:hover{filter:drop-shadow(0 0 14px var(--active-color))}.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy[disabled]{background-color:inherit!important;box-shadow:none;filter:none;pointer-events:none}.ChatPrompt_button__h1lLp.ChatPrompt_submit__CICZy[disabled] svg{color:var(--accent-color-alpha-500)!important}.ChatPrompt_submitIcon__yqHzk{display:block}.ChatPrompt_gap__xkA50{flex-grow:1}.ChatPrompt_livePanel__RoA-9{align-items:center;display:flex;flex-shrink:0;gap:6px}.ChatPrompt_promptModelSelector__RZpMR{bottom:100%;flex-shrink:0;max-width:calc(100% - 200px);opacity:.4;position:absolute;right:var(--p-1);transition:opacity .2s ease-out}.ChatPrompt_promptModelSelector__RZpMR label>div:first-child{background-color:transparent!important}.ChatPrompt_promptModelSelector__RZpMR:hover{opacity:1}.ChatPrompt_fileInput__l36Lj{display:none}.ChatPrompt_attachButton__vLVfy{flex-shrink:0;margin-left:-8px;opacity:.5;position:relative;z-index:4}.ChatPrompt_status__RpNcl{align-items:center;display:flex;flex-shrink:0;font-size:12.8px;font-size:calc(12.8px*var(--dialogue-text-scale, 1));pointer-events:none;white-space:nowrap}.ChatPrompt_status__RpNcl:last-child{padding-left:var(--p-3)}";
|
|
4
|
+
var S = {"root":"ChatPrompt_root__jEydp","composer":"ChatPrompt_composer__uWvF4","buttons":"ChatPrompt_buttons__gm2Lm","button":"ChatPrompt_button__h1lLp","submit":"ChatPrompt_submit__CICZy","submitIcon":"ChatPrompt_submitIcon__yqHzk","gap":"ChatPrompt_gap__xkA50","livePanel":"ChatPrompt_livePanel__RoA-9","promptModelSelector":"ChatPrompt_promptModelSelector__RZpMR","fileInput":"ChatPrompt_fileInput__l36Lj","attachButton":"ChatPrompt_attachButton__vLVfy","status":"ChatPrompt_status__RpNcl"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { Button } from '../Button/Button.js';
|
|
4
|
+
import { Icon } from '../Icon/Icon.js';
|
|
5
|
+
import { Input } from '../Input/Input.js';
|
|
6
|
+
import { Menu } from '../Menu/Menu.js';
|
|
7
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
8
|
+
import cn from 'classnames';
|
|
9
|
+
import S from './ChatSelector.styl.js';
|
|
10
|
+
|
|
11
|
+
const NEW_CHAT_ID = '__new__';
|
|
12
|
+
function ChatSelector({ title, chats, searchQuery, selectedId, onSearch, onSelectChat, onRename, onNewChat, onSearchOpen, onSearchClose, searchPlaceholder = 'Search chats...', newChatLabel = '+ New chat', disabled, isLoading, className, }) {
|
|
13
|
+
const [mode, setMode] = useState('folded');
|
|
14
|
+
const [draft, setDraft] = useState(title);
|
|
15
|
+
const rootRef = useRef(null);
|
|
16
|
+
const fold = useCallback(() => {
|
|
17
|
+
setMode('folded');
|
|
18
|
+
setDraft(title);
|
|
19
|
+
onSearchClose?.();
|
|
20
|
+
}, [onSearchClose, title]);
|
|
21
|
+
const openSearch = useCallback(() => {
|
|
22
|
+
if (disabled)
|
|
23
|
+
return;
|
|
24
|
+
setMode('search');
|
|
25
|
+
onSearch('');
|
|
26
|
+
onSearchOpen?.();
|
|
27
|
+
}, [disabled, onSearch, onSearchOpen]);
|
|
28
|
+
const openRename = useCallback(() => {
|
|
29
|
+
if (disabled)
|
|
30
|
+
return;
|
|
31
|
+
setDraft(title);
|
|
32
|
+
setMode('rename');
|
|
33
|
+
}, [disabled, title]);
|
|
34
|
+
const commitRename = useCallback(() => {
|
|
35
|
+
const next = draft.trim();
|
|
36
|
+
if (next && next !== title)
|
|
37
|
+
onRename(next);
|
|
38
|
+
fold();
|
|
39
|
+
}, [draft, fold, onRename, title]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (mode === 'folded')
|
|
42
|
+
setDraft(title);
|
|
43
|
+
}, [mode, title]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (mode !== 'search')
|
|
46
|
+
return;
|
|
47
|
+
const onDoc = (e) => {
|
|
48
|
+
if (!rootRef.current?.contains(e.target))
|
|
49
|
+
fold();
|
|
50
|
+
};
|
|
51
|
+
document.addEventListener('mousedown', onDoc);
|
|
52
|
+
return () => document.removeEventListener('mousedown', onDoc);
|
|
53
|
+
}, [fold, mode]);
|
|
54
|
+
const onInputKeyDown = useCallback((e) => {
|
|
55
|
+
if (e.key === 'Escape') {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
fold();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (mode === 'rename' && e.key === 'Enter') {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
commitRename();
|
|
64
|
+
}
|
|
65
|
+
}, [commitRename, fold, mode]);
|
|
66
|
+
const pick = useCallback((id) => {
|
|
67
|
+
if (id === NEW_CHAT_ID)
|
|
68
|
+
onNewChat?.();
|
|
69
|
+
else
|
|
70
|
+
onSelectChat(id);
|
|
71
|
+
fold();
|
|
72
|
+
}, [fold, onNewChat, onSelectChat]);
|
|
73
|
+
const items = [
|
|
74
|
+
{ id: NEW_CHAT_ID, title: newChatLabel },
|
|
75
|
+
...chats,
|
|
76
|
+
];
|
|
77
|
+
return (jsxs("div", { ref: rootRef, className: cn(S.root, className), children: [mode === 'folded' ? (jsxs("div", { className: S.folded, children: [jsx("button", { type: "button", className: S.title, disabled: disabled, onClick: openSearch, children: title }), !disabled && (jsx(Tooltip, { content: "Rename", direction: "bottom", children: jsx(Button, { className: S.edit, variant: "text", size: "s", square: true, "aria-label": "Rename", onClick: openRename, children: jsx(Icon, { type: "edit", size: "s" }) }) }))] })) : (jsx("div", { onKeyDown: onInputKeyDown, children: jsx(Input, { className: S.input, variant: "clean", size: "s", round: true, hideRequiredStar: true, autoFocus: true, disabled: disabled, value: mode === 'search' ? searchQuery : draft, placeholder: mode === 'search' ? searchPlaceholder : title, onChange: (_, val) => {
|
|
78
|
+
const next = String(val);
|
|
79
|
+
if (mode === 'search')
|
|
80
|
+
onSearch(next);
|
|
81
|
+
else
|
|
82
|
+
setDraft(next);
|
|
83
|
+
}, onBlur: () => {
|
|
84
|
+
if (mode === 'rename')
|
|
85
|
+
commitRename();
|
|
86
|
+
} }) })), mode === 'search' && (jsxs(Menu, { className: S.list, size: "s", children: [items.map(item => (jsx(Menu.Item, { className: cn(S.item, item.id === NEW_CHAT_ID && S.newChat, item.id === selectedId && S.selected), selected: item.id === selectedId, textOverflow: true, onClick: () => pick(item.id), children: item.title }, item.id))), isLoading && chats.length === 0 && (jsx(Menu.Item, { className: S.empty, disabled: true, children: "Loading\u2026" }))] }))] }));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { ChatSelector };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".ChatSelector_root__udKf3{flex:1 1 auto;max-width:100%;min-width:0;position:relative}.ChatSelector_folded__AKz8P{align-items:center;background-color:var(--accent-color-alpha-50);border-radius:var(--p-5);box-shadow:0 0 0 1px var(--active-color-alpha-100);display:flex;min-height:36px;min-width:0;padding:0 4px 0 12px;width:100%}.ChatSelector_title__bxcLO{background:none;border:0;color:inherit;cursor:text;flex:1 1 auto;font:inherit;font-weight:650;letter-spacing:-.02em;margin:0;min-width:0;overflow:hidden;padding:0;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ChatSelector_title__bxcLO:disabled{cursor:default}.ChatSelector_edit__RECGY{flex-shrink:0;opacity:.5;transition:opacity .2s ease-out}.ChatSelector_folded__AKz8P:hover .ChatSelector_edit__RECGY{opacity:1}.ChatSelector_input__8tdEl{font-size:inherit!important;min-width:0;width:100%}.ChatSelector_input__8tdEl label{border-radius:var(--p-5)!important;font-size:inherit!important}.ChatSelector_list__1XlnZ{background:#1a1a1a;background:var(--bg-color,#1a1a1a);border-radius:var(--p-3);box-shadow:0 8px 24px rgba(0,0,0,.4);left:0;max-height:280px;min-width:0;position:absolute;right:0;top:calc(100% + 4px);z-index:6}.ChatSelector_item__ASuZG{max-width:320px}.ChatSelector_newChat__7Ayx5,.ChatSelector_selected__199i2{font-weight:650}.ChatSelector_empty__3l4Yb{opacity:.6}";
|
|
4
|
+
var S = {"root":"ChatSelector_root__udKf3","folded":"ChatSelector_folded__AKz8P","title":"ChatSelector_title__bxcLO","edit":"ChatSelector_edit__RECGY","input":"ChatSelector_input__8tdEl","list":"ChatSelector_list__1XlnZ","item":"ChatSelector_item__ASuZG","newChat":"ChatSelector_newChat__7Ayx5","selected":"ChatSelector_selected__199i2","empty":"ChatSelector_empty__3l4Yb"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -10,11 +10,12 @@ import { scrollTo } from '../../tools/scroll.js';
|
|
|
10
10
|
function ChatView({ messages, isPrompting, emptyLabel = 'Start the conversation', className, messagesClassName, footer, onButtonClick, footerClassName, }) {
|
|
11
11
|
const listRef = useRef(null);
|
|
12
12
|
const visible = messages.filter(message => !isPlanMessageContent(message.content));
|
|
13
|
+
const lastContent = visible[visible.length - 1]?.content;
|
|
13
14
|
useEffect(() => {
|
|
14
15
|
const scroller = listRef.current;
|
|
15
16
|
if (scroller)
|
|
16
17
|
scrollTo(scroller, 0, scroller.scrollHeight + 80);
|
|
17
|
-
}, [visible.length, isPrompting]);
|
|
18
|
+
}, [visible.length, lastContent, isPrompting]);
|
|
18
19
|
return (jsxs("div", { className: cn(S.root, className), children: [jsxs(Scroll, { y: true, fadeSize: "l", autoHide: true, offset: { y: { after: 30 } }, className: S.messages, innerClassName: cn(S.messagesInner, footer && S.messagesInnerWithPrompt, messagesClassName), onInnerRef: elem => {
|
|
19
20
|
listRef.current = elem;
|
|
20
21
|
}, children: [visible.length === 0 && jsx("div", { className: S.empty, children: emptyLabel }), visible.map((message, index) => {
|
|
@@ -9,7 +9,7 @@ import { Popup } from '../Popup/Popup.js';
|
|
|
9
9
|
import S from './DatePickerInput.styl.js';
|
|
10
10
|
|
|
11
11
|
function DatePickerInput(props) {
|
|
12
|
-
const { value, onChange, variant = 'default', size = 'm', popupProps, buttonProps, displayFormat = 'MMM Do YYYY', } = props;
|
|
12
|
+
const { value, onChange, variant = 'default', size = 'm', popupProps, buttonProps, displayFormat = 'MMM Do YYYY', calendarProps, } = props;
|
|
13
13
|
const isRange = Array.isArray(value);
|
|
14
14
|
const isControlled = popupProps?.isOpen !== undefined;
|
|
15
15
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -38,7 +38,10 @@ function DatePickerInput(props) {
|
|
|
38
38
|
// @ts-ignore
|
|
39
39
|
jsx(Button, { variant: variant, size: size, ...buttonProps, children: isRange ? (jsxs(Fragment, { children: [jsx(DateTime, { value: strToDate(value[0]), format: displayFormat }), ' - ', jsx(DateTime, { value: strToDate(value[1]), format: displayFormat })] })) : (jsx(DateTime, { value: strToDate(value), format: displayFormat })) }), contentProps: {
|
|
40
40
|
className: cn(S.popupContent, props.doubleCalendar && S.doubleCalendar, S[`size-${size}`], popupProps?.contentProps?.className),
|
|
41
|
-
}, content: jsx(DatePicker, { ...props, onChange: handleChange, className: S.content, calendarProps: {
|
|
41
|
+
}, content: jsx(DatePicker, { ...props, onChange: handleChange, className: S.content, calendarProps: {
|
|
42
|
+
...calendarProps,
|
|
43
|
+
className: cn(S.calendar, calendarProps?.className),
|
|
44
|
+
} }) }));
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
export { DatePickerInput };
|
|
@@ -42,6 +42,8 @@ import '../PromptComposer/PromptComposer.js';
|
|
|
42
42
|
import '../Chat/ChatPrompt.styl.js';
|
|
43
43
|
import '../TextShimmer/TextShimmer.js';
|
|
44
44
|
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
45
|
+
import '../Menu/Menu.js';
|
|
46
|
+
import '../Chat/ChatSelector.styl.js';
|
|
45
47
|
import '../Chat/ChatView.styl.js';
|
|
46
48
|
import '../Container/Container.js';
|
|
47
49
|
import '../DatePicker/DatePicker.styl.js';
|
|
@@ -65,7 +67,6 @@ import '../GridLayout/GridLayout.styl.js';
|
|
|
65
67
|
import '../Heading/Heading.js';
|
|
66
68
|
import '../../services/i18n.js';
|
|
67
69
|
import '../LightBox/LightBox.styl.js';
|
|
68
|
-
import '../Menu/Menu.js';
|
|
69
70
|
import '../NestedMenu/NestedMenu.js';
|
|
70
71
|
import '../Notifications/store.js';
|
|
71
72
|
import '../Notifications/Notifications.styl.js';
|
|
@@ -83,6 +84,7 @@ import '../RadioGroup/RadioGroupContext.js';
|
|
|
83
84
|
import '../RadioButton/RadioButton.styl.js';
|
|
84
85
|
import '../RadioGroup/RadioGroup.styl.js';
|
|
85
86
|
import '../Router/Router.js';
|
|
87
|
+
import '../Resizer/Resizer.styl.js';
|
|
86
88
|
import '../Tabs/Tabs.styl.js';
|
|
87
89
|
import '../TextWithDeferTooltip/TextWithDeferTooltip.styl.js';
|
|
88
90
|
import '../Text/Text.js';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function parseMinWidth(value) {
|
|
2
|
+
if (value == null || value === '')
|
|
3
|
+
return null;
|
|
4
|
+
if (typeof value === 'number') {
|
|
5
|
+
return Number.isFinite(value) && value > 0 ? { kind: 'pct', value } : null;
|
|
6
|
+
}
|
|
7
|
+
const s = String(value).trim().toLowerCase();
|
|
8
|
+
const n = parseFloat(s);
|
|
9
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
10
|
+
return null;
|
|
11
|
+
if (s.endsWith('px'))
|
|
12
|
+
return { kind: 'px', value: n };
|
|
13
|
+
return { kind: 'pct', value: n };
|
|
14
|
+
}
|
|
15
|
+
function isPxMin(value) {
|
|
16
|
+
return parseMinWidth(value)?.kind === 'px';
|
|
17
|
+
}
|
|
18
|
+
function minToPct(value, totalPx) {
|
|
19
|
+
const parsed = parseMinWidth(value);
|
|
20
|
+
if (!parsed)
|
|
21
|
+
return 0;
|
|
22
|
+
if (parsed.kind === 'pct')
|
|
23
|
+
return parsed.value;
|
|
24
|
+
return totalPx > 0 ? (parsed.value / totalPx) * 100 : 0;
|
|
25
|
+
}
|
|
26
|
+
function clampPair(nextLeft, combined, minLeft, minRight) {
|
|
27
|
+
const maxLeft = combined - minRight;
|
|
28
|
+
if (minLeft > maxLeft)
|
|
29
|
+
return null;
|
|
30
|
+
return Math.min(Math.max(nextLeft, minLeft), maxLeft);
|
|
31
|
+
}
|
|
32
|
+
function clampAll(sizes, mins) {
|
|
33
|
+
const next = sizes.slice();
|
|
34
|
+
const minSum = mins.reduce((sum, n) => sum + n, 0);
|
|
35
|
+
if (minSum >= 100 && minSum > 0) {
|
|
36
|
+
return mins.map(n => (n / minSum) * 100);
|
|
37
|
+
}
|
|
38
|
+
for (let i = 0; i < next.length; i++) {
|
|
39
|
+
const deficit = mins[i] - next[i];
|
|
40
|
+
if (deficit <= 0)
|
|
41
|
+
continue;
|
|
42
|
+
let need = deficit;
|
|
43
|
+
for (let j = 0; j < next.length && need > 0; j++) {
|
|
44
|
+
if (j === i)
|
|
45
|
+
continue;
|
|
46
|
+
const slack = next[j] - mins[j];
|
|
47
|
+
if (slack <= 0)
|
|
48
|
+
continue;
|
|
49
|
+
const take = Math.min(slack, need);
|
|
50
|
+
next[j] -= take;
|
|
51
|
+
need -= take;
|
|
52
|
+
}
|
|
53
|
+
next[i] += deficit - need;
|
|
54
|
+
}
|
|
55
|
+
return next;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { clampAll, clampPair, isPxMin, minToPct, parseMinWidth };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useLayoutEffect, Fragment } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import LS from '../../tools/localStorage.js';
|
|
5
|
+
import S from './Resizer.styl.js';
|
|
6
|
+
import { isPxMin, minToPct, clampAll, clampPair } from './Resizer.helpers.js';
|
|
7
|
+
|
|
8
|
+
const LS_PREFIX = 'ui:resizer:';
|
|
9
|
+
const toPct = (n) => `${Number(n.toFixed(4))}%`;
|
|
10
|
+
function readPct(el, prop, fallback) {
|
|
11
|
+
const n = parseFloat(el.style.getPropertyValue(prop));
|
|
12
|
+
return Number.isFinite(n) ? n : fallback;
|
|
13
|
+
}
|
|
14
|
+
function writePct(el, value) {
|
|
15
|
+
const v = toPct(value);
|
|
16
|
+
el.style.setProperty('--width', v);
|
|
17
|
+
el.style.setProperty('--height', v);
|
|
18
|
+
}
|
|
19
|
+
function lsKey(rememberKey) {
|
|
20
|
+
return `${LS_PREFIX}${rememberKey}`;
|
|
21
|
+
}
|
|
22
|
+
function isValidSizes(value, count) {
|
|
23
|
+
return (Array.isArray(value) &&
|
|
24
|
+
value.length === count &&
|
|
25
|
+
value.every(n => typeof n === 'number' && Number.isFinite(n)));
|
|
26
|
+
}
|
|
27
|
+
function loadRemembered(rememberKey, count) {
|
|
28
|
+
if (!rememberKey)
|
|
29
|
+
return null;
|
|
30
|
+
const stored = LS.get(lsKey(rememberKey));
|
|
31
|
+
return isValidSizes(stored, count) ? stored : null;
|
|
32
|
+
}
|
|
33
|
+
function resolveSizes(n, equal, sizes, rememberKey) {
|
|
34
|
+
const remembered = loadRemembered(rememberKey, n);
|
|
35
|
+
if (remembered)
|
|
36
|
+
return remembered;
|
|
37
|
+
return Array.from({ length: n }, (_, i) => sizes?.[i] ?? equal);
|
|
38
|
+
}
|
|
39
|
+
function minsToPct(minWidths, n, totalPx) {
|
|
40
|
+
return Array.from({ length: n }, (_, i) => minToPct(minWidths?.[i], totalPx));
|
|
41
|
+
}
|
|
42
|
+
function applySizes(panes, values, mins) {
|
|
43
|
+
const next = clampAll(values, mins);
|
|
44
|
+
panes.forEach((el, i) => {
|
|
45
|
+
if (el)
|
|
46
|
+
writePct(el, next[i]);
|
|
47
|
+
});
|
|
48
|
+
return next;
|
|
49
|
+
}
|
|
50
|
+
function Resizer({ vertical = false, content, className, sizes, minWidths, rememberKey, }) {
|
|
51
|
+
const rootRef = useRef(null);
|
|
52
|
+
const panesRef = useRef([]);
|
|
53
|
+
const n = content.length;
|
|
54
|
+
const equal = n ? 100 / n : 0;
|
|
55
|
+
const sizesKey = sizes?.join(' ') ?? '';
|
|
56
|
+
const minKey = minWidths?.map(String).join(' ') ?? '';
|
|
57
|
+
useLayoutEffect(() => {
|
|
58
|
+
panesRef.current.length = n;
|
|
59
|
+
const root = rootRef.current;
|
|
60
|
+
const total = root ? (vertical ? root.clientHeight : root.clientWidth) : 0;
|
|
61
|
+
applySizes(panesRef.current, resolveSizes(n, equal, sizes, rememberKey), minsToPct(minWidths, n, total));
|
|
62
|
+
}, [n, equal, sizesKey, rememberKey, minKey, vertical]);
|
|
63
|
+
useLayoutEffect(() => {
|
|
64
|
+
const root = rootRef.current;
|
|
65
|
+
if (!root || !minWidths?.some(isPxMin))
|
|
66
|
+
return;
|
|
67
|
+
const apply = () => {
|
|
68
|
+
const total = vertical ? root.clientHeight : root.clientWidth;
|
|
69
|
+
const prop = vertical ? '--height' : '--width';
|
|
70
|
+
const current = panesRef.current.map(el => el ? readPct(el, prop, equal) : equal);
|
|
71
|
+
applySizes(panesRef.current, current, minsToPct(minWidths, n, total));
|
|
72
|
+
};
|
|
73
|
+
const ro = new ResizeObserver(apply);
|
|
74
|
+
ro.observe(root);
|
|
75
|
+
return () => ro.disconnect();
|
|
76
|
+
}, [n, equal, minKey, vertical]);
|
|
77
|
+
const onPointerDown = (index) => (e) => {
|
|
78
|
+
const left = panesRef.current[index];
|
|
79
|
+
const right = panesRef.current[index + 1];
|
|
80
|
+
const root = rootRef.current;
|
|
81
|
+
if (!left || !right || !root)
|
|
82
|
+
return;
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
85
|
+
const prop = vertical ? '--height' : '--width';
|
|
86
|
+
const startPos = vertical ? e.clientY : e.clientX;
|
|
87
|
+
const total = vertical ? root.clientHeight : root.clientWidth;
|
|
88
|
+
const startLeft = readPct(left, prop, equal);
|
|
89
|
+
const startRight = readPct(right, prop, equal);
|
|
90
|
+
const combined = startLeft + startRight;
|
|
91
|
+
const minLeft = minToPct(minWidths?.[index], total);
|
|
92
|
+
const minRight = minToPct(minWidths?.[index + 1], total);
|
|
93
|
+
root.classList.add(S.dragging);
|
|
94
|
+
document.body.style.userSelect = 'none';
|
|
95
|
+
const onMove = (ev) => {
|
|
96
|
+
const pos = vertical ? ev.clientY : ev.clientX;
|
|
97
|
+
const delta = ((pos - startPos) / total) * 100;
|
|
98
|
+
const nextLeft = clampPair(startLeft + delta, combined, minLeft, minRight) ?? startLeft;
|
|
99
|
+
writePct(left, nextLeft);
|
|
100
|
+
writePct(right, combined - nextLeft);
|
|
101
|
+
};
|
|
102
|
+
const onUp = () => {
|
|
103
|
+
document.removeEventListener('pointermove', onMove);
|
|
104
|
+
document.removeEventListener('pointerup', onUp);
|
|
105
|
+
root.classList.remove(S.dragging);
|
|
106
|
+
document.body.style.removeProperty('user-select');
|
|
107
|
+
if (rememberKey) {
|
|
108
|
+
const current = panesRef.current.map(el => el ? readPct(el, prop, equal) : equal);
|
|
109
|
+
LS.set(lsKey(rememberKey), current);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
document.addEventListener('pointermove', onMove);
|
|
113
|
+
document.addEventListener('pointerup', onUp);
|
|
114
|
+
};
|
|
115
|
+
return (jsx("div", { ref: rootRef, className: cn(S.root, vertical && S.vertical, className), children: content.map((item, i) => (jsxs(Fragment, { children: [jsx("div", { ref: el => {
|
|
116
|
+
panesRef.current[i] = el;
|
|
117
|
+
}, className: S.pane, children: item }), i < n - 1 && (jsx("div", { className: S.handle, role: "separator", "aria-label": "Resize panes", "aria-orientation": vertical ? 'horizontal' : 'vertical', onPointerDown: onPointerDown(i) }))] }, i))) }));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { Resizer };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Resizer_root__ALJP3{display:flex;flex-direction:row;height:100%;min-height:0;min-width:0;width:100%}.Resizer_root__ALJP3.Resizer_vertical__YFqC0{flex-direction:column}.Resizer_root__ALJP3.Resizer_dragging__pD7Co{cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Resizer_root__ALJP3.Resizer_dragging__pD7Co.Resizer_vertical__YFqC0{cursor:row-resize}.Resizer_pane__VMBEO{box-sizing:border-box;flex-shrink:0;height:100%;min-height:0;min-width:0;overflow:hidden;width:var(--width)}.Resizer_root__ALJP3.Resizer_vertical__YFqC0 .Resizer_pane__VMBEO{height:var(--height);width:100%}.Resizer_handle__OOZAA{cursor:col-resize;flex-shrink:0;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:0;z-index:1}.Resizer_handle__OOZAA:before{bottom:0;content:\"\";left:-7px;position:absolute;top:0;width:14px}.Resizer_handle__OOZAA:after{background:var(--accent-color-alpha-50);bottom:0;content:\"\";left:-1px;position:absolute;top:0;width:2px}.Resizer_handle__OOZAA:hover:after{background:var(--active-color)}.Resizer_root__ALJP3.Resizer_vertical__YFqC0 .Resizer_handle__OOZAA{cursor:row-resize;height:0;width:auto}.Resizer_root__ALJP3.Resizer_vertical__YFqC0 .Resizer_handle__OOZAA:before{bottom:auto;height:14px;left:0;right:0;top:-7px;width:auto}.Resizer_root__ALJP3.Resizer_vertical__YFqC0 .Resizer_handle__OOZAA:after{bottom:auto;height:2px;left:0;right:0;top:-1px;width:auto}";
|
|
4
|
+
var S = {"root":"Resizer_root__ALJP3","vertical":"Resizer_vertical__YFqC0","dragging":"Resizer_dragging__pD7Co","pane":"Resizer_pane__VMBEO","handle":"Resizer_handle__OOZAA"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Select_root__mjOjv{max-height:200px;max-width:100%;position:relative}.Select_root__mjOjv.Select_disabled__AlOQi{opacity:.4;pointer-events:none}.Select_additionalLabel__K0--Z{flex-grow:1;overflow:hidden;text-align:left;text-overflow:ellipsis}.Select_trigger__OH48f{position:relative;z-index:1}.Select_triggerArrow__1LEop{flex-shrink:0;margin-left:.3em;margin-right:.7em;transition:transform .2s ease-out}.Select_triggerArrow__1LEop.Select_isOpen__WlMUH{transform:rotateX(-180deg)}.Select_disabled__AlOQi .Select_triggerArrow__1LEop{color:var(--text3-color)}.Select_triggerButton__lErtt{justify-content:space-between;text-align:left;width:100%}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad{padding-right:0}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad>span{max-width:calc(100% - 22px)}.Select_triggerButton__lErtt.Select_isError__WJJLq{box-shadow:inset 0 0 0 2px var(--danger-color)}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh{line-height:1.2em;opacity:0;overflow:hidden;text-overflow:ellipsis}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh.Select_hasSelected__zQhBV{opacity:1}.Select_presetPanel__Yu94r{box-shadow:inset 0 -1px 0 var(--decent-color-alpha-100);display:flex;padding:5px}.Select_presetButton__BAl0q{flex-grow:1;justify-content:center}.Select_presetButton__BAl0q+.Select_presetButton__BAl0q{margin-left:8px}.Select_options__3C0-v{max-height:200px;overflow-y:auto}.keyboard .Select_options__3C0-v{pointer-events:none}.Select_option__iJkfJ{align-items:center;cursor:pointer;display:flex;overflow:hidden;padding-bottom:0!important;padding-top:0!important;position:relative;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}.Select_isTree__SiTaD .Select_option__iJkfJ{min-height:36px}.Select_size-xs__2lZQY .Select_option__iJkfJ{border-radius:6px;font-size:14px;height:22px;padding:0 8px}.Select_size-s__qBK9t .Select_option__iJkfJ{border-radius:6px;font-size:16px;height:26px;padding:0 12px}.Select_size-m__jp7n- .Select_option__iJkfJ{border-radius:9px;font-size:18px;height:34px;padding:0 16px}.Select_size-l__b4EEy .Select_option__iJkfJ{border-radius:12px;font-size:22px;height:42px;padding:0 20px}.Select_size-xl__0OerX .Select_option__iJkfJ{border-radius:15px;font-size:26px;height:50px;padding:0 24px}.Select_isTree__SiTaD .Select_option__iJkfJ{padding-left:30px}.Select_option__iJkfJ.Select_isGroup__aP1lY{color:var(--accent-color);font-weight:500;pointer-events:none}.Select_isExpanded__rG8R1>.Select_option__iJkfJ{display:flex}.Select_option__iJkfJ>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Select_option__iJkfJ:before{content:\"\";display:inline-block}.Select_option__iJkfJ.Select_level-0__vu03A:before{content:none}.Select_option__iJkfJ.Select_level-1__ozH2U:before{min-width:24px;width:24px}.Select_option__iJkfJ.Select_level-2__XDqeh:before{min-width:48px;width:48px}.Select_option__iJkfJ.Select_level-3__Bc9XS:before{min-width:72px;width:72px}.Select_option__iJkfJ.Select_level-4__KfQcQ:before{min-width:96px;width:96px}.Select_option__iJkfJ.Select_level-5__DGSDM:before{min-width:120px;width:120px}.Select_option__iJkfJ.Select_level-6__p688A:before{min-width:144px;width:144px}.Select_option__iJkfJ.Select_isIndeterminate__dy-xV,.Select_option__iJkfJ.Select_isSelected__n3ZeN{background-color:var(--active-color-alpha-500)}.keyboard .Select_option__iJkfJ.Select_isFocused__oZSgY,.pointer .Select_option__iJkfJ:hover{box-shadow:inset 100vw 0 0 0 var(--accent-color-alpha-200)}.Select_expandButton__UTwlR{background-color:transparent!important;display:flex;height:100%;justify-content:flex-end;overflow:visible;padding:0;position:relative;width:30px}.Select_expandButton__UTwlR:before{content:\"\";display:block;height:calc(100% + 20px);position:absolute;right:0;top:-10;width:100px}.Select_size-xs__2lZQY .Select_expandButton__UTwlR{margin-left:-34px}.Select_size-s__qBK9t .Select_expandButton__UTwlR{margin-left:-37px}.Select_size-m__jp7n- .Select_expandButton__UTwlR{margin-left:-40px}.Select_size-l__b4EEy .Select_expandButton__UTwlR{margin-left:-46px}.Select_size-xl__0OerX .Select_expandButton__UTwlR{margin-left:-52px}.Select_expandIcon__gWAIB{-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:transform .1s ease-out}.Select_isExpanded__rG8R1 .Select_expandIcon__gWAIB{transform:rotate(90deg) translateZ(0)}.Select_expandButton__UTwlR:hover .Select_expandIcon__gWAIB{color:var(--primary-color)}.Select_chip__FRK2y{margin-left:-.4em}.Select_chipsContainer__JruCi{overflow-y:auto;padding:4px 0}.Select_size-xs__2lZQY .Select_chipsContainer__JruCi{max-height:90px}.Select_size-s__qBK9t .Select_chipsContainer__JruCi{max-height:108px}.Select_size-m__jp7n- .Select_chipsContainer__JruCi{max-height:180px}.Select_size-l__b4EEy .Select_chipsContainer__JruCi{max-height:220px}.Select_size-xl__0OerX .Select_chipsContainer__JruCi{max-height:260px}.Select_chipContainerInner__cYHSk{display:flex;flex-wrap:wrap;gap:4px}.Select_chip__FRK2y{margin:0}@keyframes Select_fadeIn__QpAwZ{0%{opacity:0}10%{opacity:0}to{opacity:1}}";
|
|
4
|
-
var S = {"root":"Select_root__mjOjv","disabled":"Select_disabled__AlOQi","additionalLabel":"Select_additionalLabel__K0--Z","trigger":"Select_trigger__OH48f","triggerArrow":"Select_triggerArrow__1LEop","isOpen":"Select_isOpen__WlMUH","triggerButton":"Select_triggerButton__lErtt","hasTriggerArrow":"Select_hasTriggerArrow__vPLad","isError":"Select_isError__WJJLq","triggerButtonLabel":"Select_triggerButtonLabel__XXLzh","hasSelected":"Select_hasSelected__zQhBV","presetPanel":"Select_presetPanel__Yu94r","presetButton":"Select_presetButton__BAl0q","options":"Select_options__3C0-v","option":"Select_option__iJkfJ","isTree":"Select_isTree__SiTaD","size-xs":"Select_size-xs__2lZQY","size-s":"Select_size-s__qBK9t","size-m":"Select_size-m__jp7n-","size-l":"Select_size-l__b4EEy","size-xl":"Select_size-xl__0OerX","isGroup":"Select_isGroup__aP1lY","isExpanded":"Select_isExpanded__rG8R1","level-0":"Select_level-0__vu03A","level-1":"Select_level-1__ozH2U","level-2":"Select_level-2__XDqeh","level-3":"Select_level-3__Bc9XS","level-4":"Select_level-4__KfQcQ","level-5":"Select_level-5__DGSDM","level-6":"Select_level-6__p688A","isSelected":"Select_isSelected__n3ZeN","isIndeterminate":"Select_isIndeterminate__dy-xV","isFocused":"Select_isFocused__oZSgY","expandButton":"Select_expandButton__UTwlR","expandIcon":"Select_expandIcon__gWAIB","chip":"Select_chip__FRK2y","chipsContainer":"Select_chipsContainer__JruCi","chipContainerInner":"Select_chipContainerInner__cYHSk","fadeIn":"Select_fadeIn__QpAwZ"};
|
|
3
|
+
var css_248z = ".Select_root__mjOjv{max-height:200px;max-width:100%;position:relative}.Select_root__mjOjv.Select_disabled__AlOQi{opacity:.4;pointer-events:none}.Select_additionalLabel__K0--Z{flex-grow:1;overflow:hidden;text-align:left;text-overflow:ellipsis}.Select_trigger__OH48f{position:relative;z-index:1}.Select_triggerArrow__1LEop{flex-shrink:0;margin-left:.3em;margin-right:.7em;transition:transform .2s ease-out}.Select_triggerArrow__1LEop.Select_isOpen__WlMUH{transform:rotateX(-180deg)}.Select_disabled__AlOQi .Select_triggerArrow__1LEop{color:var(--text3-color)}.Select_variant-clear__3Htb5 .Select_triggerButton__lErtt{background-color:transparent}.Select_triggerButton__lErtt{justify-content:space-between;text-align:left;width:100%}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad{padding-right:0}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad>span{max-width:calc(100% - 22px)}.Select_triggerButton__lErtt.Select_isError__WJJLq{box-shadow:inset 0 0 0 2px var(--danger-color)}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh{line-height:1.2em;opacity:0;overflow:hidden;text-overflow:ellipsis}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh.Select_hasSelected__zQhBV{opacity:1}.Select_presetPanel__Yu94r{box-shadow:inset 0 -1px 0 var(--decent-color-alpha-100);display:flex;padding:5px}.Select_presetButton__BAl0q{flex-grow:1;justify-content:center}.Select_presetButton__BAl0q+.Select_presetButton__BAl0q{margin-left:8px}.Select_options__3C0-v{max-height:200px;overflow-y:auto}.keyboard .Select_options__3C0-v{pointer-events:none}.Select_option__iJkfJ{align-items:center;cursor:pointer;display:flex;overflow:hidden;padding-bottom:0!important;padding-top:0!important;position:relative;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}.Select_isTree__SiTaD .Select_option__iJkfJ{min-height:36px}.Select_size-xs__2lZQY .Select_option__iJkfJ{border-radius:6px;font-size:14px;height:22px;padding:0 8px}.Select_size-s__qBK9t .Select_option__iJkfJ{border-radius:6px;font-size:16px;height:26px;padding:0 12px}.Select_size-m__jp7n- .Select_option__iJkfJ{border-radius:9px;font-size:18px;height:34px;padding:0 16px}.Select_size-l__b4EEy .Select_option__iJkfJ{border-radius:12px;font-size:22px;height:42px;padding:0 20px}.Select_size-xl__0OerX .Select_option__iJkfJ{border-radius:15px;font-size:26px;height:50px;padding:0 24px}.Select_isTree__SiTaD .Select_option__iJkfJ{padding-left:30px}.Select_option__iJkfJ.Select_isGroup__aP1lY{color:var(--accent-color);font-weight:500;pointer-events:none}.Select_isExpanded__rG8R1>.Select_option__iJkfJ{display:flex}.Select_option__iJkfJ>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Select_option__iJkfJ:before{content:\"\";display:inline-block}.Select_option__iJkfJ.Select_level-0__vu03A:before{content:none}.Select_option__iJkfJ.Select_level-1__ozH2U:before{min-width:24px;width:24px}.Select_option__iJkfJ.Select_level-2__XDqeh:before{min-width:48px;width:48px}.Select_option__iJkfJ.Select_level-3__Bc9XS:before{min-width:72px;width:72px}.Select_option__iJkfJ.Select_level-4__KfQcQ:before{min-width:96px;width:96px}.Select_option__iJkfJ.Select_level-5__DGSDM:before{min-width:120px;width:120px}.Select_option__iJkfJ.Select_level-6__p688A:before{min-width:144px;width:144px}.Select_option__iJkfJ.Select_isIndeterminate__dy-xV,.Select_option__iJkfJ.Select_isSelected__n3ZeN{background-color:var(--active-color-alpha-500)}.keyboard .Select_option__iJkfJ.Select_isFocused__oZSgY,.pointer .Select_option__iJkfJ:hover{box-shadow:inset 100vw 0 0 0 var(--accent-color-alpha-200)}.Select_expandButton__UTwlR{background-color:transparent!important;display:flex;height:100%;justify-content:flex-end;overflow:visible;padding:0;position:relative;width:30px}.Select_expandButton__UTwlR:before{content:\"\";display:block;height:calc(100% + 20px);position:absolute;right:0;top:-10;width:100px}.Select_size-xs__2lZQY .Select_expandButton__UTwlR{margin-left:-34px}.Select_size-s__qBK9t .Select_expandButton__UTwlR{margin-left:-37px}.Select_size-m__jp7n- .Select_expandButton__UTwlR{margin-left:-40px}.Select_size-l__b4EEy .Select_expandButton__UTwlR{margin-left:-46px}.Select_size-xl__0OerX .Select_expandButton__UTwlR{margin-left:-52px}.Select_expandIcon__gWAIB{-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:transform .1s ease-out}.Select_isExpanded__rG8R1 .Select_expandIcon__gWAIB{transform:rotate(90deg) translateZ(0)}.Select_expandButton__UTwlR:hover .Select_expandIcon__gWAIB{color:var(--primary-color)}.Select_chip__FRK2y{margin-left:-.4em}.Select_chipsContainer__JruCi{overflow-y:auto;padding:4px 0}.Select_size-xs__2lZQY .Select_chipsContainer__JruCi{max-height:90px}.Select_size-s__qBK9t .Select_chipsContainer__JruCi{max-height:108px}.Select_size-m__jp7n- .Select_chipsContainer__JruCi{max-height:180px}.Select_size-l__b4EEy .Select_chipsContainer__JruCi{max-height:220px}.Select_size-xl__0OerX .Select_chipsContainer__JruCi{max-height:260px}.Select_chipContainerInner__cYHSk{display:flex;flex-wrap:wrap;gap:4px}.Select_chip__FRK2y{margin:0}@keyframes Select_fadeIn__QpAwZ{0%{opacity:0}10%{opacity:0}to{opacity:1}}";
|
|
4
|
+
var S = {"root":"Select_root__mjOjv","disabled":"Select_disabled__AlOQi","additionalLabel":"Select_additionalLabel__K0--Z","trigger":"Select_trigger__OH48f","triggerArrow":"Select_triggerArrow__1LEop","isOpen":"Select_isOpen__WlMUH","variant-clear":"Select_variant-clear__3Htb5","triggerButton":"Select_triggerButton__lErtt","hasTriggerArrow":"Select_hasTriggerArrow__vPLad","isError":"Select_isError__WJJLq","triggerButtonLabel":"Select_triggerButtonLabel__XXLzh","hasSelected":"Select_hasSelected__zQhBV","presetPanel":"Select_presetPanel__Yu94r","presetButton":"Select_presetButton__BAl0q","options":"Select_options__3C0-v","option":"Select_option__iJkfJ","isTree":"Select_isTree__SiTaD","size-xs":"Select_size-xs__2lZQY","size-s":"Select_size-s__qBK9t","size-m":"Select_size-m__jp7n-","size-l":"Select_size-l__b4EEy","size-xl":"Select_size-xl__0OerX","isGroup":"Select_isGroup__aP1lY","isExpanded":"Select_isExpanded__rG8R1","level-0":"Select_level-0__vu03A","level-1":"Select_level-1__ozH2U","level-2":"Select_level-2__XDqeh","level-3":"Select_level-3__Bc9XS","level-4":"Select_level-4__KfQcQ","level-5":"Select_level-5__DGSDM","level-6":"Select_level-6__p688A","isSelected":"Select_isSelected__n3ZeN","isIndeterminate":"Select_isIndeterminate__dy-xV","isFocused":"Select_isFocused__oZSgY","expandButton":"Select_expandButton__UTwlR","expandIcon":"Select_expandIcon__gWAIB","chip":"Select_chip__FRK2y","chipsContainer":"Select_chipsContainer__JruCi","chipContainerInner":"Select_chipContainerInner__cYHSk","fadeIn":"Select_fadeIn__QpAwZ"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -23,7 +23,7 @@ import S from './Select.styl.js';
|
|
|
23
23
|
const BLUR_CLOSE_DELAY = 60;
|
|
24
24
|
const POINTER_PRESS_TTL = 100;
|
|
25
25
|
function Select2(props) {
|
|
26
|
-
const { className, value, onChange, onChipClick, onSearchChange, disableTriggerArrow, inputProps, popupProps, scrollProps, size = 'm', round, optionsClassName, optionClassName, selectedChipClassName, additionalOptions = [], options = [], variant, label, additionalLabel, error, blur, disabled, trigger, required, hideRequiredStar,
|
|
26
|
+
const { className, value, onChange, onChipClick, onSearchChange, disableTriggerArrow, inputProps, popupProps, scrollProps, size = 'm', round, optionsClassName, optionClassName, selectedChipClassName, additionalOptions = [], options = [], variant, isSearchable, label, additionalLabel, error, blur, disabled, trigger, required, hideRequiredStar, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, selectedChipRemoveTooltip, selectedChipIds, onOpen, onClose, onFocus, onBlur, } = props;
|
|
27
27
|
const isMultiple$1 = isMultiple(value);
|
|
28
28
|
const closeOnSelect = props.closeOnSelect ?? !isMultiple$1;
|
|
29
29
|
const instanceId = useRef(generateUID());
|
|
@@ -212,15 +212,17 @@ function Select2(props) {
|
|
|
212
212
|
window.clearTimeout(blurTimer.current);
|
|
213
213
|
window.clearTimeout(pointerPressTimer.current);
|
|
214
214
|
}, []);
|
|
215
|
+
const triggerVariant = variant === 'clear' ? 'clear' : (variant ?? 'default');
|
|
216
|
+
const fieldVariant = variant === 'clear' ? 'clean' : variant;
|
|
217
|
+
const hideFieldLabel = Boolean(disableLabel || !label);
|
|
215
218
|
const triggerProps = useMemo(() => ({
|
|
216
|
-
label,
|
|
217
219
|
size,
|
|
218
220
|
round,
|
|
219
|
-
variant,
|
|
221
|
+
variant: isSearchable ? fieldVariant : triggerVariant,
|
|
220
222
|
...props.triggerProps,
|
|
221
|
-
}), [props.triggerProps,
|
|
223
|
+
}), [props.triggerProps, size, round, fieldVariant, triggerVariant, isSearchable]);
|
|
222
224
|
const getFieldLabel = (label) => {
|
|
223
|
-
if (
|
|
225
|
+
if (hideFieldLabel)
|
|
224
226
|
return null;
|
|
225
227
|
if (isMultiple$1 && selectedIds.length && showSelectedCount)
|
|
226
228
|
return `${label} (${selectedIds.length})`;
|
|
@@ -248,14 +250,14 @@ function Select2(props) {
|
|
|
248
250
|
addonRight: triggerArrow, error: isErrorVisible, value: inputValue, onChange: handleSearchChange, selectAllOnFocus: true, label: getFieldLabel(label), placeholder: hasChips && !inputValue ? '' : inputProps?.placeholder }));
|
|
249
251
|
};
|
|
250
252
|
const renderTriggerButton = () => {
|
|
251
|
-
const {
|
|
253
|
+
const { className, ...rest } = triggerProps;
|
|
252
254
|
const buttonProps = omit(rest, ['name', 'inputProps']);
|
|
253
255
|
const fullSelectedLabel = [selectedLabel, additionalLabel].filter(Boolean);
|
|
254
256
|
const hasSelected = fullSelectedLabel.length > 0;
|
|
255
257
|
const displayLabel = hasSelected ? fullSelectedLabel : label;
|
|
256
258
|
const title = hasSelected && !isMultiple$1 ? fullSelectedLabel : null;
|
|
257
259
|
const classes = cn(S.triggerButton, isErrorVisible && S.isError, triggerArrow && S.hasTriggerArrow, className);
|
|
258
|
-
return (jsxs("div", { children: [jsxs(Button, { className: classes, variant:
|
|
260
|
+
return (jsxs("div", { children: [jsxs(Button, { className: classes, variant: triggerVariant, ...buttonProps, style: { clipPath: labelClipPath }, title: title?.join?.(', '), children: [jsx("div", { className: cn(S.triggerButtonLabel, hasSelected && S.hasSelected), children: displayLabel }), triggerArrow] }), !isMultiple$1 && (jsx(Label, { size: size, isOnTop: hasSelected, isError: isErrorVisible, onClipPathChange: setLabelClipPath, children: getFieldLabel(label) }))] }));
|
|
259
261
|
};
|
|
260
262
|
const renderTrigger = () => {
|
|
261
263
|
if (trigger)
|
|
@@ -301,7 +303,7 @@ function Select2(props) {
|
|
|
301
303
|
return (jsx("div", { ...optionProps, children: renderLabel(item) }, id));
|
|
302
304
|
};
|
|
303
305
|
const optionsList = (jsxs("div", { ref: contentRef, "data-select-id": instanceId.current, children: [renderPresets(), createElement(Scroll, { y: true, ...scrollProps, offset: { y: { before: 10, after: 10 } }, className: cn(S.options, S[`size-${size}`], optionsClassName, scrollProps?.className), onInnerRef: onScrollInnerRef, key: "items-scroll" }, visibleOptions.map(item => renderOption(item)))] }));
|
|
304
|
-
const classes = cn(S.root, className, S[`size-${size}`]);
|
|
306
|
+
const classes = cn(S.root, className, S[`size-${size}`], variant === 'clear' && S['variant-clear']);
|
|
305
307
|
return (jsxs(Fragment, { children: [jsx(Popup, { className: classes, direction: "bottom", size: size, focusControl: true, blur: blur, round: round, disabled: disabled, ...popupProps, isOpen: isOpen, onOpen: openIfEnabled, onClose: close, trigger: renderTrigger(), triggerProps: {
|
|
306
308
|
'data-select-id': instanceId.current,
|
|
307
309
|
onFocus: handleFocus,
|
|
@@ -37,7 +37,7 @@ function Tabs(props) {
|
|
|
37
37
|
}
|
|
38
38
|
return (createElement(Button, { ...rest, className: cn(S.tab, isActive && S.active, rest.className), size: size, key: id, onClick: e => onTabClick(e, params), checked: isActive }, label));
|
|
39
39
|
});
|
|
40
|
-
const tabs = tabsButtons.length === 1 && hideTabsIfSingle ? null : (jsx(Scroll, { x: true, offset: { x: { before: 10, after: 10 } }, className: tabsWrapperClassName, innerClassName: cn(S.tabsScroll, S[`size-${size}`], tabsInnerClassName), autoHide: true, fadeSize: size, size: size, children: jsx(ButtonGroup, { className:
|
|
40
|
+
const tabs = tabsButtons.length === 1 && hideTabsIfSingle ? null : (jsx(Scroll, { x: true, offset: { x: { before: 10, after: 10 } }, className: tabsWrapperClassName, innerClassName: cn(S.tabsScroll, S[`size-${size}`], S[`variant-${variant}`], tabsInnerClassName), autoHide: true, fadeSize: size, size: size, children: jsx(ButtonGroup, { className: tabsClassName, ...rest, children: tabsButtons }) }));
|
|
41
41
|
if (typeof children === 'function') {
|
|
42
42
|
return children({
|
|
43
43
|
tabs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "div .Tabs_inactive__H0mPh{display:none}.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--p-5)}.Tabs_size-xs__J0-xo.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--p-3)}.Tabs_size-s__bz7NO.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--p-4)}.Tabs_size-l__emJzX.Tabs_tabsScroll__7Dj0S{padding-bottom:calc(var(--p-5)*1.2)}.Tabs_size-xl__Kqzt-.Tabs_tabsScroll__7Dj0S{padding-bottom:calc(var(--p-5)*1.35)}.Tabs_tab__-oN-g{flex-shrink:0;white-space:nowrap}.Tabs_variant-links__-N1Ym
|
|
4
|
-
var S = {"inactive":"Tabs_inactive__H0mPh","tabsScroll":"Tabs_tabsScroll__7Dj0S","size-xs":"Tabs_size-xs__J0-xo","size-s":"Tabs_size-s__bz7NO","size-l":"Tabs_size-l__emJzX","size-xl":"Tabs_size-xl__Kqzt-","tab":"Tabs_tab__-oN-g","variant-links":"Tabs_variant-links__-N1Ym","active":"Tabs_active__nOA5N"};
|
|
3
|
+
var css_248z = "div .Tabs_inactive__H0mPh{display:none}.Tabs_variant-default__3nsrd.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--p-5)}.Tabs_variant-default__3nsrd.Tabs_size-xs__J0-xo.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--p-3)}.Tabs_variant-default__3nsrd.Tabs_size-s__bz7NO.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--p-4)}.Tabs_variant-default__3nsrd.Tabs_size-l__emJzX.Tabs_tabsScroll__7Dj0S{padding-bottom:calc(var(--p-5)*1.2)}.Tabs_variant-default__3nsrd.Tabs_size-xl__Kqzt-.Tabs_tabsScroll__7Dj0S{padding-bottom:calc(var(--p-5)*1.35)}.Tabs_tab__-oN-g{flex-shrink:0;white-space:nowrap}.Tabs_variant-links__-N1Ym.Tabs_tabsScroll__7Dj0S{padding-bottom:2px}.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g{border-radius:0!important}.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g:not(:first-child){margin-left:0}.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g{background-color:transparent!important;box-shadow:0 2px 0 0 var(--accent-color-alpha-100);padding:var(--p-3) var(--p-5)}.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g:focus,.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g:hover{background-color:transparent!important;box-shadow:0 2px 0 0 var(--active-color-alpha-100)}.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g.Tabs_active__nOA5N,.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g.Tabs_active__nOA5N:focus,.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g.Tabs_active__nOA5N:hover{background-color:transparent!important;box-shadow:0 2px 0 0 var(--active-color);color:inherit}";
|
|
4
|
+
var S = {"inactive":"Tabs_inactive__H0mPh","variant-default":"Tabs_variant-default__3nsrd","tabsScroll":"Tabs_tabsScroll__7Dj0S","size-xs":"Tabs_size-xs__J0-xo","size-s":"Tabs_size-s__bz7NO","size-l":"Tabs_size-l__emJzX","size-xl":"Tabs_size-xl__Kqzt-","tab":"Tabs_tab__-oN-g","variant-links":"Tabs_variant-links__-N1Ym","active":"Tabs_active__nOA5N"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@property --promptGlowAngle{syntax:\"<angle>\";inherits:true;initial-value:0deg}.ThinkingOutline_root__rvvBG{animation:ThinkingOutline_orbitGlow__3bK-F 3.5s linear infinite;animation-play-state:paused;border-radius:inherit;inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .5s ease-out}.ThinkingOutline_root__rvvBG.ThinkingOutline_active__-66iV
|
|
3
|
+
var css_248z = "@property --promptGlowAngle{syntax:\"<angle>\";inherits:true;initial-value:0deg}.ThinkingOutline_root__rvvBG{animation:ThinkingOutline_orbitGlow__3bK-F 3.5s linear infinite;animation-play-state:paused;border-radius:inherit;inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .5s ease-out}.ThinkingOutline_root__rvvBG.ThinkingOutline_active__-66iV{animation-play-state:running;opacity:1}.ThinkingOutline_root__rvvBG:before{background:conic-gradient(from var(--promptGlowAngle),var(--active-color) 0deg,var(--active-color-alpha-300) 48deg,transparent 80deg,transparent 100deg,var(--active-color-alpha-300) 132deg,var(--active-color) 180deg,var(--active-color-alpha-300) 228deg,transparent 260deg,transparent 280deg,var(--active-color-alpha-300) 312deg,var(--active-color) 1turn);border-radius:inherit;content:\"\";inset:0;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1.5px;position:absolute}.ThinkingOutline_bloom__XKYD5{border-radius:inherit;filter:blur(20px);inset:0;opacity:.55;position:absolute}.ThinkingOutline_bloom__XKYD5:before{background:conic-gradient(from var(--promptGlowAngle),var(--active-color) 0deg,var(--active-color-alpha-300) 48deg,transparent 80deg,transparent 100deg,var(--active-color-alpha-300) 132deg,var(--active-color) 180deg,var(--active-color-alpha-300) 228deg,transparent 260deg,transparent 280deg,var(--active-color-alpha-300) 312deg,var(--active-color) 1turn);border-radius:inherit;content:\"\";inset:0;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:6px;position:absolute}@media (prefers-reduced-motion:reduce){.ThinkingOutline_root__rvvBG{animation:none}}@keyframes ThinkingOutline_orbitGlow__3bK-F{0%{--promptGlowAngle:-30deg}25%{--promptGlowAngle:30deg}50%{--promptGlowAngle:150deg}75%{--promptGlowAngle:210deg}to{--promptGlowAngle:330deg}}";
|
|
4
4
|
var S = {"root":"ThinkingOutline_root__rvvBG","orbitGlow":"ThinkingOutline_orbitGlow__3bK-F","active":"ThinkingOutline_active__-66iV","bloom":"ThinkingOutline_bloom__XKYD5"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -51,6 +51,27 @@ export type ChatPromptModel = {
|
|
|
51
51
|
id: string;
|
|
52
52
|
label: string;
|
|
53
53
|
};
|
|
54
|
+
export type ChatSelectorItem = {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
};
|
|
58
|
+
export type ChatSelectorProps = {
|
|
59
|
+
title: string;
|
|
60
|
+
chats: ChatSelectorItem[];
|
|
61
|
+
searchQuery: string;
|
|
62
|
+
selectedId?: string;
|
|
63
|
+
onSearch: (query: string) => void;
|
|
64
|
+
onSelectChat: (id: string) => void;
|
|
65
|
+
onRename: (title: string) => void;
|
|
66
|
+
onNewChat?: () => void;
|
|
67
|
+
onSearchOpen?: () => void;
|
|
68
|
+
onSearchClose?: () => void;
|
|
69
|
+
searchPlaceholder?: string;
|
|
70
|
+
newChatLabel?: string;
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
isLoading?: boolean;
|
|
73
|
+
className?: string;
|
|
74
|
+
};
|
|
54
75
|
export type ChatPromptProps = {
|
|
55
76
|
value: string;
|
|
56
77
|
onChange: (value: string) => void;
|
|
@@ -63,11 +84,16 @@ export type ChatPromptProps = {
|
|
|
63
84
|
promptingLabel?: ReactNode;
|
|
64
85
|
placeholder?: string;
|
|
65
86
|
className?: string;
|
|
66
|
-
/** Default true. Hidden file input + plus button
|
|
87
|
+
/** Default true. Hidden file input + plus button. */
|
|
67
88
|
showAttach?: boolean;
|
|
68
89
|
onAttach?: (files: File[]) => void;
|
|
69
90
|
attachAccept?: string;
|
|
70
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Presentational slot next to Send (live radio + TTS). Host app owns the
|
|
93
|
+
* node — do not import GLASS LivePanel into this package.
|
|
94
|
+
*/
|
|
95
|
+
livePanel?: ReactNode;
|
|
96
|
+
/** Default true. Compact model dropdown (e.g. Auto Router). Hidden while `isPrompting`. */
|
|
71
97
|
showModelSelector?: boolean;
|
|
72
98
|
models?: ChatPromptModel[];
|
|
73
99
|
model?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ChatPromptProps } from './types';
|
|
2
|
-
export declare function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, status, promptingLabel, placeholder, className, showAttach, onAttach, attachAccept, showModelSelector, models, model, onModelChange, }: ChatPromptProps): import("react").JSX.Element;
|
|
2
|
+
export declare function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, status, promptingLabel, placeholder, className, showAttach, onAttach, attachAccept, livePanel, showModelSelector, models, model, onModelChange, }: ChatPromptProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ChatSelectorProps } from './Chat.types';
|
|
2
|
+
export declare function ChatSelector({ title, chats, searchQuery, selectedId, onSearch, onSelectChat, onRename, onNewChat, onSearchOpen, onSearchClose, searchPlaceholder, newChatLabel, disabled, isLoading, className, }: ChatSelectorProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ChatFormattedText } from './ChatFormattedText';
|
|
2
2
|
export { ChatMessage } from './ChatMessage';
|
|
3
3
|
export { ChatPrompt } from './ChatPrompt';
|
|
4
|
+
export { ChatSelector } from './ChatSelector';
|
|
4
5
|
export { ChatView } from './ChatView';
|
|
5
6
|
export { getDisplayContent, getDisplayParts, isPlanMessageContent, parseSystemEvent, } from './content';
|
|
6
|
-
export type { ChatContentPart, ChatFormattedTextProps, ChatMessageData, ChatMessageProps, ChatPromptModel, ChatPromptProps, ChatRole, ChatViewProps, } from './types';
|
|
7
|
+
export type { ChatContentPart, ChatFormattedTextProps, ChatMessageData, ChatMessageProps, ChatPromptModel, ChatPromptProps, ChatRole, ChatSelectorItem, ChatSelectorProps, ChatViewProps, } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { ChatContentPart, ChatFormattedTextProps, ChatMessageData, ChatMessageProps, ChatPromptModel, ChatPromptProps, ChatRole, ChatViewProps, } from './Chat.types';
|
|
1
|
+
export type { ChatContentPart, ChatFormattedTextProps, ChatMessageData, ChatMessageProps, ChatPromptModel, ChatPromptProps, ChatRole, ChatSelectorItem, ChatSelectorProps, ChatViewProps, } from './Chat.types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as T from './Resizer.types';
|
|
2
|
+
export type ParsedMin = {
|
|
3
|
+
kind: 'pct';
|
|
4
|
+
value: number;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'px';
|
|
7
|
+
value: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function parseMinWidth(value: T.SizeValue | undefined): ParsedMin | null;
|
|
10
|
+
export declare function isPxMin(value: T.SizeValue | undefined): boolean;
|
|
11
|
+
export declare function minToPct(value: T.SizeValue | undefined, totalPx: number): number;
|
|
12
|
+
export declare function clampPair(nextLeft: number, combined: number, minLeft: number, minRight: number): number;
|
|
13
|
+
export declare function clampAll(sizes: number[], mins: number[]): number[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -39,7 +39,7 @@ export type Props = FormControl<Value> & InheritedInputProps & {
|
|
|
39
39
|
selectedChipClassName?: string;
|
|
40
40
|
additionalLabel?: ReactNode;
|
|
41
41
|
size?: Size;
|
|
42
|
-
variant?: 'default' | 'outlined';
|
|
42
|
+
variant?: 'default' | 'outlined' | 'clear';
|
|
43
43
|
showSelectedCount?: boolean;
|
|
44
44
|
disableLabel?: boolean;
|
|
45
45
|
blur?: boolean;
|
|
@@ -45,6 +45,7 @@ export * from './RadioButton/RadioButton';
|
|
|
45
45
|
export * from './RadioGroup/RadioGroup';
|
|
46
46
|
export * from './Router/Router';
|
|
47
47
|
export * from './RequiredStar/RequiredStar';
|
|
48
|
+
export * from './Resizer/Resizer';
|
|
48
49
|
export * from './Select/Select';
|
|
49
50
|
export * from './Select/Select2';
|
|
50
51
|
export * from './Scroll/Scroll';
|