@cjlapao/ui-kit-vue 0.2.0 → 0.2.3
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 +18 -25
- package/dist/index.css +37732 -13285
- package/dist/index.js +31192 -21036
- package/dist/types/common/chat/markdown.d.ts +8 -0
- package/dist/types/common/chat/storage.d.ts +48 -0
- package/dist/types/common/chat/stream.d.ts +43 -0
- package/dist/types/common/chat/types.d.ts +143 -0
- package/dist/types/common/connectionFlow/header.d.ts +56 -0
- package/dist/types/common/connectionFlow/icons.d.ts +15 -0
- package/dist/types/common/connectionFlow/index.d.ts +6 -0
- package/dist/types/common/connectionFlow/layout.d.ts +73 -0
- package/dist/types/common/connectionFlow/measure.d.ts +94 -0
- package/dist/types/common/connectionFlow/paint.d.ts +36 -0
- package/dist/types/common/connectionFlow/router.d.ts +131 -0
- package/dist/types/common/connectionFlow/tones.d.ts +79 -0
- package/dist/types/common/connectionFlow/types.d.ts +394 -0
- package/dist/types/common/gantt/drag.d.ts +221 -0
- package/dist/types/common/gantt/index.d.ts +11 -0
- package/dist/types/common/gantt/layout.d.ts +133 -0
- package/dist/types/common/gantt/sample.d.ts +15 -0
- package/dist/types/common/gantt/time.d.ts +77 -0
- package/dist/types/common/gantt/tokens.d.ts +73 -0
- package/dist/types/common/gantt/types.d.ts +216 -0
- package/dist/types/common/i18n/builtIn/de.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/en.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/es.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/fr.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/index.d.ts +15 -0
- package/dist/types/common/i18n/builtIn/pt.d.ts +2 -0
- package/dist/types/common/i18n/catalog.d.ts +32 -0
- package/dist/types/common/i18n/createI18n.d.ts +2 -0
- package/dist/types/common/i18n/dates.d.ts +12 -0
- package/dist/types/common/i18n/detect.d.ts +29 -0
- package/dist/types/common/i18n/icu.d.ts +36 -0
- package/dist/types/common/i18n/index.d.ts +10 -0
- package/dist/types/common/i18n/provider.d.ts +7 -0
- package/dist/types/common/i18n/storage.d.ts +8 -0
- package/dist/types/common/i18n/types.d.ts +64 -0
- package/dist/types/common/i18n/warn.d.ts +5 -0
- package/dist/types/common/theme/Theme.d.ts +941 -3
- package/dist/types/common/theme/glass.d.ts +90 -11
- package/dist/types/common/theme/randomThemeColor.d.ts +4 -4
- package/dist/types/common/tooltip/placement.d.ts +103 -0
- package/dist/types/common/tooltip/tokens.d.ts +40 -0
- package/dist/types/common/types/TableSettings.d.ts +15 -0
- package/dist/types/common/types/Variables.d.ts +71 -1
- package/dist/types/common/utils/dates.d.ts +113 -0
- package/dist/types/common/utils/gravatar.d.ts +0 -10
- package/dist/types/common/utils/safeStorage.d.ts +28 -0
- package/dist/types/common/utils/sanitizeSvg.d.ts +44 -0
- package/dist/types/common/utils/smartVariables.d.ts +74 -18
- package/dist/types/common/utils/tableStorage.d.ts +38 -0
- package/dist/types/vue/src/chat/index.d.ts +4 -0
- package/dist/types/vue/src/components/AccessMatrix.test.d.ts +1 -0
- package/dist/types/vue/src/components/AccessMatrix.vue.d.ts +23 -1
- package/dist/types/vue/src/components/Accordion.test.d.ts +1 -0
- package/dist/types/vue/src/components/Accordion.vue.d.ts +42 -28
- package/dist/types/vue/src/components/ActivityFeed.test.d.ts +1 -0
- package/dist/types/vue/src/components/ActivityFeed.vue.d.ts +141 -0
- package/dist/types/vue/src/components/Alert.test.d.ts +1 -0
- package/dist/types/vue/src/components/Alert.vue.d.ts +59 -2
- package/dist/types/vue/src/components/ApiErrorState.test.d.ts +1 -0
- package/dist/types/vue/src/components/ApiErrorState.vue.d.ts +28 -8
- package/dist/types/vue/src/components/AppDivider.vue.d.ts +53 -4
- package/dist/types/vue/src/components/Badge.vue.d.ts +45 -13
- package/dist/types/vue/src/components/BadgeIcon.vue.d.ts +1 -1
- package/dist/types/vue/src/components/BreakdownCard.test.d.ts +1 -0
- package/dist/types/vue/src/components/BreakdownCard.vue.d.ts +81 -0
- package/dist/types/vue/src/components/Button.vue.d.ts +22 -11
- package/dist/types/vue/src/components/Chat.test.d.ts +1 -0
- package/dist/types/vue/src/components/Chat.vue.d.ts +80 -0
- package/dist/types/vue/src/components/Checkbox.test.d.ts +1 -0
- package/dist/types/vue/src/components/Checkbox.vue.d.ts +44 -29
- package/dist/types/vue/src/components/CollapsiblePanel.vue.d.ts +5 -5
- package/dist/types/vue/src/components/ColorSwatches.test.d.ts +1 -0
- package/dist/types/vue/src/components/ColorSwatches.vue.d.ts +42 -0
- package/dist/types/vue/src/components/Combobox.test.d.ts +1 -0
- package/dist/types/vue/src/components/Combobox.vue.d.ts +61 -12
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlow.vue.d.ts +153 -17
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowCanvas.vue.d.ts +28 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowHeader.vue.d.ts +33 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowNodeBody.vue.d.ts +32 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowSkeleton.vue.d.ts +18 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowSvg.vue.d.ts +52 -0
- package/dist/types/vue/src/components/ConnectionFlow/connectionFlow.test.d.ts +1 -0
- package/dist/types/vue/src/components/ConnectionFlow/index.d.ts +11 -4
- package/dist/types/vue/src/components/CustomIcon.vue.d.ts +35 -11
- package/dist/types/vue/src/components/DetailItemCard.vue.d.ts +37 -5
- package/dist/types/vue/src/components/DropdownButton.vue.d.ts +3 -3
- package/dist/types/vue/src/components/DropdownMenu.test.d.ts +1 -0
- package/dist/types/vue/src/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/types/vue/src/components/DynamicFormField.test.d.ts +1 -0
- package/dist/types/vue/src/components/DynamicFormField.vue.d.ts +61 -5
- package/dist/types/vue/src/components/DynamicImg.vue.d.ts +28 -3
- package/dist/types/vue/src/components/EmptyState.test.d.ts +1 -0
- package/dist/types/vue/src/components/EmptyState.vue.d.ts +104 -24
- package/dist/types/vue/src/components/FormField.vue.d.ts +2 -1
- package/dist/types/vue/src/components/Gantt/Gantt.test.d.ts +1 -0
- package/dist/types/vue/src/components/Gantt/Gantt.vue.d.ts +160 -0
- package/dist/types/vue/src/components/Gantt/GanttBodyRow.vue.d.ts +78 -0
- package/dist/types/vue/src/components/Gantt/GanttCell.vue.d.ts +28 -0
- package/dist/types/vue/src/components/Gantt/GanttLinkLayer.vue.d.ts +22 -0
- package/dist/types/vue/src/components/Gantt/GanttScale.vue.d.ts +7 -0
- package/dist/types/vue/src/components/Gantt/GanttTaskBar.vue.d.ts +53 -0
- package/dist/types/vue/src/components/Gantt/GanttToolbar.vue.d.ts +22 -0
- package/dist/types/vue/src/components/Gantt/index.d.ts +18 -0
- package/dist/types/vue/src/components/Gantt/labels.d.ts +3 -0
- package/dist/types/vue/src/components/Gantt/types.d.ts +11 -0
- package/dist/types/vue/src/components/Gantt/useGanttDrag.d.ts +105 -0
- package/dist/types/vue/src/components/GlassBackground.vue.d.ts +4 -3
- package/dist/types/vue/src/components/GlassPanel.vue.d.ts +2 -2
- package/dist/types/vue/src/components/HeaderGroup.vue.d.ts +19 -1
- package/dist/types/vue/src/components/HelpButton.test.d.ts +1 -0
- package/dist/types/vue/src/components/HelpButton.vue.d.ts +15 -6
- package/dist/types/vue/src/components/Hero.test.d.ts +1 -0
- package/dist/types/vue/src/components/Hero.vue.d.ts +52 -31
- package/dist/types/vue/src/components/IconButton.vue.d.ts +12 -6
- package/dist/types/vue/src/components/InfiniteScrollPanel.vue.d.ts +61 -14
- package/dist/types/vue/src/components/InfoRow.test.d.ts +1 -0
- package/dist/types/vue/src/components/InfoRow.vue.d.ts +67 -37
- package/dist/types/vue/src/components/InlinePanel.vue.d.ts +12 -18
- package/dist/types/vue/src/components/Input.test.d.ts +1 -0
- package/dist/types/vue/src/components/Input.vue.d.ts +42 -13
- package/dist/types/vue/src/components/InputGroup.test.d.ts +1 -0
- package/dist/types/vue/src/components/InputGroup.vue.d.ts +20 -5
- package/dist/types/vue/src/components/Loader.test.d.ts +1 -0
- package/dist/types/vue/src/components/Loader.vue.d.ts +30 -11
- package/dist/types/vue/src/components/MarkdownEditor.vue.d.ts +1 -1
- package/dist/types/vue/src/components/MetricBar.test.d.ts +1 -0
- package/dist/types/vue/src/components/MetricBar.vue.d.ts +16 -5
- package/dist/types/vue/src/components/Modal.vue.d.ts +18 -19
- package/dist/types/vue/src/components/MultiProgressBar.vue.d.ts +15 -2
- package/dist/types/vue/src/components/MultiSelectPills.test.d.ts +1 -0
- package/dist/types/vue/src/components/MultiSelectPills.vue.d.ts +47 -43
- package/dist/types/vue/src/components/MultiToggle.test.d.ts +1 -0
- package/dist/types/vue/src/components/MultiToggle.vue.d.ts +33 -6
- package/dist/types/vue/src/components/NotificationModal.test.d.ts +1 -0
- package/dist/types/vue/src/components/NotificationModal.vue.d.ts +19 -2
- package/dist/types/vue/src/components/PageHeader.test.d.ts +1 -0
- package/dist/types/vue/src/components/PageHeader.vue.d.ts +18 -0
- package/dist/types/vue/src/components/PagedPanel.test.d.ts +1 -0
- package/dist/types/vue/src/components/PagedPanel.vue.d.ts +39 -11
- package/dist/types/vue/src/components/Panel.vue.d.ts +18 -9
- package/dist/types/vue/src/components/PasswordInput.test.d.ts +1 -0
- package/dist/types/vue/src/components/PasswordInput.vue.d.ts +20 -3
- package/dist/types/vue/src/components/Picker.test.d.ts +1 -0
- package/dist/types/vue/src/components/Picker.vue.d.ts +3 -3
- package/dist/types/vue/src/components/Pill.vue.d.ts +63 -5
- package/dist/types/vue/src/components/Progress.test.d.ts +1 -0
- package/dist/types/vue/src/components/Progress.vue.d.ts +60 -11
- package/dist/types/vue/src/components/ProgressSpinner.test.d.ts +1 -0
- package/dist/types/vue/src/components/ProgressSpinner.vue.d.ts +46 -0
- package/dist/types/vue/src/components/ScrollArea.test.d.ts +1 -0
- package/dist/types/vue/src/components/ScrollArea.vue.d.ts +52 -0
- package/dist/types/vue/src/components/SearchBar.vue.d.ts +2 -3
- package/dist/types/vue/src/components/Section.vue.d.ts +1 -1
- package/dist/types/vue/src/components/SectionCard.vue.d.ts +2 -2
- package/dist/types/vue/src/components/Select.test.d.ts +1 -0
- package/dist/types/vue/src/components/Select.vue.d.ts +41 -16
- package/dist/types/vue/src/components/SidePanel.vue.d.ts +1 -1
- package/dist/types/vue/src/components/SmartInput.vue.d.ts +49 -18
- package/dist/types/vue/src/components/SmartValue.vue.d.ts +20 -13
- package/dist/types/vue/src/components/SmartVariableBadge.vue.d.ts +17 -0
- package/dist/types/vue/src/components/Spinner.test.d.ts +1 -0
- package/dist/types/vue/src/components/Spinner.vue.d.ts +12 -5
- package/dist/types/vue/src/components/SplitView.vue.d.ts +6 -6
- package/dist/types/vue/src/components/StartupStageStepper.vue.d.ts +1 -1
- package/dist/types/vue/src/components/StatChartTile.vue.d.ts +5 -0
- package/dist/types/vue/src/components/StatCountTile.vue.d.ts +5 -1
- package/dist/types/vue/src/components/StatGraphTile.vue.d.ts +1 -1
- package/dist/types/vue/src/components/StatTile.test.d.ts +1 -0
- package/dist/types/vue/src/components/StatTile.vue.d.ts +5 -1
- package/dist/types/vue/src/components/StatusSpinner.test.d.ts +1 -0
- package/dist/types/vue/src/components/StatusSpinner.vue.d.ts +10 -5
- package/dist/types/vue/src/components/Stepper.test.d.ts +1 -0
- package/dist/types/vue/src/components/Stepper.vue.d.ts +62 -25
- package/dist/types/vue/src/components/Table.test.d.ts +1 -0
- package/dist/types/vue/src/components/Table.vue.d.ts +67 -14
- package/dist/types/vue/src/components/Tabs.vue.d.ts +20 -3
- package/dist/types/vue/src/components/TagPicker.vue.d.ts +3 -3
- package/dist/types/vue/src/components/Textarea.vue.d.ts +8 -5
- package/dist/types/vue/src/components/TimelinePanel/TimelinePanel.vue.d.ts +4 -4
- package/dist/types/vue/src/components/Toggle.vue.d.ts +4 -4
- package/dist/types/vue/src/components/Toolbar.test.d.ts +1 -0
- package/dist/types/vue/src/components/Toolbar.vue.d.ts +62 -0
- package/dist/types/vue/src/components/Tooltip.test.d.ts +1 -0
- package/dist/types/vue/src/components/Tooltip.vue.d.ts +20 -3
- package/dist/types/vue/src/components/TooltipWrapper.vue.d.ts +24 -3
- package/dist/types/vue/src/components/TreeView/TreeFlowSvg.vue.d.ts +5 -5
- package/dist/types/vue/src/components/TreeView/TreeItemRow.vue.d.ts +2 -2
- package/dist/types/vue/src/components/TreeView/TreeView.vue.d.ts +4 -4
- package/dist/types/vue/src/components/UserAvatar.test.d.ts +1 -0
- package/dist/types/vue/src/components/UserAvatar.vue.d.ts +56 -6
- package/dist/types/vue/src/components/VariablePicker.vue.d.ts +23 -6
- package/dist/types/vue/src/components/__dbg.test.d.ts +1 -0
- package/dist/types/vue/src/components/index.d.ts +50 -31
- package/dist/types/vue/src/components/internal/InfoRowContent.vue.d.ts +52 -0
- package/dist/types/vue/src/components/internal/PagedPanelContent.vue.d.ts +47 -0
- package/dist/types/vue/src/connectionFlow/index.d.ts +1 -0
- package/dist/types/vue/src/contexts/IconContext.d.ts +8 -3
- package/dist/types/vue/src/i18n/I18nContext.d.ts +14 -0
- package/dist/types/vue/src/i18n/I18nProvider.test.d.ts +2 -0
- package/dist/types/vue/src/i18n/I18nProvider.vue.d.ts +35 -0
- package/dist/types/vue/src/i18n/index.d.ts +8 -0
- package/dist/types/vue/src/i18n/kit-components-spot.test.d.ts +1 -0
- package/dist/types/vue/src/i18n/useI18n.d.ts +44 -0
- package/dist/types/vue/src/index.d.ts +2 -2
- package/dist/types/vue/src/test-setup.d.ts +5 -0
- package/dist/types/vue/src/types/Icon.d.ts +11 -2
- package/dist/types/vue/src/types/TableSettings.d.ts +1 -0
- package/dist/types/vue/src/types/index.d.ts +1 -0
- package/dist/types/vue/src/utils/index.d.ts +1 -0
- package/dist/types/vue/src/utils/sanitizeSvg.d.ts +1 -0
- package/dist/types/vue/src/utils/tableStorage.d.ts +1 -0
- package/dist/ui-kit-vue.css +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type SurfaceVariant, type TrueColor } from "../theme/Theme";
|
|
2
|
+
import { type LaidOutConnector } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Tailwind class strings for a node card, generated from `TRUE_COLORS` so a
|
|
5
|
+
* tone can never be missing. The hand-written table these replace had drifted
|
|
6
|
+
* three ways: `pink` was present but is not a `TrueColor`, `neutral` was
|
|
7
|
+
* absent and only worked by falling through to a separate constant, and
|
|
8
|
+
* `slate` was remapped to `neutral` by a 21-branch switch in which every other
|
|
9
|
+
* branch returned its own input.
|
|
10
|
+
*/
|
|
11
|
+
export interface ConnectionFlowToneClasses {
|
|
12
|
+
fill: string;
|
|
13
|
+
border: string;
|
|
14
|
+
heading: string;
|
|
15
|
+
body: string;
|
|
16
|
+
/** A brighter fill for the pulsing "in progress" overlay. */
|
|
17
|
+
pulse: string;
|
|
18
|
+
/**
|
|
19
|
+
* Stroke for the edge line. A class rather than a value: an SVG `stroke`
|
|
20
|
+
* attribute cannot carry a `dark:` variant, and a single shade that reads
|
|
21
|
+
* as a quiet line on white glares on near-black.
|
|
22
|
+
*/
|
|
23
|
+
line: string;
|
|
24
|
+
/** Fill for a terminal's core dot and for the dots travelling the line. */
|
|
25
|
+
dot: string;
|
|
26
|
+
/** Fill for the card's silhouette path — the SVG twin of `fill`. */
|
|
27
|
+
shapeFill: string;
|
|
28
|
+
/** Stroke for that silhouette — the SVG twin of `border`. */
|
|
29
|
+
shapeStroke: string;
|
|
30
|
+
/** Stroke for the silhouette of the selected card. */
|
|
31
|
+
shapeStrokeSelected: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const CONNECTION_FLOW_TONE_CLASSES: Record<TrueColor, ConnectionFlowToneClasses>;
|
|
34
|
+
export declare const getToneClasses: (tone: TrueColor | undefined) => ConnectionFlowToneClasses;
|
|
35
|
+
/**
|
|
36
|
+
* How one terminal is painted.
|
|
37
|
+
*
|
|
38
|
+
* Only the core dot: the bulge around it is part of the node's own outline
|
|
39
|
+
* path (`LaidOutNode.outline`), because a terminal is the card bulging rather
|
|
40
|
+
* than a marker laid on top of it — no chord across it, and the same fill
|
|
41
|
+
* inside. An earlier version drew a full ring here, which read as a separate
|
|
42
|
+
* disc stuck to the side of the card.
|
|
43
|
+
*
|
|
44
|
+
* The colour is a Tailwind class, not a value: an SVG `fill` attribute cannot
|
|
45
|
+
* carry a `dark:` variant. State is expressed by opacity rather than a second
|
|
46
|
+
* shade table.
|
|
47
|
+
*/
|
|
48
|
+
export interface ConnectorVisual {
|
|
49
|
+
/** Radius of the node's bulge around this port. */
|
|
50
|
+
radius: number;
|
|
51
|
+
/** Radius of the solid core dot the edge attaches to. */
|
|
52
|
+
dotRadius: number;
|
|
53
|
+
dotClass: string;
|
|
54
|
+
opacity: number;
|
|
55
|
+
/** The outline stays straight here — `ringSize: "fit"`. */
|
|
56
|
+
solid: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare const connectorVisual: (connector: LaidOutConnector) => ConnectorVisual;
|
|
59
|
+
/**
|
|
60
|
+
* How a node card's silhouette is painted, per shared surface variant.
|
|
61
|
+
*
|
|
62
|
+
* These are the SVG twins of what `Panel` puts on a `<section>`: the same
|
|
63
|
+
* shades from the same table, with `bg-` becoming `fill-` and `border-`
|
|
64
|
+
* becoming `stroke-`. A card in a flow and a card beside it should not be two
|
|
65
|
+
* different greys, and they were — the node had one hand-picked pair while
|
|
66
|
+
* every other surface in the kit took `getPanelToneStyles`.
|
|
67
|
+
*
|
|
68
|
+
* The glass family keeps its translucent fill and light rim. `backdrop-filter`
|
|
69
|
+
* is not honoured on an SVG shape, so those variants read as tinted glass
|
|
70
|
+
* without the blur; everything else is pixel-identical to a Panel.
|
|
71
|
+
*/
|
|
72
|
+
export interface NodeSurface {
|
|
73
|
+
fill: string;
|
|
74
|
+
/** Empty for the variants that carry no rim. */
|
|
75
|
+
stroke: string;
|
|
76
|
+
/** Extra classes on the path — a drop shadow for `elevated`. */
|
|
77
|
+
effect: string;
|
|
78
|
+
}
|
|
79
|
+
export declare const getNodeSurface: (tone: TrueColor | undefined, variant: SurfaceVariant | undefined) => NodeSurface;
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import type { ControlSize, SurfaceCorner, TrueColor } from "../theme/Theme";
|
|
2
|
+
import type { PortSide } from "./router";
|
|
3
|
+
/**
|
|
4
|
+
* How an edge is behaving. `flowing` animates, `stopped` is a solid traversed
|
|
5
|
+
* edge, `disabled` is a dashed not-yet-reached one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CONNECTION_STATES: readonly ["flowing", "stopped", "disabled"];
|
|
8
|
+
export type ConnectionState = (typeof CONNECTION_STATES)[number];
|
|
9
|
+
/** Shape of the edge drawn between two nodes. */
|
|
10
|
+
export declare const CONNECTION_FLOW_EDGE_STYLES: readonly ["orthogonal", "curved", "straight"];
|
|
11
|
+
export type ConnectionFlowEdgeStyle = (typeof CONNECTION_FLOW_EDGE_STYLES)[number];
|
|
12
|
+
/**
|
|
13
|
+
* How the whole component reports that it is loading.
|
|
14
|
+
*
|
|
15
|
+
* `skeleton` is the default because it is the only one that holds the card's
|
|
16
|
+
* shape: a spinner or a bar collapses the frame and the layout jumps when the
|
|
17
|
+
* real graph arrives.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CONNECTION_FLOW_LOADERS: readonly ["skeleton", "spinner", "progress"];
|
|
20
|
+
export type ConnectionFlowLoader = (typeof CONNECTION_FLOW_LOADERS)[number];
|
|
21
|
+
/** What the in-progress indicator looks like. Only one is ever shown. */
|
|
22
|
+
export declare const CONNECTION_FLOW_PROGRESS_TYPES: readonly ["none", "bar", "spinner"];
|
|
23
|
+
export type ConnectionFlowProgressType = (typeof CONNECTION_FLOW_PROGRESS_TYPES)[number];
|
|
24
|
+
/**
|
|
25
|
+
* How a node relates to the one before it — the "connection type" borrowed
|
|
26
|
+
* from `TreeView`, so a flow can express structure as well as sequence.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CONNECTION_FLOW_NODE_KINDS: readonly ["step", "parallel", "child", "branch"];
|
|
29
|
+
export type ConnectionFlowNodeKind = (typeof CONNECTION_FLOW_NODE_KINDS)[number];
|
|
30
|
+
/**
|
|
31
|
+
* Size of the bulge a node's border takes around a connector. `fit` drops the
|
|
32
|
+
* bulge entirely, leaving the core dot alone on the border. The rest are the
|
|
33
|
+
* shared control scale, so a terminal and the controls beside it are described
|
|
34
|
+
* in one language.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CONNECTION_FLOW_RING_SIZES: readonly ["xs", "sm", "md", "lg", "xl", "fit"];
|
|
37
|
+
export type ConnectionFlowRingSize = (typeof CONNECTION_FLOW_RING_SIZES)[number];
|
|
38
|
+
/**
|
|
39
|
+
* Radius of the border's bulge, in px, per ring size.
|
|
40
|
+
*
|
|
41
|
+
* A terminal is the node's border detouring around the port — a half-circle
|
|
42
|
+
* springing from the border line — with a solid core dot at the centre that
|
|
43
|
+
* the edge attaches to. The two radii are related rather than independent so
|
|
44
|
+
* the proportion holds at every size.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CONNECTOR_RING_RADIUS: Record<ConnectionFlowRingSize, number>;
|
|
47
|
+
/** Radius of the solid core dot for a given bulge radius. */
|
|
48
|
+
export declare const connectorDotRadius: (ringRadius: number) => number;
|
|
49
|
+
/**
|
|
50
|
+
* Below this the bulge is indistinguishable from the dot sitting in it, so the
|
|
51
|
+
* outline stays straight and only the dot is drawn. This is what `fit` means.
|
|
52
|
+
*/
|
|
53
|
+
export declare const CONNECTOR_BULGE_MIN = 2.5;
|
|
54
|
+
export interface ConnectionFlowConnectorConfig {
|
|
55
|
+
state?: ConnectionState;
|
|
56
|
+
animated?: boolean;
|
|
57
|
+
/** Size of the border bulge on both ends of this edge. */
|
|
58
|
+
ringSize?: ConnectionFlowRingSize;
|
|
59
|
+
/** Edge shape override for this one edge. */
|
|
60
|
+
edgeStyle?: ConnectionFlowEdgeStyle;
|
|
61
|
+
/** Force the source-side tone instead of inheriting it from the source node. */
|
|
62
|
+
sourceTone?: TrueColor;
|
|
63
|
+
/** Force the target-side tone instead of inheriting it from this node. */
|
|
64
|
+
targetTone?: TrueColor;
|
|
65
|
+
/** Draw travelling dots on a `stopped` edge as well as a `flowing` one. */
|
|
66
|
+
animateCompleted?: boolean;
|
|
67
|
+
/** Caption rendered along the edge. */
|
|
68
|
+
label?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* What happened to a step, as opposed to what colour it is.
|
|
72
|
+
*
|
|
73
|
+
* A flow almost always has a status per node already; before this it had to be
|
|
74
|
+
* hand-translated into a tone at every call site, which is how a demo ends up
|
|
75
|
+
* with `red` on one card and `rose` on the next. `tone` still wins when it is
|
|
76
|
+
* set, so a status is a default rather than a constraint.
|
|
77
|
+
*/
|
|
78
|
+
export declare const CONNECTION_FLOW_STATUSES: readonly ["succeeded", "running", "failed", "pending", "skipped"];
|
|
79
|
+
export type ConnectionFlowStatus = (typeof CONNECTION_FLOW_STATUSES)[number];
|
|
80
|
+
export declare const STATUS_TONE: Record<ConnectionFlowStatus, TrueColor>;
|
|
81
|
+
/**
|
|
82
|
+
* Glyph for a status, used only when the node names no icon of its own.
|
|
83
|
+
*
|
|
84
|
+
* A status that showed as colour alone would be invisible to anyone who
|
|
85
|
+
* cannot separate emerald from rose, and `pending` and `skipped` share a tone
|
|
86
|
+
* outright — the same reason `MultiSelectPills` offers a check mark.
|
|
87
|
+
*/
|
|
88
|
+
export declare const STATUS_ICON: Record<ConnectionFlowStatus, string>;
|
|
89
|
+
/** Alias used where a tone is threaded through helpers. */
|
|
90
|
+
export type TrueColorLike = TrueColor;
|
|
91
|
+
/** How an item shows its progress. */
|
|
92
|
+
export declare const CONNECTION_FLOW_ITEM_PROGRESS: readonly ["none", "bar", "spinner"];
|
|
93
|
+
export type ConnectionFlowItemProgress = (typeof CONNECTION_FLOW_ITEM_PROGRESS)[number];
|
|
94
|
+
/**
|
|
95
|
+
* One row inside a node card.
|
|
96
|
+
*
|
|
97
|
+
* Deliberately a fixed shape rather than free content: the layout is pure, so
|
|
98
|
+
* a card's height has to be arithmetic, and a list of known parts can be
|
|
99
|
+
* measured where a caller-supplied template cannot. A node that needs
|
|
100
|
+
* arbitrary content uses the template slot and declares its own `height`.
|
|
101
|
+
*/
|
|
102
|
+
export interface ConnectionFlowNodeItem {
|
|
103
|
+
id: string;
|
|
104
|
+
title: string;
|
|
105
|
+
subtitle?: string;
|
|
106
|
+
/** Registry icon name. A spinner takes this slot while progress is running. */
|
|
107
|
+
icon?: string;
|
|
108
|
+
/** Picks the tone and, with no icon, the glyph — as it does on a node. */
|
|
109
|
+
status?: ConnectionFlowStatus;
|
|
110
|
+
tone?: TrueColor;
|
|
111
|
+
/** 0–1. */
|
|
112
|
+
progress?: number;
|
|
113
|
+
/** Where that progress is drawn. Defaults to the node's `itemProgress`. */
|
|
114
|
+
progressType?: ConnectionFlowItemProgress;
|
|
115
|
+
}
|
|
116
|
+
export interface ConnectionFlowNode {
|
|
117
|
+
id: string;
|
|
118
|
+
title?: string;
|
|
119
|
+
subtitle?: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
/** Registry icon name. A node icon in canvas mode must be a name, not a node. */
|
|
122
|
+
icon?: string;
|
|
123
|
+
/**
|
|
124
|
+
* What happened to this step. Picks the tone and, when the node names no
|
|
125
|
+
* icon, the glyph — and implies `active` for `running` and `skipped` for
|
|
126
|
+
* `skipped`, so the semantics are stated once rather than three times.
|
|
127
|
+
*/
|
|
128
|
+
status?: ConnectionFlowStatus;
|
|
129
|
+
/** Overrides whatever tone `status` would have chosen. */
|
|
130
|
+
tone?: TrueColor;
|
|
131
|
+
/** Currently executing — drives the flow animation and the pulse. */
|
|
132
|
+
active?: boolean;
|
|
133
|
+
/** 0–1. Draws the node's own progress indicator. */
|
|
134
|
+
progress?: number;
|
|
135
|
+
/** Overrides the flow-level progress indicator for this node. */
|
|
136
|
+
progressType?: ConnectionFlowProgressType;
|
|
137
|
+
/** Bypassed — a arc is drawn over it from its last live predecessor. */
|
|
138
|
+
skipped?: boolean;
|
|
139
|
+
/** Emits no edge to the following node. */
|
|
140
|
+
terminal?: boolean;
|
|
141
|
+
/** How this node attaches to the flow. @default "step" */
|
|
142
|
+
kind?: ConnectionFlowNodeKind;
|
|
143
|
+
/**
|
|
144
|
+
* Which parallel column this lane belongs to.
|
|
145
|
+
*
|
|
146
|
+
* Consecutive `parallel` nodes form one column, which left no way to put two
|
|
147
|
+
* multi-lane columns next to each other — five lanes in a row became one
|
|
148
|
+
* column of five rather than three lanes feeding two. A change of `group`
|
|
149
|
+
* starts a new column. Nodes that do not set it all share the same
|
|
150
|
+
* (undefined) group, so a single run behaves exactly as before.
|
|
151
|
+
*/
|
|
152
|
+
group?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Rows inside the card, below the title and subtitle.
|
|
155
|
+
*
|
|
156
|
+
* Measurable, unlike the template slot — which is why they are a fixed shape
|
|
157
|
+
* and why a card built from them needs no declared height.
|
|
158
|
+
*/
|
|
159
|
+
items?: ConnectionFlowNodeItem[];
|
|
160
|
+
/** Where an item's progress is drawn, unless the item overrides it. */
|
|
161
|
+
itemProgress?: ConnectionFlowItemProgress;
|
|
162
|
+
/**
|
|
163
|
+
* Rows shown before the "show more" row appears. Overrides the flow's
|
|
164
|
+
* `maxVisibleItems`.
|
|
165
|
+
*/
|
|
166
|
+
maxItems?: number;
|
|
167
|
+
/** Nodes hanging vertically below this one. */
|
|
168
|
+
children?: ConnectionFlowNode[];
|
|
169
|
+
/** Config for the edge leading *into* this node. */
|
|
170
|
+
connector?: ConnectionFlowConnectorConfig;
|
|
171
|
+
/**
|
|
172
|
+
* Exact card height, in px.
|
|
173
|
+
*
|
|
174
|
+
* A caller-supplied body cannot be measured — the layout is pure, and the
|
|
175
|
+
* card's silhouette has to exist before the first paint — so a templated
|
|
176
|
+
* node says how much room it needs and its content scrolls inside that.
|
|
177
|
+
* Ignored for a node whose body is built from `items`, which is measurable.
|
|
178
|
+
*/
|
|
179
|
+
height?: number;
|
|
180
|
+
/**
|
|
181
|
+
* Caps the card's height and scrolls the body past it.
|
|
182
|
+
*
|
|
183
|
+
* A measurable body (`items`, or a title and subtitle) can outgrow the room
|
|
184
|
+
* you want to give it; this is how you say so without having to work out the
|
|
185
|
+
* exact height yourself. Ignored when `height` is set, which is already
|
|
186
|
+
* exact.
|
|
187
|
+
*/
|
|
188
|
+
maxHeight?: number;
|
|
189
|
+
/**
|
|
190
|
+
* Whether the body scrolls. Defaults to true when the card is capped —
|
|
191
|
+
* a cap with no scroll is content you have hidden rather than contained.
|
|
192
|
+
*/
|
|
193
|
+
scrollable?: boolean;
|
|
194
|
+
/** Excluded from hit-testing, hover and selection. */
|
|
195
|
+
disabled?: boolean;
|
|
196
|
+
/** Arbitrary payload handed back on click and hover. */
|
|
197
|
+
data?: unknown;
|
|
198
|
+
}
|
|
199
|
+
export interface LaidOutNode {
|
|
200
|
+
id: string;
|
|
201
|
+
node: ConnectionFlowNode;
|
|
202
|
+
/**
|
|
203
|
+
* The card's silhouette: a rounded rectangle detouring around each of its
|
|
204
|
+
* ports. The card is painted from this path rather than from a CSS border,
|
|
205
|
+
* because a terminal is the node bulging — no chord across it, and the same
|
|
206
|
+
* fill inside — which no border can express.
|
|
207
|
+
*/
|
|
208
|
+
outline: string;
|
|
209
|
+
x: number;
|
|
210
|
+
y: number;
|
|
211
|
+
width: number;
|
|
212
|
+
height: number;
|
|
213
|
+
/** Y of the horizontal connection point, relative to the node's own top. */
|
|
214
|
+
anchorY: number;
|
|
215
|
+
/** Column index on the main track. */
|
|
216
|
+
column: number;
|
|
217
|
+
/** Depth below the main track: 0 for the track itself. */
|
|
218
|
+
depth: number;
|
|
219
|
+
tone: TrueColor;
|
|
220
|
+
/**
|
|
221
|
+
* Whether this card's body scrolls. Resolved in the layout, because the
|
|
222
|
+
* answer depends on the height it was measured to — not something a
|
|
223
|
+
* renderer should work out for itself, twice.
|
|
224
|
+
*/
|
|
225
|
+
scrollable: boolean;
|
|
226
|
+
}
|
|
227
|
+
export interface LaidOutEdge {
|
|
228
|
+
id: string;
|
|
229
|
+
fromId: string | null;
|
|
230
|
+
toId: string;
|
|
231
|
+
state: ConnectionState;
|
|
232
|
+
/** Waypoints in layout space, for label placement and measurement. */
|
|
233
|
+
points: {
|
|
234
|
+
x: number;
|
|
235
|
+
y: number;
|
|
236
|
+
}[];
|
|
237
|
+
/**
|
|
238
|
+
* The SVG path. The travelling dots follow this same string, so the dots
|
|
239
|
+
* and the line they sit on can never disagree about the route.
|
|
240
|
+
*/
|
|
241
|
+
d: string;
|
|
242
|
+
sourceTone: TrueColor;
|
|
243
|
+
targetTone: TrueColor;
|
|
244
|
+
/** A bypass arc travels *over* skipped nodes rather than between neighbours. */
|
|
245
|
+
bypass: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Position in its source's emission round-robin, and how many edges share
|
|
248
|
+
* that round-robin.
|
|
249
|
+
*
|
|
250
|
+
* A source releases one dot at a time — to its first target, then its
|
|
251
|
+
* second, and so on before coming round again — so a fan reads as a source
|
|
252
|
+
* feeding its targets in turn rather than as a swarm of independent streams.
|
|
253
|
+
* Only animated edges take a slot.
|
|
254
|
+
*/
|
|
255
|
+
emitIndex: number;
|
|
256
|
+
emitCount: number;
|
|
257
|
+
/**
|
|
258
|
+
* The longest route in that round-robin, in px.
|
|
259
|
+
*
|
|
260
|
+
* The cycle is a property of the *group*, not of one edge: derive it from
|
|
261
|
+
* each edge's own length and a group containing one long route falls out of
|
|
262
|
+
* step with itself. Sizing it to the longest route keeps the rhythm shared
|
|
263
|
+
* and every dot at the same speed — the emitter simply waits for its
|
|
264
|
+
* furthest target.
|
|
265
|
+
*/
|
|
266
|
+
emitSpan: number;
|
|
267
|
+
animated: boolean;
|
|
268
|
+
label?: string;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* A terminal where one or more edges meet a node.
|
|
272
|
+
*
|
|
273
|
+
* These are layout output rather than something each edge draws for itself.
|
|
274
|
+
* When three edges fan out of one card they share a single port, and an edge
|
|
275
|
+
* that painted its own endpoints stamped three identical rings on that one
|
|
276
|
+
* spot — which the highlight then dimmed three times over, so a "dimmed"
|
|
277
|
+
* connector came out darker than a lit one.
|
|
278
|
+
*/
|
|
279
|
+
export interface LaidOutConnector {
|
|
280
|
+
id: string;
|
|
281
|
+
/** The node this connector sits on. */
|
|
282
|
+
nodeId: string;
|
|
283
|
+
x: number;
|
|
284
|
+
y: number;
|
|
285
|
+
/** Which border of the node it sits on. */
|
|
286
|
+
side: PortSide;
|
|
287
|
+
tone: TrueColor;
|
|
288
|
+
/** The liveliest state among the edges meeting here. */
|
|
289
|
+
state: ConnectionState;
|
|
290
|
+
/** Something is flowing through this terminal. */
|
|
291
|
+
active: boolean;
|
|
292
|
+
/** Edges meeting here, so the path highlight dims a connector with them. */
|
|
293
|
+
edgeIds: string[];
|
|
294
|
+
/** Radius of the border's bulge, in px. */
|
|
295
|
+
radius: number;
|
|
296
|
+
}
|
|
297
|
+
export interface ConnectionFlowLayout {
|
|
298
|
+
nodes: LaidOutNode[];
|
|
299
|
+
edges: LaidOutEdge[];
|
|
300
|
+
connectors: LaidOutConnector[];
|
|
301
|
+
width: number;
|
|
302
|
+
height: number;
|
|
303
|
+
/**
|
|
304
|
+
* How far the content overhangs the origin, as a negative number or zero.
|
|
305
|
+
* A bypass arc lifts above `y = 0`, so a renderer that starts drawing at the
|
|
306
|
+
* origin clips it; shifting by this puts the whole graph back in view.
|
|
307
|
+
*/
|
|
308
|
+
offsetX: number;
|
|
309
|
+
offsetY: number;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Every number the node body is built from, per shared control size.
|
|
313
|
+
*
|
|
314
|
+
* One table, read by both the arithmetic and the CSS. The previous version
|
|
315
|
+
* declared `padding`, `title` and `body` and nothing read them: the renderers
|
|
316
|
+
* hardcoded `padding: 10`, `text-[13px]` and `text-[11px]`, so an `xs` flow and
|
|
317
|
+
* an `xl` flow had identical type and inset while only the box changed size.
|
|
318
|
+
* That was cosmetic while a card held two fixed lines. It is structural the
|
|
319
|
+
* moment a card holds a measured list, because the height the layout computes
|
|
320
|
+
* and the height the DOM renders have to be the same number.
|
|
321
|
+
*/
|
|
322
|
+
export interface NodeMetrics {
|
|
323
|
+
width: number;
|
|
324
|
+
/** Inset on all four sides. */
|
|
325
|
+
padding: number;
|
|
326
|
+
/** Title type size and the line box it occupies. */
|
|
327
|
+
title: number;
|
|
328
|
+
titleLine: number;
|
|
329
|
+
/** Subtitle and description type size, and their line box. */
|
|
330
|
+
body: number;
|
|
331
|
+
bodyLine: number;
|
|
332
|
+
/** Space between the header, the item list and a progress bar. */
|
|
333
|
+
gap: number;
|
|
334
|
+
/** Space between one item and the next. */
|
|
335
|
+
itemGap: number;
|
|
336
|
+
/** The leading glyph box — an icon, or the spinner that replaces it. */
|
|
337
|
+
glyph: number;
|
|
338
|
+
/**
|
|
339
|
+
* Control size for that glyph. Restricted to the range where `CustomIcon`
|
|
340
|
+
* and `ProgressSpinner` render the same px (16 / 20 / 24), so a spinner can
|
|
341
|
+
* take the icon's place without the row shifting under it.
|
|
342
|
+
*/
|
|
343
|
+
glyphSize: ControlSize;
|
|
344
|
+
/** Control size for a progress bar, and the height it actually renders at. */
|
|
345
|
+
barSize: ControlSize;
|
|
346
|
+
barHeight: number;
|
|
347
|
+
/** The "show more" row. */
|
|
348
|
+
moreRow: number;
|
|
349
|
+
/** A card holding a title and a subtitle and nothing else. Derived. */
|
|
350
|
+
height: number;
|
|
351
|
+
}
|
|
352
|
+
export declare const NODE_METRICS: Record<ControlSize, NodeMetrics>;
|
|
353
|
+
export interface ConnectionFlowLayoutOptions {
|
|
354
|
+
/**
|
|
355
|
+
* Everything the card body is built from. Held whole rather than copied
|
|
356
|
+
* field by field, so the layout and the renderers measure from one table.
|
|
357
|
+
*/
|
|
358
|
+
metrics: NodeMetrics;
|
|
359
|
+
connectorWidth: number;
|
|
360
|
+
/** Vertical gap between stacked parallel nodes. */
|
|
361
|
+
laneGap: number;
|
|
362
|
+
/** Vertical gap between a node and its children. */
|
|
363
|
+
childGap: number;
|
|
364
|
+
/** Horizontal indent for child nodes. */
|
|
365
|
+
childIndent: number;
|
|
366
|
+
edgeStyle: ConnectionFlowEdgeStyle;
|
|
367
|
+
/** Corner radius on an orthogonal edge. */
|
|
368
|
+
cornerRadius: number;
|
|
369
|
+
/** How far above everything in the way a bypass arc travels. */
|
|
370
|
+
bypassLift: number;
|
|
371
|
+
/** Default size of the border bulge where an edge meets a node. */
|
|
372
|
+
ringSize: ConnectionFlowRingSize;
|
|
373
|
+
/** Rows a card shows before the rest collapse behind "show more". */
|
|
374
|
+
maxVisibleItems: number;
|
|
375
|
+
/** Where an item draws its progress, unless the item or its node says. */
|
|
376
|
+
itemProgress: ConnectionFlowItemProgress;
|
|
377
|
+
/** Corner radius of a node card, in px. Drives the outline path. */
|
|
378
|
+
nodeCornerRadius: number;
|
|
379
|
+
padding: number;
|
|
380
|
+
}
|
|
381
|
+
export declare const DEFAULT_LAYOUT_OPTIONS: ConnectionFlowLayoutOptions;
|
|
382
|
+
export declare const NODE_CORNER_RADIUS: Record<SurfaceCorner, number>;
|
|
383
|
+
/** The node's tone: its own if set, else its status's, else neutral. */
|
|
384
|
+
export declare const nodeTone: (node: ConnectionFlowNode | undefined) => TrueColor;
|
|
385
|
+
/** The node's glyph: its own if set, else its status's. */
|
|
386
|
+
export declare const nodeIcon: (node: ConnectionFlowNode | undefined) => string | undefined;
|
|
387
|
+
/** Whether the node is executing. `status: "running"` implies it. */
|
|
388
|
+
export declare const nodeIsActive: (node: ConnectionFlowNode | undefined) => boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Whether the node is bypassed. Tri-state on purpose: `undefined` means "no
|
|
391
|
+
* opinion", which is what lets `autoState` infer it, while an explicit
|
|
392
|
+
* `skipped: false` overrides even `status: "skipped"`.
|
|
393
|
+
*/
|
|
394
|
+
export declare const nodeIsSkipped: (node: ConnectionFlowNode | undefined) => boolean | undefined;
|