diff --git a/packages/blog-ui/package.json b/packages/blog-ui/package.json index dc689c857..8a0c45c2a 100644 --- a/packages/blog-ui/package.json +++ b/packages/blog-ui/package.json @@ -1,6 +1,6 @@ { "name": "@omars-lab/blog-ui", - "version": "0.7.1", + "version": "0.7.2", "description": "Reusable React components for design/blog posts: animated UX Walkthrough, Mockup frame, Gif animated-media figure, DiagramWithFootnotes, Assumption highlight, and the question-set set (SectionBanner, Question card+modal with power badges, PowerLegend).", "license": "MIT", "repository": { diff --git a/packages/blog-ui/src/components/MindMap/index.tsx b/packages/blog-ui/src/components/MindMap/index.tsx index 43918983f..74f0921e7 100644 --- a/packages/blog-ui/src/components/MindMap/index.tsx +++ b/packages/blog-ui/src/components/MindMap/index.tsx @@ -92,18 +92,30 @@ const MindMap: React.FC = ({ {connectors.map((c, i) => ( - + + {/* Wide, invisible hit-area so the thin connector is easy to + hover: an SVG stroke only receives pointer events on its + visible width. This transparent path sits under the visible + one; hovering anywhere on the group highlights the line. The + linked nodes render AFTER (on top), so they stay clickable. */} + ))} diff --git a/packages/blog-ui/src/components/MindMap/styles.module.css b/packages/blog-ui/src/components/MindMap/styles.module.css index 80c7aeb60..8cc46da11 100644 --- a/packages/blog-ui/src/components/MindMap/styles.module.css +++ b/packages/blog-ui/src/components/MindMap/styles.module.css @@ -75,6 +75,25 @@ html[data-theme='dark'] .themeBlog { stroke: var(--bopmind-connector); fill: none; stroke-linecap: round; + transition: stroke var(--duration-fast, 0.12s) var(--ease-standard, ease), + stroke-width var(--duration-fast, 0.12s) var(--ease-standard, ease); +} +/* Invisible, fat pointer target under the thin visible connector. transparent + (not none) so it still receives pointer events. Never animated. */ +.connectorHit { + stroke: transparent; + stroke-width: 16; + stroke-linecap: round; + fill: none; + pointer-events: stroke; +} +/* Hovering anywhere on the connector group (its fat hit-area or the visible + line) highlights the visible connector. Color only : the visible connector's + stroke-width is an inline style (it tapers per depth) and would win over a + class rule, so we tint instead of thicken. The tint to the node-border color + reads clearly against the pale connector. */ +.connectorG:hover .connector { + stroke: var(--bopmind-node-border); } /* ---- Nodes ---- */ diff --git a/packages/blog-ui/src/components/UseCaseDiagram/index.tsx b/packages/blog-ui/src/components/UseCaseDiagram/index.tsx index 8f51107cc..87c89d43d 100644 --- a/packages/blog-ui/src/components/UseCaseDiagram/index.tsx +++ b/packages/blog-ui/src/components/UseCaseDiagram/index.tsx @@ -173,11 +173,24 @@ const UseCaseDiagram: React.FC = ({ {rLinks.map((l, i) => ( + {/* Wide, invisible hit-area so the thin link is easy to hover: + an SVG stroke only receives pointer events on its visible + width. This transparent line sits under the visible one and + captures the hover for the whole link group. */}