@cjlapao/ui-kit-vue 0.2.5 → 0.2.7
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/index.cjs +16 -16
- package/dist/index.css +9 -0
- package/dist/index.js +13589 -13065
- package/dist/types/common/connectionFlow/router.d.ts +89 -0
- package/dist/types/common/connectionFlow/types.d.ts +90 -0
- package/dist/types/common/theme/Theme.d.ts +28 -1
- package/dist/types/vue/src/components/ScrollArea.vue.d.ts +8 -0
- package/dist/types/vue/src/components/SmartInput.test.d.ts +1 -0
- package/dist/types/vue/src/components/SmartInput.vue.d.ts +0 -1
- package/package.json +1 -1
|
@@ -129,3 +129,92 @@ export declare const labelAnchor: (points: {
|
|
|
129
129
|
x: number;
|
|
130
130
|
y: number;
|
|
131
131
|
};
|
|
132
|
+
/** One end of a route, with the card it must connect to. */
|
|
133
|
+
export interface PathEndpoint {
|
|
134
|
+
box: Box;
|
|
135
|
+
/**
|
|
136
|
+
* The connection line, as a fraction along the side. Callers pass the
|
|
137
|
+
* card's own `anchorY / height`; a side change simply slides the same
|
|
138
|
+
* fraction along the new side.
|
|
139
|
+
*/
|
|
140
|
+
t: number;
|
|
141
|
+
/**
|
|
142
|
+
* The visual idiom, as a preference: these sides get a bonus, never a
|
|
143
|
+
* straitjacket — a card in the way always outranks the idiom.
|
|
144
|
+
*/
|
|
145
|
+
preferSides?: PortSide[];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Shared lane accounting. Every route the engine returns charges its grid
|
|
149
|
+
* segments here, and later routes pay for reusing them — so two retry loops
|
|
150
|
+
* into the same card stack stack themselves side by side on adjacent
|
|
151
|
+
* clearance lines instead of drawing one line twice.
|
|
152
|
+
*/
|
|
153
|
+
export type LaneUse = Map<string, number>;
|
|
154
|
+
export declare const createLaneUse: () => LaneUse;
|
|
155
|
+
export interface PathOptions {
|
|
156
|
+
style: ConnectionFlowEdgeStyle;
|
|
157
|
+
/** How far a line must run out of a port before it may turn. */
|
|
158
|
+
stub?: number;
|
|
159
|
+
radius?: number;
|
|
160
|
+
trim?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Obstacle inflation. A clean route passes at least this far outside every
|
|
163
|
+
* card — sized for the terminal rings, so a route that clears the inflated
|
|
164
|
+
* box also clears the bulges sticking out of the real one.
|
|
165
|
+
*/
|
|
166
|
+
clearance?: number;
|
|
167
|
+
/** Extra cost per change of direction. */
|
|
168
|
+
bendPenalty?: number;
|
|
169
|
+
/** Cost per px travelled inside an inflated card. Finite on purpose. */
|
|
170
|
+
obstaclePenalty?: number;
|
|
171
|
+
/** Cost per prior use of the same grid segment. */
|
|
172
|
+
lanePenalty?: number;
|
|
173
|
+
/** Score taken off for connecting on a preferred side. */
|
|
174
|
+
preferBonus?: number;
|
|
175
|
+
/** Shared across one layout run — see `createLaneUse`. */
|
|
176
|
+
laneUse?: LaneUse;
|
|
177
|
+
}
|
|
178
|
+
/** Does any segment of this waypoint list pass through the interior of a box? */
|
|
179
|
+
export declare const segmentsCrossBoxes: (points: {
|
|
180
|
+
x: number;
|
|
181
|
+
y: number;
|
|
182
|
+
}[], boxes: Box[]) => boolean;
|
|
183
|
+
export interface RoutedPath extends Route {
|
|
184
|
+
/** The ports the engine actually connected — the layout draws its
|
|
185
|
+
* connectors here, wherever that turns out to be. */
|
|
186
|
+
fromPort: Port;
|
|
187
|
+
toPort: Port;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A* over the grid the cards define.
|
|
191
|
+
*
|
|
192
|
+
* Candidate lines come from the cards themselves — each inflated edge is a
|
|
193
|
+
* lane that provably clears the cards (a Hanan grid), plus ring roads beyond
|
|
194
|
+
* them all. Cost is length, plus a penalty per bend, plus a *large but
|
|
195
|
+
* finite* penalty per px inside an inflated card, plus a small one per reuse
|
|
196
|
+
* of an already-used lane. Finite obstacles are the important part: an edge
|
|
197
|
+
* boxed in by cards still draws its fewest-crossings route rather than
|
|
198
|
+
* vanishing, and a clean route always outranks any number of crossings.
|
|
199
|
+
*
|
|
200
|
+
* Returns `null` only when the grid would be too large to search — the
|
|
201
|
+
* caller then keeps its naive route. The engine never hangs and never blanks.
|
|
202
|
+
*/
|
|
203
|
+
export declare const routeBetween: (from: PathEndpoint, to: PathEndpoint, obstacles: Box[], options: PathOptions) => RoutedPath | null;
|
|
204
|
+
export interface RoutableEdge {
|
|
205
|
+
id: string;
|
|
206
|
+
points: {
|
|
207
|
+
x: number;
|
|
208
|
+
y: number;
|
|
209
|
+
}[];
|
|
210
|
+
style: ConnectionFlowEdgeStyle;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* The crossing pass: compare every pair of routed edges and give the
|
|
214
|
+
* horizontal one of each crossing a hop. Returns the new `d` for the edges
|
|
215
|
+
* that gained hops — every other edge keeps its path byte-identical.
|
|
216
|
+
*/
|
|
217
|
+
export declare const routeCrossings: (edges: RoutableEdge[], options?: {
|
|
218
|
+
cornerRadius?: number;
|
|
219
|
+
jumpRadius?: number;
|
|
220
|
+
}) => Map<string, string>;
|
|
@@ -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
|
/**
|
|
@@ -243,6 +295,13 @@ export interface LaidOutEdge {
|
|
|
243
295
|
targetTone: TrueColor;
|
|
244
296
|
/** A bypass arc travels *over* skipped nodes rather than between neighbours. */
|
|
245
297
|
bypass: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* The style this edge's corners are drawn in. The crossing-hop pass
|
|
300
|
+
* rebuilds a crossing edge's path exactly as the router would have drawn
|
|
301
|
+
* it, which needs the style the edge was routed with — `edgeStyle`
|
|
302
|
+
* governs corners only, so hops are round on every style.
|
|
303
|
+
*/
|
|
304
|
+
style?: ConnectionFlowEdgeStyle;
|
|
246
305
|
/**
|
|
247
306
|
* Position in its source's emission round-robin, and how many edges share
|
|
248
307
|
* that round-robin.
|
|
@@ -266,6 +325,14 @@ export interface LaidOutEdge {
|
|
|
266
325
|
emitSpan: number;
|
|
267
326
|
animated: boolean;
|
|
268
327
|
label?: string;
|
|
328
|
+
/**
|
|
329
|
+
* What kind of connection this is. Optional for backward compatibility —
|
|
330
|
+
* renderers treat everything as the track edge it always drew; the tests
|
|
331
|
+
* and the chain/branch passes are explicit.
|
|
332
|
+
*/
|
|
333
|
+
kind?: "track" | "chain" | "branch";
|
|
334
|
+
/** Set when `kind` is `"branch"`. */
|
|
335
|
+
branchKind?: "success" | "failure";
|
|
269
336
|
}
|
|
270
337
|
/**
|
|
271
338
|
* A terminal where one or more edges meet a node.
|
|
@@ -363,11 +430,26 @@ export interface ConnectionFlowLayoutOptions {
|
|
|
363
430
|
childGap: number;
|
|
364
431
|
/** Horizontal indent for child nodes. */
|
|
365
432
|
childIndent: number;
|
|
433
|
+
/**
|
|
434
|
+
* Vertical gap between the rows of a chained child grid. Wider than the
|
|
435
|
+
* child gap on purpose: the ladder has to read as a ladder, and the
|
|
436
|
+
* engine's crossing hops need air in the corridors the rows define.
|
|
437
|
+
* @default 20
|
|
438
|
+
*/
|
|
439
|
+
rowGap: number;
|
|
440
|
+
/** Left inset of a chained child grid under its parent. @default childIndent */
|
|
441
|
+
gridIndent: number;
|
|
366
442
|
edgeStyle: ConnectionFlowEdgeStyle;
|
|
367
443
|
/** Corner radius on an orthogonal edge. */
|
|
368
444
|
cornerRadius: number;
|
|
369
445
|
/** How far above everything in the way a bypass arc travels. */
|
|
370
446
|
bypassLift: number;
|
|
447
|
+
/**
|
|
448
|
+
* How far outside a card the path engine will route. An edge whose naive
|
|
449
|
+
* route crosses a card is re-routed through lanes at least this far from
|
|
450
|
+
* every card face, so it clears the terminal bulges too. @default 12
|
|
451
|
+
*/
|
|
452
|
+
pathClearance: number;
|
|
371
453
|
/** Default size of the border bulge where an edge meets a node. */
|
|
372
454
|
ringSize: ConnectionFlowRingSize;
|
|
373
455
|
/** Rows a card shows before the rest collapse behind "show more". */
|
|
@@ -386,6 +468,14 @@ export declare const nodeTone: (node: ConnectionFlowNode | undefined) => TrueCol
|
|
|
386
468
|
export declare const nodeIcon: (node: ConnectionFlowNode | undefined) => string | undefined;
|
|
387
469
|
/** Whether the node is executing. `status: "running"` implies it. */
|
|
388
470
|
export declare const nodeIsActive: (node: ConnectionFlowNode | undefined) => boolean;
|
|
471
|
+
/** Whether the node failed — what makes its failure edge the live one. */
|
|
472
|
+
export declare const nodeHasFailed: (node: ConnectionFlowNode | undefined) => boolean;
|
|
473
|
+
/**
|
|
474
|
+
* The chain grid's rows, however they were written: `rows` verbatim, or a
|
|
475
|
+
* flat `children` array promoted to one card per row. Fan callers never
|
|
476
|
+
* call this.
|
|
477
|
+
*/
|
|
478
|
+
export declare const toRows: (node: ConnectionFlowNode) => ConnectionFlowNode[][];
|
|
389
479
|
/**
|
|
390
480
|
* Whether the node is bypassed. Tri-state on purpose: `undefined` means "no
|
|
391
481
|
* opinion", which is what lets `autoState` infer it, while an explicit
|
|
@@ -117,6 +117,23 @@ export type InputVariantTokens = {
|
|
|
117
117
|
/** True when the surface is see-through and sits over unknown content. */
|
|
118
118
|
translucent: boolean;
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* Extras for `getInputVariantTokens`.
|
|
122
|
+
*/
|
|
123
|
+
export type InputVariantOptions = {
|
|
124
|
+
/**
|
|
125
|
+
* The tone the caller *chose*, as opposed to the one the component resolved.
|
|
126
|
+
*
|
|
127
|
+
* `glass` tints its fill from this alone. Every field resolves a missing
|
|
128
|
+
* tone to `blue` (`tone ?? color ?? "blue"`), so tinting from the resolved
|
|
129
|
+
* value would repaint every bare `<Input variant="glass">` in the product
|
|
130
|
+
* pale blue — which is what `ghost` does, and why the distinction has to be
|
|
131
|
+
* carried from the call site rather than inferred here. A field nobody ever
|
|
132
|
+
* tinted keeps the white wash it has always had; a field whose caller asked
|
|
133
|
+
* for violet gets violet glass.
|
|
134
|
+
*/
|
|
135
|
+
explicitTone?: TrueColor;
|
|
136
|
+
};
|
|
120
137
|
/**
|
|
121
138
|
* The variant's surface with its border colour removed, keeping the width and
|
|
122
139
|
* sides.
|
|
@@ -129,6 +146,16 @@ export type InputVariantTokens = {
|
|
|
129
146
|
* successful one stayed grey. Strip the colour so only one class can apply.
|
|
130
147
|
*/
|
|
131
148
|
export declare const stripBorderColor: (surface: string) => string;
|
|
149
|
+
/**
|
|
150
|
+
* A surface with its background colour removed, keeping the rest.
|
|
151
|
+
*
|
|
152
|
+
* Used where a component paints a *second* fill over the variant's own. The
|
|
153
|
+
* alternative — replacing the expected literal, `surface.replace("bg-white/45",
|
|
154
|
+
* …)` — goes silently stale the moment anyone edits the token table: the
|
|
155
|
+
* replace finds nothing, the old fill survives underneath, and the field is
|
|
156
|
+
* untinted again with nothing said about it. Stripping cannot fail that way.
|
|
157
|
+
*/
|
|
158
|
+
export declare const stripFillClass: (surface: string) => string;
|
|
132
159
|
/** True when a caller-supplied class string sets a text colour of its own. */
|
|
133
160
|
export declare const hasTextColor: (className?: string) => boolean;
|
|
134
161
|
/**
|
|
@@ -148,7 +175,7 @@ export declare const stripTextColor: (className: string) => string;
|
|
|
148
175
|
* replaces it. (`underline` paints no box, so a corner there has nowhere
|
|
149
176
|
* to land — honestly no-op.)
|
|
150
177
|
*/
|
|
151
|
-
export declare const getInputVariantTokens: (variant: InputVariant, tone?: TrueColor, corner?: SurfaceCorner) => InputVariantTokens;
|
|
178
|
+
export declare const getInputVariantTokens: (variant: InputVariant, tone?: TrueColor, corner?: SurfaceCorner, options?: InputVariantOptions) => InputVariantTokens;
|
|
152
179
|
export type FieldToneTokens = {
|
|
153
180
|
/** Border colour while anything inside the field has focus. */
|
|
154
181
|
focusBorder: string;
|
|
@@ -25,6 +25,13 @@ interface ScrollAreaProps {
|
|
|
25
25
|
variant?: ScrollAreaVariant;
|
|
26
26
|
/** Fade the content at the edges it can scroll toward. @default false */
|
|
27
27
|
mask?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the region can scroll sideways. A one-axis region — a nav list,
|
|
30
|
+
* a text column — should say so: `scrollWidth` reports content clipped by
|
|
31
|
+
* `overflow-x: hidden` as loudly as content that actually scrolls, so the
|
|
32
|
+
* bar would be drawn for an axis with nothing to scroll. @default true
|
|
33
|
+
*/
|
|
34
|
+
horizontal?: boolean;
|
|
28
35
|
/**
|
|
29
36
|
* Tab order entry for the viewport while overflowing; the viewport leaves
|
|
30
37
|
* the tab order when the content fits. @default 0
|
|
@@ -38,6 +45,7 @@ type __VLS_Slots = {} & {
|
|
|
38
45
|
default?: (props: typeof __VLS_1) => any;
|
|
39
46
|
};
|
|
40
47
|
declare const __VLS_component: import("vue").DefineComponent<ScrollAreaProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScrollAreaProps> & Readonly<{}>, {
|
|
48
|
+
horizontal: boolean;
|
|
41
49
|
mask: boolean;
|
|
42
50
|
variant: ScrollAreaVariant;
|
|
43
51
|
tabIndex: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|