@datatechsolutions/ui 2.11.69 → 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.
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var chunkUZ3CMNUJ_js = require('./chunk-UZ3CMNUJ.js');
4
5
  var chunkYXN2K77G_js = require('./chunk-YXN2K77G.js');
5
6
  var chunkS7KHTUHA_js = require('./chunk-S7KHTUHA.js');
6
- var chunkUZ3CMNUJ_js = require('./chunk-UZ3CMNUJ.js');
7
7
  var Headless6 = require('@headlessui/react');
8
8
  var clsx = require('clsx');
9
9
  var React12 = require('react');
@@ -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;
@@ -17217,11 +17248,13 @@ function DepartmentAssistantDemo({
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,42 +17331,57 @@ 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
17341
  cursorClass
17306
17342
  }) {
17307
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col items-center justify-center px-6 py-10 sm:px-12", children: [
17308
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-8 flex items-center gap-3", children: [
17309
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-14 w-14 rounded-2xl bg-gradient-to-br ${avatarGradient} flex items-center justify-center shadow-lg`, children: /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.SparklesIcon, { className: "h-7 w-7 text-white" }) }),
17310
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-left", children: [
17311
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[10px] font-bold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: [
17312
- "Assistente \u2014 ",
17313
- department
17314
- ] }),
17315
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold text-gray-900 dark:text-white", children: "Como posso ajudar hoje?" })
17316
- ] })
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
17317
17350
  ] }),
17318
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-3xl", children: [
17319
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface rounded-2xl px-6 py-6 min-h-[140px] flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xl font-medium leading-relaxed text-gray-900 dark:text-white", children: [
17320
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `mr-1 inline-block h-1.5 w-1.5 rounded-full ${cursorClass}` }),
17321
- prompt,
17322
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `ml-1 inline-block w-0.5 h-6 align-middle ${cursorClass} animate-pulse` })
17323
- ] }) }),
17324
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2 text-xs text-gray-500 dark:text-gray-400", children: [
17325
- /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.BoltIcon, { className: `h-3.5 w-3.5 ${cursorClass.replace("bg-", "text-")}` }),
17326
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Agentes prontos:" }),
17327
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1.5", children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
17328
- "span",
17329
- {
17330
- className: "liquid-surface inline-flex items-center rounded-full px-3 py-1 text-[11px] font-semibold text-gray-700 dark:text-gray-200",
17331
- children: agent
17332
- },
17333
- agent
17334
- )) })
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
+ ] }) })
17335
17379
  ] })
17336
- ] })
17380
+ ] }),
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
+ ] }) })
17337
17385
  ] });
17338
17386
  }
17339
17387
  var koriDepartmentFlows = [
@@ -25340,5 +25388,5 @@ exports.usePullToRefresh = usePullToRefresh;
25340
25388
  exports.validateDashboardSpec = validateDashboardSpec;
25341
25389
  exports.xScale = xScale;
25342
25390
  exports.yScale = yScale;
25343
- //# sourceMappingURL=chunk-WBYNJTQN.js.map
25344
- //# sourceMappingURL=chunk-WBYNJTQN.js.map
25391
+ //# sourceMappingURL=chunk-ZNLDMYBS.js.map
25392
+ //# sourceMappingURL=chunk-ZNLDMYBS.js.map