@cjlapao/ui-kit-vue 0.2.5 → 0.2.6

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.
@@ -9,6 +9,12 @@ export type ConnectionState = (typeof CONNECTION_STATES)[number];
9
9
  /** Shape of the edge drawn between two nodes. */
10
10
  export declare const CONNECTION_FLOW_EDGE_STYLES: readonly ["orthogonal", "curved", "straight"];
11
11
  export type ConnectionFlowEdgeStyle = (typeof CONNECTION_FLOW_EDGE_STYLES)[number];
12
+ /**
13
+ * How a card's children attach — the elbow fan, or the walked grid.
14
+ * @see ConnectionFlowNode.childLayout
15
+ */
16
+ export declare const CONNECTION_FLOW_CHILD_LAYOUTS: readonly ["fan", "chain"];
17
+ export type ConnectionFlowChildLayout = (typeof CONNECTION_FLOW_CHILD_LAYOUTS)[number];
12
18
  /**
13
19
  * How the whole component reports that it is loading.
14
20
  *
@@ -67,6 +73,19 @@ export interface ConnectionFlowConnectorConfig {
67
73
  /** Caption rendered along the edge. */
68
74
  label?: string;
69
75
  }
76
+ /**
77
+ * One of a card's two outcomes, as an edge. `success` without a `to` is the
78
+ * implicit next step and draws nothing extra — it only restyles the walk
79
+ * edge. `failure` always names its target: there is no implicit failure.
80
+ */
81
+ export interface ConnectionFlowBranch {
82
+ /** Target node id. */
83
+ to?: string;
84
+ /** @default emerald for success, rose for failure (`STATUS_TONE`). */
85
+ tone?: TrueColor;
86
+ /** Caption along the edge (no default text — the kit ships no strings). */
87
+ label?: string;
88
+ }
70
89
  /**
71
90
  * What happened to a step, as opposed to what colour it is.
72
91
  *
@@ -166,6 +185,39 @@ export interface ConnectionFlowNode {
166
185
  maxItems?: number;
167
186
  /** Nodes hanging vertically below this one. */
168
187
  children?: ConnectionFlowNode[];
188
+ /**
189
+ * How `children` attach.
190
+ *
191
+ * - `"fan"` (default) is today: every child gets its own elbow from the
192
+ * parent, hanging below it, indented.
193
+ * - `"chain"` reads `rows` (or `children`, one card per row) as a grid:
194
+ * the flow enters the first card, walks each row left→right, and drops
195
+ * from the last card of a row into the first card of the next. The
196
+ * parent becomes a pure container — it emits no edge onward; the grid's
197
+ * last card carries the connection to the parent's next sibling.
198
+ *
199
+ * @default "fan"
200
+ */
201
+ childLayout?: ConnectionFlowChildLayout;
202
+ /**
203
+ * Rows for `childLayout: "chain"` — each row walks left→right, rows are
204
+ * walked top→bottom. Cards keep the standard size; a longer row widens
205
+ * the grid (longer connectors), never the cards.
206
+ */
207
+ rows?: ConnectionFlowNode[][];
208
+ /**
209
+ * Where this card goes when it succeeds. Without `to` it follows the
210
+ * implicit next step (the track, or the chain walk); with `to` the
211
+ * successor points there instead. Emerald unless `tone` says otherwise.
212
+ */
213
+ success?: ConnectionFlowBranch;
214
+ /**
215
+ * Where this card goes when it fails — usually upstream (a loop-back
216
+ * that re-enters the target from the top, so the flow can run the chain
217
+ * down again). Rose unless `tone` says otherwise. Always drawn: topology
218
+ * stays visible while the flow runs; only its liveliness follows status.
219
+ */
220
+ failure?: ConnectionFlowBranch;
169
221
  /** Config for the edge leading *into* this node. */
170
222
  connector?: ConnectionFlowConnectorConfig;
171
223
  /**
@@ -266,6 +318,14 @@ export interface LaidOutEdge {
266
318
  emitSpan: number;
267
319
  animated: boolean;
268
320
  label?: string;
321
+ /**
322
+ * What kind of connection this is. Optional for backward compatibility —
323
+ * renderers treat everything as the track edge it always drew; the tests
324
+ * and the chain/branch passes are explicit.
325
+ */
326
+ kind?: "track" | "chain" | "branch";
327
+ /** Set when `kind` is `"branch"`. */
328
+ branchKind?: "success" | "failure";
269
329
  }
270
330
  /**
271
331
  * A terminal where one or more edges meet a node.
@@ -363,6 +423,10 @@ export interface ConnectionFlowLayoutOptions {
363
423
  childGap: number;
364
424
  /** Horizontal indent for child nodes. */
365
425
  childIndent: number;
426
+ /** Vertical gap between the rows of a chained child grid. @default childGap */
427
+ rowGap: number;
428
+ /** Left inset of a chained child grid under its parent. @default childIndent */
429
+ gridIndent: number;
366
430
  edgeStyle: ConnectionFlowEdgeStyle;
367
431
  /** Corner radius on an orthogonal edge. */
368
432
  cornerRadius: number;
@@ -386,6 +450,14 @@ export declare const nodeTone: (node: ConnectionFlowNode | undefined) => TrueCol
386
450
  export declare const nodeIcon: (node: ConnectionFlowNode | undefined) => string | undefined;
387
451
  /** Whether the node is executing. `status: "running"` implies it. */
388
452
  export declare const nodeIsActive: (node: ConnectionFlowNode | undefined) => boolean;
453
+ /** Whether the node failed — what makes its failure edge the live one. */
454
+ export declare const nodeHasFailed: (node: ConnectionFlowNode | undefined) => boolean;
455
+ /**
456
+ * The chain grid's rows, however they were written: `rows` verbatim, or a
457
+ * flat `children` array promoted to one card per row. Fan callers never
458
+ * call this.
459
+ */
460
+ export declare const toRows: (node: ConnectionFlowNode) => ConnectionFlowNode[][];
389
461
  /**
390
462
  * Whether the node is bypassed. Tri-state on purpose: `undefined` means "no
391
463
  * opinion", which is what lets `autoState` infer it, while an explicit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjlapao/ui-kit-vue",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cjlapao/ui-kit.git",