@datatechsolutions/ui 2.11.69 → 2.11.71

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');
@@ -16463,7 +16463,8 @@ function DepartmentWorkflowDemo({
16463
16463
  className,
16464
16464
  hideHeader = false,
16465
16465
  onComplete,
16466
- theme
16466
+ theme,
16467
+ nodeAvatars
16467
16468
  }) {
16468
16469
  const t = { ...DEFAULT_THEME, ...theme };
16469
16470
  const { graph, steps, title, description, accentBadge, completionSummary } = workflow;
@@ -16628,6 +16629,7 @@ function DepartmentWorkflowDemo({
16628
16629
  col.nodes.map((node2) => {
16629
16630
  const status = getStatus(node2);
16630
16631
  const meta = getNodeMeta(node2.type);
16632
+ const avatar = nodeAvatars?.[node2.id];
16631
16633
  const statusClass = status === "running" ? `scale-[1.04] ring-2 ${t.activeRing}` : status === "complete" ? "ring-1 ring-emerald-500/40" : "opacity-50";
16632
16634
  return /* @__PURE__ */ jsxRuntime.jsx(
16633
16635
  "div",
@@ -16635,7 +16637,14 @@ function DepartmentWorkflowDemo({
16635
16637
  className: `liquid-surface rounded-xl p-2.5 transition-all duration-500 ${statusClass}`,
16636
16638
  style: status === "running" ? { "--glow": meta.glow, animation: "deptGlow 1.4s ease-in-out infinite" } : void 0,
16637
16639
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
16638
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${meta.bg}`, children: /* @__PURE__ */ jsxRuntime.jsx(meta.icon, { className: `h-4 w-4 ${meta.color}` }) }),
16640
+ avatar ? /* @__PURE__ */ jsxRuntime.jsx(
16641
+ "img",
16642
+ {
16643
+ src: avatar,
16644
+ alt: "",
16645
+ className: `h-10 w-10 shrink-0 rounded-xl bg-white/40 dark:bg-white/[0.06] ${status === "running" ? "ring-2 ring-white/40" : ""}`
16646
+ }
16647
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-xl ${meta.bg}`, children: /* @__PURE__ */ jsxRuntime.jsx(meta.icon, { className: `h-5 w-5 ${meta.color}` }) }),
16639
16648
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
16640
16649
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[11px] font-semibold text-gray-900 dark:text-white", children: node2.data.label }),
16641
16650
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-[8px] text-gray-500 dark:text-gray-500", children: [
@@ -17135,26 +17144,57 @@ function DepartmentAssistantDemo({
17135
17144
  const t = { ...DEFAULT_ASSISTANT_THEME, ...theme, workflow: { ...DEFAULT_ASSISTANT_THEME.workflow, ...theme?.workflow } };
17136
17145
  const [flowIndex, setFlowIndex] = React12.useState(initialIndex);
17137
17146
  const [stage, setStage] = React12.useState("input");
17138
- const [typed, setTyped] = React12.useState("");
17147
+ const [userTyped, setUserTyped] = React12.useState("");
17148
+ const [assistantTyped, setAssistantTyped] = React12.useState("");
17149
+ const [inputPhase, setInputPhase] = React12.useState("user");
17139
17150
  const rotateTimerRef = React12.useRef(null);
17140
17151
  const flow = flows[flowIndex];
17152
+ const assistantMessage = React12.useMemo(
17153
+ () => `Entendi. Vou ativar ${flow.agents.length} agentes especializados e orquestrar o fluxo no Astrlabe.`,
17154
+ [flow.agents.length]
17155
+ );
17156
+ React12.useEffect(() => {
17157
+ if (stage === "input") {
17158
+ setInputPhase("user");
17159
+ setUserTyped("");
17160
+ setAssistantTyped("");
17161
+ }
17162
+ }, [stage, flow.id]);
17141
17163
  React12.useEffect(() => {
17142
- if (stage !== "input") return void 0;
17143
- setTyped("");
17164
+ if (stage !== "input" || inputPhase !== "user") return void 0;
17165
+ setUserTyped("");
17144
17166
  let i = 0;
17145
17167
  const interval = setInterval(() => {
17146
17168
  i += 1;
17147
17169
  if (i <= flow.prompt.length) {
17148
- setTyped(flow.prompt.slice(0, i));
17170
+ setUserTyped(flow.prompt.slice(0, i));
17149
17171
  } else {
17150
17172
  clearInterval(interval);
17151
- const timer = setTimeout(() => setStage("workflow"), 700);
17173
+ const timer = setTimeout(() => setInputPhase("assistant"), 600);
17152
17174
  return () => clearTimeout(timer);
17153
17175
  }
17154
17176
  return void 0;
17155
17177
  }, typingSpeedMs);
17156
17178
  return () => clearInterval(interval);
17157
- }, [stage, flow.prompt, typingSpeedMs]);
17179
+ }, [stage, inputPhase, flow.prompt, typingSpeedMs]);
17180
+ React12.useEffect(() => {
17181
+ if (stage !== "input" || inputPhase !== "assistant") return void 0;
17182
+ setAssistantTyped("");
17183
+ let i = 0;
17184
+ const speed = Math.max(18, Math.round(typingSpeedMs * 0.55));
17185
+ const interval = setInterval(() => {
17186
+ i += 1;
17187
+ if (i <= assistantMessage.length) {
17188
+ setAssistantTyped(assistantMessage.slice(0, i));
17189
+ } else {
17190
+ clearInterval(interval);
17191
+ const timer = setTimeout(() => setStage("workflow"), 800);
17192
+ return () => clearTimeout(timer);
17193
+ }
17194
+ return void 0;
17195
+ }, speed);
17196
+ return () => clearInterval(interval);
17197
+ }, [stage, inputPhase, assistantMessage, typingSpeedMs]);
17158
17198
  const handleWorkflowComplete = React12.useCallback(() => {
17159
17199
  const timer = setTimeout(() => setStage("dashboard"), 1200);
17160
17200
  rotateTimerRef.current = timer;
@@ -17217,11 +17257,14 @@ function DepartmentAssistantDemo({
17217
17257
  children: /* @__PURE__ */ jsxRuntime.jsx(
17218
17258
  InputStage3,
17219
17259
  {
17220
- prompt: typed,
17260
+ userPrompt: userTyped,
17261
+ assistantMessage: assistantTyped,
17262
+ phase: inputPhase,
17263
+ assistantComplete: assistantTyped.length === assistantMessage.length,
17221
17264
  department: flow.name,
17222
17265
  agents: flow.agents,
17266
+ agentAvatars: flow.agentAvatars,
17223
17267
  avatarGradient: t.inputAvatar,
17224
- borderClass: t.inputBorder,
17225
17268
  cursorClass: t.inputCursor
17226
17269
  }
17227
17270
  )
@@ -17244,7 +17287,8 @@ function DepartmentAssistantDemo({
17244
17287
  hideHeader: true,
17245
17288
  stepDurationMs: workflowStepMs,
17246
17289
  onComplete: handleWorkflowComplete,
17247
- theme: t.workflow
17290
+ theme: t.workflow,
17291
+ nodeAvatars: flow.nodeAvatars
17248
17292
  },
17249
17293
  `wf-${flow.id}`
17250
17294
  )
@@ -17298,42 +17342,61 @@ function StageChip({ label, stageIndex, mine, activeBadge }) {
17298
17342
  );
17299
17343
  }
17300
17344
  function InputStage3({
17301
- prompt,
17345
+ userPrompt,
17346
+ assistantMessage,
17347
+ phase,
17348
+ assistantComplete,
17302
17349
  department,
17303
17350
  agents,
17351
+ agentAvatars,
17304
17352
  avatarGradient,
17305
17353
  cursorClass
17306
17354
  }) {
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
- ] })
17355
+ const cursor = /* @__PURE__ */ jsxRuntime.jsx("span", { className: `ml-0.5 inline-block w-[2px] h-4 align-middle ${cursorClass} animate-pulse` });
17356
+ const showAssistant = phase === "assistant";
17357
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col px-4 py-6 sm:px-8", children: [
17358
+ /* @__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: [
17359
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-1 w-1 rounded-full bg-emerald-500 animate-pulse" }),
17360
+ "Conversa \u2014 ",
17361
+ department
17317
17362
  ] }),
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
- )) })
17363
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex w-full max-w-3xl flex-1 flex-col justify-end gap-4 overflow-hidden", children: [
17364
+ /* @__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: [
17365
+ userPrompt,
17366
+ phase === "user" && cursor
17367
+ ] }) }) }),
17368
+ showAssistant && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-2.5", children: [
17369
+ /* @__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" }) }),
17370
+ /* @__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: [
17371
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${cursorClass} animate-pulse` }),
17372
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${cursorClass} animate-pulse`, style: { animationDelay: "150ms" } }),
17373
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${cursorClass} animate-pulse`, style: { animationDelay: "300ms" } })
17374
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17375
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base leading-relaxed text-gray-900 dark:text-white", children: [
17376
+ assistantMessage,
17377
+ !assistantComplete && cursor
17378
+ ] }),
17379
+ assistantComplete && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: agents.map((agent) => {
17380
+ const avatar = agentAvatars?.[agent];
17381
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17382
+ "span",
17383
+ {
17384
+ className: "inline-flex items-center gap-1.5 rounded-full bg-white/40 dark:bg-white/[0.08] py-0.5 pl-0.5 pr-3 text-[11px] font-semibold text-gray-700 dark:text-gray-200 shadow-sm",
17385
+ children: [
17386
+ avatar ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: avatar, alt: "", className: "h-6 w-6 rounded-full bg-white/40 dark:bg-white/[0.06]" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: `flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br ${avatarGradient}`, children: /* @__PURE__ */ jsxRuntime.jsx(HeroIcons.BoltIcon, { className: "h-3 w-3 text-white" }) }),
17387
+ agent
17388
+ ]
17389
+ },
17390
+ agent
17391
+ );
17392
+ }) })
17393
+ ] }) })
17335
17394
  ] })
17336
- ] })
17395
+ ] }),
17396
+ /* @__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: [
17397
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs italic text-gray-500 dark:text-gray-400", children: "Mensagem para Kori AI\u2026" }),
17398
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex items-center gap-1 text-[10px] text-gray-400 dark:text-gray-500", children: "\u23CE enviar" })
17399
+ ] }) })
17337
17400
  ] });
17338
17401
  }
17339
17402
  var koriDepartmentFlows = [
@@ -25340,5 +25403,5 @@ exports.usePullToRefresh = usePullToRefresh;
25340
25403
  exports.validateDashboardSpec = validateDashboardSpec;
25341
25404
  exports.xScale = xScale;
25342
25405
  exports.yScale = yScale;
25343
- //# sourceMappingURL=chunk-WBYNJTQN.js.map
25344
- //# sourceMappingURL=chunk-WBYNJTQN.js.map
25406
+ //# sourceMappingURL=chunk-UOKLJT2P.js.map
25407
+ //# sourceMappingURL=chunk-UOKLJT2P.js.map