@beehexa/design-rules 2611.5.4 → 2611.5.5
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/catalog.json
CHANGED
|
@@ -1336,8 +1336,8 @@
|
|
|
1336
1336
|
"status": "active",
|
|
1337
1337
|
"releasePhase": null,
|
|
1338
1338
|
"planned": [],
|
|
1339
|
-
"body": "\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1340
|
-
"raw": "---\ntitle: VueFlow theme\ndescription: Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.\norder: 5\n---\n\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1339
|
+
"body": "\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1340
|
+
"raw": "---\ntitle: VueFlow theme\ndescription: Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.\norder: 5\n---\n\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1341
1341
|
"frontmatter": {
|
|
1342
1342
|
"title": "VueFlow theme",
|
|
1343
1343
|
"description": "Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.",
|
|
@@ -130,6 +130,16 @@ The same host accepts `data-bh-large-text="true"` and
|
|
|
130
130
|
1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.
|
|
131
131
|
Keep actual user preference bindings; do not duplicate descendant CSS locally.
|
|
132
132
|
|
|
133
|
+
Native `WorkflowViewer` consumers use `.bh-workflow-canvas` with
|
|
134
|
+
`data-bh-contrast="high"`. Its companion recipe strengthens node boundaries,
|
|
135
|
+
descriptive text, edges and arrowheads with theme-resolved strong text ink.
|
|
136
|
+
Selection and error paint retain their separate meanings; focus uses the accent
|
|
137
|
+
outline width. Removing the attribute restores the base recipe, and changing
|
|
138
|
+
theme while enabled resolves the new theme's ink without remounting the graph.
|
|
139
|
+
Keep navigator and accessibility actions in the viewer's native `#dock` extension
|
|
140
|
+
slot alongside its built-in controls rather than replacing the dock.
|
|
141
|
+
|
|
142
|
+
|
|
133
143
|
## Edges, controls and export
|
|
134
144
|
|
|
135
145
|
`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke
|
package/dist/index.js
CHANGED
|
@@ -1337,8 +1337,8 @@ export const catalog = [
|
|
|
1337
1337
|
"status": "active",
|
|
1338
1338
|
"releasePhase": null,
|
|
1339
1339
|
"planned": [],
|
|
1340
|
-
"body": "\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1341
|
-
"raw": "---\ntitle: VueFlow theme\ndescription: Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.\norder: 5\n---\n\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1340
|
+
"body": "\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1341
|
+
"raw": "---\ntitle: VueFlow theme\ndescription: Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.\norder: 5\n---\n\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Operational categories are not statuses\n\n`flow.category.*` identifies the existing product's node kinds: task blue, dependency red,\ntransformation green, validation deep red, push step gold, decision cyan, loop magenta and\ngrouped nodes purple. These categorical identities must not be interpreted as success,\nfailure or warning. Keep the node's type label and icon; colour is never its sole identity.\nA category colour does not certify the state of an execution.\n\nEach category supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and\n`getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical\napplication-owned palettes, alpha overlays, gradients and palette-adjustment functions.\nNever append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.\nFor a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the\npublic `style` prop and omit `color`. This cached immutable recipe pairs the\ncategory foreground/background/border instead of putting native white text on a\nframe/edge stroke. The canonical contrast check includes all eight small-text\ncategory pairs in both themes at WCAG AA 4.5:1; the native family demonstrates\ntheir actual paint. Decision foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite category identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,\nspacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,\nlabels, handles, accessibility semantics and events in the application. Meaningful loading\nindicators may move; decorative node entrances, pulsing identities, rotating idle icons,\nhover transforms, flowing edge dashes, gradients and glass are not part of the theme.\n\nCustom semantic category content uses `getFlowCategoryStyles(type, part?)`;\n`foreground` sets category text, `border` sets border colour and `background`\nsets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,\nwhose default colour is category border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`edge-dependency|edge-transformation` preserve their categorical identity.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle category icon.\n\nFor a labelled relationship indicator use `bh-flow-category-mark` and\n`data-bh-category=\"<FlowCategory>\"`: the source owns its `space.075` circular\ngeometry and categorical border-colour fill. A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\n`NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped\noperational matrix is: task, task dependency, task transformation and task data **450×130**;\nthree groups **350×130**; validation, transformation and push step **200×130**;\ndecision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation\ncards with individual transformation steps. Rendering, layout and half-dimension centering\nmust use the same source. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Category adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nControls round exposed button corners without clipping focus. Connector logos\nretain their nested `radius.075` (6 px). Decision and loop nodes keep their true\ncircular geometry, as do connection handles; edge-routing radius remains path\ngeometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;\ndialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke\nand marker, keeps other edge data, and disables decorative traversal motion. The application\nmay retain dashed lines to communicate transformation or conditional semantics. The custom\nedge renderer must consume the supplied stroke rather than replace it with an unrelated\nedge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.\n\nCustom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ncategory fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static\nrelation dashes (solid dependency; dashed transformation/conditional/dataFlow).\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing\ntarget type through `data.nodeType` before the task-category fallback.\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not\n`z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and category semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
1342
1342
|
"frontmatter": {
|
|
1343
1343
|
"title": "VueFlow theme",
|
|
1344
1344
|
"description": "Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.",
|