@homecode/ui 5.16.1 → 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.
Files changed (42) hide show
  1. package/dist/esm/index.js +2 -1
  2. package/dist/esm/src/components/Autocomplete/Autocomplete.js +3 -2
  3. package/dist/esm/src/components/Chat/ChatPrompt.js +21 -15
  4. package/dist/esm/src/components/Chat/ChatPrompt.styl.js +2 -2
  5. package/dist/esm/src/components/Chat/ChatSelector.js +89 -0
  6. package/dist/esm/src/components/Chat/ChatSelector.styl.js +7 -0
  7. package/dist/esm/src/components/Chat/ChatView.js +2 -1
  8. package/dist/esm/src/components/DatePickerInput/DatePickerInput.js +5 -2
  9. package/dist/esm/src/components/InputFile/InputFile.js +3 -2
  10. package/dist/esm/src/components/NestedMenu/NestedMenu.js +20 -6
  11. package/dist/esm/src/components/NestedMenu/NestedMenu.styl.js +2 -2
  12. package/dist/esm/src/components/Popup/Popup.styl.js +1 -1
  13. package/dist/esm/src/components/Resizer/Resizer.helpers.js +58 -0
  14. package/dist/esm/src/components/Resizer/Resizer.js +120 -0
  15. package/dist/esm/src/components/Resizer/Resizer.styl.js +7 -0
  16. package/dist/esm/src/components/Select/Select.styl.js +2 -2
  17. package/dist/esm/src/components/Select/Select2.js +10 -8
  18. package/dist/esm/src/components/Tabs/Tabs.js +1 -1
  19. package/dist/esm/src/components/Tabs/Tabs.styl.js +2 -2
  20. package/dist/esm/src/components/ThinkingOutline/ThinkingOutline.js +2 -2
  21. package/dist/esm/src/components/ThinkingOutline/ThinkingOutline.styl.js +1 -1
  22. package/dist/esm/types/src/components/Chat/Chat.types.d.ts +28 -2
  23. package/dist/esm/types/src/components/Chat/ChatPrompt.d.ts +1 -1
  24. package/dist/esm/types/src/components/Chat/ChatSelector.d.ts +2 -0
  25. package/dist/esm/types/src/components/Chat/index.d.ts +2 -1
  26. package/dist/esm/types/src/components/Chat/types.d.ts +1 -1
  27. package/dist/esm/types/src/components/Input/Input.d.ts +1 -1
  28. package/dist/esm/types/src/components/NestedMenu/NestedMenu.d.ts +1 -1
  29. package/dist/esm/types/src/components/NestedMenu/NestedMenu.types.d.ts +2 -1
  30. package/dist/esm/types/src/components/Resizer/Resizer.d.ts +3 -0
  31. package/dist/esm/types/src/components/Resizer/Resizer.helpers.d.ts +13 -0
  32. package/dist/esm/types/src/components/Resizer/Resizer.helpers.test.d.ts +1 -0
  33. package/dist/esm/types/src/components/Resizer/Resizer.types.d.ts +10 -0
  34. package/dist/esm/types/src/components/Select/Select.d.ts +1 -1
  35. package/dist/esm/types/src/components/Select/Select.types.d.ts +1 -1
  36. package/dist/esm/types/src/components/ThinkingOutline/ThinkingOutline.d.ts +1 -1
  37. package/dist/esm/types/src/components/index.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/dist/esm/src/components/PopupMenu/PopupMenu.js +0 -15
  40. package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js +0 -7
  41. package/dist/esm/types/src/components/PopupMenu/PopupMenu.d.ts +0 -2
  42. package/dist/esm/types/src/components/PopupMenu/PopupMenu.types.d.ts +0 -13
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';
@@ -42,7 +43,6 @@ export { Nudge, NudgeError, NudgeText } from './src/components/Nudge/Nudge.js';
42
43
  export { Paranja } from './src/components/Paranja/Paranja.js';
43
44
  export { ANIMATION_DURATION, Popup } from './src/components/Popup/Popup.js';
44
45
  export { Portal } from './src/components/Portal/Portal.js';
45
- export { PopupMenu } from './src/components/PopupMenu/PopupMenu.js';
46
46
  export { Progress } from './src/components/Progress/Progress.js';
47
47
  export { ProgressCircular } from './src/components/ProgressCircular/ProgressCircular.js';
48
48
  export { PromptComposer } from './src/components/PromptComposer/PromptComposer.js';
@@ -52,6 +52,7 @@ export { RadioButton } from './src/components/RadioButton/RadioButton.js';
52
52
  export { RadioGroup } from './src/components/RadioGroup/RadioGroup.js';
53
53
  export { Router, RouterContext, RouterStore } from './src/components/Router/Router.js';
54
54
  export { RequiredStar } from './src/components/RequiredStar/RequiredStar.js';
55
+ export { Resizer } from './src/components/Resizer/Resizer.js';
55
56
  export { Select, SelectHelpers } from './src/components/Select/Select.js';
56
57
  export { Select2 } from './src/components/Select/Select2.js';
57
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';
@@ -75,7 +76,6 @@ import '../NestedMenu/NestedMenu.js';
75
76
  import '../Notifications/store.js';
76
77
  import '../Notifications/Notifications.styl.js';
77
78
  import '../Nudge/Nudge.styl.js';
78
- import '../PopupMenu/PopupMenu.styl.js';
79
79
  import '../Progress/Progress.styl.js';
80
80
  import '@tiptap/extensions';
81
81
  import '@tiptap/starter-kit';
@@ -84,6 +84,7 @@ import '../RadioGroup/RadioGroupContext.js';
84
84
  import '../RadioButton/RadioButton.styl.js';
85
85
  import '../RadioGroup/RadioGroup.styl.js';
86
86
  import '../Router/Router.js';
87
+ import '../Resizer/Resizer.styl.js';
87
88
  import '../Tabs/Tabs.styl.js';
88
89
  import '../TextWithDeferTooltip/TextWithDeferTooltip.styl.js';
89
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: [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: {
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: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"};
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: { className: S.calendar } }) }));
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,12 +67,10 @@ 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';
72
73
  import '../Nudge/Nudge.styl.js';
73
- import '../PopupMenu/PopupMenu.styl.js';
74
74
  import '../Progress/Progress.styl.js';
75
75
  import '@tiptap/extensions';
76
76
  import '@tiptap/react';
@@ -84,6 +84,7 @@ import '../RadioGroup/RadioGroupContext.js';
84
84
  import '../RadioButton/RadioButton.styl.js';
85
85
  import '../RadioGroup/RadioGroup.styl.js';
86
86
  import '../Router/Router.js';
87
+ import '../Resizer/Resizer.styl.js';
87
88
  import '../Tabs/Tabs.styl.js';
88
89
  import '../TextWithDeferTooltip/TextWithDeferTooltip.styl.js';
89
90
  import '../Text/Text.js';
@@ -29,7 +29,7 @@ function NestedMenuItemRow({ children, className, danger, disabled, href, target
29
29
  }
30
30
  return (jsx("button", { type: "button", className: classes, disabled: disabled, onClick: onClick, children: children }));
31
31
  }
32
- function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end', size = 'm', className, popupProps, }) {
32
+ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end', size = 'm', className, popupProps, onItemClick, }) {
33
33
  const [activeId, setActiveId] = useState(null);
34
34
  const stacked = useMedia(MOBILE_MQ);
35
35
  const canHover = useMedia(HOVER_MQ);
@@ -58,7 +58,8 @@ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end'
58
58
  document.addEventListener('keydown', onKey);
59
59
  return () => document.removeEventListener('keydown', onKey);
60
60
  }, [open]);
61
- function onItemClick(id, e) {
61
+ function handleItemClick(id, e) {
62
+ onItemClick?.(id);
62
63
  const item = items.find(entry => entry.id === id);
63
64
  if (!item || item.disabled)
64
65
  return;
@@ -68,8 +69,11 @@ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end'
68
69
  close();
69
70
  return;
70
71
  }
71
- if (!item.submenu)
72
+ if (!item.submenu) {
73
+ if (item.closeOnClick !== false)
74
+ close();
72
75
  return;
76
+ }
73
77
  if (activeId === id && !stacked && !canHover) {
74
78
  setActiveId(null);
75
79
  return;
@@ -77,10 +81,17 @@ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end'
77
81
  openSub(id, true);
78
82
  }
79
83
  function renderItemButton(item) {
80
- return (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, onPointerDown: e => {
84
+ return (jsxs("button", { type: "button", className: cn(S.item, activeId === item.id && S.itemActive, item.danger && S.itemDanger, item.disabled && S.itemDisabled, item.wrap && S.wrap, item.className), role: "menuitem", disabled: item.disabled, "aria-haspopup": item.submenu ? 'menu' : undefined, "aria-expanded": item.submenu ? activeId === item.id : undefined, onPointerDown: e => {
81
85
  // Keep focus off underlying inputs (e.g. ChatSelector search).
82
86
  e.preventDefault();
83
- }, onClick: e => onItemClick(item.id, e), 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: iconSize }))] }));
87
+ if (e.button === 0)
88
+ handleItemClick(item.id, e);
89
+ }, onKeyDown: e => {
90
+ if (e.key !== 'Enter' && e.key !== ' ')
91
+ return;
92
+ e.preventDefault();
93
+ handleItemClick(item.id, e);
94
+ }, children: [item.icon && (jsx("span", { className: S.icon, "aria-hidden": true, children: item.icon })), item.hint != null && item.hint !== '' ? (jsxs("span", { className: S.text, children: [jsx("span", { className: S.label, children: item.label }), jsx("span", { className: S.hint, children: item.hint })] })) : (jsx("span", { className: S.label, children: item.label })), item.submenu && (jsx(Icon, { className: S.chevron, type: "chevronRight", size: iconSize }))] }));
84
95
  }
85
96
  function renderItems() {
86
97
  return items.map(item => {
@@ -101,10 +112,13 @@ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end'
101
112
  }, children: renderItemButton(item) }, item.id));
102
113
  });
103
114
  }
115
+ if (items.length === 0)
116
+ return null;
104
117
  return (jsx(Popup, { ...popupProps, className: cn(S.root, className, popupProps?.className), size: size, isOpen: open, onOpen: () => onOpenChange(true), onClose: () => {
105
118
  onOpenChange(false);
106
119
  setActiveId(null);
107
- }, direction: align === 'end' ? 'bottom-left' : 'bottom-right', trigger: trigger, triggerProps: {
120
+ }, direction: popupProps?.direction ??
121
+ (align === 'end' ? 'bottom-left' : 'bottom-right'), trigger: trigger, triggerProps: {
108
122
  ...popupProps?.triggerProps,
109
123
  className: cn(S.trigger, popupProps?.triggerProps?.className),
110
124
  onClick: () => onOpenChange(!open),
@@ -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,.NestedMenu_trigger__zBeNI{display:inline-flex}.NestedMenu_content__OyLXN{box-sizing:border-box;max-width:min(100vw - 16px,360px);min-width:0;padding:4px;width:-moz-fit-content;width:fit-content}.NestedMenu_list__Q55Aa{display:flex;flex-direction:column;gap:1px}.NestedMenu_itemPopup__kMaxU{display:block;width:100%}.NestedMenu_itemTrigger__a7XHw{cursor:inherit;display:block;width:100%}.NestedMenu_itemWrap__Qmc0B{position:relative}.NestedMenu_back__dNsDV,.NestedMenu_item__tgbZm,.NestedMenu_row__48g5c{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:flex;font:inherit;font-weight:500;gap:8px;letter-spacing:.01em;line-height:1.3;text-align:left;text-decoration:none;width:100%}.NestedMenu_back__dNsDV:hover,.NestedMenu_item__tgbZm:hover,.NestedMenu_row__48g5c:hover{background:var(--accent-color-alpha-50)}.NestedMenu_back__dNsDV.NestedMenu_itemActive__RfPZH,.NestedMenu_item__tgbZm.NestedMenu_itemActive__RfPZH,.NestedMenu_row__48g5c.NestedMenu_itemActive__RfPZH{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_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}.NestedMenu_size-s__2n2te .NestedMenu_back__dNsDV,.NestedMenu_size-s__2n2te .NestedMenu_item__tgbZm,.NestedMenu_size-s__2n2te .NestedMenu_row__48g5c,.NestedMenu_size-xs__yUJ0q .NestedMenu_back__dNsDV,.NestedMenu_size-xs__yUJ0q .NestedMenu_item__tgbZm,.NestedMenu_size-xs__yUJ0q .NestedMenu_row__48g5c{border-radius:6px;font-size:12px;gap:6px;padding:4px 8px}.NestedMenu_size-s__2n2te.NestedMenu_content__OyLXN,.NestedMenu_size-xs__yUJ0q.NestedMenu_content__OyLXN{padding:3px}.NestedMenu_size-s__2n2te .NestedMenu_back__dNsDV svg,.NestedMenu_size-s__2n2te .NestedMenu_chevron__8i-Po,.NestedMenu_size-s__2n2te .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-s__2n2te .NestedMenu_row__48g5c svg,.NestedMenu_size-xs__yUJ0q .NestedMenu_back__dNsDV svg,.NestedMenu_size-xs__yUJ0q .NestedMenu_chevron__8i-Po,.NestedMenu_size-xs__yUJ0q .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-xs__yUJ0q .NestedMenu_row__48g5c svg{height:10px;width:10px}.NestedMenu_size-m__B8zm5 .NestedMenu_back__dNsDV,.NestedMenu_size-m__B8zm5 .NestedMenu_item__tgbZm,.NestedMenu_size-m__B8zm5 .NestedMenu_row__48g5c{border-radius:9px;font-size:13px;padding:6px 10px}.NestedMenu_size-l__1FrvQ .NestedMenu_back__dNsDV,.NestedMenu_size-l__1FrvQ .NestedMenu_item__tgbZm,.NestedMenu_size-l__1FrvQ .NestedMenu_row__48g5c{border-radius:12px;font-size:16px;gap:10px;padding:10px 14px}.NestedMenu_size-l__1FrvQ.NestedMenu_content__OyLXN{max-width:320px;padding:6px}.NestedMenu_size-l__1FrvQ .NestedMenu_back__dNsDV svg,.NestedMenu_size-l__1FrvQ .NestedMenu_chevron__8i-Po,.NestedMenu_size-l__1FrvQ .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-l__1FrvQ .NestedMenu_row__48g5c svg{height:18px;width:18px}.NestedMenu_size-xl__jiXmT .NestedMenu_back__dNsDV,.NestedMenu_size-xl__jiXmT .NestedMenu_item__tgbZm,.NestedMenu_size-xl__jiXmT .NestedMenu_row__48g5c{border-radius:15px;font-size:18px;gap:12px;padding:12px 16px}.NestedMenu_size-xl__jiXmT.NestedMenu_content__OyLXN{max-width:360px;padding:8px}.NestedMenu_size-xl__jiXmT .NestedMenu_back__dNsDV svg,.NestedMenu_size-xl__jiXmT .NestedMenu_chevron__8i-Po,.NestedMenu_size-xl__jiXmT .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-xl__jiXmT .NestedMenu_row__48g5c svg{height:22px;width:22px}";
4
- var S = {"root":"NestedMenu_root__ybyGA","trigger":"NestedMenu_trigger__zBeNI","content":"NestedMenu_content__OyLXN","list":"NestedMenu_list__Q55Aa","itemPopup":"NestedMenu_itemPopup__kMaxU","itemTrigger":"NestedMenu_itemTrigger__a7XHw","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","stacked":"NestedMenu_stacked__rMiOi","stackedBody":"NestedMenu_stackedBody__Fbkma","size-xs":"NestedMenu_size-xs__yUJ0q","size-s":"NestedMenu_size-s__2n2te","size-m":"NestedMenu_size-m__B8zm5","size-l":"NestedMenu_size-l__1FrvQ","size-xl":"NestedMenu_size-xl__jiXmT"};
3
+ var css_248z = ".NestedMenu_root__ybyGA,.NestedMenu_trigger__zBeNI{display:inline-flex}.NestedMenu_content__OyLXN{box-sizing:border-box;max-width:min(100vw - 16px,360px);min-width:0;padding:4px;width:-moz-fit-content;width:fit-content}.NestedMenu_list__Q55Aa{display:flex;flex-direction:column;gap:1px}.NestedMenu_itemPopup__kMaxU{display:block;width:100%}.NestedMenu_itemTrigger__a7XHw{cursor:inherit;display:block;width:100%}.NestedMenu_itemWrap__Qmc0B{position:relative}.NestedMenu_back__dNsDV,.NestedMenu_item__tgbZm,.NestedMenu_row__48g5c{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:flex;font:inherit;font-weight:500;gap:8px;letter-spacing:.01em;line-height:1.3;text-align:left;text-decoration:none;width:100%}.NestedMenu_back__dNsDV:hover,.NestedMenu_item__tgbZm:hover,.NestedMenu_row__48g5c:hover{background:var(--accent-color-alpha-50)}.NestedMenu_back__dNsDV.NestedMenu_itemActive__RfPZH,.NestedMenu_item__tgbZm.NestedMenu_itemActive__RfPZH,.NestedMenu_row__48g5c.NestedMenu_itemActive__RfPZH{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_text__0iCNy{display:flex;flex:1 1 auto;flex-direction:column;gap:0;justify-content:center;min-width:-moz-min-content;min-width:min-content}.NestedMenu_text__0iCNy .NestedMenu_label__Jnm6l{flex:none}.NestedMenu_hint__hotNP{flex-shrink:0;font-weight:400;line-height:1.2;margin:0;opacity:.5;white-space:nowrap}.NestedMenu_label__Jnm6l{flex:1;line-height:1.2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.NestedMenu_wrap__3b6E1 .NestedMenu_text__0iCNy{min-width:0}.NestedMenu_wrap__3b6E1 .NestedMenu_label__Jnm6l{overflow:visible;text-overflow:clip;white-space:normal}.NestedMenu_wrap__3b6E1 .NestedMenu_hint__hotNP{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_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}.NestedMenu_size-s__2n2te .NestedMenu_back__dNsDV,.NestedMenu_size-s__2n2te .NestedMenu_item__tgbZm,.NestedMenu_size-s__2n2te .NestedMenu_row__48g5c,.NestedMenu_size-xs__yUJ0q .NestedMenu_back__dNsDV,.NestedMenu_size-xs__yUJ0q .NestedMenu_item__tgbZm,.NestedMenu_size-xs__yUJ0q .NestedMenu_row__48g5c{border-radius:6px;font-size:12px;gap:6px;padding:4px 8px}.NestedMenu_size-s__2n2te.NestedMenu_content__OyLXN,.NestedMenu_size-xs__yUJ0q.NestedMenu_content__OyLXN{padding:3px}.NestedMenu_size-s__2n2te .NestedMenu_back__dNsDV svg,.NestedMenu_size-s__2n2te .NestedMenu_chevron__8i-Po,.NestedMenu_size-s__2n2te .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-s__2n2te .NestedMenu_row__48g5c svg,.NestedMenu_size-xs__yUJ0q .NestedMenu_back__dNsDV svg,.NestedMenu_size-xs__yUJ0q .NestedMenu_chevron__8i-Po,.NestedMenu_size-xs__yUJ0q .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-xs__yUJ0q .NestedMenu_row__48g5c svg{height:10px;width:10px}.NestedMenu_size-m__B8zm5 .NestedMenu_back__dNsDV,.NestedMenu_size-m__B8zm5 .NestedMenu_item__tgbZm,.NestedMenu_size-m__B8zm5 .NestedMenu_row__48g5c{border-radius:9px;font-size:13px;padding:6px 10px}.NestedMenu_size-l__1FrvQ .NestedMenu_back__dNsDV,.NestedMenu_size-l__1FrvQ .NestedMenu_item__tgbZm,.NestedMenu_size-l__1FrvQ .NestedMenu_row__48g5c{border-radius:12px;font-size:16px;gap:10px;padding:10px 14px}.NestedMenu_size-l__1FrvQ.NestedMenu_content__OyLXN{max-width:320px;padding:6px}.NestedMenu_size-l__1FrvQ .NestedMenu_back__dNsDV svg,.NestedMenu_size-l__1FrvQ .NestedMenu_chevron__8i-Po,.NestedMenu_size-l__1FrvQ .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-l__1FrvQ .NestedMenu_row__48g5c svg{height:18px;width:18px}.NestedMenu_size-xl__jiXmT .NestedMenu_back__dNsDV,.NestedMenu_size-xl__jiXmT .NestedMenu_item__tgbZm,.NestedMenu_size-xl__jiXmT .NestedMenu_row__48g5c{border-radius:15px;font-size:18px;gap:12px;padding:12px 16px}.NestedMenu_size-xl__jiXmT.NestedMenu_content__OyLXN{max-width:360px;padding:8px}.NestedMenu_size-xl__jiXmT .NestedMenu_back__dNsDV svg,.NestedMenu_size-xl__jiXmT .NestedMenu_chevron__8i-Po,.NestedMenu_size-xl__jiXmT .NestedMenu_icon__4g2Yp svg,.NestedMenu_size-xl__jiXmT .NestedMenu_row__48g5c svg{height:22px;width:22px}";
4
+ var S = {"root":"NestedMenu_root__ybyGA","trigger":"NestedMenu_trigger__zBeNI","content":"NestedMenu_content__OyLXN","list":"NestedMenu_list__Q55Aa","itemPopup":"NestedMenu_itemPopup__kMaxU","itemTrigger":"NestedMenu_itemTrigger__a7XHw","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","text":"NestedMenu_text__0iCNy","label":"NestedMenu_label__Jnm6l","hint":"NestedMenu_hint__hotNP","wrap":"NestedMenu_wrap__3b6E1","chevron":"NestedMenu_chevron__8i-Po","stacked":"NestedMenu_stacked__rMiOi","stackedBody":"NestedMenu_stackedBody__Fbkma","size-xs":"NestedMenu_size-xs__yUJ0q","size-s":"NestedMenu_size-s__2n2te","size-m":"NestedMenu_size-m__B8zm5","size-l":"NestedMenu_size-l__1FrvQ","size-xl":"NestedMenu_size-xl__jiXmT"};
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 = ".Popup_root__uQ-fP{display:inline-block;position:relative}.Popup_contentWrapper__2yi-2{opacity:0;pointer-events:none;position:absolute}.Popup_contentWrapper__2yi-2.Popup_animating__kR0qF{transition:opacity .1s ease-out}.Popup_contentWrapper__2yi-2.Popup_isOpen__BRIdP{opacity:1;z-index:11}.Popup_contentWrapper__2yi-2.Popup_inline__1-l1S.Popup_isOpen__BRIdP{position:relative}.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S),.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S)>.Popup_content__e8Qyu{position:absolute}.Popup_trigger__jQNaQ{cursor:pointer}.Popup_trigger__jQNaQ.Popup_isOpen__BRIdP{position:relative;z-index:11}.Popup_trigger__jQNaQ.Popup_disabled__DlE9y{opacity:.4;pointer-events:none}.Popup_content__e8Qyu{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--decent-color);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50);box-sizing:border-box;max-width:min(min(560px,70vw),calc(100svw - 16px));min-width:100%;overflow:hidden;position:relative;transform-origin:top center;z-index:11}.Popup_content__e8Qyu:before{background-color:var(--accent-color-alpha-50);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_content__e8Qyu.Popup_blur__1hfU8{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background-color:var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_size-xs__7QR-d{border-radius:6px}.Popup_content__e8Qyu.Popup_size-xs__7QR-d.Popup_round__7rD1m{border-radius:12px}.Popup_content__e8Qyu.Popup_size-s__UmixP{border-radius:6px}.Popup_content__e8Qyu.Popup_size-s__UmixP.Popup_round__7rD1m{border-radius:16px}.Popup_content__e8Qyu.Popup_size-m__FYpTL{border-radius:9px}.Popup_content__e8Qyu.Popup_size-m__FYpTL.Popup_round__7rD1m{border-radius:20px}.Popup_content__e8Qyu.Popup_size-l__BTS57{border-radius:12px}.Popup_content__e8Qyu.Popup_size-l__BTS57.Popup_round__7rD1m{border-radius:24px}.Popup_content__e8Qyu.Popup_size-xl__fSfCc{border-radius:15px}.Popup_content__e8Qyu.Popup_size-xl__fSfCc.Popup_round__7rD1m{border-radius:28px}.Popup_content__e8Qyu.Popup_elevation-1__vmP3e{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--p-3) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_elevation-2__Ci4sI{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--p-5) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_outlined__g3cJV:after{border-radius:inherit;bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_isOpen__BRIdP .Popup_content__e8Qyu{opacity:1;pointer-events:all;transform:scaleX(1)}.Popup_animating__kR0qF{transition:70ms ease-out;transition-property:transform,opacity,margin}.Popup_axis-top__BaLgG{bottom:100%}.Popup_axis-bottom__hZwwr{top:100%}.Popup_axis-right__LMYVy{left:100%}.Popup_axis-left__SFKm-{right:100%}.Popup_float-top__8SQAu{bottom:0}.Popup_float-right__mdm-3{left:0}.Popup_float-bottom__7flve{top:0}.Popup_float-left__tz7fX{right:0}.Popup_axis-bottom__hZwwr,.Popup_axis-top__BaLgG{transform:scaleY(.5)}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{left:50%;transform:translateX(-50%) scaleY(.5)}.Popup_isOpen__BRIdP .Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform:translateX(-50%) scaleX(1)}.Popup_axis-left__SFKm-,.Popup_axis-right__LMYVy{transform:scaleX(.5)}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{top:50%;transform:translateY(-50%) scaleX(.5)}.Popup_isOpen__BRIdP .Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform:translateY(-50%) scaleX(1)}.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform-origin:bottom center}.Popup_axis-top__BaLgG.Popup_float-right__mdm-3{transform-origin:bottom left}.Popup_axis-top__BaLgG.Popup_float-left__tz7fX{transform-origin:bottom right}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1{transform-origin:top center}.Popup_axis-bottom__hZwwr.Popup_float-right__mdm-3{transform-origin:top left}.Popup_axis-bottom__hZwwr.Popup_float-left__tz7fX{transform-origin:top right}.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform-origin:center left}.Popup_axis-right__LMYVy.Popup_float-top__8SQAu{transform-origin:bottom left}.Popup_axis-right__LMYVy.Popup_float-bottom__7flve{transform-origin:top left}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1{transform-origin:center right}.Popup_axis-left__SFKm-.Popup_float-top__8SQAu{transform-origin:bottom right}.Popup_axis-left__SFKm-.Popup_float-bottom__7flve{transform-origin:top right}";
3
+ var css_248z = ".Popup_root__uQ-fP{display:inline-block;position:relative}.Popup_contentWrapper__2yi-2{opacity:0;pointer-events:none;position:absolute}.Popup_contentWrapper__2yi-2.Popup_animating__kR0qF{transition:opacity .1s ease-out}.Popup_contentWrapper__2yi-2.Popup_isOpen__BRIdP{opacity:1;z-index:11}.Popup_contentWrapper__2yi-2.Popup_inline__1-l1S.Popup_isOpen__BRIdP{position:relative}.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S),.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S)>.Popup_content__e8Qyu{position:absolute}.Popup_trigger__jQNaQ{cursor:pointer}.Popup_trigger__jQNaQ.Popup_isOpen__BRIdP{position:relative;z-index:11}.Popup_trigger__jQNaQ.Popup_disabled__DlE9y{opacity:.4;pointer-events:none}.Popup_content__e8Qyu{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--decent-color);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50);box-sizing:border-box;max-width:min(min(560px,70vw),calc(100svw - 16px));min-width:100%;overflow:hidden;position:relative;transform-origin:top center;z-index:11}.Popup_content__e8Qyu:before{background-color:var(--accent-color-alpha-50);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_content__e8Qyu.Popup_blur__1hfU8{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background-color:var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_size-xs__7QR-d{border-radius:8.4px}.Popup_content__e8Qyu.Popup_size-xs__7QR-d.Popup_round__7rD1m{border-radius:12px}.Popup_content__e8Qyu.Popup_size-s__UmixP{border-radius:8.4px}.Popup_content__e8Qyu.Popup_size-s__UmixP.Popup_round__7rD1m{border-radius:16px}.Popup_content__e8Qyu.Popup_size-m__FYpTL{border-radius:12.6px}.Popup_content__e8Qyu.Popup_size-m__FYpTL.Popup_round__7rD1m{border-radius:20px}.Popup_content__e8Qyu.Popup_size-l__BTS57{border-radius:16.8px}.Popup_content__e8Qyu.Popup_size-l__BTS57.Popup_round__7rD1m{border-radius:24px}.Popup_content__e8Qyu.Popup_size-xl__fSfCc{border-radius:21px}.Popup_content__e8Qyu.Popup_size-xl__fSfCc.Popup_round__7rD1m{border-radius:28px}.Popup_content__e8Qyu.Popup_elevation-1__vmP3e{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--p-3) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_elevation-2__Ci4sI{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--p-5) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_outlined__g3cJV:after{border-radius:inherit;bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_isOpen__BRIdP .Popup_content__e8Qyu{opacity:1;pointer-events:all;transform:scaleX(1)}.Popup_animating__kR0qF{transition:70ms ease-out;transition-property:transform,opacity,margin}.Popup_axis-top__BaLgG{bottom:100%}.Popup_axis-bottom__hZwwr{top:100%}.Popup_axis-right__LMYVy{left:100%}.Popup_axis-left__SFKm-{right:100%}.Popup_float-top__8SQAu{bottom:0}.Popup_float-right__mdm-3{left:0}.Popup_float-bottom__7flve{top:0}.Popup_float-left__tz7fX{right:0}.Popup_axis-bottom__hZwwr,.Popup_axis-top__BaLgG{transform:scaleY(.5)}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{left:50%;transform:translateX(-50%) scaleY(.5)}.Popup_isOpen__BRIdP .Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform:translateX(-50%) scaleX(1)}.Popup_axis-left__SFKm-,.Popup_axis-right__LMYVy{transform:scaleX(.5)}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{top:50%;transform:translateY(-50%) scaleX(.5)}.Popup_isOpen__BRIdP .Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform:translateY(-50%) scaleX(1)}.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform-origin:bottom center}.Popup_axis-top__BaLgG.Popup_float-right__mdm-3{transform-origin:bottom left}.Popup_axis-top__BaLgG.Popup_float-left__tz7fX{transform-origin:bottom right}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1{transform-origin:top center}.Popup_axis-bottom__hZwwr.Popup_float-right__mdm-3{transform-origin:top left}.Popup_axis-bottom__hZwwr.Popup_float-left__tz7fX{transform-origin:top right}.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform-origin:center left}.Popup_axis-right__LMYVy.Popup_float-top__8SQAu{transform-origin:bottom left}.Popup_axis-right__LMYVy.Popup_float-bottom__7flve{transform-origin:top left}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1{transform-origin:center right}.Popup_axis-left__SFKm-.Popup_float-top__8SQAu{transform-origin:bottom right}.Popup_axis-left__SFKm-.Popup_float-bottom__7flve{transform-origin:top right}";
4
4
  var S = {"root":"Popup_root__uQ-fP","contentWrapper":"Popup_contentWrapper__2yi-2","animating":"Popup_animating__kR0qF","isOpen":"Popup_isOpen__BRIdP","inline":"Popup_inline__1-l1S","content":"Popup_content__e8Qyu","trigger":"Popup_trigger__jQNaQ","disabled":"Popup_disabled__DlE9y","blur":"Popup_blur__1hfU8","size-xs":"Popup_size-xs__7QR-d","round":"Popup_round__7rD1m","size-s":"Popup_size-s__UmixP","size-m":"Popup_size-m__FYpTL","size-l":"Popup_size-l__BTS57","size-xl":"Popup_size-xl__fSfCc","elevation-1":"Popup_elevation-1__vmP3e","elevation-2":"Popup_elevation-2__Ci4sI","outlined":"Popup_outlined__g3cJV","axis-top":"Popup_axis-top__BaLgG","axis-bottom":"Popup_axis-bottom__hZwwr","axis-right":"Popup_axis-right__LMYVy","axis-left":"Popup_axis-left__SFKm-","float-top":"Popup_float-top__8SQAu","float-right":"Popup_float-right__mdm-3","float-bottom":"Popup_float-bottom__7flve","float-left":"Popup_float-left__tz7fX","float-middle":"Popup_float-middle__Dmnn1"};
5
5
  styleInject(css_248z);
6
6
 
@@ -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, isSearchable, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, selectedChipRemoveTooltip, selectedChipIds, onOpen, onClose, onFocus, onBlur, } = props;
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, label, size, round, variant]);
223
+ }), [props.triggerProps, size, round, fieldVariant, triggerVariant, isSearchable]);
222
224
  const getFieldLabel = (label) => {
223
- if (disableLabel)
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 { label, className, ...rest } = triggerProps;
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: "default", ...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) }))] }));
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: cn(variant === 'links' && S['variant-links'], tabsClassName), ...rest, children: tabsButtons }) }));
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>button:not(:first-child){border-radius:inherit;margin-left:0}.Tabs_variant-links__-N1Ym>button:not(:last-child){border-radius:inherit}.Tabs_variant-links__-N1Ym .Tabs_tab__-oN-g{background-color:transparent!important;box-shadow:none;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","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,8 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import cn from 'classnames';
3
2
  import S from './ThinkingOutline.styl.js';
3
+ import cn from 'classnames';
4
4
 
5
- function ThinkingOutline({ active, className }) {
5
+ function ThinkingOutline({ active = false, className, }) {
6
6
  return (jsx("div", { className: cn(S.root, active && S.active, className), children: jsx("div", { className: S.bloom }) }));
7
7
  }
8
8
 
@@ -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;border-radius:inherit;inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .5s ease-out}.ThinkingOutline_root__rvvBG.ThinkingOutline_active__-66iV{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}}";
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 (no STT / live voice). */
87
+ /** Default true. Hidden file input + plus button. */
67
88
  showAttach?: boolean;
68
89
  onAttach?: (files: File[]) => void;
69
90
  attachAccept?: string;
70
- /** Default true. Compact model dropdown (e.g. Auto Router). */
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';
@@ -1,6 +1,6 @@
1
1
  import * as T from './Input.types';
2
2
  export type InputProps = T.Props;
3
- export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "onChange"> & Omit<T.ControlProps, "onChange" | "ref"> & import("../../types").FormControl<T.Value, HTMLInputElement> & {
3
+ export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> & Omit<T.ControlProps, "onChange" | "size" | "ref"> & import("../../types").FormControl<T.Value, HTMLInputElement> & {
4
4
  name?: string;
5
5
  step?: number;
6
6
  size?: import("../../types").Size;
@@ -1,7 +1,7 @@
1
1
  import * as T from './NestedMenu.types';
2
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
- declare function NestedMenuComponent({ trigger, items, open, onOpenChange, align, size, className, popupProps, }: T.Props): import("react").JSX.Element;
4
+ declare function NestedMenuComponent({ trigger, items, open, onOpenChange, align, size, className, popupProps, onItemClick, }: T.Props): import("react").JSX.Element;
5
5
  export declare const NestedMenu: typeof NestedMenuComponent & {
6
6
  Item: typeof NestedMenuItemRow;
7
7
  Label: typeof NestedMenuLabel;
@@ -6,7 +6,7 @@ export type NestedMenuItem = {
6
6
  label: ReactNode;
7
7
  icon?: ReactNode;
8
8
  hint?: ReactNode;
9
- /** Wrap long hint/label onto additional lines instead of clipping. */
9
+ /** Allow long hint/label text to wrap inside the text column. */
10
10
  wrap?: boolean;
11
11
  submenu?: ReactNode;
12
12
  onSubmenuOpen?: () => void;
@@ -22,6 +22,7 @@ export type Props = {
22
22
  items: NestedMenuItem[];
23
23
  open: boolean;
24
24
  onOpenChange: (open: boolean) => void;
25
+ onItemClick?: (id: string) => void;
25
26
  align?: 'start' | 'end';
26
27
  size?: Size;
27
28
  className?: string;
@@ -0,0 +1,3 @@
1
+ import * as T from './Resizer.types';
2
+ export type { Props as ResizerProps, SizeValue } from './Resizer.types';
3
+ export declare function Resizer({ vertical, content, className, sizes, minWidths, rememberKey, }: T.Props): import("react").JSX.Element;
@@ -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,10 @@
1
+ import { ReactNode } from 'react';
2
+ export type SizeValue = number | string;
3
+ export type Props = {
4
+ vertical?: boolean;
5
+ content: ReactNode[];
6
+ sizes?: number[];
7
+ minWidths?: SizeValue[];
8
+ rememberKey?: string;
9
+ className?: string;
10
+ };
@@ -4,7 +4,7 @@ import { Component, ReactNode } from 'react';
4
4
  export declare const SelectHelpers: typeof H;
5
5
  export declare class Select extends Component<T.Props, T.State> {
6
6
  store: any;
7
- inputRef: import("react").RefObject<import("react").ForwardRefExoticComponent<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "onChange"> & Omit<import("../Input/Input.types").ControlProps, "onChange" | "ref"> & import("../../types").FormControl<import("../Input/Input.types").Value, HTMLInputElement> & {
7
+ inputRef: import("react").RefObject<import("react").ForwardRefExoticComponent<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> & Omit<import("../Input/Input.types").ControlProps, "onChange" | "size" | "ref"> & import("../../types").FormControl<import("../Input/Input.types").Value, HTMLInputElement> & {
8
8
  name?: string;
9
9
  step?: number;
10
10
  size?: import("../../types").Size;
@@ -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;
@@ -2,4 +2,4 @@ export type ThinkingOutlineProps = {
2
2
  active?: boolean;
3
3
  className?: string;
4
4
  };
5
- export declare function ThinkingOutline({ active, className }: ThinkingOutlineProps): import("react").JSX.Element;
5
+ export declare function ThinkingOutline({ active, className, }: ThinkingOutlineProps): import("react").JSX.Element;
@@ -38,7 +38,6 @@ export * from './Nudge';
38
38
  export * from './Paranja/Paranja';
39
39
  export * from './Popup/Popup';
40
40
  export * from './Portal/Portal';
41
- export * from './PopupMenu/PopupMenu';
42
41
  export * from './Progress/Progress';
43
42
  export * from './ProgressCircular/ProgressCircular';
44
43
  export * from './PromptComposer';
@@ -46,6 +45,7 @@ export * from './RadioButton/RadioButton';
46
45
  export * from './RadioGroup/RadioGroup';
47
46
  export * from './Router/Router';
48
47
  export * from './RequiredStar/RequiredStar';
48
+ export * from './Resizer/Resizer';
49
49
  export * from './Select/Select';
50
50
  export * from './Select/Select2';
51
51
  export * from './Scroll/Scroll';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "5.16.1",
3
+ "version": "5.18.0",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",
@@ -1,15 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { createElement } from 'react';
3
- import cn from 'classnames';
4
- import { Button } from '../Button/Button.js';
5
- import { Popup } from '../Popup/Popup.js';
6
- import S from './PopupMenu.styl.js';
7
-
8
- function PopupMenu({ items, ...props }) {
9
- if (items.length === 0)
10
- return null;
11
- const { size } = props;
12
- return (jsx(Popup, { ...props, content: jsx("div", { className: S.list, children: items.map(({ id, title, className, ...rest }) => (createElement(Button, { variant: "clear", size: size, ...rest, className: cn(S.item, className), key: id }, title))) }) }));
13
- }
14
-
15
- export { PopupMenu };
@@ -1,7 +0,0 @@
1
- import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
-
3
- var css_248z = ".PopupMenu_list__G7xP3{align-items:stretch;border-radius:inherit;display:flex;flex-direction:column;padding:2px}.PopupMenu_item__wxay-{gap:var(--p-2);justify-content:flex-start;text-align:left;white-space:nowrap}.PopupMenu_item__wxay-+.PopupMenu_item__wxay-{margin-top:2px}.PopupMenu_item__wxay-:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.PopupMenu_item__wxay-:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}";
4
- var S = {"list":"PopupMenu_list__G7xP3","item":"PopupMenu_item__wxay-"};
5
- styleInject(css_248z);
6
-
7
- export { S as default };
@@ -1,2 +0,0 @@
1
- import * as T from './PopupMenu.types';
2
- export declare function PopupMenu({ items, ...props }: T.Props): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import type { Props as ButtonProps } from '../Button/Button.types';
3
- import type { Props as PopupProps } from '../Popup/Popup.types';
4
- export type Item = Pick<ButtonProps, 'onClick'> & {
5
- id: string;
6
- title: ReactNode;
7
- className?: string;
8
- };
9
- export type Props = Omit<PopupProps, 'content'> & {
10
- trigger: ReactNode;
11
- items: Item[];
12
- onClose?: () => void;
13
- };