@cjlapao/ui-kit-vue 0.2.6 → 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 +15 -15
- package/dist/index.css +9 -0
- package/dist/index.js +12686 -12345
- package/dist/types/common/connectionFlow/router.d.ts +89 -0
- package/dist/types/common/connectionFlow/types.d.ts +19 -1
- 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>;
|
|
@@ -295,6 +295,13 @@ export interface LaidOutEdge {
|
|
|
295
295
|
targetTone: TrueColor;
|
|
296
296
|
/** A bypass arc travels *over* skipped nodes rather than between neighbours. */
|
|
297
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;
|
|
298
305
|
/**
|
|
299
306
|
* Position in its source's emission round-robin, and how many edges share
|
|
300
307
|
* that round-robin.
|
|
@@ -423,7 +430,12 @@ export interface ConnectionFlowLayoutOptions {
|
|
|
423
430
|
childGap: number;
|
|
424
431
|
/** Horizontal indent for child nodes. */
|
|
425
432
|
childIndent: number;
|
|
426
|
-
/**
|
|
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
|
+
*/
|
|
427
439
|
rowGap: number;
|
|
428
440
|
/** Left inset of a chained child grid under its parent. @default childIndent */
|
|
429
441
|
gridIndent: number;
|
|
@@ -432,6 +444,12 @@ export interface ConnectionFlowLayoutOptions {
|
|
|
432
444
|
cornerRadius: number;
|
|
433
445
|
/** How far above everything in the way a bypass arc travels. */
|
|
434
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;
|
|
435
453
|
/** Default size of the border bulge where an edge meets a node. */
|
|
436
454
|
ringSize: ConnectionFlowRingSize;
|
|
437
455
|
/** Rows a card shows before the rest collapse behind "show more". */
|
|
@@ -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 {};
|