@tetrascience-npm/tetrascience-react-ui 0.5.0-beta.65.1 → 0.5.0-beta.67.1
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/README.md +84 -37
- package/dist/components/composed/ProcessFlow/ProcessFlow.cjs +2 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.cjs.map +1 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.js +543 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.js.map +1 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.utils.cjs +2 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.utils.cjs.map +1 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.utils.js +84 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.utils.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +99 -0
- package/dist/index.js +605 -601
- package/dist/index.js.map +1 -1
- package/dist/index.tailwind.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import { jsx as s, jsxs as w, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { CheckIcon as q, TriangleAlertIcon as U, LockIcon as W, DotIcon as Z } from "lucide-react";
|
|
3
|
+
import { hasCustomStepLayout as z, positionStep as E, resolveConnections as N, getConnectionPath as j, getStepAccessibleLabel as F, STATUS_LABELS as K, getDescriptionVisibility as S } from "./ProcessFlow.utils.js";
|
|
4
|
+
import { PROCESS_FLOW_STEP_STATUSES as ge } from "./ProcessFlow.utils.js";
|
|
5
|
+
import { cn as f } from "../../../lib/utils.js";
|
|
6
|
+
const Q = {
|
|
7
|
+
pending: "text-muted-foreground",
|
|
8
|
+
active: "text-foreground",
|
|
9
|
+
completed: "text-foreground",
|
|
10
|
+
error: "text-destructive",
|
|
11
|
+
disabled: "text-muted-foreground"
|
|
12
|
+
}, $ = {
|
|
13
|
+
pending: "border-border bg-background text-muted-foreground",
|
|
14
|
+
active: "border-primary bg-primary text-primary-foreground",
|
|
15
|
+
completed: "border-positive bg-positive text-background",
|
|
16
|
+
error: "border-destructive bg-destructive text-background",
|
|
17
|
+
disabled: "border-border bg-muted text-muted-foreground"
|
|
18
|
+
}, B = {
|
|
19
|
+
pending: "stroke-muted-foreground/35",
|
|
20
|
+
active: "stroke-primary",
|
|
21
|
+
completed: "stroke-positive",
|
|
22
|
+
error: "stroke-destructive",
|
|
23
|
+
disabled: "stroke-border"
|
|
24
|
+
}, H = {
|
|
25
|
+
default: "11rem",
|
|
26
|
+
compact: "8.5rem"
|
|
27
|
+
}, L = {
|
|
28
|
+
default: "8rem",
|
|
29
|
+
compact: "7rem"
|
|
30
|
+
}, D = {
|
|
31
|
+
default: "5.5rem",
|
|
32
|
+
compact: "4.75rem"
|
|
33
|
+
}, G = {
|
|
34
|
+
default: "2.75rem",
|
|
35
|
+
compact: "2.5rem"
|
|
36
|
+
}, k = {
|
|
37
|
+
default: "7.5rem",
|
|
38
|
+
compact: "5.75rem"
|
|
39
|
+
}, I = {
|
|
40
|
+
default: "6.5rem",
|
|
41
|
+
compact: "5rem"
|
|
42
|
+
}, y = {
|
|
43
|
+
default: "4.5rem",
|
|
44
|
+
compact: "3.75rem"
|
|
45
|
+
}, R = {
|
|
46
|
+
default: "3.5rem",
|
|
47
|
+
compact: "3rem"
|
|
48
|
+
}, J = {
|
|
49
|
+
default: "1.25rem",
|
|
50
|
+
compact: "0.75rem"
|
|
51
|
+
}, X = {
|
|
52
|
+
default: "0.875rem",
|
|
53
|
+
compact: "0.625rem"
|
|
54
|
+
}, Y = {
|
|
55
|
+
default: "0.5rem",
|
|
56
|
+
compact: "0.375rem"
|
|
57
|
+
}, ee = {
|
|
58
|
+
default: "0.375rem",
|
|
59
|
+
compact: "0.25rem"
|
|
60
|
+
}, T = {
|
|
61
|
+
default: "2.5rem",
|
|
62
|
+
compact: "1.75rem"
|
|
63
|
+
}, C = {
|
|
64
|
+
default: "2rem",
|
|
65
|
+
compact: "1.5rem"
|
|
66
|
+
}, A = {
|
|
67
|
+
default: "1.5rem",
|
|
68
|
+
compact: "1.25rem"
|
|
69
|
+
}, M = {
|
|
70
|
+
default: "1.25rem",
|
|
71
|
+
compact: "1.125rem"
|
|
72
|
+
};
|
|
73
|
+
function re(r, a) {
|
|
74
|
+
return r === "completed" ? /* @__PURE__ */ s(q, { "aria-hidden": "true" }) : r === "error" ? /* @__PURE__ */ s(U, { "aria-hidden": "true" }) : r === "disabled" ? /* @__PURE__ */ s(W, { "aria-hidden": "true" }) : r === "active" ? /* @__PURE__ */ s(Z, { "aria-hidden": "true" }) : a;
|
|
75
|
+
}
|
|
76
|
+
function te(r, a) {
|
|
77
|
+
return {
|
|
78
|
+
left: `calc(${(r + 0.5) / a * 100}% + (var(--process-flow-marker-size) / 2))`,
|
|
79
|
+
width: `calc(${1 / a * 100}% - var(--process-flow-marker-size))`
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function oe(r, a) {
|
|
83
|
+
return {
|
|
84
|
+
height: `calc(${1 / a * 100}% - var(--process-flow-marker-size))`,
|
|
85
|
+
top: `calc(${(r + 0.5) / a * 100}% + (var(--process-flow-marker-size) / 2))`
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function se() {
|
|
89
|
+
const r = "calc(((100% / var(--process-flow-count)) / 2) + (var(--process-flow-marker-size) / 2))";
|
|
90
|
+
return {
|
|
91
|
+
left: r,
|
|
92
|
+
right: r
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function ae() {
|
|
96
|
+
const r = "calc(((100% / var(--process-flow-count)) / 2) + (var(--process-flow-marker-size) / 2))";
|
|
97
|
+
return {
|
|
98
|
+
bottom: r,
|
|
99
|
+
top: r
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function le({ contentLayout: r, onStepSelect: a, isDisabled: l, size: t, status: n }) {
|
|
103
|
+
return f(
|
|
104
|
+
"flex w-full min-w-0 border-0 bg-transparent p-0 text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
105
|
+
r === "inline" && "flex-row items-center gap-3 text-left",
|
|
106
|
+
r === "stacked" && "flex-col items-center gap-2 text-center",
|
|
107
|
+
r === "anchored" && "relative h-full flex-col items-center justify-center text-center",
|
|
108
|
+
t === "compact" && (r === "inline" ? "gap-2" : "gap-1.5"),
|
|
109
|
+
a && !l && f("cursor-pointer hover:text-foreground", r !== "anchored" && "hover:-translate-y-px"),
|
|
110
|
+
a && l && "cursor-not-allowed",
|
|
111
|
+
Q[n]
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function ie({
|
|
115
|
+
isSelected: r,
|
|
116
|
+
size: a,
|
|
117
|
+
status: l
|
|
118
|
+
}) {
|
|
119
|
+
return f(
|
|
120
|
+
"flex size-[var(--process-flow-marker-size)] shrink-0 items-center justify-center rounded-full border text-xs font-semibold tabular-nums transition-colors [&_svg]:size-4",
|
|
121
|
+
a === "compact" && "text-[0.7rem] [&_svg]:size-3",
|
|
122
|
+
"shadow-[0_0_0_0.25rem_var(--background)]",
|
|
123
|
+
r && "ring-4 ring-primary/20",
|
|
124
|
+
$[l]
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function ne({
|
|
128
|
+
layout: r,
|
|
129
|
+
isSelected: a,
|
|
130
|
+
status: l
|
|
131
|
+
}) {
|
|
132
|
+
return f(
|
|
133
|
+
"block max-w-full truncate font-medium text-current",
|
|
134
|
+
r === "linear" && a && l === "completed" && "text-positive",
|
|
135
|
+
r === "linear" && a && l !== "completed" && l !== "error" && "text-primary"
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function P({
|
|
139
|
+
item: r,
|
|
140
|
+
isSelected: a,
|
|
141
|
+
onStepSelect: l,
|
|
142
|
+
descriptionVisibility: t,
|
|
143
|
+
size: n,
|
|
144
|
+
layout: o,
|
|
145
|
+
contentLayout: m
|
|
146
|
+
}) {
|
|
147
|
+
const { step: d, stepIndex: p, status: e } = r, c = e === "disabled" || d.selectable === !1, v = F(d, e, p + 1), u = t === "visible" ? "visible" : "auto", h = le({
|
|
148
|
+
contentLayout: m,
|
|
149
|
+
onStepSelect: l,
|
|
150
|
+
isDisabled: c,
|
|
151
|
+
size: n,
|
|
152
|
+
status: e
|
|
153
|
+
}), g = /* @__PURE__ */ s(
|
|
154
|
+
"span",
|
|
155
|
+
{
|
|
156
|
+
"aria-hidden": "true",
|
|
157
|
+
className: ie({
|
|
158
|
+
isSelected: a,
|
|
159
|
+
size: n,
|
|
160
|
+
status: e
|
|
161
|
+
}),
|
|
162
|
+
"data-slot": "process-flow-marker",
|
|
163
|
+
children: re(e, p + 1)
|
|
164
|
+
}
|
|
165
|
+
), x = /* @__PURE__ */ w(
|
|
166
|
+
"span",
|
|
167
|
+
{
|
|
168
|
+
"data-slot": "process-flow-text",
|
|
169
|
+
"data-text-visibility": u,
|
|
170
|
+
className: f(
|
|
171
|
+
"flex min-w-0 flex-col gap-0.5",
|
|
172
|
+
m === "stacked" && "w-full items-center",
|
|
173
|
+
m === "anchored" && "pointer-events-none absolute left-1/2 top-[calc(50%+var(--process-flow-marker-size)/2+0.375rem)] w-max max-w-[calc(var(--process-flow-step-min-width)-0.5rem)] -translate-x-1/2 items-center px-1"
|
|
174
|
+
),
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ s("span", { className: ne({ layout: o, isSelected: a, status: e }), "data-slot": "process-flow-label", children: d.label }),
|
|
177
|
+
t !== "hidden" && d.description ? /* @__PURE__ */ s(
|
|
178
|
+
"span",
|
|
179
|
+
{
|
|
180
|
+
className: "line-clamp-2 text-xs leading-snug text-muted-foreground",
|
|
181
|
+
"data-description-visibility": t,
|
|
182
|
+
"data-slot": "process-flow-description",
|
|
183
|
+
children: d.description
|
|
184
|
+
}
|
|
185
|
+
) : null,
|
|
186
|
+
/* @__PURE__ */ w("span", { className: "sr-only", children: [
|
|
187
|
+
"Status: ",
|
|
188
|
+
K[e]
|
|
189
|
+
] })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
), b = /* @__PURE__ */ w(V, { children: [
|
|
193
|
+
g,
|
|
194
|
+
x
|
|
195
|
+
] });
|
|
196
|
+
return l ? /* @__PURE__ */ s(
|
|
197
|
+
"button",
|
|
198
|
+
{
|
|
199
|
+
type: "button",
|
|
200
|
+
"aria-current": e === "active" ? "step" : void 0,
|
|
201
|
+
"aria-invalid": e === "error" || void 0,
|
|
202
|
+
"aria-label": v,
|
|
203
|
+
"aria-pressed": a,
|
|
204
|
+
className: h,
|
|
205
|
+
"data-selected": a || void 0,
|
|
206
|
+
"data-status": e,
|
|
207
|
+
disabled: c,
|
|
208
|
+
onClick: (_) => l(d, {
|
|
209
|
+
nativeEvent: _,
|
|
210
|
+
status: e,
|
|
211
|
+
stepIndex: p
|
|
212
|
+
}),
|
|
213
|
+
children: b
|
|
214
|
+
}
|
|
215
|
+
) : /* @__PURE__ */ s(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
"aria-current": e === "active" ? "step" : void 0,
|
|
219
|
+
"aria-disabled": c || void 0,
|
|
220
|
+
"aria-invalid": e === "error" || void 0,
|
|
221
|
+
"aria-label": v,
|
|
222
|
+
className: h,
|
|
223
|
+
"data-selected": a || void 0,
|
|
224
|
+
"data-status": e,
|
|
225
|
+
children: b
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
function ce({
|
|
230
|
+
steps: r,
|
|
231
|
+
selectedStepId: a,
|
|
232
|
+
onStepSelect: l,
|
|
233
|
+
size: t,
|
|
234
|
+
showDescriptions: n
|
|
235
|
+
}) {
|
|
236
|
+
const o = r.map((e, c) => E(e, c, "horizontal")), m = N(o), d = S(n), p = {
|
|
237
|
+
"--process-flow-count": r.length,
|
|
238
|
+
"--process-flow-step-min-width-base": H[t],
|
|
239
|
+
"--process-flow-step-min-width-responsive": L[t],
|
|
240
|
+
"--process-flow-step-min-width-squeezed": D[t],
|
|
241
|
+
"--process-flow-step-min-width-mini": G[t],
|
|
242
|
+
"--process-flow-row-min-height-base": k[t],
|
|
243
|
+
"--process-flow-row-min-height-responsive": I[t],
|
|
244
|
+
"--process-flow-row-min-height-squeezed": y[t],
|
|
245
|
+
"--process-flow-row-min-height-mini": R[t],
|
|
246
|
+
"--process-flow-marker-size-base": T[t],
|
|
247
|
+
"--process-flow-marker-size-responsive": C[t],
|
|
248
|
+
"--process-flow-marker-size-squeezed": A[t],
|
|
249
|
+
"--process-flow-marker-size-mini": M[t]
|
|
250
|
+
};
|
|
251
|
+
return /* @__PURE__ */ s("div", { className: "overflow-hidden px-3 py-4", "data-slot": "process-flow-viewport", style: p, children: /* @__PURE__ */ w(
|
|
252
|
+
"ol",
|
|
253
|
+
{
|
|
254
|
+
className: "relative grid min-w-0 min-h-[var(--process-flow-row-min-height)] list-none p-0",
|
|
255
|
+
"data-slot": "process-flow-list",
|
|
256
|
+
style: {
|
|
257
|
+
gridTemplateColumns: "repeat(var(--process-flow-count), minmax(0, 1fr))"
|
|
258
|
+
},
|
|
259
|
+
children: [
|
|
260
|
+
r.length > 1 ? /* @__PURE__ */ s(
|
|
261
|
+
"li",
|
|
262
|
+
{
|
|
263
|
+
"aria-hidden": "true",
|
|
264
|
+
className: "absolute top-[calc(var(--process-flow-marker-size)/2)] h-0.5 -translate-y-1/2 rounded-full bg-muted",
|
|
265
|
+
style: se()
|
|
266
|
+
}
|
|
267
|
+
) : null,
|
|
268
|
+
m.map((e, c) => /* @__PURE__ */ s(
|
|
269
|
+
"li",
|
|
270
|
+
{
|
|
271
|
+
"aria-hidden": "true",
|
|
272
|
+
className: f(
|
|
273
|
+
"absolute top-[calc(var(--process-flow-marker-size)/2)] h-0.5 -translate-y-1/2 rounded-full transition-colors",
|
|
274
|
+
e.status === "completed" && "bg-positive",
|
|
275
|
+
e.status === "active" && "bg-primary",
|
|
276
|
+
e.status === "error" && "bg-destructive",
|
|
277
|
+
e.status === "pending" && "bg-muted",
|
|
278
|
+
e.status === "disabled" && "bg-border"
|
|
279
|
+
),
|
|
280
|
+
style: te(c, r.length)
|
|
281
|
+
},
|
|
282
|
+
e.id
|
|
283
|
+
)),
|
|
284
|
+
o.map((e) => /* @__PURE__ */ s(
|
|
285
|
+
"li",
|
|
286
|
+
{
|
|
287
|
+
className: "relative z-[1] flex min-w-0 items-start justify-center",
|
|
288
|
+
"data-slot": "process-flow-item",
|
|
289
|
+
children: /* @__PURE__ */ s(
|
|
290
|
+
P,
|
|
291
|
+
{
|
|
292
|
+
item: e,
|
|
293
|
+
contentLayout: "stacked",
|
|
294
|
+
descriptionVisibility: d,
|
|
295
|
+
isSelected: a === e.step.id,
|
|
296
|
+
layout: "linear",
|
|
297
|
+
onStepSelect: l,
|
|
298
|
+
size: t
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
},
|
|
302
|
+
e.step.id
|
|
303
|
+
))
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
) });
|
|
307
|
+
}
|
|
308
|
+
function de({
|
|
309
|
+
steps: r,
|
|
310
|
+
selectedStepId: a,
|
|
311
|
+
onStepSelect: l,
|
|
312
|
+
size: t,
|
|
313
|
+
showDescriptions: n
|
|
314
|
+
}) {
|
|
315
|
+
const o = r.map((e, c) => E(e, c, "vertical")), m = N(o), d = S(n), p = {
|
|
316
|
+
"--process-flow-count": r.length,
|
|
317
|
+
"--process-flow-row-min-height-base": k[t],
|
|
318
|
+
"--process-flow-row-min-height-responsive": I[t],
|
|
319
|
+
"--process-flow-row-min-height-squeezed": y[t],
|
|
320
|
+
"--process-flow-row-min-height-mini": R[t],
|
|
321
|
+
"--process-flow-marker-size-base": T[t],
|
|
322
|
+
"--process-flow-marker-size-responsive": C[t],
|
|
323
|
+
"--process-flow-marker-size-squeezed": A[t],
|
|
324
|
+
"--process-flow-marker-size-mini": M[t]
|
|
325
|
+
};
|
|
326
|
+
return /* @__PURE__ */ s("div", { className: "overflow-x-auto px-3 py-3", "data-slot": "process-flow-viewport", style: p, children: /* @__PURE__ */ w(
|
|
327
|
+
"ol",
|
|
328
|
+
{
|
|
329
|
+
className: "relative grid min-h-[calc(var(--process-flow-count)*var(--process-flow-row-min-height))] min-w-72 list-none p-0",
|
|
330
|
+
"data-slot": "process-flow-list",
|
|
331
|
+
style: {
|
|
332
|
+
gridTemplateRows: "repeat(var(--process-flow-count), minmax(var(--process-flow-row-min-height), auto))"
|
|
333
|
+
},
|
|
334
|
+
children: [
|
|
335
|
+
r.length > 1 ? /* @__PURE__ */ s(
|
|
336
|
+
"li",
|
|
337
|
+
{
|
|
338
|
+
"aria-hidden": "true",
|
|
339
|
+
className: "absolute left-[calc(var(--process-flow-marker-size)/2)] w-0.5 -translate-x-1/2 rounded-full bg-muted",
|
|
340
|
+
style: ae()
|
|
341
|
+
}
|
|
342
|
+
) : null,
|
|
343
|
+
m.map((e, c) => /* @__PURE__ */ s(
|
|
344
|
+
"li",
|
|
345
|
+
{
|
|
346
|
+
"aria-hidden": "true",
|
|
347
|
+
className: f(
|
|
348
|
+
"absolute left-[calc(var(--process-flow-marker-size)/2)] w-0.5 -translate-x-1/2 rounded-full transition-colors",
|
|
349
|
+
e.status === "completed" && "bg-positive",
|
|
350
|
+
e.status === "active" && "bg-primary",
|
|
351
|
+
e.status === "error" && "bg-destructive",
|
|
352
|
+
e.status === "pending" && "bg-muted",
|
|
353
|
+
e.status === "disabled" && "bg-border"
|
|
354
|
+
),
|
|
355
|
+
style: oe(c, r.length)
|
|
356
|
+
},
|
|
357
|
+
e.id
|
|
358
|
+
)),
|
|
359
|
+
o.map((e) => /* @__PURE__ */ s("li", { className: "relative z-[1] flex min-w-0 items-center", "data-slot": "process-flow-item", children: /* @__PURE__ */ s(
|
|
360
|
+
P,
|
|
361
|
+
{
|
|
362
|
+
item: e,
|
|
363
|
+
contentLayout: "inline",
|
|
364
|
+
descriptionVisibility: d,
|
|
365
|
+
isSelected: a === e.step.id,
|
|
366
|
+
layout: "linear",
|
|
367
|
+
onStepSelect: l,
|
|
368
|
+
size: t
|
|
369
|
+
}
|
|
370
|
+
) }, e.step.id))
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
) });
|
|
374
|
+
}
|
|
375
|
+
function we({
|
|
376
|
+
steps: r,
|
|
377
|
+
connections: a,
|
|
378
|
+
selectedStepId: l,
|
|
379
|
+
onStepSelect: t,
|
|
380
|
+
orientation: n = "horizontal",
|
|
381
|
+
size: o = "default",
|
|
382
|
+
showDescriptions: m,
|
|
383
|
+
className: d,
|
|
384
|
+
style: p,
|
|
385
|
+
"aria-label": e = "Process flow",
|
|
386
|
+
...c
|
|
387
|
+
}) {
|
|
388
|
+
if (r.length === 0)
|
|
389
|
+
return null;
|
|
390
|
+
const v = a || z(r) ? "branching" : "linear";
|
|
391
|
+
if (v === "linear" && n === "horizontal")
|
|
392
|
+
return /* @__PURE__ */ s(
|
|
393
|
+
"nav",
|
|
394
|
+
{
|
|
395
|
+
"aria-label": e,
|
|
396
|
+
className: f("w-full min-w-0", d),
|
|
397
|
+
"data-orientation": n,
|
|
398
|
+
"data-slot": "process-flow",
|
|
399
|
+
"data-size": o,
|
|
400
|
+
style: p,
|
|
401
|
+
...c,
|
|
402
|
+
children: /* @__PURE__ */ s(
|
|
403
|
+
ce,
|
|
404
|
+
{
|
|
405
|
+
steps: r,
|
|
406
|
+
selectedStepId: l,
|
|
407
|
+
onStepSelect: t,
|
|
408
|
+
showDescriptions: m,
|
|
409
|
+
size: o
|
|
410
|
+
}
|
|
411
|
+
)
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
if (v === "linear" && n === "vertical")
|
|
415
|
+
return /* @__PURE__ */ s(
|
|
416
|
+
"nav",
|
|
417
|
+
{
|
|
418
|
+
"aria-label": e,
|
|
419
|
+
className: f("w-full min-w-0", d),
|
|
420
|
+
"data-orientation": n,
|
|
421
|
+
"data-slot": "process-flow",
|
|
422
|
+
"data-size": o,
|
|
423
|
+
style: p,
|
|
424
|
+
...c,
|
|
425
|
+
children: /* @__PURE__ */ s(
|
|
426
|
+
de,
|
|
427
|
+
{
|
|
428
|
+
steps: r,
|
|
429
|
+
selectedStepId: l,
|
|
430
|
+
onStepSelect: t,
|
|
431
|
+
showDescriptions: m,
|
|
432
|
+
size: o
|
|
433
|
+
}
|
|
434
|
+
)
|
|
435
|
+
}
|
|
436
|
+
);
|
|
437
|
+
const u = r.map((i, O) => E(i, O, n)), h = Math.max(...u.map((i) => i.row + 1), 1), g = Math.max(...u.map((i) => i.column + 1), 1), x = N(u, a), b = S(m), _ = {
|
|
438
|
+
"--process-flow-columns": g,
|
|
439
|
+
"--process-flow-rows": h,
|
|
440
|
+
"--process-flow-step-min-width-base": H[o],
|
|
441
|
+
"--process-flow-step-min-width-responsive": L[o],
|
|
442
|
+
"--process-flow-step-min-width-squeezed": D[o],
|
|
443
|
+
"--process-flow-step-min-width-mini": G[o],
|
|
444
|
+
"--process-flow-row-min-height-base": k[o],
|
|
445
|
+
"--process-flow-row-min-height-responsive": I[o],
|
|
446
|
+
"--process-flow-row-min-height-squeezed": y[o],
|
|
447
|
+
"--process-flow-row-min-height-mini": R[o],
|
|
448
|
+
"--process-flow-gap-base": J[o],
|
|
449
|
+
"--process-flow-gap-responsive": X[o],
|
|
450
|
+
"--process-flow-gap-squeezed": Y[o],
|
|
451
|
+
"--process-flow-gap-mini": ee[o],
|
|
452
|
+
"--process-flow-marker-size-base": T[o],
|
|
453
|
+
"--process-flow-marker-size-responsive": C[o],
|
|
454
|
+
"--process-flow-marker-size-squeezed": A[o],
|
|
455
|
+
"--process-flow-marker-size-mini": M[o]
|
|
456
|
+
};
|
|
457
|
+
return /* @__PURE__ */ s(
|
|
458
|
+
"nav",
|
|
459
|
+
{
|
|
460
|
+
"aria-label": e,
|
|
461
|
+
className: f("w-full min-w-0", d),
|
|
462
|
+
"data-orientation": n,
|
|
463
|
+
"data-slot": "process-flow",
|
|
464
|
+
"data-size": o,
|
|
465
|
+
style: p,
|
|
466
|
+
...c,
|
|
467
|
+
children: /* @__PURE__ */ s("div", { className: "overflow-x-auto py-2", "data-slot": "process-flow-viewport", style: _, children: /* @__PURE__ */ w(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
className: "relative min-w-[calc(var(--process-flow-columns)*var(--process-flow-step-min-width))] min-h-[calc(var(--process-flow-rows)*var(--process-flow-row-min-height))]",
|
|
471
|
+
"data-slot": "process-flow-canvas",
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ s(
|
|
474
|
+
"svg",
|
|
475
|
+
{
|
|
476
|
+
"aria-hidden": "true",
|
|
477
|
+
className: "pointer-events-none absolute inset-0 z-0 size-full overflow-visible",
|
|
478
|
+
preserveAspectRatio: "none",
|
|
479
|
+
viewBox: "0 0 100 100",
|
|
480
|
+
children: x.map((i) => /* @__PURE__ */ s(
|
|
481
|
+
"path",
|
|
482
|
+
{
|
|
483
|
+
className: f(
|
|
484
|
+
"fill-none stroke-2 transition-colors",
|
|
485
|
+
B[i.status],
|
|
486
|
+
i.status === "disabled" && "opacity-60"
|
|
487
|
+
),
|
|
488
|
+
d: j(i, h, g),
|
|
489
|
+
"data-status": i.status,
|
|
490
|
+
strokeLinecap: "round",
|
|
491
|
+
vectorEffect: "non-scaling-stroke"
|
|
492
|
+
},
|
|
493
|
+
i.id
|
|
494
|
+
))
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ s(
|
|
498
|
+
"ol",
|
|
499
|
+
{
|
|
500
|
+
className: "relative z-[1] grid min-h-[inherit] list-none p-0",
|
|
501
|
+
"data-slot": "process-flow-list",
|
|
502
|
+
style: {
|
|
503
|
+
gap: "var(--process-flow-gap)",
|
|
504
|
+
gridTemplateColumns: "repeat(var(--process-flow-columns), minmax(var(--process-flow-step-min-width), 1fr))",
|
|
505
|
+
gridTemplateRows: "repeat(var(--process-flow-rows), minmax(var(--process-flow-row-min-height), auto))"
|
|
506
|
+
},
|
|
507
|
+
children: u.map((i) => /* @__PURE__ */ s(
|
|
508
|
+
"li",
|
|
509
|
+
{
|
|
510
|
+
className: "flex min-w-0 items-center justify-center",
|
|
511
|
+
"data-slot": "process-flow-item",
|
|
512
|
+
style: {
|
|
513
|
+
gridColumn: i.column + 1,
|
|
514
|
+
gridRow: i.row + 1
|
|
515
|
+
},
|
|
516
|
+
children: /* @__PURE__ */ s(
|
|
517
|
+
P,
|
|
518
|
+
{
|
|
519
|
+
item: i,
|
|
520
|
+
contentLayout: "anchored",
|
|
521
|
+
descriptionVisibility: b,
|
|
522
|
+
isSelected: l === i.step.id,
|
|
523
|
+
layout: "branching",
|
|
524
|
+
onStepSelect: t,
|
|
525
|
+
size: o
|
|
526
|
+
}
|
|
527
|
+
)
|
|
528
|
+
},
|
|
529
|
+
i.step.id
|
|
530
|
+
))
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
) })
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
export {
|
|
540
|
+
ge as PROCESS_FLOW_STEP_STATUSES,
|
|
541
|
+
we as ProcessFlow
|
|
542
|
+
};
|
|
543
|
+
//# sourceMappingURL=ProcessFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessFlow.js","sources":["../../../../src/components/composed/ProcessFlow/ProcessFlow.tsx"],"sourcesContent":["import { CheckIcon, DotIcon, LockIcon, TriangleAlertIcon } from \"lucide-react\";\n\nimport {\n getConnectionPath,\n getDescriptionVisibility,\n getStepAccessibleLabel,\n hasCustomStepLayout,\n positionStep,\n resolveConnections,\n STATUS_LABELS,\n type PositionedStep,\n type ProcessFlowConnection,\n type ProcessFlowDescriptionVisibility,\n type ProcessFlowOrientation,\n type ProcessFlowSize,\n type ProcessFlowStep,\n type ProcessFlowStepStatus,\n} from \"./ProcessFlow.utils\";\n\nimport type { ComponentPropsWithoutRef, CSSProperties, MouseEvent } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport { PROCESS_FLOW_STEP_STATUSES } from \"./ProcessFlow.utils\";\nexport type {\n ProcessFlowConnection,\n ProcessFlowOrientation,\n ProcessFlowSize,\n ProcessFlowStep,\n ProcessFlowStepConfig,\n ProcessFlowStepPosition,\n ProcessFlowStepStatus,\n ProcessStep,\n ProcessStepStatus,\n} from \"./ProcessFlow.utils\";\n\ntype ProcessFlowLayout = \"linear\" | \"branching\";\ntype ProcessFlowStepContentLayout = \"stacked\" | \"inline\" | \"anchored\";\n\nexport interface ProcessFlowStepSelectDetails {\n /** Zero-based index of the selected step in the steps prop. */\n stepIndex: number;\n /** Current visual status of the selected step. */\n status: ProcessFlowStepStatus;\n nativeEvent: MouseEvent<HTMLButtonElement>;\n}\n\n/**\n * Presentational process flow.\n *\n * ProcessFlow is fully controlled by props. It visualizes parent-owned workflow state and emits user selection through\n * onStepSelect. It intentionally does not own status transitions or fire completion/error side effects.\n */\nexport interface ProcessFlowProps extends Omit<ComponentPropsWithoutRef<\"nav\">, \"onSelect\"> {\n /** Ordered list of steps to render. Each step controls its own visual status. */\n steps: ProcessFlowStep[];\n /** Optional explicit connections for branching/configurable flows. */\n connections?: ProcessFlowConnection[];\n /** Selected/viewed step id. This is separate from the active workflow status. */\n selectedStepId?: string;\n /** Called when a selectable step is clicked. Disabled and non-selectable steps do not call this. */\n onStepSelect?: (step: ProcessFlowStep, details: ProcessFlowStepSelectDetails) => void;\n orientation?: ProcessFlowOrientation;\n size?: ProcessFlowSize;\n /** Defaults to true. Set to false to hide step descriptions. */\n showDescriptions?: boolean;\n}\n\ninterface StepControlClassOptions {\n layout: ProcessFlowLayout;\n contentLayout: ProcessFlowStepContentLayout;\n onStepSelect?: ProcessFlowProps[\"onStepSelect\"];\n isDisabled: boolean;\n isSelected: boolean;\n size: ProcessFlowSize;\n status: ProcessFlowStepStatus;\n}\n\nconst LINEAR_STEP_STATUS_CLASSES: Record<ProcessFlowStepStatus, string> = {\n pending: \"text-muted-foreground\",\n active: \"text-foreground\",\n completed: \"text-foreground\",\n error: \"text-destructive\",\n disabled: \"text-muted-foreground\",\n};\n\nconst MARKER_STATUS_CLASSES: Record<ProcessFlowStepStatus, string> = {\n pending: \"border-border bg-background text-muted-foreground\",\n active: \"border-primary bg-primary text-primary-foreground\",\n completed: \"border-positive bg-positive text-background\",\n error: \"border-destructive bg-destructive text-background\",\n disabled: \"border-border bg-muted text-muted-foreground\",\n};\n\nconst CONNECTION_STATUS_CLASSES: Record<ProcessFlowStepStatus, string> = {\n pending: \"stroke-muted-foreground/35\",\n active: \"stroke-primary\",\n completed: \"stroke-positive\",\n error: \"stroke-destructive\",\n disabled: \"stroke-border\",\n};\n\nconst STEP_MIN_WIDTH: Record<ProcessFlowSize, string> = {\n default: \"11rem\",\n compact: \"8.5rem\",\n};\n\nconst RESPONSIVE_STEP_MIN_WIDTH: Record<ProcessFlowSize, string> = {\n default: \"8rem\",\n compact: \"7rem\",\n};\n\nconst SQUEEZED_STEP_MIN_WIDTH: Record<ProcessFlowSize, string> = {\n default: \"5.5rem\",\n compact: \"4.75rem\",\n};\n\nconst MINI_STEP_MIN_WIDTH: Record<ProcessFlowSize, string> = {\n default: \"2.75rem\",\n compact: \"2.5rem\",\n};\n\nconst ROW_MIN_HEIGHT: Record<ProcessFlowSize, string> = {\n default: \"7.5rem\",\n compact: \"5.75rem\",\n};\n\nconst RESPONSIVE_ROW_MIN_HEIGHT: Record<ProcessFlowSize, string> = {\n default: \"6.5rem\",\n compact: \"5rem\",\n};\n\nconst SQUEEZED_ROW_MIN_HEIGHT: Record<ProcessFlowSize, string> = {\n default: \"4.5rem\",\n compact: \"3.75rem\",\n};\n\nconst MINI_ROW_MIN_HEIGHT: Record<ProcessFlowSize, string> = {\n default: \"3.5rem\",\n compact: \"3rem\",\n};\n\nconst GRID_GAP: Record<ProcessFlowSize, string> = {\n default: \"1.25rem\",\n compact: \"0.75rem\",\n};\n\nconst RESPONSIVE_GRID_GAP: Record<ProcessFlowSize, string> = {\n default: \"0.875rem\",\n compact: \"0.625rem\",\n};\n\nconst SQUEEZED_GRID_GAP: Record<ProcessFlowSize, string> = {\n default: \"0.5rem\",\n compact: \"0.375rem\",\n};\n\nconst MINI_GRID_GAP: Record<ProcessFlowSize, string> = {\n default: \"0.375rem\",\n compact: \"0.25rem\",\n};\n\nconst LINEAR_MARKER_SIZE: Record<ProcessFlowSize, string> = {\n default: \"2.5rem\",\n compact: \"1.75rem\",\n};\n\nconst RESPONSIVE_LINEAR_MARKER_SIZE: Record<ProcessFlowSize, string> = {\n default: \"2rem\",\n compact: \"1.5rem\",\n};\n\nconst SQUEEZED_LINEAR_MARKER_SIZE: Record<ProcessFlowSize, string> = {\n default: \"1.5rem\",\n compact: \"1.25rem\",\n};\n\nconst MINI_LINEAR_MARKER_SIZE: Record<ProcessFlowSize, string> = {\n default: \"1.25rem\",\n compact: \"1.125rem\",\n};\n\nfunction getMarkerContent(status: ProcessFlowStepStatus, stepNumber: number) {\n if (status === \"completed\") {\n return <CheckIcon aria-hidden=\"true\" />;\n }\n\n if (status === \"error\") {\n return <TriangleAlertIcon aria-hidden=\"true\" />;\n }\n\n if (status === \"disabled\") {\n return <LockIcon aria-hidden=\"true\" />;\n }\n\n if (status === \"active\") {\n return <DotIcon aria-hidden=\"true\" />;\n }\n\n return stepNumber;\n}\n\nfunction getLinearSegmentStyle(index: number, count: number): CSSProperties {\n return {\n left: `calc(${((index + 0.5) / count) * 100}% + (var(--process-flow-marker-size) / 2))`,\n width: `calc(${(1 / count) * 100}% - var(--process-flow-marker-size))`,\n };\n}\n\nfunction getVerticalSegmentStyle(index: number, count: number): CSSProperties {\n return {\n height: `calc(${(1 / count) * 100}% - var(--process-flow-marker-size))`,\n top: `calc(${((index + 0.5) / count) * 100}% + (var(--process-flow-marker-size) / 2))`,\n };\n}\n\nfunction getHorizontalRailStyle(): CSSProperties {\n const inset = \"calc(((100% / var(--process-flow-count)) / 2) + (var(--process-flow-marker-size) / 2))\";\n\n return {\n left: inset,\n right: inset,\n };\n}\n\nfunction getVerticalRailStyle(): CSSProperties {\n const inset = \"calc(((100% / var(--process-flow-count)) / 2) + (var(--process-flow-marker-size) / 2))\";\n\n return {\n bottom: inset,\n top: inset,\n };\n}\n\nfunction getStepControlClassName({ contentLayout, onStepSelect, isDisabled, size, status }: StepControlClassOptions) {\n return cn(\n \"flex w-full min-w-0 border-0 bg-transparent p-0 text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\",\n contentLayout === \"inline\" && \"flex-row items-center gap-3 text-left\",\n contentLayout === \"stacked\" && \"flex-col items-center gap-2 text-center\",\n contentLayout === \"anchored\" && \"relative h-full flex-col items-center justify-center text-center\",\n size === \"compact\" && (contentLayout === \"inline\" ? \"gap-2\" : \"gap-1.5\"),\n onStepSelect &&\n !isDisabled &&\n cn(\"cursor-pointer hover:text-foreground\", contentLayout !== \"anchored\" && \"hover:-translate-y-px\"),\n onStepSelect && isDisabled && \"cursor-not-allowed\",\n LINEAR_STEP_STATUS_CLASSES[status],\n );\n}\n\nfunction getMarkerClassName({\n isSelected,\n size,\n status,\n}: Pick<StepControlClassOptions, \"isSelected\" | \"size\" | \"status\">) {\n return cn(\n \"flex size-[var(--process-flow-marker-size)] shrink-0 items-center justify-center rounded-full border text-xs font-semibold tabular-nums transition-colors [&_svg]:size-4\",\n size === \"compact\" && \"text-[0.7rem] [&_svg]:size-3\",\n \"shadow-[0_0_0_0.25rem_var(--background)]\",\n isSelected && \"ring-4 ring-primary/20\",\n MARKER_STATUS_CLASSES[status],\n );\n}\n\nfunction getLabelClassName({\n layout,\n isSelected,\n status,\n}: Pick<StepControlClassOptions, \"layout\" | \"isSelected\" | \"status\">) {\n return cn(\n \"block max-w-full truncate font-medium text-current\",\n layout === \"linear\" && isSelected && status === \"completed\" && \"text-positive\",\n layout === \"linear\" && isSelected && status !== \"completed\" && status !== \"error\" && \"text-primary\",\n );\n}\n\nfunction ProcessFlowStepControl({\n item,\n isSelected,\n onStepSelect,\n descriptionVisibility,\n size,\n layout,\n contentLayout,\n}: {\n item: PositionedStep;\n isSelected: boolean;\n onStepSelect?: ProcessFlowProps[\"onStepSelect\"];\n descriptionVisibility: ProcessFlowDescriptionVisibility;\n size: ProcessFlowSize;\n layout: ProcessFlowLayout;\n contentLayout: ProcessFlowStepContentLayout;\n}) {\n const { step, stepIndex, status } = item;\n const isDisabled = status === \"disabled\" || step.selectable === false;\n const accessibleLabel = getStepAccessibleLabel(step, status, stepIndex + 1);\n const textVisibility = descriptionVisibility === \"visible\" ? \"visible\" : \"auto\";\n const controlClassName = getStepControlClassName({\n layout,\n contentLayout,\n onStepSelect,\n isDisabled,\n isSelected,\n size,\n status,\n });\n const markerContent = (\n <span\n aria-hidden=\"true\"\n className={getMarkerClassName({\n isSelected,\n size,\n status,\n })}\n data-slot=\"process-flow-marker\"\n >\n {getMarkerContent(status, stepIndex + 1)}\n </span>\n );\n const textContent = (\n <span\n data-slot=\"process-flow-text\"\n data-text-visibility={textVisibility}\n className={cn(\n \"flex min-w-0 flex-col gap-0.5\",\n contentLayout === \"stacked\" && \"w-full items-center\",\n contentLayout === \"anchored\" &&\n \"pointer-events-none absolute left-1/2 top-[calc(50%+var(--process-flow-marker-size)/2+0.375rem)] w-max max-w-[calc(var(--process-flow-step-min-width)-0.5rem)] -translate-x-1/2 items-center px-1\",\n )}\n >\n <span className={getLabelClassName({ layout, isSelected, status })} data-slot=\"process-flow-label\">\n {step.label}\n </span>\n {descriptionVisibility !== \"hidden\" && step.description ? (\n <span\n className=\"line-clamp-2 text-xs leading-snug text-muted-foreground\"\n data-description-visibility={descriptionVisibility}\n data-slot=\"process-flow-description\"\n >\n {step.description}\n </span>\n ) : null}\n <span className=\"sr-only\">Status: {STATUS_LABELS[status]}</span>\n </span>\n );\n const content = (\n <>\n {markerContent}\n {textContent}\n </>\n );\n\n if (!onStepSelect) {\n return (\n <div\n aria-current={status === \"active\" ? \"step\" : undefined}\n aria-disabled={isDisabled || undefined}\n aria-invalid={status === \"error\" || undefined}\n aria-label={accessibleLabel}\n className={controlClassName}\n data-selected={isSelected || undefined}\n data-status={status}\n >\n {content}\n </div>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-current={status === \"active\" ? \"step\" : undefined}\n aria-invalid={status === \"error\" || undefined}\n aria-label={accessibleLabel}\n aria-pressed={isSelected}\n className={controlClassName}\n data-selected={isSelected || undefined}\n data-status={status}\n disabled={isDisabled}\n onClick={(nativeEvent) =>\n onStepSelect(step, {\n nativeEvent,\n status,\n stepIndex,\n })\n }\n >\n {content}\n </button>\n );\n}\n\nfunction HorizontalProcessFlow({\n steps,\n selectedStepId,\n onStepSelect,\n size,\n showDescriptions,\n}: Pick<ProcessFlowProps, \"steps\" | \"selectedStepId\" | \"onStepSelect\" | \"showDescriptions\"> & {\n size: ProcessFlowSize;\n}) {\n const positionedSteps = steps.map((step, index) => positionStep(step, index, \"horizontal\"));\n const resolvedConnections = resolveConnections(positionedSteps);\n const descriptionVisibility = getDescriptionVisibility(showDescriptions);\n const flowStyle = {\n \"--process-flow-count\": steps.length,\n \"--process-flow-step-min-width-base\": STEP_MIN_WIDTH[size],\n \"--process-flow-step-min-width-responsive\": RESPONSIVE_STEP_MIN_WIDTH[size],\n \"--process-flow-step-min-width-squeezed\": SQUEEZED_STEP_MIN_WIDTH[size],\n \"--process-flow-step-min-width-mini\": MINI_STEP_MIN_WIDTH[size],\n \"--process-flow-row-min-height-base\": ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-responsive\": RESPONSIVE_ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-squeezed\": SQUEEZED_ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-mini\": MINI_ROW_MIN_HEIGHT[size],\n \"--process-flow-marker-size-base\": LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-responsive\": RESPONSIVE_LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-squeezed\": SQUEEZED_LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-mini\": MINI_LINEAR_MARKER_SIZE[size],\n } as CSSProperties;\n\n return (\n <div className=\"overflow-hidden px-3 py-4\" data-slot=\"process-flow-viewport\" style={flowStyle}>\n <ol\n className=\"relative grid min-w-0 min-h-[var(--process-flow-row-min-height)] list-none p-0\"\n data-slot=\"process-flow-list\"\n style={{\n gridTemplateColumns: \"repeat(var(--process-flow-count), minmax(0, 1fr))\",\n }}\n >\n {steps.length > 1 ? (\n <li\n aria-hidden=\"true\"\n className=\"absolute top-[calc(var(--process-flow-marker-size)/2)] h-0.5 -translate-y-1/2 rounded-full bg-muted\"\n style={getHorizontalRailStyle()}\n />\n ) : null}\n {resolvedConnections.map((connection, index) => (\n <li\n key={connection.id}\n aria-hidden=\"true\"\n className={cn(\n \"absolute top-[calc(var(--process-flow-marker-size)/2)] h-0.5 -translate-y-1/2 rounded-full transition-colors\",\n connection.status === \"completed\" && \"bg-positive\",\n connection.status === \"active\" && \"bg-primary\",\n connection.status === \"error\" && \"bg-destructive\",\n connection.status === \"pending\" && \"bg-muted\",\n connection.status === \"disabled\" && \"bg-border\",\n )}\n style={getLinearSegmentStyle(index, steps.length)}\n />\n ))}\n {positionedSteps.map((item) => (\n <li\n key={item.step.id}\n className=\"relative z-[1] flex min-w-0 items-start justify-center\"\n data-slot=\"process-flow-item\"\n >\n <ProcessFlowStepControl\n item={item}\n contentLayout=\"stacked\"\n descriptionVisibility={descriptionVisibility}\n isSelected={selectedStepId === item.step.id}\n layout=\"linear\"\n onStepSelect={onStepSelect}\n size={size}\n />\n </li>\n ))}\n </ol>\n </div>\n );\n}\n\nfunction VerticalProcessFlow({\n steps,\n selectedStepId,\n onStepSelect,\n size,\n showDescriptions,\n}: Pick<ProcessFlowProps, \"steps\" | \"selectedStepId\" | \"onStepSelect\" | \"showDescriptions\"> & {\n size: ProcessFlowSize;\n}) {\n const positionedSteps = steps.map((step, index) => positionStep(step, index, \"vertical\"));\n const resolvedConnections = resolveConnections(positionedSteps);\n const descriptionVisibility = getDescriptionVisibility(showDescriptions);\n const flowStyle = {\n \"--process-flow-count\": steps.length,\n \"--process-flow-row-min-height-base\": ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-responsive\": RESPONSIVE_ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-squeezed\": SQUEEZED_ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-mini\": MINI_ROW_MIN_HEIGHT[size],\n \"--process-flow-marker-size-base\": LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-responsive\": RESPONSIVE_LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-squeezed\": SQUEEZED_LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-mini\": MINI_LINEAR_MARKER_SIZE[size],\n } as CSSProperties;\n\n return (\n <div className=\"overflow-x-auto px-3 py-3\" data-slot=\"process-flow-viewport\" style={flowStyle}>\n <ol\n className=\"relative grid min-h-[calc(var(--process-flow-count)*var(--process-flow-row-min-height))] min-w-72 list-none p-0\"\n data-slot=\"process-flow-list\"\n style={{\n gridTemplateRows: \"repeat(var(--process-flow-count), minmax(var(--process-flow-row-min-height), auto))\",\n }}\n >\n {steps.length > 1 ? (\n <li\n aria-hidden=\"true\"\n className=\"absolute left-[calc(var(--process-flow-marker-size)/2)] w-0.5 -translate-x-1/2 rounded-full bg-muted\"\n style={getVerticalRailStyle()}\n />\n ) : null}\n {resolvedConnections.map((connection, index) => (\n <li\n key={connection.id}\n aria-hidden=\"true\"\n className={cn(\n \"absolute left-[calc(var(--process-flow-marker-size)/2)] w-0.5 -translate-x-1/2 rounded-full transition-colors\",\n connection.status === \"completed\" && \"bg-positive\",\n connection.status === \"active\" && \"bg-primary\",\n connection.status === \"error\" && \"bg-destructive\",\n connection.status === \"pending\" && \"bg-muted\",\n connection.status === \"disabled\" && \"bg-border\",\n )}\n style={getVerticalSegmentStyle(index, steps.length)}\n />\n ))}\n {positionedSteps.map((item) => (\n <li key={item.step.id} className=\"relative z-[1] flex min-w-0 items-center\" data-slot=\"process-flow-item\">\n <ProcessFlowStepControl\n item={item}\n contentLayout=\"inline\"\n descriptionVisibility={descriptionVisibility}\n isSelected={selectedStepId === item.step.id}\n layout=\"linear\"\n onStepSelect={onStepSelect}\n size={size}\n />\n </li>\n ))}\n </ol>\n </div>\n );\n}\n\nexport function ProcessFlow({\n steps,\n connections,\n selectedStepId,\n onStepSelect,\n orientation = \"horizontal\",\n size = \"default\",\n showDescriptions,\n className,\n style,\n \"aria-label\": ariaLabel = \"Process flow\",\n ...props\n}: ProcessFlowProps) {\n if (steps.length === 0) {\n return null;\n }\n\n const layout: ProcessFlowLayout = connections || hasCustomStepLayout(steps) ? \"branching\" : \"linear\";\n\n if (layout === \"linear\" && orientation === \"horizontal\") {\n return (\n <nav\n aria-label={ariaLabel}\n className={cn(\"w-full min-w-0\", className)}\n data-orientation={orientation}\n data-slot=\"process-flow\"\n data-size={size}\n style={style}\n {...props}\n >\n <HorizontalProcessFlow\n steps={steps}\n selectedStepId={selectedStepId}\n onStepSelect={onStepSelect}\n showDescriptions={showDescriptions}\n size={size}\n />\n </nav>\n );\n }\n\n if (layout === \"linear\" && orientation === \"vertical\") {\n return (\n <nav\n aria-label={ariaLabel}\n className={cn(\"w-full min-w-0\", className)}\n data-orientation={orientation}\n data-slot=\"process-flow\"\n data-size={size}\n style={style}\n {...props}\n >\n <VerticalProcessFlow\n steps={steps}\n selectedStepId={selectedStepId}\n onStepSelect={onStepSelect}\n showDescriptions={showDescriptions}\n size={size}\n />\n </nav>\n );\n }\n\n const positionedSteps = steps.map((step, index) => positionStep(step, index, orientation));\n const rowCount = Math.max(...positionedSteps.map((step) => step.row + 1), 1);\n const columnCount = Math.max(...positionedSteps.map((step) => step.column + 1), 1);\n const resolvedConnections = resolveConnections(positionedSteps, connections);\n const descriptionVisibility = getDescriptionVisibility(showDescriptions);\n const flowStyle = {\n \"--process-flow-columns\": columnCount,\n \"--process-flow-rows\": rowCount,\n \"--process-flow-step-min-width-base\": STEP_MIN_WIDTH[size],\n \"--process-flow-step-min-width-responsive\": RESPONSIVE_STEP_MIN_WIDTH[size],\n \"--process-flow-step-min-width-squeezed\": SQUEEZED_STEP_MIN_WIDTH[size],\n \"--process-flow-step-min-width-mini\": MINI_STEP_MIN_WIDTH[size],\n \"--process-flow-row-min-height-base\": ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-responsive\": RESPONSIVE_ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-squeezed\": SQUEEZED_ROW_MIN_HEIGHT[size],\n \"--process-flow-row-min-height-mini\": MINI_ROW_MIN_HEIGHT[size],\n \"--process-flow-gap-base\": GRID_GAP[size],\n \"--process-flow-gap-responsive\": RESPONSIVE_GRID_GAP[size],\n \"--process-flow-gap-squeezed\": SQUEEZED_GRID_GAP[size],\n \"--process-flow-gap-mini\": MINI_GRID_GAP[size],\n \"--process-flow-marker-size-base\": LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-responsive\": RESPONSIVE_LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-squeezed\": SQUEEZED_LINEAR_MARKER_SIZE[size],\n \"--process-flow-marker-size-mini\": MINI_LINEAR_MARKER_SIZE[size],\n } as CSSProperties;\n\n return (\n <nav\n aria-label={ariaLabel}\n className={cn(\"w-full min-w-0\", className)}\n data-orientation={orientation}\n data-slot=\"process-flow\"\n data-size={size}\n style={style}\n {...props}\n >\n <div className=\"overflow-x-auto py-2\" data-slot=\"process-flow-viewport\" style={flowStyle}>\n <div\n className=\"relative min-w-[calc(var(--process-flow-columns)*var(--process-flow-step-min-width))] min-h-[calc(var(--process-flow-rows)*var(--process-flow-row-min-height))]\"\n data-slot=\"process-flow-canvas\"\n >\n <svg\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 z-0 size-full overflow-visible\"\n preserveAspectRatio=\"none\"\n viewBox=\"0 0 100 100\"\n >\n {resolvedConnections.map((connection) => (\n <path\n key={connection.id}\n className={cn(\n \"fill-none stroke-2 transition-colors\",\n CONNECTION_STATUS_CLASSES[connection.status],\n connection.status === \"disabled\" && \"opacity-60\",\n )}\n d={getConnectionPath(connection, rowCount, columnCount)}\n data-status={connection.status}\n strokeLinecap=\"round\"\n vectorEffect=\"non-scaling-stroke\"\n />\n ))}\n </svg>\n\n <ol\n className=\"relative z-[1] grid min-h-[inherit] list-none p-0\"\n data-slot=\"process-flow-list\"\n style={{\n gap: \"var(--process-flow-gap)\",\n gridTemplateColumns:\n \"repeat(var(--process-flow-columns), minmax(var(--process-flow-step-min-width), 1fr))\",\n gridTemplateRows: \"repeat(var(--process-flow-rows), minmax(var(--process-flow-row-min-height), auto))\",\n }}\n >\n {positionedSteps.map((item) => (\n <li\n key={item.step.id}\n className=\"flex min-w-0 items-center justify-center\"\n data-slot=\"process-flow-item\"\n style={{\n gridColumn: item.column + 1,\n gridRow: item.row + 1,\n }}\n >\n <ProcessFlowStepControl\n item={item}\n contentLayout=\"anchored\"\n descriptionVisibility={descriptionVisibility}\n isSelected={selectedStepId === item.step.id}\n layout=\"branching\"\n onStepSelect={onStepSelect}\n size={size}\n />\n </li>\n ))}\n </ol>\n </div>\n </div>\n </nav>\n );\n}\n"],"names":["LINEAR_STEP_STATUS_CLASSES","MARKER_STATUS_CLASSES","CONNECTION_STATUS_CLASSES","STEP_MIN_WIDTH","RESPONSIVE_STEP_MIN_WIDTH","SQUEEZED_STEP_MIN_WIDTH","MINI_STEP_MIN_WIDTH","ROW_MIN_HEIGHT","RESPONSIVE_ROW_MIN_HEIGHT","SQUEEZED_ROW_MIN_HEIGHT","MINI_ROW_MIN_HEIGHT","GRID_GAP","RESPONSIVE_GRID_GAP","SQUEEZED_GRID_GAP","MINI_GRID_GAP","LINEAR_MARKER_SIZE","RESPONSIVE_LINEAR_MARKER_SIZE","SQUEEZED_LINEAR_MARKER_SIZE","MINI_LINEAR_MARKER_SIZE","getMarkerContent","status","stepNumber","jsx","CheckIcon","TriangleAlertIcon","LockIcon","DotIcon","getLinearSegmentStyle","index","count","getVerticalSegmentStyle","getHorizontalRailStyle","inset","getVerticalRailStyle","getStepControlClassName","contentLayout","onStepSelect","isDisabled","size","cn","getMarkerClassName","isSelected","getLabelClassName","layout","ProcessFlowStepControl","item","descriptionVisibility","step","stepIndex","accessibleLabel","getStepAccessibleLabel","textVisibility","controlClassName","markerContent","textContent","jsxs","STATUS_LABELS","content","Fragment","nativeEvent","HorizontalProcessFlow","steps","selectedStepId","showDescriptions","positionedSteps","positionStep","resolvedConnections","resolveConnections","getDescriptionVisibility","flowStyle","connection","VerticalProcessFlow","ProcessFlow","connections","orientation","className","style","ariaLabel","props","hasCustomStepLayout","rowCount","columnCount","getConnectionPath"],"mappings":";;;;;AA8EA,MAAMA,IAAoE;AAAA,EACxE,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AACZ,GAEMC,IAA+D;AAAA,EACnE,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AACZ,GAEMC,IAAmE;AAAA,EACvE,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AACZ,GAEMC,IAAkD;AAAA,EACtD,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAA6D;AAAA,EACjE,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAAuD;AAAA,EAC3D,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAAkD;AAAA,EACtD,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAA6D;AAAA,EACjE,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAAuD;AAAA,EAC3D,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAA4C;AAAA,EAChD,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,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tC,GAAGY,EAAkBZ,GAAYU,GAAUC,CAAW;AAAA,oBACtD,eAAaX,EAAW;AAAA,oBACxB,eAAc;AAAA,oBACd,cAAa;AAAA,kBAAA;AAAA,kBATRA,EAAW;AAAA,gBAAA,CAWnB;AAAA,cAAA;AAAA,YAAA;AAAA,YAGH,gBAAAhD;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,aAAU;AAAA,gBACV,OAAO;AAAA,kBACL,KAAK;AAAA,kBACL,qBACE;AAAA,kBACF,kBAAkB;AAAA,gBAAA;AAAA,gBAGnB,UAAA0C,EAAgB,IAAI,CAACnB,MACpB,gBAAAvB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBAEC,WAAU;AAAA,oBACV,aAAU;AAAA,oBACV,OAAO;AAAA,sBACL,YAAYuB,EAAK,SAAS;AAAA,sBAC1B,SAASA,EAAK,MAAM;AAAA,oBAAA;AAAA,oBAGtB,UAAA,gBAAAvB;AAAA,sBAACsB;AAAA,sBAAA;AAAA,wBACC,MAAAC;AAAA,wBACA,eAAc;AAAA,wBACd,uBAAAC;AAAA,wBACA,YAAYgB,MAAmBjB,EAAK,KAAK;AAAA,wBACzC,QAAO;AAAA,wBACP,cAAAT;AAAA,wBACA,MAAAE;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACF;AAAA,kBAhBKO,EAAK,KAAK;AAAA,gBAAA,CAkBlB;AAAA,cAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=["pending","active","completed","error","disabled"],u={pending:"Pending",active:"Active",completed:"Completed",error:"Error",disabled:"Disabled"};function S(e){return e===!0?"visible":e===!1?"hidden":"visible"}function l(e,t){return Math.max(Math.floor(e??t),0)}function d(e){return e.disabled?"disabled":e.status??"pending"}function f(e,t,i){return e.ariaLabel?e.ariaLabel:`${typeof e.label=="string"?e.label:`Step ${i}`}, ${u[t]}`}function b(e,t,i){const r=i==="vertical"?t:0,n=i==="vertical"?0:t;return{step:e,stepIndex:t,status:d(e),row:l(e.position?.row,r),column:l(e.position?.column,n)}}function c(e,t){return e==="error"||t==="error"?"error":e==="disabled"||t==="disabled"?"disabled":e==="completed"&&(t==="completed"||t==="active")?"completed":e==="active"||t==="active"?"active":"pending"}function m(e){return e.slice(0,-1).map((t,i)=>({from:t.step.id,to:e[i+1].step.id}))}function g(e,t){const i=new Map(e.map(r=>[r.step.id,r]));return(t??m(e)).flatMap((r,n)=>{const o=i.get(r.from),a=i.get(r.to);return!o||!a?[]:[{...r,id:r.id??`${r.from}-${r.to}-${n}`,fromStep:o,toStep:a,status:r.status??c(o.status,a.status)}]})}function s(e,t,i){return{x:(e.column+.5)/i*100,y:(e.row+.5)/t*100}}function $(e,t,i){const r=s(e.fromStep,t,i),n=s(e.toStep,t,i);if(e.fromStep.row===e.toStep.row||e.fromStep.column===e.toStep.column)return`M ${r.x} ${r.y} L ${n.x} ${n.y}`;const o=(r.x+n.x)/2;return`M ${r.x} ${r.y} C ${o} ${r.y}, ${o} ${n.y}, ${n.x} ${n.y}`}function v(e){return e.some(t=>t.position)}exports.PROCESS_FLOW_STEP_STATUSES=p;exports.STATUS_LABELS=u;exports.deriveConnectionStatus=c;exports.getConnectionPath=$;exports.getDescriptionVisibility=S;exports.getPoint=s;exports.getStepAccessibleLabel=f;exports.getStepStatus=d;exports.hasCustomStepLayout=v;exports.normalizeGridIndex=l;exports.positionStep=b;exports.resolveConnections=g;
|
|
2
|
+
//# sourceMappingURL=ProcessFlow.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessFlow.utils.cjs","sources":["../../../../src/components/composed/ProcessFlow/ProcessFlow.utils.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\n/**\n * Runtime list of the visual states supported by ProcessFlow steps.\n * Use this for controls, schemas, and forms that need to present the same status values the component understands.\n */\nexport const PROCESS_FLOW_STEP_STATUSES = [\"pending\", \"active\", \"completed\", \"error\", \"disabled\"] as const;\n\n/**\n * Visual state for a ProcessFlow step.\n *\n * The parent application owns this state. ProcessFlow renders the provided status and does not run workflow side effects.\n */\nexport type ProcessFlowStepStatus = (typeof PROCESS_FLOW_STEP_STATUSES)[number];\nexport type ProcessStepStatus = ProcessFlowStepStatus;\n\n/** Direction for linear process flows. Branching flows are configured with step positions and connections. */\nexport type ProcessFlowOrientation = \"horizontal\" | \"vertical\";\n\n/** Visual density of the process flow. */\nexport type ProcessFlowSize = \"default\" | \"compact\";\n\nexport type ProcessFlowDescriptionVisibility = \"auto\" | \"hidden\" | \"visible\";\n\nexport interface ProcessFlowStepPosition {\n /** Zero-based row used when rendering a simple branching/configurable flow. */\n row?: number;\n /** Zero-based column used when rendering a simple branching/configurable flow. */\n column?: number;\n}\n\n/**\n * Configurable step rendered by ProcessFlow.\n *\n * Keep workflow-specific behavior in the parent. A step config should describe what to render, not what to do when a\n * workflow completes or errors.\n */\nexport interface ProcessFlowStep {\n /** Stable identifier used for selection and connections. */\n id: string;\n /** Visible step label. */\n label: ReactNode;\n /** Optional secondary text shown under or beside the label. */\n description?: ReactNode;\n /** Parent-controlled visual state. Defaults to \"pending\". */\n status?: ProcessFlowStepStatus;\n /** Accessible label for selectable steps. */\n ariaLabel?: string;\n /** Forces the step into the disabled visual/non-interactive state. */\n disabled?: boolean;\n /** Set to false when the step should render as non-navigable even when onStepSelect is provided. */\n selectable?: boolean;\n /** Optional grid position for simple branching/configurable layouts. */\n position?: ProcessFlowStepPosition;\n}\n\nexport type ProcessFlowStepConfig = ProcessFlowStep;\nexport type ProcessStep = ProcessFlowStep;\n\n/** Connection between two steps in a branching/configurable flow. Linear flows derive connections automatically. */\nexport interface ProcessFlowConnection {\n id?: string;\n from: string;\n to: string;\n status?: ProcessFlowStepStatus;\n ariaLabel?: string;\n}\n\nexport interface PositionedStep {\n step: ProcessFlowStep;\n stepIndex: number;\n status: ProcessFlowStepStatus;\n row: number;\n column: number;\n}\n\nexport interface ResolvedConnection extends ProcessFlowConnection {\n id: string;\n fromStep: PositionedStep;\n toStep: PositionedStep;\n status: ProcessFlowStepStatus;\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport const STATUS_LABELS: Record<ProcessFlowStepStatus, string> = {\n pending: \"Pending\",\n active: \"Active\",\n completed: \"Completed\",\n error: \"Error\",\n disabled: \"Disabled\",\n};\n\nexport function getDescriptionVisibility(showDescriptions?: boolean): ProcessFlowDescriptionVisibility {\n if (showDescriptions === true) {\n return \"visible\";\n }\n\n if (showDescriptions === false) {\n return \"hidden\";\n }\n\n return \"visible\";\n}\n\nexport function normalizeGridIndex(value: number | undefined, fallback: number) {\n return Math.max(Math.floor(value ?? fallback), 0);\n}\n\nexport function getStepStatus(step: ProcessFlowStep): ProcessFlowStepStatus {\n if (step.disabled) {\n return \"disabled\";\n }\n\n return step.status ?? \"pending\";\n}\n\nexport function getStepAccessibleLabel(step: ProcessFlowStep, status: ProcessFlowStepStatus, stepNumber: number) {\n if (step.ariaLabel) {\n return step.ariaLabel;\n }\n\n const label = typeof step.label === \"string\" ? step.label : `Step ${stepNumber}`;\n\n return `${label}, ${STATUS_LABELS[status]}`;\n}\n\nexport function positionStep(\n step: ProcessFlowStep,\n index: number,\n orientation: ProcessFlowOrientation,\n): PositionedStep {\n const rowFallback = orientation === \"vertical\" ? index : 0;\n const columnFallback = orientation === \"vertical\" ? 0 : index;\n\n return {\n step,\n stepIndex: index,\n status: getStepStatus(step),\n row: normalizeGridIndex(step.position?.row, rowFallback),\n column: normalizeGridIndex(step.position?.column, columnFallback),\n };\n}\n\nexport function deriveConnectionStatus(\n fromStatus: ProcessFlowStepStatus,\n toStatus: ProcessFlowStepStatus,\n): ProcessFlowStepStatus {\n if (fromStatus === \"error\" || toStatus === \"error\") {\n return \"error\";\n }\n\n if (fromStatus === \"disabled\" || toStatus === \"disabled\") {\n return \"disabled\";\n }\n\n if (fromStatus === \"completed\" && (toStatus === \"completed\" || toStatus === \"active\")) {\n return \"completed\";\n }\n\n if (fromStatus === \"active\" || toStatus === \"active\") {\n return \"active\";\n }\n\n return \"pending\";\n}\n\nfunction getLinearConnections(steps: PositionedStep[]): ProcessFlowConnection[] {\n return steps.slice(0, -1).map((step, index) => ({\n from: step.step.id,\n to: steps[index + 1].step.id,\n }));\n}\n\nexport function resolveConnections(steps: PositionedStep[], connections?: ProcessFlowConnection[]) {\n const stepMap = new Map(steps.map((step) => [step.step.id, step]));\n\n return (connections ?? getLinearConnections(steps)).flatMap((connection, index): ResolvedConnection[] => {\n const fromStep = stepMap.get(connection.from);\n const toStep = stepMap.get(connection.to);\n\n if (!fromStep || !toStep) {\n return [];\n }\n\n return [\n {\n ...connection,\n id: connection.id ?? `${connection.from}-${connection.to}-${index}`,\n fromStep,\n toStep,\n status: connection.status ?? deriveConnectionStatus(fromStep.status, toStep.status),\n },\n ];\n });\n}\n\nexport function getPoint(step: PositionedStep, rowCount: number, columnCount: number): Point {\n return {\n x: ((step.column + 0.5) / columnCount) * 100,\n y: ((step.row + 0.5) / rowCount) * 100,\n };\n}\n\nexport function getConnectionPath(connection: ResolvedConnection, rowCount: number, columnCount: number) {\n const start = getPoint(connection.fromStep, rowCount, columnCount);\n const end = getPoint(connection.toStep, rowCount, columnCount);\n\n if (connection.fromStep.row === connection.toStep.row || connection.fromStep.column === connection.toStep.column) {\n return `M ${start.x} ${start.y} L ${end.x} ${end.y}`;\n }\n\n const midX = (start.x + end.x) / 2;\n\n return `M ${start.x} ${start.y} C ${midX} ${start.y}, ${midX} ${end.y}, ${end.x} ${end.y}`;\n}\n\nexport function hasCustomStepLayout(steps: ProcessFlowStep[]) {\n return steps.some((step) => step.position);\n}\n"],"names":["PROCESS_FLOW_STEP_STATUSES","STATUS_LABELS","getDescriptionVisibility","showDescriptions","normalizeGridIndex","value","fallback","getStepStatus","step","getStepAccessibleLabel","status","stepNumber","positionStep","index","orientation","rowFallback","columnFallback","deriveConnectionStatus","fromStatus","toStatus","getLinearConnections","steps","resolveConnections","connections","stepMap","connection","fromStep","toStep","getPoint","rowCount","columnCount","getConnectionPath","start","end","midX","hasCustomStepLayout"],"mappings":"gFAMO,MAAMA,EAA6B,CAAC,UAAW,SAAU,YAAa,QAAS,UAAU,EAkFnFC,EAAuD,CAClE,QAAS,UACT,OAAQ,SACR,UAAW,YACX,MAAO,QACP,SAAU,UACZ,EAEO,SAASC,EAAyBC,EAA8D,CACrG,OAAIA,IAAqB,GAChB,UAGLA,IAAqB,GAChB,SAGF,SACT,CAEO,SAASC,EAAmBC,EAA2BC,EAAkB,CAC9E,OAAO,KAAK,IAAI,KAAK,MAAMD,GAASC,CAAQ,EAAG,CAAC,CAClD,CAEO,SAASC,EAAcC,EAA8C,CAC1E,OAAIA,EAAK,SACA,WAGFA,EAAK,QAAU,SACxB,CAEO,SAASC,EAAuBD,EAAuBE,EAA+BC,EAAoB,CAC/G,OAAIH,EAAK,UACAA,EAAK,UAKP,GAFO,OAAOA,EAAK,OAAU,SAAWA,EAAK,MAAQ,QAAQG,CAAU,EAE/D,KAAKV,EAAcS,CAAM,CAAC,EAC3C,CAEO,SAASE,EACdJ,EACAK,EACAC,EACgB,CAChB,MAAMC,EAAcD,IAAgB,WAAaD,EAAQ,EACnDG,EAAiBF,IAAgB,WAAa,EAAID,EAExD,MAAO,CACL,KAAAL,EACA,UAAWK,EACX,OAAQN,EAAcC,CAAI,EAC1B,IAAKJ,EAAmBI,EAAK,UAAU,IAAKO,CAAW,EACvD,OAAQX,EAAmBI,EAAK,UAAU,OAAQQ,CAAc,CAAA,CAEpE,CAEO,SAASC,EACdC,EACAC,EACuB,CACvB,OAAID,IAAe,SAAWC,IAAa,QAClC,QAGLD,IAAe,YAAcC,IAAa,WACrC,WAGLD,IAAe,cAAgBC,IAAa,aAAeA,IAAa,UACnE,YAGLD,IAAe,UAAYC,IAAa,SACnC,SAGF,SACT,C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