@elabs-ai/components-flow 4.0.0

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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +79 -0
  3. package/dist/index.d.ts +634 -0
  4. package/dist/index.js +1577 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +68 -0
  7. package/src/canvas-shell/canvas-shell.stories.tsx +77 -0
  8. package/src/canvas-shell/canvas-shell.test.tsx +106 -0
  9. package/src/canvas-shell/canvas-shell.tsx +128 -0
  10. package/src/canvas-shell/index.ts +1 -0
  11. package/src/flow-button-edge/flow-button-edge.stories.tsx +151 -0
  12. package/src/flow-button-edge/flow-button-edge.test.tsx +99 -0
  13. package/src/flow-button-edge/flow-button-edge.tsx +80 -0
  14. package/src/flow-button-edge/index.ts +5 -0
  15. package/src/flow-edge/flow-edge.stories.tsx +79 -0
  16. package/src/flow-edge/flow-edge.test.tsx +76 -0
  17. package/src/flow-edge/flow-edge.tsx +34 -0
  18. package/src/flow-edge/index.ts +1 -0
  19. package/src/flow-floating-edge/floating-edge-geometry.test.ts +100 -0
  20. package/src/flow-floating-edge/floating-edge-geometry.ts +128 -0
  21. package/src/flow-floating-edge/flow-floating-edge.stories.tsx +81 -0
  22. package/src/flow-floating-edge/flow-floating-edge.tsx +82 -0
  23. package/src/flow-floating-edge/index.ts +6 -0
  24. package/src/flow-group-node/flow-group-node.stories.tsx +283 -0
  25. package/src/flow-group-node/flow-group-node.test.tsx +100 -0
  26. package/src/flow-group-node/flow-group-node.tsx +134 -0
  27. package/src/flow-group-node/index.ts +6 -0
  28. package/src/flow-layout/flow-layout.stories.tsx +215 -0
  29. package/src/flow-layout/flow-layout.test.tsx +133 -0
  30. package/src/flow-layout/flow-layout.ts +104 -0
  31. package/src/flow-layout/index.ts +14 -0
  32. package/src/flow-layout/layout-graph.test.ts +257 -0
  33. package/src/flow-layout/layout-graph.ts +302 -0
  34. package/src/flow-layout/use-auto-layout.ts +26 -0
  35. package/src/flow-layout/use-flow-layout.ts +60 -0
  36. package/src/flow-mini-map/flow-mini-map.stories.tsx +74 -0
  37. package/src/flow-mini-map/flow-mini-map.test.tsx +56 -0
  38. package/src/flow-mini-map/flow-mini-map.tsx +29 -0
  39. package/src/flow-mini-map/index.ts +1 -0
  40. package/src/flow-node/flow-node.stories.tsx +143 -0
  41. package/src/flow-node/flow-node.test.tsx +156 -0
  42. package/src/flow-node/flow-node.tsx +190 -0
  43. package/src/flow-node/index.ts +8 -0
  44. package/src/flow-placeholder-node/flow-placeholder-node.stories.tsx +260 -0
  45. package/src/flow-placeholder-node/flow-placeholder-node.test.tsx +101 -0
  46. package/src/flow-placeholder-node/flow-placeholder-node.tsx +49 -0
  47. package/src/flow-placeholder-node/index.ts +5 -0
  48. package/src/flow-smart-edge/flow-smart-edge.stories.tsx +75 -0
  49. package/src/flow-smart-edge/flow-smart-edge.tsx +75 -0
  50. package/src/flow-smart-edge/index.ts +9 -0
  51. package/src/flow-smart-edge/smart-edge-geometry.test.ts +120 -0
  52. package/src/flow-smart-edge/smart-edge-geometry.ts +116 -0
  53. package/src/helper-lines/get-helper-lines.ts +98 -0
  54. package/src/helper-lines/helper-lines.stories.tsx +107 -0
  55. package/src/helper-lines/helper-lines.test.tsx +78 -0
  56. package/src/helper-lines/helper-lines.tsx +67 -0
  57. package/src/helper-lines/index.ts +7 -0
  58. package/src/helper-lines/use-helper-lines.ts +109 -0
  59. package/src/index.ts +37 -0
  60. package/src/inspector-panel/index.ts +1 -0
  61. package/src/inspector-panel/inspector-panel.stories.tsx +161 -0
  62. package/src/inspector-panel/inspector-panel.test.tsx +82 -0
  63. package/src/inspector-panel/inspector-panel.tsx +129 -0
  64. package/src/legend/index.ts +1 -0
  65. package/src/legend/legend.stories.tsx +56 -0
  66. package/src/legend/legend.test.tsx +46 -0
  67. package/src/legend/legend.tsx +39 -0
  68. package/src/templates-flow-workspace.stories.tsx +169 -0
  69. package/src/use-flow-groups/group-operations.test.ts +318 -0
  70. package/src/use-flow-groups/group-operations.ts +349 -0
  71. package/src/use-flow-groups/index.ts +13 -0
  72. package/src/use-flow-groups/use-flow-groups.ts +113 -0
  73. package/src/zoom-controls/index.ts +1 -0
  74. package/src/zoom-controls/zoom-controls.stories.tsx +68 -0
  75. package/src/zoom-controls/zoom-controls.test.tsx +80 -0
  76. package/src/zoom-controls/zoom-controls.tsx +78 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Manuel Reimitz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ <!-- brand-ui:gen:readme:start -->
2
+ <!-- Generated by scripts/gen-package-readmes.mjs — do not edit inside these markers. -->
3
+
4
+ # `@elabs-ai/components-flow`
5
+
6
+ > Branded React Flow canvas, nodes, edges, controls, inspector.
7
+
8
+ Part of **brand-ui**, a source-owned, token-driven React component system.
9
+ These packages are **private** and are not published to any registry — they are
10
+ consumed from this workspace. See `docs/CONSUMING.md`.
11
+
12
+ ## Install
13
+
14
+ Inside this monorepo the packages resolve as workspace dependencies:
15
+
16
+ ```json
17
+ "@elabs-ai/components-flow": "workspace:*"
18
+ ```
19
+
20
+ ## Set up styling (do not skip)
21
+
22
+ Components are Tailwind v4 classes backed by semantic tokens. Two lines in
23
+ your CSS entry, or **everything renders unstyled** — the single most common
24
+ mistake:
25
+
26
+ ```css
27
+ @import "@elabs-ai/components-tokens/styles.css";
28
+ @source "../node_modules/@elabs-ai/components-flow/dist";
29
+ ```
30
+
31
+ The `@source` line is required because Tailwind ignores `node_modules`. Add
32
+ one per brand-ui package you render. Then wrap your app once:
33
+
34
+ ```tsx
35
+ import { ThemeProvider } from "@elabs-ai/components-tokens";
36
+
37
+ <ThemeProvider defaultTheme="light">{children}</ThemeProvider>;
38
+ ```
39
+
40
+ ## This package specifically
41
+
42
+ - `@xyflow/react` is a peer — it carries the React context `useReactFlow` reads, so two copies break.
43
+ - Import `"@xyflow/react/dist/style.css"` once.
44
+
45
+ ## What's in it
46
+
47
+ 23 exported components — including `Background`, `CanvasShell`, `Controls`, `FLOW_ALL_SIDE_HANDLES`, `FLOW_GROUP_NODE_TYPE`.
48
+
49
+ Don't guess the API — ask the CLI:
50
+
51
+ ```bash
52
+ pnpm add -D @elabs-ai/components-cli
53
+ pnpm exec brand-ui search <query> # find a component
54
+ pnpm exec brand-ui docs <Name> # its real props, from source
55
+ ```
56
+
57
+ ## Using an AI coding agent?
58
+
59
+ For Claude Code, install the plugin from this repo's checkout:
60
+
61
+ ```
62
+ /plugin marketplace add .
63
+ /plugin install brand-ui
64
+ ```
65
+
66
+ `brand-ui docs <Name>` returns intent, composition, state→token mappings and
67
+ anti-patterns — tell your agent to run it instead of guessing a prop. The CLI
68
+ also runs as an MCP server (`brand-ui mcp`).
69
+
70
+ ## Full guide
71
+
72
+ Tailwind and Next.js wiring, per-package extras, agent enablement and a
73
+ prompt for migrating an existing project: `docs/CONSUMING.md`.
74
+
75
+ ## License
76
+
77
+ UNLICENSED — private.
78
+
79
+ <!-- brand-ui:gen:readme:end -->