@homecode/ui 5.9.2 → 5.10.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 +1 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +2 -1
- package/dist/esm/src/components/Chat/ChatPrompt.js +15 -13
- package/dist/esm/src/components/Chat/ChatPrompt.styl.js +2 -2
- package/dist/esm/src/components/Chat/ChatView.js +2 -3
- package/dist/esm/src/components/Chat/ChatView.styl.js +2 -2
- package/dist/esm/src/components/Dialogue/Dialogue.styl.js +1 -1
- package/dist/esm/src/components/InputFile/InputFile.js +2 -1
- package/dist/esm/src/components/NestedMenu/NestedMenu.js +2 -2
- package/dist/esm/src/components/NestedMenu/NestedMenu.styl.js +2 -2
- package/dist/esm/src/components/Nudge/Nudge.js +15 -0
- package/dist/esm/src/components/Nudge/Nudge.styl.js +7 -0
- package/dist/esm/types/src/components/Chat/Chat.types.d.ts +4 -2
- package/dist/esm/types/src/components/Chat/ChatPrompt.d.ts +1 -1
- package/dist/esm/types/src/components/Chat/ChatView.d.ts +1 -1
- package/dist/esm/types/src/components/NestedMenu/NestedMenu.d.ts +1 -1
- package/dist/esm/types/src/components/NestedMenu/NestedMenu.types.d.ts +2 -0
- package/dist/esm/types/src/components/Nudge/Nudge.d.ts +16 -0
- package/dist/esm/types/src/components/Nudge/index.d.ts +2 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export { LightBox } from './src/components/LightBox/LightBox.js';
|
|
|
35
35
|
export { Menu } from './src/components/Menu/Menu.js';
|
|
36
36
|
export { NestedMenu, NestedMenuItemRow, NestedMenuLabel } from './src/components/NestedMenu/NestedMenu.js';
|
|
37
37
|
export { Notifications, NotificationsStore } from './src/components/Notifications/Notifications.js';
|
|
38
|
+
export { Nudge, NudgeError, NudgeText } from './src/components/Nudge/Nudge.js';
|
|
38
39
|
export { Paranja } from './src/components/Paranja/Paranja.js';
|
|
39
40
|
export { ANIMATION_DURATION, Popup } from './src/components/Popup/Popup.js';
|
|
40
41
|
export { Portal } from './src/components/Portal/Portal.js';
|
|
@@ -37,9 +37,9 @@ import '../Expand/Expand.styl.js';
|
|
|
37
37
|
import '../Chat/ChatMessage.styl.js';
|
|
38
38
|
import '../PromptComposer/PromptComposer.js';
|
|
39
39
|
import '../Chat/ChatPrompt.styl.js';
|
|
40
|
+
import '../TextShimmer/TextShimmer.js';
|
|
40
41
|
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
41
42
|
import '../Chat/ChatView.styl.js';
|
|
42
|
-
import '../TextShimmer/TextShimmer.js';
|
|
43
43
|
import '../Container/Container.js';
|
|
44
44
|
import '../DatePicker/DatePicker.styl.js';
|
|
45
45
|
import 'moment';
|
|
@@ -72,6 +72,7 @@ import '../LightBox/LightBox.styl.js';
|
|
|
72
72
|
import '../NestedMenu/NestedMenu.js';
|
|
73
73
|
import '../Notifications/store.js';
|
|
74
74
|
import '../Notifications/Notifications.styl.js';
|
|
75
|
+
import '../Nudge/Nudge.styl.js';
|
|
75
76
|
import '../PopupMenu/PopupMenu.styl.js';
|
|
76
77
|
import '../Progress/Progress.styl.js';
|
|
77
78
|
import '@tiptap/extensions';
|
|
@@ -5,6 +5,7 @@ import { Icon } from '../Icon/Icon.js';
|
|
|
5
5
|
import { PromptComposer } from '../PromptComposer/PromptComposer.js';
|
|
6
6
|
import S from './ChatPrompt.styl.js';
|
|
7
7
|
import { Select2 } from '../Select/Select2.js';
|
|
8
|
+
import { TextShimmer } from '../TextShimmer/TextShimmer.js';
|
|
8
9
|
import { ThinkingOutline } from '../ThinkingOutline/ThinkingOutline.js';
|
|
9
10
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
10
11
|
import cn from 'classnames';
|
|
@@ -12,12 +13,13 @@ import cn from 'classnames';
|
|
|
12
13
|
const DEFAULT_MODELS = [
|
|
13
14
|
{ id: 'auto', label: 'Auto Router' },
|
|
14
15
|
];
|
|
15
|
-
function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, 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, showModelSelector = true, models = DEFAULT_MODELS, model, onModelChange, }) {
|
|
16
17
|
const fileInputRef = useRef(null);
|
|
17
18
|
const composerRef = useRef(null);
|
|
18
19
|
const [uncontrolledModel, setUncontrolledModel] = useState(model ?? models[0]?.id ?? 'auto');
|
|
19
20
|
const modelId = model ?? uncontrolledModel;
|
|
20
21
|
const canSubmit = !disabled && Boolean(value.trim());
|
|
22
|
+
const statusNode = status || (isPrompting && promptingLabel);
|
|
21
23
|
const setModel = (id) => {
|
|
22
24
|
if (model === undefined)
|
|
23
25
|
setUncontrolledModel(id);
|
|
@@ -35,24 +37,24 @@ function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, placehol
|
|
|
35
37
|
if (!next || disabled)
|
|
36
38
|
return;
|
|
37
39
|
onSubmit(next);
|
|
38
|
-
} }), jsxs("div", { className: S.buttons, onClick: onButtonsWrapperClick, children: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
} }), jsxs("div", { className: S.buttons, onClick: onButtonsWrapperClick, children: [showAttach && (jsxs(Fragment, { children: [jsx("input", { ref: fileInputRef, type: "file", accept: attachAccept, multiple: true, className: S.fileInput, disabled: disabled, onChange: e => {
|
|
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: {
|
|
44
46
|
direction: 'top-right',
|
|
45
47
|
round: true,
|
|
46
48
|
}, onChange: next => {
|
|
47
49
|
if (next == null || Array.isArray(next))
|
|
48
50
|
return;
|
|
49
51
|
setModel(String(next));
|
|
50
|
-
} })), jsx(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
} })), jsx(Button, { className: cn(S.button, S.submit), variant: "text", type: "submit", round: true, square: true, disabled: !canSubmit, "aria-label": "Send", onClick: () => {
|
|
53
|
+
const next = value.trim();
|
|
54
|
+
if (!next || disabled)
|
|
55
|
+
return;
|
|
56
|
+
onSubmit(next);
|
|
57
|
+
}, children: jsx(Icon, { type: "arrowUp", className: S.submitIcon }) })] })] }));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
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
|
|
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"};
|
|
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:wrap;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_promptModelSelector__RZpMR{flex-shrink:0;max-width:calc(100% - 200px);opacity:.5;transition:opacity .2s ease-out}.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:first-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","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 };
|
|
@@ -3,12 +3,11 @@ import { useRef, useEffect } from 'react';
|
|
|
3
3
|
import { ChatMessage } from './ChatMessage.js';
|
|
4
4
|
import S from './ChatView.styl.js';
|
|
5
5
|
import { Scroll } from '../Scroll/Scroll.js';
|
|
6
|
-
import { TextShimmer } from '../TextShimmer/TextShimmer.js';
|
|
7
6
|
import cn from 'classnames';
|
|
8
7
|
import { isPlanMessageContent } from './content.js';
|
|
9
8
|
import { scrollTo } from '../../tools/scroll.js';
|
|
10
9
|
|
|
11
|
-
function ChatView({ messages, isPrompting,
|
|
10
|
+
function ChatView({ messages, isPrompting, emptyLabel = 'Start the conversation', className, messagesClassName, footer, onButtonClick, footerClassName, }) {
|
|
12
11
|
const listRef = useRef(null);
|
|
13
12
|
const visible = messages.filter(message => !isPlanMessageContent(message.content));
|
|
14
13
|
useEffect(() => {
|
|
@@ -24,7 +23,7 @@ function ChatView({ messages, isPrompting, promptingLabel = 'Thinking…', empty
|
|
|
24
23
|
prev.role === message.role &&
|
|
25
24
|
message.role !== 'SYSTEM';
|
|
26
25
|
return (jsx(ChatMessage, { data: message, isStacked: isStacked, isLastMessage: index === visible.length - 1, onButtonClick: onButtonClick }, message.id || `${message.role}-${index}`));
|
|
27
|
-
})] }), footer && (
|
|
26
|
+
})] }), footer && (jsx("div", { className: cn(S.footer, footerClassName), children: footer }))] }));
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export { ChatView };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".ChatView_root__fRLUe{--prompt-height:80px;display:flex;flex-direction:column;height:100%;min-height:0;position:relative;width:100%}.ChatView_messages__XjC53{flex:1;min-height:0}.ChatView_messagesInner__oRfmN{display:flex;flex-direction:column;height:-moz-fit-content;height:fit-content;min-height:100%;padding:var(--p-10) calc(50% - 300px) 0}.ChatView_messagesInnerWithPrompt__AuC8M{padding-bottom:20px}.ChatView_empty__5yGXV{margin:auto;opacity:.6;padding:24px;text-align:center}.
|
|
4
|
-
var S = {"root":"ChatView_root__fRLUe","messages":"ChatView_messages__XjC53","messagesInner":"ChatView_messagesInner__oRfmN","messagesInnerWithPrompt":"ChatView_messagesInnerWithPrompt__AuC8M","empty":"ChatView_empty__5yGXV","
|
|
3
|
+
var css_248z = ".ChatView_root__fRLUe{--prompt-height:80px;display:flex;flex-direction:column;height:100%;max-height:100%;min-height:0;position:relative;width:100%}.ChatView_messages__XjC53{flex:1;min-height:0}.ChatView_messagesInner__oRfmN{display:flex;flex-direction:column;height:-moz-fit-content;height:fit-content;min-height:100%;padding:var(--p-10) calc(50% - 300px) 0}.ChatView_messagesInnerWithPrompt__AuC8M{padding-bottom:20px}.ChatView_empty__5yGXV{margin:auto;opacity:.6;padding:24px;text-align:center}.ChatView_footer__huDww{height:-moz-fit-content;height:fit-content;margin-top:calc(var(--p-5)*-1);overflow:visible;padding:0;position:relative}";
|
|
4
|
+
var S = {"root":"ChatView_root__fRLUe","messages":"ChatView_messages__XjC53","messagesInner":"ChatView_messagesInner__oRfmN","messagesInnerWithPrompt":"ChatView_messagesInnerWithPrompt__AuC8M","empty":"ChatView_empty__5yGXV","footer":"ChatView_footer__huDww"};
|
|
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 = ".Dialogue_dialogOverlay__jjBIa{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--decent-color-alpha-900);inset:0;opacity:0;position:fixed;transition:opacity .2s ease-out;z-index:50}.Dialogue_dialogOverlay__jjBIa.Dialogue_isOpen__gISMb{animation-duration:.2s;animation-fill-mode:forwards;animation-name:Dialogue_fadeIn__RSEB2;animation-timing-function:ease-out;opacity:1}.Dialogue_dialogContent__-Lxde{border-radius:var(--border-radius-l);box-shadow:0 10px 20px rgba(0,0,0,.3),0 0 0 2px var(--decent-color-alpha-800);display:flex;flex-direction:column;left:50%;max-height:calc(100% - var(--p-5));opacity:0;position:fixed;top:50%;transform:translateX(-50%) translateY(-50%) scale(.95);transition:opacity .2s ease-out,transform .2s ease-out;width:-moz-fit-content;width:fit-content;z-index:50}.Dialogue_dialogContent__-Lxde.Dialogue_isOpen__gISMb{animation-duration:.2s;animation-fill-mode:forwards;animation-name:Dialogue_dialogueIn__M0tLL;animation-timing-function:ease-out;opacity:1;transform:translateX(-50%) translateY(-50%) scale(1)}.Dialogue_dialogContent__-Lxde.Dialogue_isClosed__lHYyZ{animation-duration:.2s;animation-fill-mode:forwards;animation-name:Dialogue_dialogueOut__6bLTY;animation-timing-function:ease-in;opacity:0;pointer-events:none;transform:translateX(-50%) translateY(-50%) scale(.95)}@media (max-width:700px){.Dialogue_dialogContent__-Lxde{max-width:calc(100% - var(--p-5));width:calc(100% - var(--p-5))}}.Dialogue_dialogContent__-Lxde:has(.Dialogue_dialogClose__5q12n) [data-slot=card-header]{padding-right:calc(2rem + var(--p-3))}.Dialogue_size-default__X1sdB{max-width:40rem}.Dialogue_size-login__GyixB{max-width:24rem}.Dialogue_size-wide__HQbiX{max-width:calc(100% - var(--p-5))}@media (min-width:700px){.Dialogue_size-wide__HQbiX{max-width:80rem}}.Dialogue_dialogClose__5q12n{align-items:center;background-color:transparent;border:none;border-radius:var(--border-radius-s);box-shadow:inset 0 0 0 2px none;color:var(--accent-color);cursor:pointer;display:flex;height:2rem;justify-content:center;opacity:.
|
|
3
|
+
var css_248z = ".Dialogue_dialogOverlay__jjBIa{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:var(--decent-color-alpha-900);inset:0;opacity:0;position:fixed;transition:opacity .2s ease-out;z-index:50}.Dialogue_dialogOverlay__jjBIa.Dialogue_isOpen__gISMb{animation-duration:.2s;animation-fill-mode:forwards;animation-name:Dialogue_fadeIn__RSEB2;animation-timing-function:ease-out;opacity:1}.Dialogue_dialogContent__-Lxde{border-radius:var(--border-radius-l);box-shadow:0 10px 20px rgba(0,0,0,.3),0 0 0 2px var(--decent-color-alpha-800);display:flex;flex-direction:column;left:50%;max-height:calc(100% - var(--p-5));opacity:0;position:fixed;top:50%;transform:translateX(-50%) translateY(-50%) scale(.95);transition:opacity .2s ease-out,transform .2s ease-out;width:-moz-fit-content;width:fit-content;z-index:50}.Dialogue_dialogContent__-Lxde.Dialogue_isOpen__gISMb{animation-duration:.2s;animation-fill-mode:forwards;animation-name:Dialogue_dialogueIn__M0tLL;animation-timing-function:ease-out;opacity:1;transform:translateX(-50%) translateY(-50%) scale(1)}.Dialogue_dialogContent__-Lxde.Dialogue_isClosed__lHYyZ{animation-duration:.2s;animation-fill-mode:forwards;animation-name:Dialogue_dialogueOut__6bLTY;animation-timing-function:ease-in;opacity:0;pointer-events:none;transform:translateX(-50%) translateY(-50%) scale(.95)}@media (max-width:700px){.Dialogue_dialogContent__-Lxde{max-width:calc(100% - var(--p-5));width:calc(100% - var(--p-5))}}.Dialogue_dialogContent__-Lxde:has(.Dialogue_dialogClose__5q12n) [data-slot=card-header]{padding-right:calc(2rem + var(--p-3))}.Dialogue_size-default__X1sdB{max-width:40rem}.Dialogue_size-login__GyixB{max-width:24rem}.Dialogue_size-wide__HQbiX{max-width:calc(100% - var(--p-5))}@media (min-width:700px){.Dialogue_size-wide__HQbiX{max-width:80rem}}.Dialogue_dialogClose__5q12n{align-items:center;background-color:transparent;border:none;border-radius:var(--border-radius-s);box-shadow:inset 0 0 0 2px none;color:var(--accent-color);cursor:pointer;display:flex;height:2rem;justify-content:center;opacity:.3;position:absolute;right:var(--p-3);top:var(--p-3);transform-origin:center;transition:opacity .2s ease,transform .2s ease;width:2rem;z-index:10}.Dialogue_dialogClose__5q12n:focus-visible,.Dialogue_dialogClose__5q12n:hover{opacity:1;transform:scale(1.1)}.Dialogue_dialogClose__5q12n:focus-visible{box-shadow:0 0 0 2px var(--active-color)}.Dialogue_dialogClose__5q12n:disabled{pointer-events:none}.Dialogue_footerAlignLeft__xQUD8{justify-content:flex-start}.Dialogue_footerAlignCenter__yq9Mu{justify-content:center}.Dialogue_footerAlignRight__Yo7hG{justify-content:flex-end}@keyframes Dialogue_fadeIn__RSEB2{0%{opacity:0}to{opacity:1}}@keyframes Dialogue_dialogueIn__M0tLL{0%{opacity:0;transform:translateX(-50%) translateY(-50%) scale(.95)}to{opacity:1;transform:translateX(-50%) translateY(-50%) scale(1)}}@keyframes Dialogue_dialogueOut__6bLTY{0%{opacity:1;transform:translateX(-50%) translateY(-50%) scale(1)}to{opacity:0;transform:translateX(-50%) translateY(-50%) scale(.95)}}";
|
|
4
4
|
var S = {"dialogOverlay":"Dialogue_dialogOverlay__jjBIa","isOpen":"Dialogue_isOpen__gISMb","fadeIn":"Dialogue_fadeIn__RSEB2","dialogContent":"Dialogue_dialogContent__-Lxde","dialogueIn":"Dialogue_dialogueIn__M0tLL","isClosed":"Dialogue_isClosed__lHYyZ","dialogueOut":"Dialogue_dialogueOut__6bLTY","dialogClose":"Dialogue_dialogClose__5q12n","size-default":"Dialogue_size-default__X1sdB","size-login":"Dialogue_size-login__GyixB","size-wide":"Dialogue_size-wide__HQbiX","footerAlignLeft":"Dialogue_footerAlignLeft__xQUD8","footerAlignCenter":"Dialogue_footerAlignCenter__yq9Mu","footerAlignRight":"Dialogue_footerAlignRight__Yo7hG"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -40,9 +40,9 @@ import '../Expand/Expand.styl.js';
|
|
|
40
40
|
import '../Chat/ChatMessage.styl.js';
|
|
41
41
|
import '../PromptComposer/PromptComposer.js';
|
|
42
42
|
import '../Chat/ChatPrompt.styl.js';
|
|
43
|
+
import '../TextShimmer/TextShimmer.js';
|
|
43
44
|
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
44
45
|
import '../Chat/ChatView.styl.js';
|
|
45
|
-
import '../TextShimmer/TextShimmer.js';
|
|
46
46
|
import '../Container/Container.js';
|
|
47
47
|
import '../DatePicker/DatePicker.styl.js';
|
|
48
48
|
import 'moment';
|
|
@@ -67,6 +67,7 @@ import '../Menu/Menu.js';
|
|
|
67
67
|
import '../NestedMenu/NestedMenu.js';
|
|
68
68
|
import '../Notifications/store.js';
|
|
69
69
|
import '../Notifications/Notifications.styl.js';
|
|
70
|
+
import '../Nudge/Nudge.styl.js';
|
|
70
71
|
import '../PopupMenu/PopupMenu.styl.js';
|
|
71
72
|
import '../Progress/Progress.styl.js';
|
|
72
73
|
import '@tiptap/extensions';
|
|
@@ -17,7 +17,7 @@ function useMedia(query) {
|
|
|
17
17
|
}, [query]);
|
|
18
18
|
return matches;
|
|
19
19
|
}
|
|
20
|
-
function NestedMenuLabel({ children, className }) {
|
|
20
|
+
function NestedMenuLabel({ children, className, }) {
|
|
21
21
|
return jsx("span", { className: cn(S.label, className), children: children });
|
|
22
22
|
}
|
|
23
23
|
function NestedMenuItemRow({ children, className, danger, disabled, href, target, rel, onClick, }) {
|
|
@@ -104,7 +104,7 @@ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end'
|
|
|
104
104
|
openSub(id, true);
|
|
105
105
|
}
|
|
106
106
|
function renderItems() {
|
|
107
|
-
return items.map(item => (jsxs("div", { className: S.itemWrap, onMouseEnter: () => onItemEnter(item.id), onMouseLeave: onItemLeave, children: [jsxs("button", { type: "button", className: cn(S.item, activeId === item.id && S.itemActive, item.danger && S.itemDanger, item.disabled && S.itemDisabled, item.className), role: "menuitem", disabled: item.disabled, "aria-haspopup": item.submenu ? 'menu' : undefined, "aria-expanded": item.submenu ? activeId === item.id : undefined, onClick: () => onItemClick(item.id), children: [item.icon && (jsx("span", { className: S.icon, "aria-hidden": true, children: item.icon })), jsx("span", { className: S.label, children: item.label }), item.hint != null && item.hint !== '' && (jsx("span", { className: S.hint, children: item.hint })), item.submenu && (jsx(Icon, { className: S.chevron, type: "chevronRight", size: "xs" }))] }), !stacked && activeId === item.id && item.submenu && (jsx("div", { className: cn(S.submenu, flipLeft && S.submenuLeft), role: "menu", onMouseEnter: () => {
|
|
107
|
+
return items.map(item => (jsxs("div", { className: S.itemWrap, onMouseEnter: () => onItemEnter(item.id), onMouseLeave: onItemLeave, children: [jsxs("button", { type: "button", className: cn(S.item, activeId === item.id && S.itemActive, item.danger && S.itemDanger, item.disabled && S.itemDisabled, item.wrap && S.multiline, item.className), role: "menuitem", disabled: item.disabled, "aria-haspopup": item.submenu ? 'menu' : undefined, "aria-expanded": item.submenu ? activeId === item.id : undefined, onClick: () => onItemClick(item.id), children: [item.icon && (jsx("span", { className: S.icon, "aria-hidden": true, children: item.icon })), jsx("span", { className: S.label, children: item.label }), item.hint != null && item.hint !== '' && (jsx("span", { className: S.hint, children: item.hint })), item.submenu && (jsx(Icon, { className: S.chevron, type: "chevronRight", size: "xs" }))] }), !stacked && activeId === item.id && item.submenu && (jsx("div", { className: cn(S.submenu, flipLeft && S.submenuLeft), role: "menu", onMouseEnter: () => {
|
|
108
108
|
window.clearTimeout(hoverTimer.current);
|
|
109
109
|
}, children: item.submenu }))] }, item.id)));
|
|
110
110
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".NestedMenu_root__ybyGA{display:inline-flex;position:relative}.NestedMenu_trigger__zBeNI{display:inline-flex}.NestedMenu_popup__q0uYO{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);left:0;max-width:
|
|
4
|
-
var S = {"root":"NestedMenu_root__ybyGA","trigger":"NestedMenu_trigger__zBeNI","popup":"NestedMenu_popup__q0uYO","alignEnd":"NestedMenu_alignEnd__L4AZi","itemWrap":"NestedMenu_itemWrap__Qmc0B","item":"NestedMenu_item__tgbZm","row":"NestedMenu_row__48g5c","back":"NestedMenu_back__dNsDV","itemActive":"NestedMenu_itemActive__RfPZH","itemDisabled":"NestedMenu_itemDisabled__evVk1","itemDanger":"NestedMenu_itemDanger__oAJbP","icon":"NestedMenu_icon__4g2Yp","label":"NestedMenu_label__Jnm6l","hint":"NestedMenu_hint__hotNP","chevron":"NestedMenu_chevron__8i-Po","submenu":"NestedMenu_submenu__Tx1Ll","submenuLeft":"NestedMenu_submenuLeft__y18Nb","stacked":"NestedMenu_stacked__rMiOi","stackedBody":"NestedMenu_stackedBody__Fbkma"};
|
|
3
|
+
var css_248z = ".NestedMenu_root__ybyGA{display:inline-flex;position:relative}.NestedMenu_trigger__zBeNI{display:inline-flex}.NestedMenu_popup__q0uYO{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);left:0;max-width:280px;min-width:200px;padding:4px;position:absolute;top:calc(100% + 6px);z-index:20}.NestedMenu_alignEnd__L4AZi{left:auto;right:0}.NestedMenu_itemWrap__Qmc0B{position:relative}.NestedMenu_back__dNsDV,.NestedMenu_item__tgbZm,.NestedMenu_row__48g5c{align-items:center;background:none;border:none;border-radius:6px;color:inherit;cursor:pointer;display:flex;font:inherit;font-size:13px;font-weight:500;gap:8px;letter-spacing:.01em;line-height:1.3;padding:6px 10px;text-align:left;text-decoration:none;width:100%}.NestedMenu_back__dNsDV.NestedMenu_itemActive__RfPZH,.NestedMenu_back__dNsDV:hover,.NestedMenu_item__tgbZm.NestedMenu_itemActive__RfPZH,.NestedMenu_item__tgbZm:hover,.NestedMenu_row__48g5c.NestedMenu_itemActive__RfPZH,.NestedMenu_row__48g5c:hover{background:var(--accent-color-alpha-100)}.NestedMenu_back__dNsDV.NestedMenu_itemDisabled__evVk1,.NestedMenu_back__dNsDV:disabled,.NestedMenu_item__tgbZm.NestedMenu_itemDisabled__evVk1,.NestedMenu_item__tgbZm:disabled,.NestedMenu_row__48g5c.NestedMenu_itemDisabled__evVk1,.NestedMenu_row__48g5c:disabled{cursor:default;opacity:.55;pointer-events:none}.NestedMenu_itemDanger__oAJbP{color:var(--active-color)}.NestedMenu_itemDanger__oAJbP .NestedMenu_icon__4g2Yp{color:inherit;opacity:1}.NestedMenu_icon__4g2Yp{display:inline-flex;flex-shrink:0;opacity:.55}.NestedMenu_icon__4g2Yp svg{display:block}.NestedMenu_label__Jnm6l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.NestedMenu_hint__hotNP{flex-shrink:0;font-weight:400;opacity:.5}.NestedMenu_multiline__MDdk-{grid-row-gap:2px;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);min-width:252px;row-gap:2px}.NestedMenu_multiline__MDdk- .NestedMenu_label__Jnm6l{overflow:visible;text-overflow:clip}.NestedMenu_multiline__MDdk- .NestedMenu_hint__hotNP{grid-column:2;min-width:0;white-space:normal}.NestedMenu_chevron__8i-Po{flex-shrink:0;opacity:.45}.NestedMenu_row__48g5c svg{color:var(--active-color);flex-shrink:0}.NestedMenu_submenu__Tx1Ll{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);left:calc(100% + 6px);max-height:min(360px,calc(100vh - 24px));max-width:280px;min-width:220px;overflow-x:hidden;overflow-y:auto;padding:4px;position:absolute;top:-4px;z-index:21}.NestedMenu_submenu__Tx1Ll:before{bottom:0;content:\"\";left:-6px;position:absolute;top:0;width:6px}.NestedMenu_submenuLeft__y18Nb{left:auto;right:calc(100% + 6px)}.NestedMenu_submenuLeft__y18Nb:before{left:auto;right:-6px}.NestedMenu_stacked__rMiOi{display:flex;flex-direction:column;max-height:min(360px,calc(100vh - 24px));overflow-y:auto}.NestedMenu_back__dNsDV{font-weight:650;margin-bottom:2px}.NestedMenu_stackedBody__Fbkma{min-width:0}";
|
|
4
|
+
var S = {"root":"NestedMenu_root__ybyGA","trigger":"NestedMenu_trigger__zBeNI","popup":"NestedMenu_popup__q0uYO","alignEnd":"NestedMenu_alignEnd__L4AZi","itemWrap":"NestedMenu_itemWrap__Qmc0B","item":"NestedMenu_item__tgbZm","row":"NestedMenu_row__48g5c","back":"NestedMenu_back__dNsDV","itemActive":"NestedMenu_itemActive__RfPZH","itemDisabled":"NestedMenu_itemDisabled__evVk1","itemDanger":"NestedMenu_itemDanger__oAJbP","icon":"NestedMenu_icon__4g2Yp","label":"NestedMenu_label__Jnm6l","hint":"NestedMenu_hint__hotNP","multiline":"NestedMenu_multiline__MDdk-","chevron":"NestedMenu_chevron__8i-Po","submenu":"NestedMenu_submenu__Tx1Ll","submenuLeft":"NestedMenu_submenuLeft__y18Nb","stacked":"NestedMenu_stacked__rMiOi","stackedBody":"NestedMenu_stackedBody__Fbkma"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import S from './Nudge.styl.js';
|
|
4
|
+
|
|
5
|
+
function Nudge({ className, children, ...props }) {
|
|
6
|
+
return (jsx("div", { className: cn(S.root, className), ...props, children: children }));
|
|
7
|
+
}
|
|
8
|
+
function NudgeText({ className, children, ...props }) {
|
|
9
|
+
return (jsx("p", { className: cn(S.text, className), ...props, children: children }));
|
|
10
|
+
}
|
|
11
|
+
function NudgeError({ className, children, ...props }) {
|
|
12
|
+
return (jsx("p", { className: cn(S.error, className), ...props, children: children }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Nudge, NudgeError, NudgeText };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Nudge_root__cOnE-{align-items:flex-start;background:var(--decent-color-alpha-600);background-image:linear-gradient(to right,var(--active-color-alpha-100) 0,transparent 30%);border-bottom-right-radius:var(--p-2);border-top-right-radius:var(--p-2);display:flex;flex-direction:column;gap:12px;padding:14px 16px;position:relative}.Nudge_root__cOnE-:before{background:var(--active-color-alpha-600);border-radius:10px;bottom:0;content:\"\";left:0;position:absolute;top:0;width:5px}.Nudge_text__8IF7l{font-size:14px;line-height:1.45;margin:0;opacity:.85}.Nudge_error__qotmj{color:var(--active-color);font-size:14px;margin:0}";
|
|
4
|
+
var S = {"root":"Nudge_root__cOnE-","text":"Nudge_text__8IF7l","error":"Nudge_error__qotmj"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -46,7 +46,6 @@ export type ChatMessageProps = {
|
|
|
46
46
|
export type ChatViewProps = {
|
|
47
47
|
messages: ChatMessageData[];
|
|
48
48
|
isPrompting?: boolean;
|
|
49
|
-
promptingLabel?: ReactNode;
|
|
50
49
|
emptyLabel?: ReactNode;
|
|
51
50
|
className?: string;
|
|
52
51
|
messagesClassName?: string;
|
|
@@ -63,8 +62,11 @@ export type ChatPromptProps = {
|
|
|
63
62
|
onChange: (value: string) => void;
|
|
64
63
|
onSubmit: (value: string) => void;
|
|
65
64
|
disabled?: boolean;
|
|
66
|
-
/** Orbiting glow on the prompt while the agent is generating. */
|
|
65
|
+
/** Orbiting glow on the prompt while the agent is generating. Hides the model selector. */
|
|
67
66
|
isPrompting?: boolean;
|
|
67
|
+
/** Shown after the attach button. Falls back to `promptingLabel` while `isPrompting`. */
|
|
68
|
+
status?: ReactNode;
|
|
69
|
+
promptingLabel?: ReactNode;
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
className?: string;
|
|
70
72
|
/** Default true. Hidden file input + plus button (no STT / live voice). */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ChatPromptProps } from './types';
|
|
2
|
-
export declare function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, 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, showModelSelector, models, model, onModelChange, }: ChatPromptProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ChatViewProps } from './types';
|
|
2
|
-
export declare function ChatView({ messages, isPrompting,
|
|
2
|
+
export declare function ChatView({ messages, isPrompting, emptyLabel, className, messagesClassName, footer, onButtonClick, footerClassName, }: ChatViewProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as T from './NestedMenu.types';
|
|
2
|
-
export declare function NestedMenuLabel({ children, className }: T.NestedMenuLabelProps): import("react").JSX.Element;
|
|
2
|
+
export declare function NestedMenuLabel({ children, className, }: T.NestedMenuLabelProps): import("react").JSX.Element;
|
|
3
3
|
export declare function NestedMenuItemRow({ children, className, danger, disabled, href, target, rel, onClick, }: T.NestedMenuRowProps): import("react").JSX.Element;
|
|
4
4
|
declare function NestedMenuComponent({ trigger, items, open, onOpenChange, align, className, }: T.Props): import("react").JSX.Element;
|
|
5
5
|
export declare const NestedMenu: typeof NestedMenuComponent & {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type NudgeProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export type NudgeTextProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type NudgeErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare function Nudge({ className, children, ...props }: NudgeProps): import("react").JSX.Element;
|
|
15
|
+
export declare function NudgeText({ className, children, ...props }: NudgeTextProps): import("react").JSX.Element;
|
|
16
|
+
export declare function NudgeError({ className, children, ...props }: NudgeErrorProps): import("react").JSX.Element;
|
|
@@ -32,6 +32,7 @@ export * from './Menu/Menu';
|
|
|
32
32
|
export * from './NestedMenu/NestedMenu';
|
|
33
33
|
export type { NestedMenuItem, NestedMenuProps, } from './NestedMenu/NestedMenu.types';
|
|
34
34
|
export * from './Notifications/Notifications';
|
|
35
|
+
export * from './Nudge';
|
|
35
36
|
export * from './Paranja/Paranja';
|
|
36
37
|
export * from './Popup/Popup';
|
|
37
38
|
export * from './Portal/Portal';
|