@burdenoff/microfe-healthybowl 2026.725.2 → 2026.725.3

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.
@@ -2,73 +2,89 @@ import { useTr as e } from "../../../shared/hooks/useTr.js";
2
2
  import { AssistantAttachmentButton as t } from "./AssistantAttachmentButton.js";
3
3
  import { AssistantVoiceButton as n } from "./AssistantVoiceButton.js";
4
4
  import { AssistantModeSelector as r } from "./AssistantModeSelector.js";
5
- import { useCallback as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
6
- import { ArrowUp as c, Loader2 as l } from "lucide-react";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
+ import { useCallback as i, useEffect as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
6
+ import { ArrowUp as l, Loader2 as u } from "lucide-react";
7
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
+ import { useVoiceInput as p } from "@burdenoff/fe-libs/shared/components";
8
9
  //#region src/components/assistant/composer/AssistantComposer.tsx
9
- var f = 200, p = ({ onSend: p, disabled: m = !1, placeholder: h, mode: g, availableModes: _, onModeChange: v }) => {
10
- let y = e(), b = o(null), [x, S] = s(""), C = h ?? y("healthybowl.assistant.composer.placeholder", "Ask HealthyBowl anything…"), w = x.trim().length > 0 && !m;
11
- a(() => {
12
- let e = b.current;
13
- e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, f)}px`);
14
- }, [x]);
15
- let T = i(() => {
16
- let e = x.trim();
17
- !e || m || (p(e), S(""));
10
+ var m = 200, h = ({ onSend: h, disabled: g = !1, placeholder: _, mode: v, availableModes: y, onModeChange: b }) => {
11
+ let x = e(), S = s(null), [C, w] = c(""), T = p(), E = s(""), D = _ ?? x("healthybowl.assistant.composer.placeholder", "Ask HealthyBowl anything…"), O = C.trim().length > 0 && !g;
12
+ o(() => {
13
+ let e = S.current;
14
+ e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, m)}px`);
15
+ }, [C]), a(() => {
16
+ if (!T.isListening && !T.transcript) return;
17
+ let e = E.current;
18
+ w(e ? `${e} ${T.transcript}`.trimStart() : T.transcript);
19
+ }, [T.transcript, T.isListening]);
20
+ let k = i(() => {
21
+ T.isListening && T.stop(), T.reset(), E.current = "";
22
+ }, [T]), A = i(() => {
23
+ T.isListening ? T.stop() : (E.current = C.trim(), T.reset(), T.start());
24
+ }, [T, C]), j = i(() => {
25
+ let e = C.trim();
26
+ !e || g || (k(), h(e), w(""));
18
27
  }, [
19
- x,
20
- m,
21
- p
22
- ]), E = i((e) => {
23
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), T());
24
- }, [T]);
25
- return /* @__PURE__ */ d("div", {
28
+ C,
29
+ g,
30
+ h,
31
+ k
32
+ ]), M = i((e) => {
33
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), j());
34
+ }, [j]);
35
+ return /* @__PURE__ */ f("div", {
26
36
  className: "flex-shrink-0 px-3 pb-3 pt-1.5",
27
- children: [/* @__PURE__ */ d("div", {
37
+ children: [/* @__PURE__ */ f("div", {
28
38
  className: "rounded-2xl border border-border-default bg-bg-sunken p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15",
29
- children: [/* @__PURE__ */ d("div", {
39
+ children: [/* @__PURE__ */ f("div", {
30
40
  className: "flex items-end gap-2",
31
41
  children: [
32
- /* @__PURE__ */ u(t, {}),
33
- /* @__PURE__ */ u("textarea", {
34
- ref: b,
35
- value: x,
36
- onChange: (e) => S(e.target.value),
37
- onKeyDown: E,
38
- disabled: m,
39
- placeholder: C,
42
+ /* @__PURE__ */ d(t, {}),
43
+ /* @__PURE__ */ d("textarea", {
44
+ ref: S,
45
+ value: C,
46
+ onChange: (e) => w(e.target.value),
47
+ onKeyDown: M,
48
+ disabled: g,
49
+ placeholder: D,
40
50
  rows: 1,
41
51
  className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
42
- "aria-label": y("healthybowl.assistant.chatInput.ariaLabel", "Message input"),
52
+ "aria-label": x("healthybowl.assistant.chatInput.ariaLabel", "Message input"),
43
53
  "data-testid": "assistant-input"
44
54
  }),
45
- /* @__PURE__ */ u(n, {}),
46
- /* @__PURE__ */ u("button", {
55
+ /* @__PURE__ */ d(n, {
56
+ isSupported: T.isSupported,
57
+ isListening: T.isListening,
58
+ onToggle: A,
59
+ disabled: g
60
+ }),
61
+ /* @__PURE__ */ d("button", {
47
62
  type: "button",
48
- onClick: T,
49
- disabled: !w,
50
- className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${w ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
51
- "aria-label": y("healthybowl.assistant.chatInput.send", "Send message"),
63
+ onClick: j,
64
+ disabled: !O,
65
+ className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${O ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
66
+ "aria-label": x("healthybowl.assistant.chatInput.send", "Send message"),
52
67
  "data-testid": "assistant-send",
53
- children: m ? /* @__PURE__ */ u(l, { className: "size-4 animate-spin" }) : /* @__PURE__ */ u(c, { className: "size-4" })
68
+ children: g ? /* @__PURE__ */ d(u, { className: "size-4 animate-spin" }) : /* @__PURE__ */ d(l, { className: "size-4" })
54
69
  })
55
70
  ]
56
- }), _.length > 1 && /* @__PURE__ */ u("div", {
71
+ }), y.length > 1 && /* @__PURE__ */ d("div", {
57
72
  className: "mt-2 px-0.5",
58
- children: /* @__PURE__ */ u(r, {
59
- mode: g,
60
- availableModes: _,
61
- onModeChange: v,
62
- disabled: m
73
+ children: /* @__PURE__ */ d(r, {
74
+ mode: v,
75
+ availableModes: y,
76
+ onModeChange: b,
77
+ disabled: g
63
78
  })
64
79
  })]
65
- }), /* @__PURE__ */ u("p", {
66
- className: "mt-1.5 px-1 text-center text-[11px] text-text-muted",
67
- children: y("healthybowl.assistant.composer.hint", "Enter to send · Shift+Enter for newline")
80
+ }), /* @__PURE__ */ d("p", {
81
+ className: `mt-1.5 px-1 text-center text-[11px] ${T.isListening ? "font-medium text-status-error-text" : "text-text-muted"}`,
82
+ "aria-live": "polite",
83
+ children: T.isListening ? x("healthybowl.assistant.composer.listening", "Listening… tap the mic to stop") : x("healthybowl.assistant.composer.hint", "Enter to send · Shift+Enter for newline")
68
84
  })]
69
85
  });
70
86
  };
71
87
  //#endregion
72
- export { p as AssistantComposer };
88
+ export { h as AssistantComposer };
73
89
 
74
90
  //# sourceMappingURL=AssistantComposer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantComposer.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantComposer.tsx"],"sourcesContent":["import { useCallback, useLayoutEffect, useRef, useState, type FC, type KeyboardEvent } from 'react';\nimport { ArrowUp, Loader2 } from 'lucide-react';\nimport type { AssistantMode, AssistantModeConfig } from '@/types/assistant';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { AssistantAttachmentButton } from './AssistantAttachmentButton';\nimport { AssistantVoiceButton } from './AssistantVoiceButton';\nimport { AssistantModeSelector } from './AssistantModeSelector';\n\ninterface Props {\n /** Send the message text. Same contract the previous input used — transport unchanged. */\n onSend: (message: string) => void;\n /** True while a turn is in-flight (assistant busy) — disables send + shows the spinner. */\n disabled?: boolean;\n placeholder?: string;\n mode: AssistantMode;\n /** Role-filtered list of modes the user may pick. */\n availableModes: AssistantModeConfig[];\n onModeChange: (mode: AssistantMode) => void;\n}\n\nconst MAX_TEXTAREA_HEIGHT = 200;\n\n/**\n * AssistantComposer — the v2 input surface (per the ai-assistant-v2 mockups).\n *\n * A rounded card with, on the input row: a leading circular \"+\" attach\n * placeholder, an auto-growing textarea, a microphone placeholder, and a\n * prominent filled forest-green circular send button. BELOW the input sit the\n * mode pills (\"Ask\" active-green / \"Take action\" outline).\n *\n * Fully controlled (React state for the text) with auto-grow via a layout\n * effect. Enter sends, Shift+Enter inserts a newline. It calls the SAME\n * `onSend(text)` the old composer used — the sandbox/session/transport logic in\n * AssistantChatArea is untouched.\n */\nexport const AssistantComposer: FC<Props> = ({\n onSend,\n disabled = false,\n placeholder,\n mode,\n availableModes,\n onModeChange,\n}) => {\n const tr = useTr();\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [text, setText] = useState('');\n\n const resolvedPlaceholder =\n placeholder ?? tr('healthybowl.assistant.composer.placeholder', 'Ask HealthyBowl anything…');\n const trimmed = text.trim();\n const canSend = trimmed.length > 0 && !disabled;\n\n // Auto-grow the textarea to fit its content (capped), re-measured after every\n // value change so the card breathes as the user types.\n useLayoutEffect(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, MAX_TEXTAREA_HEIGHT)}px`;\n }, [text]);\n\n const handleSend = useCallback(() => {\n const value = text.trim();\n if (!value || disabled) return;\n onSend(value);\n setText('');\n }, [text, disabled, onSend]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n return (\n <div className=\"flex-shrink-0 px-3 pb-3 pt-1.5\">\n <div className=\"rounded-2xl border border-border-default bg-bg-sunken p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15\">\n {/* Input row: attach · textarea · mic · send */}\n <div className=\"flex items-end gap-2\">\n <AssistantAttachmentButton />\n\n <textarea\n ref={textareaRef}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n placeholder={resolvedPlaceholder}\n rows={1}\n className=\"min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 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\n <AssistantVoiceButton />\n\n <button\n type=\"button\"\n onClick={handleSend}\n disabled={!canSend}\n className={`flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${\n canSend\n ? 'bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover'\n : 'bg-bg-elevated text-text-muted'\n }`}\n aria-label={tr('healthybowl.assistant.chatInput.send', 'Send message')}\n data-testid=\"assistant-send\"\n >\n {disabled ? <Loader2 className=\"size-4 animate-spin\" /> : <ArrowUp className=\"size-4\" />}\n </button>\n </div>\n\n {/* Mode pills */}\n {availableModes.length > 1 && (\n <div className=\"mt-2 px-0.5\">\n <AssistantModeSelector\n mode={mode}\n availableModes={availableModes}\n onModeChange={onModeChange}\n disabled={disabled}\n />\n </div>\n )}\n </div>\n\n <p className=\"mt-1.5 px-1 text-center text-[11px] text-text-muted\">\n {tr('healthybowl.assistant.composer.hint', 'Enter to send · Shift+Enter for newline')}\n </p>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAoBA,IAAM,IAAsB,KAef,KAAgC,EAC3C,WACA,cAAW,IACX,gBACA,SACA,mBACA,sBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAc,EAA4B,KAAK,EAC/C,CAAC,GAAM,KAAW,EAAS,GAAG,EAE9B,IACJ,KAAe,EAAG,8CAA8C,4BAA4B,EAExF,IADU,EAAK,MAAM,CACH,SAAS,KAAK,CAAC;AAIvC,SAAsB;EACpB,IAAM,IAAW,EAAY;AACxB,QACL,EAAS,MAAM,SAAS,QACxB,EAAS,MAAM,SAAS,GAAG,KAAK,IAAI,EAAS,cAAc,EAAoB,CAAC;IAC/E,CAAC,EAAK,CAAC;CAEV,IAAM,IAAa,QAAkB;EACnC,IAAM,IAAQ,EAAK,MAAM;AACrB,GAAC,KAAS,MACd,EAAO,EAAM,EACb,EAAQ,GAAG;IACV;EAAC;EAAM;EAAU;EAAO,CAAC,EAEtB,IAAgB,GACnB,MAA8C;AAC7C,EAAI,EAAM,QAAQ,WAAW,CAAC,EAAM,aAClC,EAAM,gBAAgB,EACtB,GAAY;IAGhB,CAAC,EAAW,CACb;AAED,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CAEE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,GAAD,EAA6B,CAAA;KAE7B,kBAAC,YAAD;MACE,KAAK;MACL,OAAO;MACP,WAAW,MAAU,EAAQ,EAAM,OAAO,MAAM;MAChD,WAAW;MACD;MACV,aAAa;MACb,MAAM;MACN,WAAU;MACV,cAAY,EAAG,6CAA6C,gBAAgB;MAC5E,eAAY;MACZ,CAAA;KAEF,kBAAC,GAAD,EAAwB,CAAA;KAExB,kBAAC,UAAD;MACE,MAAK;MACL,SAAS;MACT,UAAU,CAAC;MACX,WAAW,wKACT,IACI,mGACA;MAEN,cAAY,EAAG,wCAAwC,eAAe;MACtE,eAAY;gBAEX,IAAW,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAAG,kBAAC,GAAD,EAAS,WAAU,UAAW,CAAA;MACjF,CAAA;KACL;OAGL,EAAe,SAAS,KACvB,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACQ;KACU;KACF;KACJ;KACV,CAAA;IACE,CAAA,CAEJ;MAEN,kBAAC,KAAD;GAAG,WAAU;aACV,EAAG,uCAAuC,0CAA0C;GACnF,CAAA,CACA"}
1
+ {"version":3,"file":"AssistantComposer.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantComposer.tsx"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useRef, useState, type FC, type KeyboardEvent } from 'react';\nimport { ArrowUp, Loader2 } from 'lucide-react';\nimport { useVoiceInput } from '@burdenoff/fe-libs/shared/components';\nimport type { AssistantMode, AssistantModeConfig } from '@/types/assistant';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { AssistantAttachmentButton } from './AssistantAttachmentButton';\nimport { AssistantVoiceButton } from './AssistantVoiceButton';\nimport { AssistantModeSelector } from './AssistantModeSelector';\n\ninterface Props {\n /** Send the message text. Same contract the previous input used — transport unchanged. */\n onSend: (message: string) => void;\n /** True while a turn is in-flight (assistant busy) — disables send + shows the spinner. */\n disabled?: boolean;\n placeholder?: string;\n mode: AssistantMode;\n /** Role-filtered list of modes the user may pick. */\n availableModes: AssistantModeConfig[];\n onModeChange: (mode: AssistantMode) => void;\n}\n\nconst MAX_TEXTAREA_HEIGHT = 200;\n\n/**\n * AssistantComposer — the v2 input surface (per the ai-assistant-v2 mockups).\n *\n * A rounded card with, on the input row: a leading circular \"+\" attach\n * placeholder, an auto-growing textarea, a microphone (voice search), and a\n * prominent filled forest-green circular send button. BELOW the input sit the\n * mode pills (\"Ask\" active-green / \"Take action\" outline).\n *\n * Fully controlled (React state for the text) with auto-grow via a layout\n * effect. Enter sends, Shift+Enter inserts a newline. It calls the SAME\n * `onSend(text)` the old composer used — the sandbox/session/transport logic in\n * AssistantChatArea is untouched.\n *\n * Voice search (Workstream 2): the mic drives useVoiceInput (Web Speech API).\n * The recognised transcript streams into the textarea, appended to whatever the\n * user had already typed, and stays there for review/edit before sending — it\n * is never auto-sent.\n */\nexport const AssistantComposer: FC<Props> = ({\n onSend,\n disabled = false,\n placeholder,\n mode,\n availableModes,\n onModeChange,\n}) => {\n const tr = useTr();\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [text, setText] = useState('');\n const voice = useVoiceInput();\n // The composer text at the moment dictation started; the live transcript is\n // appended to it so voice augments (rather than clobbers) a typed draft.\n const voiceBaseRef = useRef('');\n\n const resolvedPlaceholder =\n placeholder ?? tr('healthybowl.assistant.composer.placeholder', 'Ask HealthyBowl anything…');\n const trimmed = text.trim();\n const canSend = trimmed.length > 0 && !disabled;\n\n // Auto-grow the textarea to fit its content (capped), re-measured after every\n // value change so the card breathes as the user types.\n useLayoutEffect(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, MAX_TEXTAREA_HEIGHT)}px`;\n }, [text]);\n\n // Stream the recognised transcript into the textarea while (and just after)\n // listening. `transcript` is the final text accumulated since the last reset.\n useEffect(() => {\n if (!voice.isListening && !voice.transcript) return;\n const base = voiceBaseRef.current;\n setText(base ? `${base} ${voice.transcript}`.trimStart() : voice.transcript);\n }, [voice.transcript, voice.isListening]);\n\n const stopVoice = useCallback(() => {\n if (voice.isListening) voice.stop();\n voice.reset();\n voiceBaseRef.current = '';\n }, [voice]);\n\n const handleMicToggle = useCallback(() => {\n if (voice.isListening) {\n voice.stop();\n } else {\n voiceBaseRef.current = text.trim();\n voice.reset();\n voice.start();\n }\n }, [voice, text]);\n\n const handleSend = useCallback(() => {\n const value = text.trim();\n if (!value || disabled) return;\n stopVoice();\n onSend(value);\n setText('');\n }, [text, disabled, onSend, stopVoice]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n return (\n <div className=\"flex-shrink-0 px-3 pb-3 pt-1.5\">\n <div className=\"rounded-2xl border border-border-default bg-bg-sunken p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15\">\n {/* Input row: attach · textarea · mic · send */}\n <div className=\"flex items-end gap-2\">\n <AssistantAttachmentButton />\n\n <textarea\n ref={textareaRef}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n placeholder={resolvedPlaceholder}\n rows={1}\n className=\"min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 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\n <AssistantVoiceButton\n isSupported={voice.isSupported}\n isListening={voice.isListening}\n onToggle={handleMicToggle}\n disabled={disabled}\n />\n\n <button\n type=\"button\"\n onClick={handleSend}\n disabled={!canSend}\n className={`flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${\n canSend\n ? 'bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover'\n : 'bg-bg-elevated text-text-muted'\n }`}\n aria-label={tr('healthybowl.assistant.chatInput.send', 'Send message')}\n data-testid=\"assistant-send\"\n >\n {disabled ? <Loader2 className=\"size-4 animate-spin\" /> : <ArrowUp className=\"size-4\" />}\n </button>\n </div>\n\n {/* Mode pills */}\n {availableModes.length > 1 && (\n <div className=\"mt-2 px-0.5\">\n <AssistantModeSelector\n mode={mode}\n availableModes={availableModes}\n onModeChange={onModeChange}\n disabled={disabled}\n />\n </div>\n )}\n </div>\n\n <p\n className={`mt-1.5 px-1 text-center text-[11px] ${\n voice.isListening ? 'font-medium text-status-error-text' : 'text-text-muted'\n }`}\n aria-live=\"polite\"\n >\n {voice.isListening\n ? tr('healthybowl.assistant.composer.listening', 'Listening… tap the mic to stop')\n : tr('healthybowl.assistant.composer.hint', 'Enter to send · Shift+Enter for newline')}\n </p>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAqBA,IAAM,IAAsB,KAoBf,KAAgC,EAC3C,WACA,cAAW,IACX,gBACA,SACA,mBACA,sBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAc,EAA4B,KAAK,EAC/C,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,IAAQ,GAAe,EAGvB,IAAe,EAAO,GAAG,EAEzB,IACJ,KAAe,EAAG,8CAA8C,4BAA4B,EAExF,IADU,EAAK,MAAM,CACH,SAAS,KAAK,CAAC;AAavC,CATA,QAAsB;EACpB,IAAM,IAAW,EAAY;AACxB,QACL,EAAS,MAAM,SAAS,QACxB,EAAS,MAAM,SAAS,GAAG,KAAK,IAAI,EAAS,cAAc,EAAoB,CAAC;IAC/E,CAAC,EAAK,CAAC,EAIV,QAAgB;AACd,MAAI,CAAC,EAAM,eAAe,CAAC,EAAM,WAAY;EAC7C,IAAM,IAAO,EAAa;AAC1B,IAAQ,IAAO,GAAG,EAAK,GAAG,EAAM,aAAa,WAAW,GAAG,EAAM,WAAW;IAC3E,CAAC,EAAM,YAAY,EAAM,YAAY,CAAC;CAEzC,IAAM,IAAY,QAAkB;AAGlC,EAFI,EAAM,eAAa,EAAM,MAAM,EACnC,EAAM,OAAO,EACb,EAAa,UAAU;IACtB,CAAC,EAAM,CAAC,EAEL,IAAkB,QAAkB;AACxC,EAAI,EAAM,cACR,EAAM,MAAM,IAEZ,EAAa,UAAU,EAAK,MAAM,EAClC,EAAM,OAAO,EACb,EAAM,OAAO;IAEd,CAAC,GAAO,EAAK,CAAC,EAEX,IAAa,QAAkB;EACnC,IAAM,IAAQ,EAAK,MAAM;AACrB,GAAC,KAAS,MACd,GAAW,EACX,EAAO,EAAM,EACb,EAAQ,GAAG;IACV;EAAC;EAAM;EAAU;EAAQ;EAAU,CAAC,EAEjC,IAAgB,GACnB,MAA8C;AAC7C,EAAI,EAAM,QAAQ,WAAW,CAAC,EAAM,aAClC,EAAM,gBAAgB,EACtB,GAAY;IAGhB,CAAC,EAAW,CACb;AAED,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CAEE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,GAAD,EAA6B,CAAA;KAE7B,kBAAC,YAAD;MACE,KAAK;MACL,OAAO;MACP,WAAW,MAAU,EAAQ,EAAM,OAAO,MAAM;MAChD,WAAW;MACD;MACV,aAAa;MACb,MAAM;MACN,WAAU;MACV,cAAY,EAAG,6CAA6C,gBAAgB;MAC5E,eAAY;MACZ,CAAA;KAEF,kBAAC,GAAD;MACE,aAAa,EAAM;MACnB,aAAa,EAAM;MACnB,UAAU;MACA;MACV,CAAA;KAEF,kBAAC,UAAD;MACE,MAAK;MACL,SAAS;MACT,UAAU,CAAC;MACX,WAAW,wKACT,IACI,mGACA;MAEN,cAAY,EAAG,wCAAwC,eAAe;MACtE,eAAY;gBAEX,IAAW,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAAG,kBAAC,GAAD,EAAS,WAAU,UAAW,CAAA;MACjF,CAAA;KACL;OAGL,EAAe,SAAS,KACvB,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACQ;KACU;KACF;KACJ;KACV,CAAA;IACE,CAAA,CAEJ;MAEN,kBAAC,KAAD;GACE,WAAW,uCACT,EAAM,cAAc,uCAAuC;GAE7D,aAAU;aAET,EAAM,cACH,EAAG,4CAA4C,iCAAiC,GAChF,EAAG,uCAAuC,0CAA0C;GACtF,CAAA,CACA"}
@@ -1,20 +1,24 @@
1
1
  import { useTr as e } from "../../../shared/hooks/useTr.js";
2
- import { Mic as t } from "lucide-react";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { Mic as t, Square as n } from "lucide-react";
3
+ import { jsx as r } from "react/jsx-runtime";
4
4
  //#region src/components/assistant/composer/AssistantVoiceButton.tsx
5
- var r = () => {
6
- let r = e()("healthybowl.assistant.composer.voiceSoon", "Voice coming soon");
7
- return /* @__PURE__ */ n("button", {
5
+ var i = ({ isSupported: i, isListening: a, onToggle: o, disabled: s = !1 }) => {
6
+ let c = e();
7
+ if (!i) return null;
8
+ let l = a ? c("healthybowl.assistant.composer.voiceStop", "Stop voice input") : c("healthybowl.assistant.composer.voiceStart", "Start voice input");
9
+ return /* @__PURE__ */ r("button", {
8
10
  type: "button",
9
- disabled: !0,
10
- title: r,
11
- "aria-label": r,
12
- className: "flex size-9 flex-shrink-0 cursor-not-allowed items-center justify-center rounded-full border border-border-subtle bg-bg-elevated text-text-muted",
11
+ onClick: o,
12
+ disabled: s,
13
+ title: l,
14
+ "aria-label": l,
15
+ "aria-pressed": a,
16
+ className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full border transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 ${a ? "animate-pulse border-status-error-text/40 bg-status-error-text/10 text-status-error-text" : "border-border-subtle bg-bg-elevated text-text-secondary hover:bg-bg-surface hover:text-text-primary"}`,
13
17
  "data-testid": "assistant-voice",
14
- children: /* @__PURE__ */ n(t, { className: "size-4" })
18
+ children: a ? /* @__PURE__ */ r(n, { className: "size-3.5" }) : /* @__PURE__ */ r(t, { className: "size-4" })
15
19
  });
16
20
  };
17
21
  //#endregion
18
- export { r as AssistantVoiceButton };
22
+ export { i as AssistantVoiceButton };
19
23
 
20
24
  //# sourceMappingURL=AssistantVoiceButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantVoiceButton.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantVoiceButton.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Mic } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\n\n/**\n * Microphone control in the composer. VISUAL PLACEHOLDER for a future\n * voice-input flow (see the v2 mockups) — disabled today with a \"coming soon\"\n * tooltip. Isolated so wiring speech capture later is a drop-in.\n */\nexport const AssistantVoiceButton: FC = () => {\n const tr = useTr();\n const label = tr('healthybowl.assistant.composer.voiceSoon', 'Voice coming soon');\n\n return (\n <button\n type=\"button\"\n disabled\n title={label}\n aria-label={label}\n className=\"flex size-9 flex-shrink-0 cursor-not-allowed items-center justify-center rounded-full border border-border-subtle bg-bg-elevated text-text-muted\"\n data-testid=\"assistant-voice\"\n >\n <Mic className=\"size-4\" />\n </button>\n );\n};\n"],"mappings":";;;;AASA,IAAa,UAAiC;CAE5C,IAAM,IADK,GAAO,CACD,4CAA4C,oBAAoB;AAEjF,QACE,kBAAC,UAAD;EACE,MAAK;EACL,UAAA;EACA,OAAO;EACP,cAAY;EACZ,WAAU;EACV,eAAY;YAEZ,kBAAC,GAAD,EAAK,WAAU,UAAW,CAAA;EACnB,CAAA"}
1
+ {"version":3,"file":"AssistantVoiceButton.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantVoiceButton.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Mic, Square } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\n\ninterface Props {\n /** From useVoiceInput — false on browsers without SpeechRecognition. */\n isSupported: boolean;\n isListening: boolean;\n onToggle: () => void;\n disabled?: boolean;\n}\n\n/**\n * Microphone control in the composer (Workstream 2 — voice search).\n *\n * Wired to the Web Speech API via useVoiceInput. Renders nothing on browsers\n * without SpeechRecognition (isSupported=false) so the composer degrades\n * gracefully. While listening it shows a pulsing \"recording\" state and a stop\n * glyph; clicking toggles capture off.\n */\nexport const AssistantVoiceButton: FC<Props> = ({ isSupported, isListening, onToggle, disabled = false }) => {\n const tr = useTr();\n if (!isSupported) return null;\n\n const label = isListening\n ? tr('healthybowl.assistant.composer.voiceStop', 'Stop voice input')\n : tr('healthybowl.assistant.composer.voiceStart', 'Start voice input');\n\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n disabled={disabled}\n title={label}\n aria-label={label}\n aria-pressed={isListening}\n className={`flex size-9 flex-shrink-0 items-center justify-center rounded-full border transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 ${\n isListening\n ? 'animate-pulse border-status-error-text/40 bg-status-error-text/10 text-status-error-text'\n : 'border-border-subtle bg-bg-elevated text-text-secondary hover:bg-bg-surface hover:text-text-primary'\n }`}\n data-testid=\"assistant-voice\"\n >\n {isListening ? <Square className=\"size-3.5\" /> : <Mic className=\"size-4\" />}\n </button>\n );\n};\n"],"mappings":";;;;AAoBA,IAAa,KAAmC,EAAE,gBAAa,gBAAa,aAAU,cAAW,SAAY;CAC3G,IAAM,IAAK,GAAO;AAClB,KAAI,CAAC,EAAa,QAAO;CAEzB,IAAM,IAAQ,IACV,EAAG,4CAA4C,mBAAmB,GAClE,EAAG,6CAA6C,oBAAoB;AAExE,QACE,kBAAC,UAAD;EACE,MAAK;EACL,SAAS;EACC;EACV,OAAO;EACP,cAAY;EACZ,gBAAc;EACd,WAAW,wNACT,IACI,6FACA;EAEN,eAAY;YAEX,IAAc,kBAAC,GAAD,EAAQ,WAAU,YAAa,CAAA,GAAG,kBAAC,GAAD,EAAK,WAAU,UAAW,CAAA;EACpE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.725.2",
3
+ "version": "2026.725.3",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [