@humain/ui 2.1.62 → 2.1.65
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.
- package/dist/components/organisms/ai/AIToolCall/AIToolCall.d.ts +9 -3
- package/dist/components/organisms/ai/AIToolRun/index.d.ts +1 -1
- package/dist/components/organisms/ai/AIToolRun/validation.d.ts +24 -3
- package/dist/components/organisms/ai/_shared/format-ai-duration.d.ts +1 -0
- package/dist/components/organisms/ai/_shared/workflow-step-renderer.d.ts +1 -0
- package/dist/index.js +52 -52
- package/dist/index151.js +1 -1
- package/dist/index174.js +10 -333
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +310 -137
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +148 -174
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +186 -78
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +74 -124
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +133 -1
- package/dist/index179.js.map +1 -0
- package/dist/index180.js +2 -201
- package/dist/index181.js +201 -0
- package/dist/{index180.js.map → index181.js.map} +1 -1
- package/dist/index183.js +130 -166
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +195 -983
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +1069 -369
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +395 -197
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +198 -243
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +263 -3
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +3 -209
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +190 -777
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +771 -252
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +250 -65
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +72 -523
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +537 -144
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +139 -720
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +707 -167
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +175 -151
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +152 -487
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +472 -225
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +236 -260
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +265 -215
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +207 -307
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +302 -135
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +140 -271
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +263 -253
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +244 -137
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +100 -238
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +278 -74
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +56 -97
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +142 -47
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +38 -84
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +72 -252
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +274 -26
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +29 -94
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +98 -25
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +20 -565
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +564 -17
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +20 -23
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +20 -95
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +92 -88
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +97 -29
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +24 -470
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +446 -196
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +199 -729
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +750 -61
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +58 -181
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +175 -259
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +246 -172
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +195 -32
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +12 -40
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +23 -26
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +45 -22
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +27 -48
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +52 -26
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +40 -225
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +217 -39
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +50 -0
- package/dist/index237.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/wc/AIToolCall.js +218 -0
- package/dist/wc/AIToolCall.js.map +1 -0
- package/dist/wc/hf-ai-tool-call.js +34 -219
- package/dist/wc/hf-ai-tool-call.js.map +1 -1
- package/dist/wc/hf-ai-tool-run.js +673 -576
- package/dist/wc/hf-ai-tool-run.js.map +1 -1
- package/dist/wc/workflow-step-renderer.js +94 -86
- package/dist/wc/workflow-step-renderer.js.map +1 -1
- package/dist/wc-react/AIToolCall.js +218 -0
- package/dist/wc-react/AIToolCall.js.map +1 -0
- package/dist/wc-react/hf-ai-tool-call.js +32 -217
- package/dist/wc-react/hf-ai-tool-call.js.map +1 -1
- package/dist/wc-react/hf-ai-tool-run.js +698 -601
- package/dist/wc-react/hf-ai-tool-run.js.map +1 -1
- package/dist/wc-react/workflow-step-renderer.js +76 -68
- package/dist/wc-react/workflow-step-renderer.js.map +1 -1
- package/package.json +1 -1
- package/skills/humain-ui/SKILL.md +1 -1
- package/skills/humain-ui-wc/SKILL.md +1 -1
- package/skills/humain-ui-wc.skill +0 -0
- package/skills/humain-ui.skill +0 -0
- package/dist/index182.js +0 -143
- package/dist/index182.js.map +0 -1
- package/dist/wc/wrench.js +0 -10
- package/dist/wc/wrench.js.map +0 -1
- package/dist/wc-react/wrench.js +0 -10
- package/dist/wc-react/wrench.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
1
|
+
import { d as M, f } from "./_shared.js";
|
|
2
|
+
import { t as E } from "./createLucideIcon.js";
|
|
3
|
+
import { t as A } from "./check.js";
|
|
4
|
+
import { t as q } from "./chevron-down.js";
|
|
5
|
+
import { t as V } from "./chevron-right.js";
|
|
6
|
+
import { t as D } from "./circle-alert.js";
|
|
7
|
+
import { t as P } from "./react.js";
|
|
8
|
+
import { t as _ } from "./AnimatePresence.js";
|
|
9
|
+
import { t as F } from "./use-reduced-motion.js";
|
|
10
|
+
import { t as $ } from "./dist.js";
|
|
11
11
|
import * as l from "react";
|
|
12
12
|
import { Fragment as B, jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
13
13
|
var K = [
|
|
@@ -43,7 +43,7 @@ var K = [
|
|
|
43
43
|
d: "m4.9 4.9 2.9 2.9",
|
|
44
44
|
key: "giyufr"
|
|
45
45
|
}]
|
|
46
|
-
], O =
|
|
46
|
+
], O = E("loader", K), T = [["rect", {
|
|
47
47
|
x: "14",
|
|
48
48
|
y: "3",
|
|
49
49
|
width: "5",
|
|
@@ -57,25 +57,30 @@ var K = [
|
|
|
57
57
|
height: "18",
|
|
58
58
|
rx: "1",
|
|
59
59
|
key: "1wsw3u"
|
|
60
|
-
}]], U =
|
|
60
|
+
}]], U = E("pause", T);
|
|
61
|
+
function G(e) {
|
|
62
|
+
const r = Math.max(0, Math.round(e / 1e3)), a = Math.floor(r / 3600), n = Math.floor(r % 3600 / 60), s = r % 60;
|
|
63
|
+
return a > 0 ? [a ? `${a}h` : "", n ? `${n}m` : ""].filter(Boolean).join(" ") : n > 0 ? `${n}m${s ? ` ${s}s` : ""}` : `${r}s`;
|
|
64
|
+
}
|
|
65
|
+
var H = {
|
|
61
66
|
pending: "text-muted-foreground",
|
|
62
67
|
running: "text-primary",
|
|
63
68
|
suspended: "text-warning",
|
|
64
69
|
completed: "text-success",
|
|
65
70
|
error: "text-destructive"
|
|
66
|
-
},
|
|
71
|
+
}, J = {
|
|
67
72
|
pending: "bg-accent text-muted-foreground",
|
|
68
73
|
running: "bg-primary/20 text-primary",
|
|
69
74
|
suspended: "bg-warning/20 text-warning",
|
|
70
75
|
completed: "bg-success/20 text-success",
|
|
71
76
|
error: "bg-destructive/20 text-destructive"
|
|
72
|
-
}, z =
|
|
73
|
-
variants: { status: G },
|
|
74
|
-
defaultVariants: { status: "pending" }
|
|
75
|
-
}), J = j("size-5 shrink-0 flex items-center justify-center rounded-full", {
|
|
77
|
+
}, z = $("flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none", {
|
|
76
78
|
variants: { status: H },
|
|
77
79
|
defaultVariants: { status: "pending" }
|
|
78
|
-
}), Q = {
|
|
80
|
+
}), Q = $("size-5 shrink-0 flex items-center justify-center rounded-full", {
|
|
81
|
+
variants: { status: J },
|
|
82
|
+
defaultVariants: { status: "pending" }
|
|
83
|
+
}), X = {
|
|
79
84
|
contained: {
|
|
80
85
|
rootClassName: "relative",
|
|
81
86
|
hasDivider: !0,
|
|
@@ -96,12 +101,9 @@ function N(e, r) {
|
|
|
96
101
|
const a = new Set(e);
|
|
97
102
|
return r.flatMap((n) => a.has(n.id) ? [n.id] : []);
|
|
98
103
|
}
|
|
99
|
-
function
|
|
104
|
+
function Y(e, r) {
|
|
100
105
|
return e.length === r.length && e.every((a, n) => a === r[n]);
|
|
101
106
|
}
|
|
102
|
-
function Y(e) {
|
|
103
|
-
return e < 1e3 ? `${e}ms` : `${(e / 1e3).toFixed(1)}s`;
|
|
104
|
-
}
|
|
105
107
|
function Z(e) {
|
|
106
108
|
return typeof e == "object" && e !== null && Symbol.iterator in e && typeof e[Symbol.iterator] == "function";
|
|
107
109
|
}
|
|
@@ -111,15 +113,15 @@ function ee(e) {
|
|
|
111
113
|
var W = /* @__PURE__ */ new WeakMap();
|
|
112
114
|
function te(e, r) {
|
|
113
115
|
const a = [];
|
|
114
|
-
let n = !1,
|
|
116
|
+
let n = !1, s = !Array.isArray(e);
|
|
115
117
|
for (let c = r.next(); !c.done; c = r.next()) {
|
|
116
118
|
const u = R(c.value);
|
|
117
|
-
a.push(u.content), n ||= u.hasRenderableContent,
|
|
119
|
+
a.push(u.content), n ||= u.hasRenderableContent, s ||= u.changed;
|
|
118
120
|
}
|
|
119
121
|
return {
|
|
120
|
-
content:
|
|
122
|
+
content: s ? a : e,
|
|
121
123
|
hasRenderableContent: n,
|
|
122
|
-
changed:
|
|
124
|
+
changed: s
|
|
123
125
|
};
|
|
124
126
|
}
|
|
125
127
|
function R(e) {
|
|
@@ -149,8 +151,8 @@ function R(e) {
|
|
|
149
151
|
if (Z(e)) {
|
|
150
152
|
const r = e[Symbol.iterator](), a = ee(r) ? r : null;
|
|
151
153
|
if (a !== null) {
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
+
const s = W.get(a);
|
|
155
|
+
if (s !== void 0) return s;
|
|
154
156
|
}
|
|
155
157
|
const n = te(e, r);
|
|
156
158
|
return a !== null && W.set(a, n), n;
|
|
@@ -177,11 +179,11 @@ function ne(e) {
|
|
|
177
179
|
case "error":
|
|
178
180
|
return "Error";
|
|
179
181
|
default:
|
|
180
|
-
return
|
|
182
|
+
return M(e);
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
|
-
function
|
|
184
|
-
const n = f(
|
|
185
|
+
function j({ status: e, index: r, className: a }) {
|
|
186
|
+
const n = f(Q({ status: e }), a);
|
|
185
187
|
switch (e) {
|
|
186
188
|
case "pending":
|
|
187
189
|
return /* @__PURE__ */ t("div", {
|
|
@@ -208,30 +210,35 @@ function q({ status: e, index: r, className: a }) {
|
|
|
208
210
|
return /* @__PURE__ */ t("div", {
|
|
209
211
|
"data-slot": "workflow-step-icon",
|
|
210
212
|
className: f(n, "delight-check-bounce motion-reduce:!animate-none"),
|
|
211
|
-
children: /* @__PURE__ */ t(
|
|
213
|
+
children: /* @__PURE__ */ t(A, { className: "size-3" })
|
|
212
214
|
});
|
|
213
215
|
case "error":
|
|
214
216
|
return /* @__PURE__ */ t("div", {
|
|
215
217
|
"data-slot": "workflow-step-icon",
|
|
216
218
|
className: f(n, "delight-shake motion-reduce:!animate-none"),
|
|
217
|
-
children: /* @__PURE__ */ t(
|
|
219
|
+
children: /* @__PURE__ */ t(D, { className: "size-3" })
|
|
218
220
|
});
|
|
219
221
|
default:
|
|
220
|
-
return
|
|
222
|
+
return M(e);
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
|
-
|
|
224
|
-
function
|
|
225
|
-
const y = l.useId(),
|
|
226
|
-
/* @__PURE__ */ t(
|
|
225
|
+
j.displayName = "WorkflowStepStatusIcon";
|
|
226
|
+
function L({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot: s = "workflow-step-item", expandable: c = !0, expanded: u, active: k = !1, onExpandedChange: S }) {
|
|
227
|
+
const y = l.useId(), d = l.useId(), p = R(e.content), C = p.hasRenderableContent, h = re(e.error), m = h !== void 0, v = C || m, w = v && c, I = F(), x = X[n], i = { duration: I ? 0 : 0.2 }, o = /* @__PURE__ */ g(B, { children: [
|
|
228
|
+
/* @__PURE__ */ t(j, {
|
|
227
229
|
status: e.status,
|
|
228
230
|
index: r
|
|
229
231
|
}),
|
|
230
232
|
/* @__PURE__ */ g("div", {
|
|
231
233
|
className: "min-w-0 flex-1 text-start",
|
|
232
234
|
children: [/* @__PURE__ */ g("div", {
|
|
233
|
-
className: "flex items-center gap-2",
|
|
235
|
+
className: "flex flex-wrap items-center gap-2",
|
|
234
236
|
children: [
|
|
237
|
+
e.contextLabel && /* @__PURE__ */ t("span", {
|
|
238
|
+
"data-slot": "workflow-step-context",
|
|
239
|
+
className: "rounded-full border border-border px-2 py-0.5 text-[0.6875rem] font-medium leading-none text-secondary-foreground",
|
|
240
|
+
children: e.contextLabel
|
|
241
|
+
}),
|
|
235
242
|
/* @__PURE__ */ t("span", {
|
|
236
243
|
className: f("text-sm font-medium", e.status === "pending" ? "text-text-quaternary" : "text-foreground"),
|
|
237
244
|
children: e.title
|
|
@@ -242,7 +249,7 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
242
249
|
}),
|
|
243
250
|
e.durationMs !== void 0 && /* @__PURE__ */ t("span", {
|
|
244
251
|
className: "text-xs text-muted-foreground",
|
|
245
|
-
children:
|
|
252
|
+
children: G(e.durationMs)
|
|
246
253
|
})
|
|
247
254
|
]
|
|
248
255
|
}), e.description && /* @__PURE__ */ t("p", {
|
|
@@ -252,11 +259,11 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
252
259
|
}),
|
|
253
260
|
w && /* @__PURE__ */ t("div", {
|
|
254
261
|
className: "shrink-0",
|
|
255
|
-
children: u ? /* @__PURE__ */ t(
|
|
262
|
+
children: u ? /* @__PURE__ */ t(q, { className: "size-4 text-muted-foreground" }) : /* @__PURE__ */ t(V, { className: "size-4 text-muted-foreground rtl:rotate-180" })
|
|
256
263
|
})
|
|
257
264
|
] });
|
|
258
265
|
return /* @__PURE__ */ g("div", {
|
|
259
|
-
"data-slot":
|
|
266
|
+
"data-slot": s,
|
|
260
267
|
"data-step-status": e.status,
|
|
261
268
|
"data-appearance": n,
|
|
262
269
|
className: f(x.rootClassName, x.hasDivider && !a && "border-b border-border"),
|
|
@@ -267,18 +274,18 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
267
274
|
"aria-current": k ? "step" : void 0,
|
|
268
275
|
"aria-expanded": u,
|
|
269
276
|
"aria-controls": y,
|
|
270
|
-
"aria-describedby": m ?
|
|
277
|
+
"aria-describedby": m ? d : void 0,
|
|
271
278
|
className: f(z({ status: e.status }), "w-full cursor-pointer hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring"),
|
|
272
279
|
children: o
|
|
273
280
|
}) : /* @__PURE__ */ t("div", {
|
|
274
281
|
"aria-current": k ? "step" : void 0,
|
|
275
|
-
"aria-describedby": m ?
|
|
282
|
+
"aria-describedby": m ? d : void 0,
|
|
276
283
|
className: f(z({ status: e.status }), "w-full"),
|
|
277
284
|
children: o
|
|
278
285
|
}),
|
|
279
|
-
/* @__PURE__ */ t(
|
|
286
|
+
/* @__PURE__ */ t(_, {
|
|
280
287
|
initial: !1,
|
|
281
|
-
children: u && v && /* @__PURE__ */ t(
|
|
288
|
+
children: u && v && /* @__PURE__ */ t(P.div, {
|
|
282
289
|
id: y,
|
|
283
290
|
"data-slot": "workflow-step-panel",
|
|
284
291
|
initial: {
|
|
@@ -293,7 +300,7 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
293
300
|
height: 0,
|
|
294
301
|
opacity: 0
|
|
295
302
|
},
|
|
296
|
-
transition:
|
|
303
|
+
transition: i,
|
|
297
304
|
className: "overflow-hidden motion-reduce:transition-none",
|
|
298
305
|
children: /* @__PURE__ */ g("div", {
|
|
299
306
|
className: "px-4 pb-3 ps-12",
|
|
@@ -301,7 +308,7 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
301
308
|
className: "rounded-lg border border-destructive/50 bg-destructive/10 p-3",
|
|
302
309
|
children: /* @__PURE__ */ g("div", {
|
|
303
310
|
className: "flex items-start gap-2",
|
|
304
|
-
children: [/* @__PURE__ */ t(
|
|
311
|
+
children: [/* @__PURE__ */ t(D, { className: "mt-0.5 size-4 shrink-0 text-destructive" }), /* @__PURE__ */ t("p", {
|
|
305
312
|
className: "text-sm text-destructive",
|
|
306
313
|
children: h
|
|
307
314
|
})]
|
|
@@ -314,7 +321,7 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
314
321
|
})
|
|
315
322
|
}),
|
|
316
323
|
m && /* @__PURE__ */ t("span", {
|
|
317
|
-
id:
|
|
324
|
+
id: d,
|
|
318
325
|
className: "sr-only",
|
|
319
326
|
children: h
|
|
320
327
|
}),
|
|
@@ -326,46 +333,47 @@ function A({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot
|
|
|
326
333
|
]
|
|
327
334
|
});
|
|
328
335
|
}
|
|
329
|
-
|
|
330
|
-
function ae({ steps: e, appearance: r = "contained", itemSlot: a = "workflow-step-item", expandable: n = !0, activeStepId:
|
|
331
|
-
const
|
|
336
|
+
L.displayName = "WorkflowStepItem";
|
|
337
|
+
function ae({ steps: e, appearance: r = "contained", itemSlot: a = "workflow-step-item", expandable: n = !0, activeStepId: s, expandedStepIds: c, defaultExpandedStepIds: u = [], onExpandedStepIdsChange: k, className: S, renderItems: y = !0 }) {
|
|
338
|
+
const d = c !== void 0, p = d ? [...c] : void 0, [C, h] = l.useState(() => N(u, e)), m = l.useRef(p ?? []), v = l.useRef(d), w = N(d ? c : C, e), I = new Set(w);
|
|
332
339
|
l.useLayoutEffect(() => {
|
|
333
340
|
p !== void 0 && (m.current = p);
|
|
334
341
|
}, [p]), l.useLayoutEffect(() => {
|
|
335
|
-
const
|
|
336
|
-
v.current =
|
|
337
|
-
const b = N(
|
|
338
|
-
return
|
|
342
|
+
const i = v.current;
|
|
343
|
+
v.current = d, !d && h((o) => {
|
|
344
|
+
const b = N(i ? m.current : o, e);
|
|
345
|
+
return Y(b, o) ? o : b;
|
|
339
346
|
});
|
|
340
|
-
}, [
|
|
341
|
-
const x = (
|
|
347
|
+
}, [d, e]);
|
|
348
|
+
const x = (i) => {
|
|
342
349
|
const o = new Set(w);
|
|
343
|
-
o.has(
|
|
350
|
+
o.has(i) ? o.delete(i) : o.add(i);
|
|
344
351
|
const b = N([...o], e);
|
|
345
|
-
|
|
352
|
+
d || h([...b]), k?.([...b]);
|
|
346
353
|
};
|
|
347
354
|
return y ? /* @__PURE__ */ t("ol", {
|
|
348
355
|
"data-slot": "workflow-step-list",
|
|
349
356
|
"data-appearance": r,
|
|
350
357
|
className: f("m-0 list-none p-0", S),
|
|
351
|
-
children: e.map((
|
|
352
|
-
step:
|
|
358
|
+
children: e.map((i, o) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(L, {
|
|
359
|
+
step: i,
|
|
353
360
|
index: o,
|
|
354
361
|
isLast: o === e.length - 1,
|
|
355
362
|
appearance: r,
|
|
356
363
|
itemSlot: a,
|
|
357
364
|
expandable: n,
|
|
358
|
-
expanded: I.has(
|
|
359
|
-
active:
|
|
360
|
-
onExpandedChange: () => x(
|
|
361
|
-
}) },
|
|
365
|
+
expanded: I.has(i.id),
|
|
366
|
+
active: s === i.id,
|
|
367
|
+
onExpandedChange: () => x(i.id)
|
|
368
|
+
}) }, i.id))
|
|
362
369
|
}) : null;
|
|
363
370
|
}
|
|
364
371
|
ae.displayName = "WorkflowStepRenderer";
|
|
365
372
|
export {
|
|
373
|
+
G as i,
|
|
366
374
|
ae as n,
|
|
367
|
-
|
|
368
|
-
|
|
375
|
+
j as r,
|
|
376
|
+
L as t
|
|
369
377
|
};
|
|
370
378
|
|
|
371
379
|
//# sourceMappingURL=workflow-step-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step-renderer.js","names":["__iconNode"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/loader.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/pause.mjs","../../src/components/organisms/ai/_shared/workflow-step-renderer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m16.2 7.8 2.9-2.9\", key: \"r700ao\" }],\n [\"path\", { d: \"M18 12h4\", key: \"wj9ykh\" }],\n [\"path\", { d: \"m16.2 16.2 2.9 2.9\", key: \"1bxg5t\" }],\n [\"path\", { d: \"M12 18v4\", key: \"jadmvz\" }],\n [\"path\", { d: \"m4.9 19.1 2.9-2.9\", key: \"bwix9q\" }],\n [\"path\", { d: \"M2 12h4\", key: \"j09sii\" }],\n [\"path\", { d: \"m4.9 4.9 2.9 2.9\", key: \"giyufr\" }]\n];\nconst Loader = createLucideIcon(\"loader\", __iconNode);\n\nexport { __iconNode, Loader as default };\n//# sourceMappingURL=loader.mjs.map\n","/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.mjs.map\n","import { cva } from 'class-variance-authority';\nimport {\n AlertCircle,\n Check,\n ChevronDown,\n ChevronRight,\n Loader,\n Pause,\n} from 'lucide-react';\nimport { AnimatePresence, motion, useReducedMotion } from 'motion/react';\nimport * as React from 'react';\nimport { assertNever, cn } from '@/lib/utils';\n\nexport type WorkflowStepStatus =\n | 'pending'\n | 'running'\n | 'suspended'\n | 'completed'\n | 'error';\n\nexport type WorkflowStepAppearance = 'contained' | 'embedded' | 'timeline';\n\nexport interface WorkflowStepViewModel {\n id: string;\n title: string;\n description?: string;\n status: WorkflowStepStatus;\n content?: React.ReactNode;\n durationMs?: number;\n error?: string;\n}\n\nexport interface WorkflowStepRendererProps {\n steps: readonly WorkflowStepViewModel[];\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n activeStepId?: string;\n expandedStepIds?: readonly string[];\n defaultExpandedStepIds?: readonly string[];\n onExpandedStepIdsChange?: (ids: readonly string[]) => void;\n className?: string;\n}\n\ninterface PrivateWorkflowStepRendererProps extends WorkflowStepRendererProps {\n renderItems?: boolean;\n}\n\nconst workflowStepItemStatusClasses = {\n pending: 'text-muted-foreground',\n running: 'text-primary',\n suspended: 'text-warning',\n completed: 'text-success',\n error: 'text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nconst workflowStepIconStatusClasses = {\n pending: 'bg-accent text-muted-foreground',\n running: 'bg-primary/20 text-primary',\n suspended: 'bg-warning/20 text-warning',\n completed: 'bg-success/20 text-success',\n error: 'bg-destructive/20 text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nexport const workflowStepItemVariants = cva(\n 'flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none',\n {\n variants: {\n status: workflowStepItemStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nexport const workflowStepIconVariants = cva(\n 'size-5 shrink-0 flex items-center justify-center rounded-full',\n {\n variants: {\n status: workflowStepIconStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nconst workflowStepAppearanceConfig = {\n contained: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n embedded: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n timeline: {\n rootClassName: 'relative',\n hasDivider: false,\n hasConnector: true,\n },\n} as const satisfies Record<\n WorkflowStepAppearance,\n { rootClassName: string; hasDivider: boolean; hasConnector: boolean }\n>;\n\nexport function normalizeExpandedWorkflowStepIds(\n ids: readonly string[],\n steps: readonly WorkflowStepViewModel[],\n): string[] {\n const requested = new Set(ids);\n return steps.flatMap((step) => (requested.has(step.id) ? [step.id] : []));\n}\n\nfunction areWorkflowStepIdsEqual(\n left: readonly string[],\n right: readonly string[],\n): boolean {\n return (\n left.length === right.length &&\n left.every((id, index) => id === right[index])\n );\n}\n\nfunction formatWorkflowStepDuration(durationMs: number): string {\n if (durationMs < 1000) return `${durationMs}ms`;\n return `${(durationMs / 1000).toFixed(1)}s`;\n}\n\nfunction isIterableWorkflowStepContent(\n content: React.ReactNode,\n): content is Iterable<React.ReactNode> {\n return (\n typeof content === 'object' &&\n content !== null &&\n Symbol.iterator in content &&\n typeof (content as Iterable<React.ReactNode>)[Symbol.iterator] ===\n 'function'\n );\n}\n\nfunction isIteratorWorkflowStepContent(\n content: unknown,\n): content is Iterator<React.ReactNode> {\n return (\n typeof (content as Partial<Iterator<React.ReactNode>>).next === 'function'\n );\n}\n\ninterface NormalizedWorkflowStepContent {\n content: React.ReactNode;\n hasRenderableContent: boolean;\n changed: boolean;\n}\n\nconst normalizedOneShotWorkflowStepContent = new WeakMap<\n object,\n NormalizedWorkflowStepContent\n>();\n\nfunction normalizeIterableWorkflowStepContent(\n content: Iterable<React.ReactNode>,\n iterator: Iterator<React.ReactNode>,\n): NormalizedWorkflowStepContent {\n const normalizedChildren: React.ReactNode[] = [];\n let hasRenderableContent = false;\n let changed = !Array.isArray(content);\n\n for (let result = iterator.next(); !result.done; result = iterator.next()) {\n const normalizedChild = normalizeWorkflowStepContent(result.value);\n normalizedChildren.push(normalizedChild.content);\n hasRenderableContent ||= normalizedChild.hasRenderableContent;\n changed ||= normalizedChild.changed;\n }\n\n return {\n content: changed ? normalizedChildren : content,\n hasRenderableContent,\n changed,\n };\n}\n\nfunction normalizeWorkflowStepContent(\n content: React.ReactNode,\n): NormalizedWorkflowStepContent {\n if (\n content === null ||\n content === undefined ||\n typeof content === 'boolean' ||\n content === ''\n ) {\n return { content, hasRenderableContent: false, changed: false };\n }\n\n if (\n typeof content === 'string' ||\n typeof content === 'number' ||\n typeof content === 'bigint'\n ) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n if (React.isValidElement<{ children?: React.ReactNode }>(content)) {\n if (content.type !== React.Fragment) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n const normalizedChildren = normalizeWorkflowStepContent(\n content.props.children,\n );\n return {\n content: normalizedChildren.changed\n ? React.cloneElement(content, undefined, normalizedChildren.content)\n : content,\n hasRenderableContent: normalizedChildren.hasRenderableContent,\n changed: normalizedChildren.changed,\n };\n }\n\n if (isIterableWorkflowStepContent(content)) {\n const iterator = content[Symbol.iterator]();\n const oneShotCacheKey = isIteratorWorkflowStepContent(iterator)\n ? (iterator as object)\n : null;\n\n if (oneShotCacheKey !== null) {\n const cached = normalizedOneShotWorkflowStepContent.get(oneShotCacheKey);\n if (cached !== undefined) return cached;\n }\n\n const normalized = normalizeIterableWorkflowStepContent(content, iterator);\n if (oneShotCacheKey !== null) {\n normalizedOneShotWorkflowStepContent.set(oneShotCacheKey, normalized);\n }\n return normalized;\n }\n\n return { content, hasRenderableContent: true, changed: false };\n}\n\nfunction getNonBlankWorkflowStepError(\n error: string | undefined,\n): string | undefined {\n return error?.trim() ? error : undefined;\n}\n\nfunction getWorkflowStepStatusLabel(status: WorkflowStepStatus): string {\n switch (status) {\n case 'pending':\n return 'Pending';\n case 'running':\n return 'Running';\n case 'suspended':\n return 'Paused';\n case 'completed':\n return 'Completed';\n case 'error':\n return 'Error';\n default:\n return assertNever(status);\n }\n}\n\nexport interface WorkflowStepStatusIconProps {\n status: WorkflowStepStatus;\n index: number;\n className?: string;\n}\n\nexport function WorkflowStepStatusIcon({\n status,\n index,\n className,\n}: WorkflowStepStatusIconProps) {\n const iconClass = cn(workflowStepIconVariants({ status }), className);\n\n switch (status) {\n case 'pending':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <span className=\"text-xs font-medium\">{index + 1}</span>\n </div>\n );\n case 'running':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-status-pulse motion-reduce:!animate-none',\n )}\n >\n <Loader className=\"size-3 animate-spin motion-reduce:animate-none\" />\n </div>\n );\n case 'suspended':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <Pause className=\"size-3\" />\n </div>\n );\n case 'completed':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-check-bounce motion-reduce:!animate-none',\n )}\n >\n <Check className=\"size-3\" />\n </div>\n );\n case 'error':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(iconClass, 'delight-shake motion-reduce:!animate-none')}\n >\n <AlertCircle className=\"size-3\" />\n </div>\n );\n default:\n return assertNever(status);\n }\n}\n\nWorkflowStepStatusIcon.displayName = 'WorkflowStepStatusIcon';\n\nexport interface WorkflowStepItemProps {\n step: WorkflowStepViewModel;\n index: number;\n isLast: boolean;\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n expanded: boolean;\n active?: boolean;\n onExpandedChange: () => void;\n}\n\nexport function WorkflowStepItem({\n step,\n index,\n isLast,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n expanded,\n active = false,\n onExpandedChange,\n}: WorkflowStepItemProps) {\n const contentId = React.useId();\n const errorDescriptionId = React.useId();\n const normalizedContent = normalizeWorkflowStepContent(step.content);\n const hasContent = normalizedContent.hasRenderableContent;\n const error = getNonBlankWorkflowStepError(step.error);\n const hasError = error !== undefined;\n const hasExpandableDetails = hasContent || hasError;\n const isDisclosureControl = hasExpandableDetails && expandable;\n const prefersReducedMotion = useReducedMotion();\n const appearanceConfig = workflowStepAppearanceConfig[appearance];\n const disclosureTransition = {\n duration: prefersReducedMotion ? 0 : 0.2,\n };\n const stepContent = (\n <>\n <WorkflowStepStatusIcon status={step.status} index={index} />\n\n <div className=\"min-w-0 flex-1 text-start\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\n 'text-sm font-medium',\n step.status === 'pending'\n ? 'text-text-quaternary'\n : 'text-foreground',\n )}\n >\n {step.title}\n </span>\n <span className=\"text-xs text-secondary-foreground\">\n {getWorkflowStepStatusLabel(step.status)}\n </span>\n {step.durationMs !== undefined && (\n <span className=\"text-xs text-muted-foreground\">\n {formatWorkflowStepDuration(step.durationMs)}\n </span>\n )}\n </div>\n {step.description && (\n <p className=\"mt-0.5 text-xs text-text-quaternary\">\n {step.description}\n </p>\n )}\n </div>\n\n {isDisclosureControl && (\n <div className=\"shrink-0\">\n {expanded ? (\n <ChevronDown className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRight className=\"size-4 text-muted-foreground rtl:rotate-180\" />\n )}\n </div>\n )}\n </>\n );\n\n return (\n <div\n data-slot={itemSlot}\n data-step-status={step.status}\n data-appearance={appearance}\n className={cn(\n appearanceConfig.rootClassName,\n appearanceConfig.hasDivider && !isLast && 'border-b border-border',\n )}\n >\n {isDisclosureControl ? (\n <button\n type=\"button\"\n onClick={onExpandedChange}\n aria-current={active ? 'step' : undefined}\n aria-expanded={expanded}\n aria-controls={contentId}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full cursor-pointer hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring',\n )}\n >\n {stepContent}\n </button>\n ) : (\n <div\n aria-current={active ? 'step' : undefined}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full',\n )}\n >\n {stepContent}\n </div>\n )}\n\n <AnimatePresence initial={false}>\n {expanded && hasExpandableDetails && (\n <motion.div\n id={contentId}\n data-slot=\"workflow-step-panel\"\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={disclosureTransition}\n className=\"overflow-hidden motion-reduce:transition-none\"\n >\n <div className=\"px-4 pb-3 ps-12\">\n {hasError && (\n <div className=\"rounded-lg border border-destructive/50 bg-destructive/10 p-3\">\n <div className=\"flex items-start gap-2\">\n <AlertCircle className=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n </div>\n )}\n {hasContent && (\n <div className={hasError ? 'mt-3' : undefined}>\n {normalizedContent.content}\n </div>\n )}\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {hasError && (\n <span id={errorDescriptionId} className=\"sr-only\">\n {error}\n </span>\n )}\n\n {appearanceConfig.hasConnector && !isLast && (\n <div\n data-slot=\"workflow-step-connector\"\n aria-hidden=\"true\"\n className=\"absolute top-8 -bottom-3 start-6 w-px bg-border\"\n />\n )}\n </div>\n );\n}\n\nWorkflowStepItem.displayName = 'WorkflowStepItem';\n\nexport function WorkflowStepRenderer({\n steps,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n activeStepId,\n expandedStepIds: controlledExpandedStepIds,\n defaultExpandedStepIds = [],\n onExpandedStepIdsChange,\n className,\n renderItems = true,\n}: PrivateWorkflowStepRendererProps) {\n const isControlled = controlledExpandedStepIds !== undefined;\n const controlledSnapshot = isControlled\n ? [...controlledExpandedStepIds]\n : undefined;\n const [uncontrolledExpandedStepIds, setUncontrolledExpandedStepIds] =\n React.useState<readonly string[]>(() =>\n normalizeExpandedWorkflowStepIds(defaultExpandedStepIds, steps),\n );\n const lastControlledExpandedStepIdsRef = React.useRef<readonly string[]>(\n controlledSnapshot ?? [],\n );\n const wasControlledRef = React.useRef(isControlled);\n const rawExpandedStepIds = isControlled\n ? controlledExpandedStepIds\n : uncontrolledExpandedStepIds;\n const visibleExpandedStepIds = normalizeExpandedWorkflowStepIds(\n rawExpandedStepIds,\n steps,\n );\n const expandedSet = new Set(visibleExpandedStepIds);\n\n React.useLayoutEffect(() => {\n if (controlledSnapshot !== undefined) {\n lastControlledExpandedStepIdsRef.current = controlledSnapshot;\n }\n }, [controlledSnapshot]);\n\n React.useLayoutEffect(() => {\n const wasControlled = wasControlledRef.current;\n wasControlledRef.current = isControlled;\n if (isControlled) return;\n\n setUncontrolledExpandedStepIds((current) => {\n const source = wasControlled\n ? lastControlledExpandedStepIdsRef.current\n : current;\n const reconciled = normalizeExpandedWorkflowStepIds(source, steps);\n return areWorkflowStepIdsEqual(reconciled, current)\n ? current\n : reconciled;\n });\n }, [isControlled, steps]);\n\n const toggleStep = (id: string) => {\n const next = new Set(visibleExpandedStepIds);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n const normalizedNext = normalizeExpandedWorkflowStepIds([...next], steps);\n if (!isControlled) {\n setUncontrolledExpandedStepIds([...normalizedNext]);\n }\n onExpandedStepIdsChange?.([...normalizedNext]);\n };\n\n if (!renderItems) return null;\n\n return (\n <ol\n data-slot=\"workflow-step-list\"\n data-appearance={appearance}\n className={cn('m-0 list-none p-0', className)}\n >\n {steps.map((step, index) => (\n <li key={step.id}>\n <WorkflowStepItem\n step={step}\n index={index}\n isLast={index === steps.length - 1}\n appearance={appearance}\n itemSlot={itemSlot}\n expandable={expandable}\n expanded={expandedSet.has(step.id)}\n active={activeStepId === step.id}\n onExpandedChange={() => toggleStep(step.id)}\n />\n </li>\n ))}\n </ol>\n );\n}\n\nWorkflowStepRenderer.displayName = 'WorkflowStepRenderer';\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;AASA,IAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAW,KAAK;AAAA,EAAS,CAAC;AAAA,EACxC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAqB,KAAK;AAAA,EAAS,CAAC;AAAA,EAClD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAY,KAAK;AAAA,EAAS,CAAC;AAAA,EACzC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAsB,KAAK;AAAA,EAAS,CAAC;AAAA,EACnD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAY,KAAK;AAAA,EAAS,CAAC;AAAA,EACzC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAA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Aa,EAHJ,IACX,EAAiC,UACjC,GACwD,CAAK;AACjE,aAAO,EAAwB,GAAY,CAAO,IAC9C,IACA;AAAA,IACN,CAAC;AAAA,EACH,GAAG,CAAC,GAAc,CAAK,CAAC;AAExB,QAAM,IAAA,CAAc,MAAe;AACjC,UAAM,IAAO,IAAI,IAAI,CAAsB;AAC3C,IAAI,EAAK,IAAI,CAAE,IAAG,EAAK,OAAO,CAAE,IAC3B,EAAK,IAAI,CAAE;AAChB,UAAM,IAAiB,EAAiC,CAAC,GAAG,CAAI,GAAG,CAAK;AACxE,IAAK,KACH,EAA+B,CAAC,GAAG,CAAc,CAAC,GAEpD,IAA0B,CAAC,GAAG,CAAc,CAAC;AAAA,EAC/C;AAEA,SAAK,IAGH,gBAAA,EAAC,MAAD;AAAA,IACE,aAAU;AAAA,IACV,mBAAiB;AAAA,IACjB,WAAW,EAAG,qBAAqB,CAAS;AAAA,cAE3C,EAAM,IAAA,CAAK,GAAM,MAChB,gBAAA,EAAC,MAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,MACQ,MAAA;AAAA,MACC,OAAA;AAAA,MACP,QAAQ,MAAU,EAAM,SAAS;AAAA,MACrB,YAAA;AAAA,MACF,UAAA;AAAA,MACE,YAAA;AAAA,MACZ,UAAU,EAAY,IAAI,EAAK,EAAE;AAAA,MACjC,QAAQ,MAAiB,EAAK;AAAA,MAC9B,kBAAA,MAAwB,EAAW,EAAK,EAAE;AAAA,IAC3C,CAAA,EACC,GAZK,EAAK,EAYV,CACL;AAAA,EACC,CAAA,IAvBmB;AAyB3B;AAEA,GAAqB,cAAc"}
|
|
1
|
+
{"version":3,"file":"workflow-step-renderer.js","names":["__iconNode"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/loader.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/pause.mjs","../../src/components/organisms/ai/_shared/format-ai-duration.ts","../../src/components/organisms/ai/_shared/workflow-step-renderer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m16.2 7.8 2.9-2.9\", key: \"r700ao\" }],\n [\"path\", { d: \"M18 12h4\", key: \"wj9ykh\" }],\n [\"path\", { d: \"m16.2 16.2 2.9 2.9\", key: \"1bxg5t\" }],\n [\"path\", { d: \"M12 18v4\", key: \"jadmvz\" }],\n [\"path\", { d: \"m4.9 19.1 2.9-2.9\", key: \"bwix9q\" }],\n [\"path\", { d: \"M2 12h4\", key: \"j09sii\" }],\n [\"path\", { d: \"m4.9 4.9 2.9 2.9\", key: \"giyufr\" }]\n];\nconst Loader = createLucideIcon(\"loader\", __iconNode);\n\nexport { __iconNode, Loader as default };\n//# sourceMappingURL=loader.mjs.map\n","/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.mjs.map\n","export function formatAIDuration(durationMs: number): string {\n const totalSeconds = Math.max(0, Math.round(durationMs / 1000));\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n\n if (hours > 0) {\n return [hours ? `${hours}h` : '', minutes ? `${minutes}m` : '']\n .filter(Boolean)\n .join(' ');\n }\n if (minutes > 0) {\n return `${minutes}m${seconds ? ` ${seconds}s` : ''}`;\n }\n return `${totalSeconds}s`;\n}\n","import { cva } from 'class-variance-authority';\nimport {\n AlertCircle,\n Check,\n ChevronDown,\n ChevronRight,\n Loader,\n Pause,\n} from 'lucide-react';\nimport { AnimatePresence, motion, useReducedMotion } from 'motion/react';\nimport * as React from 'react';\nimport { assertNever, cn } from '@/lib/utils';\nimport { formatAIDuration } from './format-ai-duration';\n\nexport type WorkflowStepStatus =\n | 'pending'\n | 'running'\n | 'suspended'\n | 'completed'\n | 'error';\n\nexport type WorkflowStepAppearance = 'contained' | 'embedded' | 'timeline';\n\nexport interface WorkflowStepViewModel {\n id: string;\n title: string;\n description?: string;\n contextLabel?: string;\n status: WorkflowStepStatus;\n content?: React.ReactNode;\n durationMs?: number;\n error?: string;\n}\n\nexport interface WorkflowStepRendererProps {\n steps: readonly WorkflowStepViewModel[];\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n activeStepId?: string;\n expandedStepIds?: readonly string[];\n defaultExpandedStepIds?: readonly string[];\n onExpandedStepIdsChange?: (ids: readonly string[]) => void;\n className?: string;\n}\n\ninterface PrivateWorkflowStepRendererProps extends WorkflowStepRendererProps {\n renderItems?: boolean;\n}\n\nconst workflowStepItemStatusClasses = {\n pending: 'text-muted-foreground',\n running: 'text-primary',\n suspended: 'text-warning',\n completed: 'text-success',\n error: 'text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nconst workflowStepIconStatusClasses = {\n pending: 'bg-accent text-muted-foreground',\n running: 'bg-primary/20 text-primary',\n suspended: 'bg-warning/20 text-warning',\n completed: 'bg-success/20 text-success',\n error: 'bg-destructive/20 text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nexport const workflowStepItemVariants = cva(\n 'flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none',\n {\n variants: {\n status: workflowStepItemStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nexport const workflowStepIconVariants = cva(\n 'size-5 shrink-0 flex items-center justify-center rounded-full',\n {\n variants: {\n status: workflowStepIconStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nconst workflowStepAppearanceConfig = {\n contained: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n embedded: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n timeline: {\n rootClassName: 'relative',\n hasDivider: false,\n hasConnector: true,\n },\n} as const satisfies Record<\n WorkflowStepAppearance,\n { rootClassName: string; hasDivider: boolean; hasConnector: boolean }\n>;\n\nexport function normalizeExpandedWorkflowStepIds(\n ids: readonly string[],\n steps: readonly WorkflowStepViewModel[],\n): string[] {\n const requested = new Set(ids);\n return steps.flatMap((step) => (requested.has(step.id) ? [step.id] : []));\n}\n\nfunction areWorkflowStepIdsEqual(\n left: readonly string[],\n right: readonly string[],\n): boolean {\n return (\n left.length === right.length &&\n left.every((id, index) => id === right[index])\n );\n}\n\nfunction isIterableWorkflowStepContent(\n content: React.ReactNode,\n): content is Iterable<React.ReactNode> {\n return (\n typeof content === 'object' &&\n content !== null &&\n Symbol.iterator in content &&\n typeof (content as Iterable<React.ReactNode>)[Symbol.iterator] ===\n 'function'\n );\n}\n\nfunction isIteratorWorkflowStepContent(\n content: unknown,\n): content is Iterator<React.ReactNode> {\n return (\n typeof (content as Partial<Iterator<React.ReactNode>>).next === 'function'\n );\n}\n\ninterface NormalizedWorkflowStepContent {\n content: React.ReactNode;\n hasRenderableContent: boolean;\n changed: boolean;\n}\n\nconst normalizedOneShotWorkflowStepContent = new WeakMap<\n object,\n NormalizedWorkflowStepContent\n>();\n\nfunction normalizeIterableWorkflowStepContent(\n content: Iterable<React.ReactNode>,\n iterator: Iterator<React.ReactNode>,\n): NormalizedWorkflowStepContent {\n const normalizedChildren: React.ReactNode[] = [];\n let hasRenderableContent = false;\n let changed = !Array.isArray(content);\n\n for (let result = iterator.next(); !result.done; result = iterator.next()) {\n const normalizedChild = normalizeWorkflowStepContent(result.value);\n normalizedChildren.push(normalizedChild.content);\n hasRenderableContent ||= normalizedChild.hasRenderableContent;\n changed ||= normalizedChild.changed;\n }\n\n return {\n content: changed ? normalizedChildren : content,\n hasRenderableContent,\n changed,\n };\n}\n\nfunction normalizeWorkflowStepContent(\n content: React.ReactNode,\n): NormalizedWorkflowStepContent {\n if (\n content === null ||\n content === undefined ||\n typeof content === 'boolean' ||\n content === ''\n ) {\n return { content, hasRenderableContent: false, changed: false };\n }\n\n if (\n typeof content === 'string' ||\n typeof content === 'number' ||\n typeof content === 'bigint'\n ) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n if (React.isValidElement<{ children?: React.ReactNode }>(content)) {\n if (content.type !== React.Fragment) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n const normalizedChildren = normalizeWorkflowStepContent(\n content.props.children,\n );\n return {\n content: normalizedChildren.changed\n ? React.cloneElement(content, undefined, normalizedChildren.content)\n : content,\n hasRenderableContent: normalizedChildren.hasRenderableContent,\n changed: normalizedChildren.changed,\n };\n }\n\n if (isIterableWorkflowStepContent(content)) {\n const iterator = content[Symbol.iterator]();\n const oneShotCacheKey = isIteratorWorkflowStepContent(iterator)\n ? (iterator as object)\n : null;\n\n if (oneShotCacheKey !== null) {\n const cached = normalizedOneShotWorkflowStepContent.get(oneShotCacheKey);\n if (cached !== undefined) return cached;\n }\n\n const normalized = normalizeIterableWorkflowStepContent(content, iterator);\n if (oneShotCacheKey !== null) {\n normalizedOneShotWorkflowStepContent.set(oneShotCacheKey, normalized);\n }\n return normalized;\n }\n\n return { content, hasRenderableContent: true, changed: false };\n}\n\nfunction getNonBlankWorkflowStepError(\n error: string | undefined,\n): string | undefined {\n return error?.trim() ? error : undefined;\n}\n\nfunction getWorkflowStepStatusLabel(status: WorkflowStepStatus): string {\n switch (status) {\n case 'pending':\n return 'Pending';\n case 'running':\n return 'Running';\n case 'suspended':\n return 'Paused';\n case 'completed':\n return 'Completed';\n case 'error':\n return 'Error';\n default:\n return assertNever(status);\n }\n}\n\nexport interface WorkflowStepStatusIconProps {\n status: WorkflowStepStatus;\n index: number;\n className?: string;\n}\n\nexport function WorkflowStepStatusIcon({\n status,\n index,\n className,\n}: WorkflowStepStatusIconProps) {\n const iconClass = cn(workflowStepIconVariants({ status }), className);\n\n switch (status) {\n case 'pending':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <span className=\"text-xs font-medium\">{index + 1}</span>\n </div>\n );\n case 'running':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-status-pulse motion-reduce:!animate-none',\n )}\n >\n <Loader className=\"size-3 animate-spin motion-reduce:animate-none\" />\n </div>\n );\n case 'suspended':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <Pause className=\"size-3\" />\n </div>\n );\n case 'completed':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-check-bounce motion-reduce:!animate-none',\n )}\n >\n <Check className=\"size-3\" />\n </div>\n );\n case 'error':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(iconClass, 'delight-shake motion-reduce:!animate-none')}\n >\n <AlertCircle className=\"size-3\" />\n </div>\n );\n default:\n return assertNever(status);\n }\n}\n\nWorkflowStepStatusIcon.displayName = 'WorkflowStepStatusIcon';\n\nexport interface WorkflowStepItemProps {\n step: WorkflowStepViewModel;\n index: number;\n isLast: boolean;\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n expanded: boolean;\n active?: boolean;\n onExpandedChange: () => void;\n}\n\nexport function WorkflowStepItem({\n step,\n index,\n isLast,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n expanded,\n active = false,\n onExpandedChange,\n}: WorkflowStepItemProps) {\n const contentId = React.useId();\n const errorDescriptionId = React.useId();\n const normalizedContent = normalizeWorkflowStepContent(step.content);\n const hasContent = normalizedContent.hasRenderableContent;\n const error = getNonBlankWorkflowStepError(step.error);\n const hasError = error !== undefined;\n const hasExpandableDetails = hasContent || hasError;\n const isDisclosureControl = hasExpandableDetails && expandable;\n const prefersReducedMotion = useReducedMotion();\n const appearanceConfig = workflowStepAppearanceConfig[appearance];\n const disclosureTransition = {\n duration: prefersReducedMotion ? 0 : 0.2,\n };\n const stepContent = (\n <>\n <WorkflowStepStatusIcon status={step.status} index={index} />\n\n <div className=\"min-w-0 flex-1 text-start\">\n <div className=\"flex flex-wrap items-center gap-2\">\n {step.contextLabel && (\n <span\n data-slot=\"workflow-step-context\"\n className=\"rounded-full border border-border px-2 py-0.5 text-[0.6875rem] font-medium leading-none text-secondary-foreground\"\n >\n {step.contextLabel}\n </span>\n )}\n <span\n className={cn(\n 'text-sm font-medium',\n step.status === 'pending'\n ? 'text-text-quaternary'\n : 'text-foreground',\n )}\n >\n {step.title}\n </span>\n <span className=\"text-xs text-secondary-foreground\">\n {getWorkflowStepStatusLabel(step.status)}\n </span>\n {step.durationMs !== undefined && (\n <span className=\"text-xs text-muted-foreground\">\n {formatAIDuration(step.durationMs)}\n </span>\n )}\n </div>\n {step.description && (\n <p className=\"mt-0.5 text-xs text-text-quaternary\">\n {step.description}\n </p>\n )}\n </div>\n\n {isDisclosureControl && (\n <div className=\"shrink-0\">\n {expanded ? (\n <ChevronDown className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRight className=\"size-4 text-muted-foreground rtl:rotate-180\" />\n )}\n </div>\n )}\n </>\n );\n\n return (\n <div\n data-slot={itemSlot}\n data-step-status={step.status}\n data-appearance={appearance}\n className={cn(\n appearanceConfig.rootClassName,\n appearanceConfig.hasDivider && !isLast && 'border-b border-border',\n )}\n >\n {isDisclosureControl ? (\n <button\n type=\"button\"\n onClick={onExpandedChange}\n aria-current={active ? 'step' : undefined}\n aria-expanded={expanded}\n aria-controls={contentId}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full cursor-pointer hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring',\n )}\n >\n {stepContent}\n </button>\n ) : (\n <div\n aria-current={active ? 'step' : undefined}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full',\n )}\n >\n {stepContent}\n </div>\n )}\n\n <AnimatePresence initial={false}>\n {expanded && hasExpandableDetails && (\n <motion.div\n id={contentId}\n data-slot=\"workflow-step-panel\"\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={disclosureTransition}\n className=\"overflow-hidden motion-reduce:transition-none\"\n >\n <div className=\"px-4 pb-3 ps-12\">\n {hasError && (\n <div className=\"rounded-lg border border-destructive/50 bg-destructive/10 p-3\">\n <div className=\"flex items-start gap-2\">\n <AlertCircle className=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n </div>\n )}\n {hasContent && (\n <div className={hasError ? 'mt-3' : undefined}>\n {normalizedContent.content}\n </div>\n )}\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {hasError && (\n <span id={errorDescriptionId} className=\"sr-only\">\n {error}\n </span>\n )}\n\n {appearanceConfig.hasConnector && !isLast && (\n <div\n data-slot=\"workflow-step-connector\"\n aria-hidden=\"true\"\n className=\"absolute top-8 -bottom-3 start-6 w-px bg-border\"\n />\n )}\n </div>\n );\n}\n\nWorkflowStepItem.displayName = 'WorkflowStepItem';\n\nexport function WorkflowStepRenderer({\n steps,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n activeStepId,\n expandedStepIds: controlledExpandedStepIds,\n defaultExpandedStepIds = [],\n onExpandedStepIdsChange,\n className,\n renderItems = true,\n}: PrivateWorkflowStepRendererProps) {\n const isControlled = controlledExpandedStepIds !== undefined;\n const controlledSnapshot = isControlled\n ? [...controlledExpandedStepIds]\n : undefined;\n const [uncontrolledExpandedStepIds, setUncontrolledExpandedStepIds] =\n React.useState<readonly string[]>(() =>\n normalizeExpandedWorkflowStepIds(defaultExpandedStepIds, steps),\n );\n const lastControlledExpandedStepIdsRef = React.useRef<readonly string[]>(\n controlledSnapshot ?? [],\n );\n const wasControlledRef = React.useRef(isControlled);\n const rawExpandedStepIds = isControlled\n ? controlledExpandedStepIds\n : uncontrolledExpandedStepIds;\n const visibleExpandedStepIds = normalizeExpandedWorkflowStepIds(\n rawExpandedStepIds,\n steps,\n );\n const expandedSet = new Set(visibleExpandedStepIds);\n\n React.useLayoutEffect(() => {\n if (controlledSnapshot !== undefined) {\n lastControlledExpandedStepIdsRef.current = controlledSnapshot;\n }\n }, [controlledSnapshot]);\n\n React.useLayoutEffect(() => {\n const wasControlled = wasControlledRef.current;\n wasControlledRef.current = isControlled;\n if (isControlled) return;\n\n setUncontrolledExpandedStepIds((current) => {\n const source = wasControlled\n ? lastControlledExpandedStepIdsRef.current\n : current;\n const reconciled = normalizeExpandedWorkflowStepIds(source, steps);\n return areWorkflowStepIdsEqual(reconciled, current)\n ? current\n : reconciled;\n });\n }, [isControlled, steps]);\n\n const toggleStep = (id: string) => {\n const next = new Set(visibleExpandedStepIds);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n const normalizedNext = normalizeExpandedWorkflowStepIds([...next], steps);\n if (!isControlled) {\n setUncontrolledExpandedStepIds([...normalizedNext]);\n }\n onExpandedStepIdsChange?.([...normalizedNext]);\n };\n\n if (!renderItems) return null;\n\n return (\n <ol\n data-slot=\"workflow-step-list\"\n data-appearance={appearance}\n className={cn('m-0 list-none p-0', className)}\n >\n {steps.map((step, index) => (\n <li key={step.id}>\n <WorkflowStepItem\n step={step}\n index={index}\n isLast={index === steps.length - 1}\n appearance={appearance}\n itemSlot={itemSlot}\n expandable={expandable}\n expanded={expandedSet.has(step.id)}\n active={activeStepId === step.id}\n onExpandedChange={() => toggleStep(step.id)}\n />\n </li>\n ))}\n </ol>\n );\n}\n\nWorkflowStepRenderer.displayName = 'WorkflowStepRenderer';\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;AASA,IAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAW,KAAK;AAAA,EAAS,CAAC;AAAA,EACxC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAqB,KAAK;AAAA,EAAS,CAAC;AAAA,EAClD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAY,KAAK;AAAA,EAAS,CAAC;AAAA,EACzC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAsB,KAAK;AAAA,EAAS,CAAC;AAAA,EACnD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAY,KAAK;AAAA,EAAS,CAAC;AAAA,EACzC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAqB,KAAK;AAAA,EAAS,CAAC;AAAA,EAClD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAW,KAAK;AAAA,EAAS,CAAC;AAAA,EACxC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAoB,KAAK;AAAA,EAAS,CAAC;AACnD,GACM,IAAS,EAAiB,UAAUA,CAAU,GCV9C,IAAa,CACjB,CAAC,QAAQ;AAAA,EAAE,GAAG;AAAA,EAAM,GAAG;AAAA,EAAK,OAAO;AAAA,EAAK,QAAQ;AAAA,EAAM,IAAI;AAAA,EAAK,KAAK;AAAS,CAAC,GAC9E,CAAC,QAAQ;AAAA,EAAE,GAAG;AAAA,EAAK,GAAG;AAAA,EAAK,OAAO;AAAA,EAAK,QAAQ;AAAA,EAAM,IAAI;AAAA,EAAK,KAAK;AAAS,CAAC,CAC/E,GACM,IAAQ,EAAiB,SAAS,CAAU;ACblD,SAAgB,EAAiB,GAA4B;AAC3D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,IAAO,IAAI,IAAI,CAAsB;AAC3C,IAAI,EAAK,IAAI,CAAE,IAAG,EAAK,OAAO,CAAE,IAC3B,EAAK,IAAI,CAAE;AAChB,UAAM,IAAiB,EAAiC,CAAC,GAAG,CAAI,GAAG,CAAK;AACxE,IAAK,KACH,EAA+B,CAAC,GAAG,CAAc,CAAC,GAEpD,IAA0B,CAAC,GAAG,CAAc,CAAC;AAAA,EAC/C;AAEA,SAAK,IAGH,gBAAA,EAAC,MAAD;AAAA,IACE,aAAU;AAAA,IACV,mBAAiB;AAAA,IACjB,WAAW,EAAG,qBAAqB,CAAS;AAAA,cAE3C,EAAM,IAAA,CAAK,GAAM,MAChB,gBAAA,EAAC,MAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,MACQ,MAAA;AAAA,MACC,OAAA;AAAA,MACP,QAAQ,MAAU,EAAM,SAAS;AAAA,MACrB,YAAA;AAAA,MACF,UAAA;AAAA,MACE,YAAA;AAAA,MACZ,UAAU,EAAY,IAAI,EAAK,EAAE;AAAA,MACjC,QAAQ,MAAiB,EAAK;AAAA,MAC9B,kBAAA,MAAwB,EAAW,EAAK,EAAE;AAAA,IAC3C,CAAA,EACC,GAZK,EAAK,EAYV,CACL;AAAA,EACC,CAAA,IAvBmB;AAyB3B;AAEA,GAAqB,cAAc"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ name: humain-ui
|
|
|
3
3
|
description: Use when building, migrating, auditing, or bootstrapping React UI with @humain/ui, including pages, dashboards, app shells, forms, dialogs, data tables, charts, AI chat workspaces, or Figma-to-Humain mapping.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Humain Foundation UI (v2.1.
|
|
6
|
+
# Humain Foundation UI (v2.1.65)
|
|
7
7
|
|
|
8
8
|
Build product UI with `@humain/ui`, a React 18/19 component library with Tailwind v4, dark mode, design tokens, Web Component projections, and AI-facing references.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ name: humain-ui-wc
|
|
|
3
3
|
description: Use when building browser-native prototypes, iframe artifacts, static HTML, custom-element demos, framework-neutral integrations, or any HUMAIN UI that must use hf-* Web Components instead of React JSX.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Humain Foundation UI Web Components (v2.1.
|
|
6
|
+
# Humain Foundation UI Web Components (v2.1.65)
|
|
7
7
|
|
|
8
8
|
**Identity** - You build HUMAIN interfaces with `hf-*` custom elements. You keep the same product taste, spacing discipline, and component intent as the React `humain-ui` skill, but you only use Web Component APIs that actually exist in the manifest.
|
|
9
9
|
|
|
Binary file
|
package/skills/humain-ui.skill
CHANGED
|
Binary file
|
package/dist/index182.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { cn } from "./index2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { useAnimate, useReducedMotion } from "motion/react";
|
|
6
|
-
//#region src/components/organisms/ai/AIThinkingLoader/AIThinkingLoader.tsx
|
|
7
|
-
function AnimatedProgressOvals({ className, animationDuration = 3e3, easing = "ease-in-out" }) {
|
|
8
|
-
const prefersReducedMotion = useReducedMotion();
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
-
"data-slot": "thinking-oval",
|
|
11
|
-
"aria-hidden": "true",
|
|
12
|
-
className: cn("absolute top-0 bottom-0 pointer-events-none", className),
|
|
13
|
-
style: prefersReducedMotion ? void 0 : {
|
|
14
|
-
left: 0,
|
|
15
|
-
right: "100%",
|
|
16
|
-
animationName: "thinking-grow-empty",
|
|
17
|
-
animationDuration: `${animationDuration}ms`,
|
|
18
|
-
animationTimingFunction: easing,
|
|
19
|
-
animationIterationCount: "infinite",
|
|
20
|
-
willChange: "left, right, transform"
|
|
21
|
-
},
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ jsx("div", {
|
|
24
|
-
className: "absolute rounded-full bg-air-200 opacity-20",
|
|
25
|
-
style: { inset: -40 }
|
|
26
|
-
}),
|
|
27
|
-
/* @__PURE__ */ jsx("div", {
|
|
28
|
-
className: "absolute rounded-full bg-air-200 opacity-50",
|
|
29
|
-
style: { inset: -20 }
|
|
30
|
-
}),
|
|
31
|
-
/* @__PURE__ */ jsx("div", {
|
|
32
|
-
className: "absolute rounded-full bg-air-200 opacity-70",
|
|
33
|
-
style: { inset: 0 }
|
|
34
|
-
})
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
AnimatedProgressOvals.displayName = "AnimatedProgressOvals";
|
|
39
|
-
function CountdownTimer({ initialTime = 5, isActive = true, onComplete, className }) {
|
|
40
|
-
const [timeLeft, setTimeLeft] = React.useState(initialTime);
|
|
41
|
-
const [scope, animate] = useAnimate();
|
|
42
|
-
const prefersReducedMotion = useReducedMotion();
|
|
43
|
-
const isFirstTick = React.useRef(true);
|
|
44
|
-
React.useEffect(() => {
|
|
45
|
-
setTimeLeft(initialTime);
|
|
46
|
-
}, [initialTime]);
|
|
47
|
-
React.useEffect(() => {
|
|
48
|
-
if (!isActive) return;
|
|
49
|
-
const timer = setInterval(() => {
|
|
50
|
-
setTimeLeft((prev) => {
|
|
51
|
-
if (prev <= 1) {
|
|
52
|
-
onComplete?.();
|
|
53
|
-
return initialTime;
|
|
54
|
-
}
|
|
55
|
-
return prev - 1;
|
|
56
|
-
});
|
|
57
|
-
}, 1e3);
|
|
58
|
-
return () => clearInterval(timer);
|
|
59
|
-
}, [
|
|
60
|
-
isActive,
|
|
61
|
-
initialTime,
|
|
62
|
-
onComplete
|
|
63
|
-
]);
|
|
64
|
-
React.useEffect(() => {
|
|
65
|
-
if (isFirstTick.current) {
|
|
66
|
-
isFirstTick.current = false;
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (!prefersReducedMotion && scope.current) animate(scope.current, {
|
|
70
|
-
scale: [1.12, 1],
|
|
71
|
-
y: [-2, 0]
|
|
72
|
-
}, {
|
|
73
|
-
duration: .3,
|
|
74
|
-
ease: [
|
|
75
|
-
.25,
|
|
76
|
-
1,
|
|
77
|
-
.5,
|
|
78
|
-
1
|
|
79
|
-
]
|
|
80
|
-
});
|
|
81
|
-
}, [
|
|
82
|
-
timeLeft,
|
|
83
|
-
animate,
|
|
84
|
-
prefersReducedMotion,
|
|
85
|
-
scope
|
|
86
|
-
]);
|
|
87
|
-
return /* @__PURE__ */ jsx("div", {
|
|
88
|
-
ref: scope,
|
|
89
|
-
role: "timer",
|
|
90
|
-
"aria-label": `${timeLeft} seconds remaining`,
|
|
91
|
-
className: cn("flex items-center justify-center px-3 py-2 rounded-full bg-card/20 shrink-0", !prefersReducedMotion && "animate-[thinking-pop-in_0.3s_ease-out_0.3s_both]", className),
|
|
92
|
-
children: /* @__PURE__ */ jsxs("span", {
|
|
93
|
-
className: "text-sm text-foreground tabular-nums",
|
|
94
|
-
children: [timeLeft, "s"]
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
CountdownTimer.displayName = "CountdownTimer";
|
|
99
|
-
function AIThinkingLoader({ loadingText = "Transferring to AI Agent: Meeting Manager", easing = "ease-in-out", showCountdown = true, countdownTime = 5, animationDuration = 3e3, onAnimationComplete, className }) {
|
|
100
|
-
const clipRef = React.useRef(null);
|
|
101
|
-
const prefersReducedMotion = useReducedMotion();
|
|
102
|
-
React.useEffect(() => {
|
|
103
|
-
if (!onAnimationComplete) return;
|
|
104
|
-
const oval = clipRef.current?.querySelector("[data-slot=\"thinking-oval\"]");
|
|
105
|
-
if (!oval) return;
|
|
106
|
-
const handler = () => onAnimationComplete();
|
|
107
|
-
oval.addEventListener("animationiteration", handler);
|
|
108
|
-
return () => oval.removeEventListener("animationiteration", handler);
|
|
109
|
-
}, [onAnimationComplete]);
|
|
110
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
111
|
-
"data-slot": "ai-thinking-loader",
|
|
112
|
-
role: "status",
|
|
113
|
-
"aria-live": "polite",
|
|
114
|
-
"aria-busy": "true",
|
|
115
|
-
"aria-label": loadingText,
|
|
116
|
-
className: cn("relative flex items-center justify-center gap-2 min-h-[3.25rem] px-4 py-2 rounded-full border border-border bg-card/60", className),
|
|
117
|
-
style: prefersReducedMotion ? void 0 : { animation: "thinking-fade-in 0.5s ease-out forwards, thinking-glow 4s ease-in-out 0.5s infinite" },
|
|
118
|
-
children: [
|
|
119
|
-
/* @__PURE__ */ jsx("div", {
|
|
120
|
-
ref: clipRef,
|
|
121
|
-
className: "absolute inset-0 overflow-clip rounded-full",
|
|
122
|
-
children: /* @__PURE__ */ jsx(AnimatedProgressOvals, {
|
|
123
|
-
easing,
|
|
124
|
-
animationDuration
|
|
125
|
-
})
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ jsx("span", {
|
|
128
|
-
className: cn("relative z-10 text-sm text-foreground whitespace-nowrap truncate font-medium", !prefersReducedMotion && "animate-[thinking-slide-in_0.35s_ease-out_0.15s_both]"),
|
|
129
|
-
children: loadingText
|
|
130
|
-
}),
|
|
131
|
-
showCountdown && /* @__PURE__ */ jsx(CountdownTimer, {
|
|
132
|
-
initialTime: countdownTime,
|
|
133
|
-
isActive: true,
|
|
134
|
-
className: "relative z-10"
|
|
135
|
-
})
|
|
136
|
-
]
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
AIThinkingLoader.displayName = "AIThinkingLoader";
|
|
140
|
-
//#endregion
|
|
141
|
-
export { AIThinkingLoader, CountdownTimer };
|
|
142
|
-
|
|
143
|
-
//# sourceMappingURL=index182.js.map
|