@burdenoff/microfe-healthybowl 2026.629.7 → 2026.629.8
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.
|
@@ -9,33 +9,32 @@ var o = ({ onSend: o, disabled: s = !1, placeholder: c = "Ask anything...", tool
|
|
|
9
9
|
if (!e) return;
|
|
10
10
|
let t = e.value.trim();
|
|
11
11
|
!t || s || (o(t), e.value = "", e.style.height = "auto");
|
|
12
|
-
}, [o, s])
|
|
13
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), f());
|
|
14
|
-
}, [f]), m = t(() => {
|
|
15
|
-
let e = d.current;
|
|
16
|
-
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 140)}px`);
|
|
17
|
-
}, []);
|
|
12
|
+
}, [o, s]);
|
|
18
13
|
return /* @__PURE__ */ i("div", {
|
|
19
14
|
className: "px-4 pb-4 pt-2",
|
|
20
15
|
children: /* @__PURE__ */ a("div", {
|
|
21
|
-
className: "
|
|
22
|
-
children: [
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
className: "rounded-2xl border border-border-default bg-bg-sunken px-1.5 pb-2 pt-1.5 shadow-sm transition-all focus-within:border-action-primary-bg focus-within:shadow-md focus-within:ring-2 focus-within:ring-action-primary-bg/15",
|
|
17
|
+
children: [/* @__PURE__ */ i("textarea", {
|
|
18
|
+
ref: d,
|
|
19
|
+
onKeyDown: t((e) => {
|
|
20
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), f());
|
|
21
|
+
}, [f]),
|
|
22
|
+
onInput: t(() => {
|
|
23
|
+
let e = d.current;
|
|
24
|
+
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 200)}px`);
|
|
25
|
+
}, []),
|
|
26
|
+
disabled: s,
|
|
27
|
+
placeholder: c,
|
|
28
|
+
rows: 3,
|
|
29
|
+
className: "min-h-[84px] w-full resize-none bg-transparent px-3 pb-2 pt-2.5 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
|
|
30
|
+
"aria-label": u("healthybowl.assistant.chatInput.ariaLabel", "Message input"),
|
|
31
|
+
"data-testid": "assistant-input"
|
|
32
|
+
}), /* @__PURE__ */ a("div", {
|
|
33
|
+
className: "flex items-center justify-between gap-2 px-1.5 pb-0.5 pt-1",
|
|
34
|
+
children: [/* @__PURE__ */ i("div", {
|
|
35
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
25
36
|
children: l
|
|
26
|
-
})
|
|
27
|
-
/* @__PURE__ */ i("textarea", {
|
|
28
|
-
ref: d,
|
|
29
|
-
onKeyDown: p,
|
|
30
|
-
onInput: m,
|
|
31
|
-
disabled: s,
|
|
32
|
-
placeholder: c,
|
|
33
|
-
rows: 1,
|
|
34
|
-
className: "min-w-0 flex-1 resize-none bg-transparent px-2 py-1.5 text-[13px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
|
|
35
|
-
"aria-label": u("healthybowl.assistant.chatInput.ariaLabel", "Message input"),
|
|
36
|
-
"data-testid": "assistant-input"
|
|
37
|
-
}),
|
|
38
|
-
/* @__PURE__ */ i("button", {
|
|
37
|
+
}), /* @__PURE__ */ i("button", {
|
|
39
38
|
type: "button",
|
|
40
39
|
onClick: f,
|
|
41
40
|
disabled: s,
|
|
@@ -43,8 +42,8 @@ var o = ({ onSend: o, disabled: s = !1, placeholder: c = "Ask anything...", tool
|
|
|
43
42
|
"aria-label": u("healthybowl.assistant.chatInput.send", "Send message"),
|
|
44
43
|
"data-testid": "assistant-send",
|
|
45
44
|
children: /* @__PURE__ */ i(r, { className: "size-4" })
|
|
46
|
-
})
|
|
47
|
-
]
|
|
45
|
+
})]
|
|
46
|
+
})]
|
|
48
47
|
})
|
|
49
48
|
});
|
|
50
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChatInput.js","names":[],"sources":["../../../src/components/assistant/AssistantChatInput.tsx"],"sourcesContent":["import { useRef, useCallback, type FC, type KeyboardEvent, type ReactNode } from 'react';\nimport { ArrowUp } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface Props {\n onSend: (message: string) => void;\n disabled?: boolean;\n placeholder?: string;\n /** Rendered inline on the left of the composer toolbar (e.g. the mode chip). */\n toolbarStart?: ReactNode;\n}\n\n/**\n * Composer — a
|
|
1
|
+
{"version":3,"file":"AssistantChatInput.js","names":[],"sources":["../../../src/components/assistant/AssistantChatInput.tsx"],"sourcesContent":["import { useRef, useCallback, type FC, type KeyboardEvent, type ReactNode } from 'react';\nimport { ArrowUp } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface Props {\n onSend: (message: string) => void;\n disabled?: boolean;\n placeholder?: string;\n /** Rendered inline on the left of the composer toolbar (e.g. the mode chip). */\n toolbarStart?: ReactNode;\n}\n\n/**\n * Composer — a large rounded \"card\" (Google-Stitch / Gemini style): a roomy\n * input area on top with a controls toolbar pinned at the bottom (the mode chip\n * on the left, a circular send up-arrow on the right). The whole card lifts its\n * border on focus. Uses HB semantic tokens only.\n */\nexport const AssistantChatInput: FC<Props> = ({\n onSend,\n disabled = false,\n placeholder = 'Ask anything...',\n toolbarStart,\n}) => {\n const tr = useTr();\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const handleSend = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n const value = textarea.value.trim();\n if (!value || disabled) return;\n\n onSend(value);\n textarea.value = '';\n textarea.style.height = 'auto';\n }, [onSend, disabled]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n const handleInput = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;\n }, []);\n\n return (\n <div className=\"px-4 pb-4 pt-2\">\n {/* Large two-row composer card: a roomy input area on top, the controls\n toolbar pinned at the bottom (mode chip left, circular send right). */}\n <div className=\"rounded-2xl border border-border-default bg-bg-sunken px-1.5 pb-2 pt-1.5 shadow-sm transition-all focus-within:border-action-primary-bg focus-within:shadow-md focus-within:ring-2 focus-within:ring-action-primary-bg/15\">\n <textarea\n ref={textareaRef}\n onKeyDown={handleKeyDown}\n onInput={handleInput}\n disabled={disabled}\n placeholder={placeholder}\n rows={3}\n className=\"min-h-[84px] w-full resize-none bg-transparent px-3 pb-2 pt-2.5 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50\"\n aria-label={tr('healthybowl.assistant.chatInput.ariaLabel', 'Message input')}\n data-testid=\"assistant-input\"\n />\n <div className=\"flex items-center justify-between gap-2 px-1.5 pb-0.5 pt-1\">\n <div className=\"flex min-w-0 items-center gap-1.5\">{toolbarStart}</div>\n <button\n type=\"button\"\n onClick={handleSend}\n disabled={disabled}\n className=\"flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text shadow-sm transition-all hover:bg-action-primary-bg-hover hover:scale-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:scale-100 disabled:opacity-40\"\n aria-label={tr('healthybowl.assistant.chatInput.send', 'Send message')}\n data-testid=\"assistant-send\"\n >\n <ArrowUp className=\"size-4\" />\n </button>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AAkBA,IAAa,KAAiC,EAC5C,WACA,cAAW,IACX,iBAAc,mBACd,sBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAc,EAA4B,KAAK,EAE/C,IAAa,QAAkB;EACnC,IAAM,IAAW,EAAY;AAC7B,MAAI,CAAC,EAAU;EAEf,IAAM,IAAQ,EAAS,MAAM,MAAM;AAC/B,GAAC,KAAS,MAEd,EAAO,EAAM,EACb,EAAS,QAAQ,IACjB,EAAS,MAAM,SAAS;IACvB,CAAC,GAAQ,EAAS,CAAC;AAmBtB,QACE,kBAAC,OAAD;EAAK,WAAU;YAGb,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,YAAD;IACE,KAAK;IACL,WAxBc,GACnB,MAA0C;AACzC,KAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,aAC1B,EAAE,gBAAgB,EAClB,GAAY;OAGhB,CAAC,EAAW,CACb;IAiBO,SAfY,QAAkB;KACpC,IAAM,IAAW,EAAY;AACxB,WACL,EAAS,MAAM,SAAS,QACxB,EAAS,MAAM,SAAS,GAAG,KAAK,IAAI,EAAS,cAAc,IAAI,CAAC;OAC/D,EAAE,CAAC;IAWY;IACG;IACb,MAAM;IACN,WAAU;IACV,cAAY,EAAG,6CAA6C,gBAAgB;IAC5E,eAAY;IACZ,CAAA,EACF,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAqC;KAAmB,CAAA,EACvE,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACC;KACV,WAAU;KACV,cAAY,EAAG,wCAAwC,eAAe;KACtE,eAAY;eAEZ,kBAAC,GAAD,EAAS,WAAU,UAAW,CAAA;KACvB,CAAA,CACL;MACF;;EACF,CAAA"}
|
package/package.json
CHANGED