@datatechsolutions/ui 2.11.68 → 2.11.70

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.
@@ -17135,26 +17135,57 @@ function DepartmentAssistantDemo({
17135
17135
  const t = { ...DEFAULT_ASSISTANT_THEME, ...theme, workflow: { ...DEFAULT_ASSISTANT_THEME.workflow, ...theme?.workflow } };
17136
17136
  const [flowIndex, setFlowIndex] = React12.useState(initialIndex);
17137
17137
  const [stage, setStage] = React12.useState("input");
17138
- const [typed, setTyped] = React12.useState("");
17138
+ const [userTyped, setUserTyped] = React12.useState("");
17139
+ const [assistantTyped, setAssistantTyped] = React12.useState("");
17140
+ const [inputPhase, setInputPhase] = React12.useState("user");
17139
17141
  const rotateTimerRef = React12.useRef(null);
17140
17142
  const flow = flows[flowIndex];
17143
+ const assistantMessage = React12.useMemo(
17144
+ () => `Entendi. Vou ativar ${flow.agents.length} agentes especializados e orquestrar o fluxo no Astrlabe.`,
17145
+ [flow.agents.length]
17146
+ );
17147
+ React12.useEffect(() => {
17148
+ if (stage === "input") {
17149
+ setInputPhase("user");
17150
+ setUserTyped("");
17151
+ setAssistantTyped("");
17152
+ }
17153
+ }, [stage, flow.id]);
17141
17154
  React12.useEffect(() => {
17142
- if (stage !== "input") return void 0;
17143
- setTyped("");
17155
+ if (stage !== "input" || inputPhase !== "user") return void 0;
17156
+ setUserTyped("");
17144
17157
  let i = 0;
17145
17158
  const interval = setInterval(() => {
17146
17159
  i += 1;
17147
17160
  if (i <= flow.prompt.length) {
17148
- setTyped(flow.prompt.slice(0, i));
17161
+ setUserTyped(flow.prompt.slice(0, i));
17149
17162
  } else {
17150
17163
  clearInterval(interval);
17151
- const timer = setTimeout(() => setStage("workflow"), 700);
17164
+ const timer = setTimeout(() => setInputPhase("assistant"), 600);
17152
17165
  return () => clearTimeout(timer);
17153
17166
  }
17154
17167
  return void 0;
17155
17168
  }, typingSpeedMs);
17156
17169
  return () => clearInterval(interval);
17157
- }, [stage, flow.prompt, typingSpeedMs]);
17170
+ }, [stage, inputPhase, flow.prompt, typingSpeedMs]);
17171
+ React12.useEffect(() => {
17172
+ if (stage !== "input" || inputPhase !== "assistant") return void 0;
17173
+ setAssistantTyped("");
17174
+ let i = 0;
17175
+ const speed = Math.max(18, Math.round(typingSpeedMs * 0.55));
17176
+ const interval = setInterval(() => {
17177
+ i += 1;
17178
+ if (i <= assistantMessage.length) {
17179
+ setAssistantTyped(assistantMessage.slice(0, i));
17180
+ } else {
17181
+ clearInterval(interval);
17182
+ const timer = setTimeout(() => setStage("workflow"), 800);
17183
+ return () => clearTimeout(timer);
17184
+ }
17185
+ return void 0;
17186
+ }, speed);
17187
+ return () => clearInterval(interval);
17188
+ }, [stage, inputPhase, assistantMessage, typingSpeedMs]);
17158
17189
  const handleWorkflowComplete = React12.useCallback(() => {
17159
17190
  const timer = setTimeout(() => setStage("dashboard"), 1200);
17160
17191
  rotateTimerRef.current = timer;
@@ -17213,15 +17244,17 @@ function DepartmentAssistantDemo({
17213
17244
  animate: { opacity: 1, y: 0 },
17214
17245
  exit: { opacity: 0, y: -12 },
17215
17246
  transition: { duration: 0.45 },
17216
- className: "flex items-center justify-center p-10",
17247
+ className: "h-full",
17217
17248
  children: /* @__PURE__ */ jsxRuntime.jsx(
17218
17249
  InputStage3,
17219
17250
  {
17220
- prompt: typed,
17251
+ userPrompt: userTyped,
17252
+ assistantMessage: assistantTyped,
17253
+ phase: inputPhase,
17254
+ assistantComplete: assistantTyped.length === assistantMessage.length,
17221
17255
  department: flow.name,
17222
17256
  agents: flow.agents,
17223
17257
  avatarGradient: t.inputAvatar,
17224
- borderClass: t.inputBorder,
17225
17258
  cursorClass: t.inputCursor
17226
17259
  }
17227
17260
  )
@@ -17298,41 +17331,58 @@ function StageChip({ label, stageIndex, mine, activeBadge }) {
17298
17331
  );
17299
17332
  }
17300
17333
  function InputStage3({
17301
- prompt,
17334
+ userPrompt,
17335
+ assistantMessage,
17336
+ phase,
17337
+ assistantComplete,
17302
17338
  department,
17303
17339
  agents,
17304
17340
  avatarGradient,
17305
- borderClass,
17306
17341
  cursorClass
17307
17342
  }) {
17308
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-white/10 bg-white/70 dark:bg-zinc-900/70 p-8 shadow-2xl backdrop-blur-sm", children: [
17309
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6 flex items-center gap-3", children: [
17310
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-12 w-12 rounded-xl bg-gradient-to-br ${avatarGradient} flex items-center justify-center`, children: /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.SparklesIcon, { className: "h-6 w-6 text-white" }) }),
17311
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
17312
- /* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-base font-bold text-gray-900 dark:text-white", children: [
17313
- "Assistente \u2014 ",
17314
- department
17315
- ] }),
17316
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Digite um pedido e veja os agentes atuarem." })
17343
+ const cursor = /* @__PURE__ */ jsxRuntime.jsx("span", { className: `ml-0.5 inline-block w-[2px] h-4 align-middle ${cursorClass} animate-pulse` });
17344
+ const showAssistant = phase === "assistant";
17345
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col px-4 py-6 sm:px-8", children: [
17346
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-5 flex items-center justify-center gap-2 text-[10px] font-semibold uppercase tracking-wider text-gray-400 dark:text-gray-500", children: [
17347
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-1 w-1 rounded-full bg-emerald-500 animate-pulse" }),
17348
+ "Conversa \u2014 ",
17349
+ department
17350
+ ] }),
17351
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex w-full max-w-3xl flex-1 flex-col justify-end gap-4 overflow-hidden", children: [
17352
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface max-w-[88%] rounded-2xl rounded-tr-md px-5 py-3.5", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base leading-relaxed text-gray-900 dark:text-white", children: [
17353
+ userPrompt,
17354
+ phase === "user" && cursor
17355
+ ] }) }) }),
17356
+ showAssistant && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-2.5", children: [
17357
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br ${avatarGradient} shadow-md`, children: /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.SparklesIcon, { className: "h-5 w-5 text-white" }) }),
17358
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface max-w-[88%] rounded-2xl rounded-bl-md px-5 py-3.5", children: assistantMessage.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 py-1", children: [
17359
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${cursorClass} animate-pulse` }),
17360
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${cursorClass} animate-pulse`, style: { animationDelay: "150ms" } }),
17361
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${cursorClass} animate-pulse`, style: { animationDelay: "300ms" } })
17362
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17363
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base leading-relaxed text-gray-900 dark:text-white", children: [
17364
+ assistantMessage,
17365
+ !assistantComplete && cursor
17366
+ ] }),
17367
+ assistantComplete && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2.5 flex flex-wrap gap-1.5", children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsxs(
17368
+ "span",
17369
+ {
17370
+ className: "inline-flex items-center rounded-full bg-white/40 dark:bg-white/[0.08] px-2.5 py-0.5 text-[10px] font-semibold text-gray-700 dark:text-gray-200",
17371
+ children: [
17372
+ /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.BoltIcon, { className: `mr-1 h-2.5 w-2.5 ${cursorClass.replace("bg-", "text-")}` }),
17373
+ agent
17374
+ ]
17375
+ },
17376
+ agent
17377
+ )) })
17378
+ ] }) })
17317
17379
  ] })
17318
17380
  ] }),
17319
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `rounded-xl border-2 ${borderClass} bg-white/40 dark:bg-white/[0.02] p-4 min-h-[120px]`, children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base font-medium text-gray-900 dark:text-white", children: [
17320
- prompt,
17321
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `ml-1 inline-block w-0.5 h-5 ${cursorClass} animate-pulse` })
17322
- ] }) }),
17323
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400", children: [
17324
- /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.BoltIcon, { className: `h-3.5 w-3.5 ${cursorClass.replace("bg-", "text-")}` }),
17325
- "Agentes prontos:",
17326
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1.5", children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
17327
- "span",
17328
- {
17329
- className: "inline-flex items-center rounded-full border border-white/10 bg-white/60 dark:bg-white/[0.04] px-2 py-0.5 text-[10px] font-semibold text-gray-700 dark:text-gray-200",
17330
- children: agent
17331
- },
17332
- agent
17333
- )) })
17334
- ] })
17335
- ] }) });
17381
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto mt-5 w-full max-w-3xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liquid-surface flex items-center gap-3 rounded-full px-4 py-2.5 opacity-60", children: [
17382
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs italic text-gray-500 dark:text-gray-400", children: "Mensagem para Kori AI\u2026" }),
17383
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex items-center gap-1 text-[10px] text-gray-400 dark:text-gray-500", children: "\u23CE enviar" })
17384
+ ] }) })
17385
+ ] });
17336
17386
  }
17337
17387
  var koriDepartmentFlows = [
17338
17388
  {
@@ -25338,5 +25388,5 @@ exports.usePullToRefresh = usePullToRefresh;
25338
25388
  exports.validateDashboardSpec = validateDashboardSpec;
25339
25389
  exports.xScale = xScale;
25340
25390
  exports.yScale = yScale;
25341
- //# sourceMappingURL=chunk-SSB6DU5G.js.map
25342
- //# sourceMappingURL=chunk-SSB6DU5G.js.map
25391
+ //# sourceMappingURL=chunk-ZNLDMYBS.js.map
25392
+ //# sourceMappingURL=chunk-ZNLDMYBS.js.map