@import "tailwindcss/theme"; @import "tailwindcss/utilities"; @import "@xyflow/react/dist/style.css"; @import "./studio/node-card.css"; @source "../src/**/*.{js,ts,jsx,tsx}"; @source "../src/safelist.txt"; /** * EventCatalog Visualizer Theme Variables * * These CSS variables provide theming support for the visualizer. * They can be customized by the consuming application. */ :root { /* Accent of the host catalog theme (used by the canvas toolbar) */ --ec-catalog-accent: 79 70 229; /* Background colors */ --ec-page-bg: 255, 255, 255; --ec-card-bg: 255, 255, 255; /* Text colors */ --ec-page-text: 17, 24, 39; --ec-page-text-muted: 55, 65, 81; /* Border colors */ --ec-page-border: 229, 231, 235; /* Accent colors */ --ec-accent: 79, 70, 229; --ec-accent-subtle: 238, 242, 255; --ec-accent-text: 255, 255, 255; /* Button colors */ --ec-button-bg: 79, 70, 229; --ec-button-text: 255, 255, 255; /* Icon colors */ --ec-icon-color: 107, 114, 128; --ec-icon-hover: 79, 70, 229; /* Input colors */ --ec-input-bg: 255, 255, 255; --ec-input-border: 209, 213, 219; --ec-input-text: 17, 24, 39; /* Group/Domain node colors (full rgba values for inline style compat) */ --ec-group-border: #c2b5f5; --ec-group-bg: rgba(250, 248, 255, 0.35); --ec-group-header-bg: rgba(237, 233, 254, 0.7); --ec-group-text: #6550b9; /* Minimap: each resource's colour (utils/minimap.ts) */ --ec-minimap-event: 239, 95, 0; --ec-minimap-command: 5, 136, 240; --ec-minimap-query: 43, 154, 102; --ec-minimap-service: 207, 56, 151; --ec-minimap-channel: 141, 141, 141; --ec-minimap-data: 51, 88, 212; --ec-minimap-agent: 7, 151, 185; --ec-minimap-view: 0, 162, 199; --ec-minimap-message-group: 101, 77, 196; --ec-minimap-system: 110, 86, 207; --ec-minimap-external: 131, 71, 185; --ec-minimap-domain: 255, 197, 61; --ec-minimap-actor: 255, 186, 24; --ec-minimap-flow: 13, 155, 138; --ec-minimap-entity: 0, 144, 255; --ec-minimap-note: 233, 193, 98; --ec-minimap-other: 187, 187, 187; } /* Dark mode theme — Vercel's neutral greys, as EventCatalog core's themes */ [data-theme="dark"] { /* Background colors */ --ec-page-bg: 17, 17, 17; /* #111111 — dark canvas, a step above the app's #0a0a0a pages so it reads as its own surface */ --ec-card-bg: 28, 28, 28; /* #1c1c1c — node surfaces a step above the canvas */ /* Text colors */ --ec-page-text: 237, 237, 237; /* #ededed */ --ec-page-text-muted: 161, 161, 161; /* #a1a1a1 */ /* Border colors */ --ec-page-border: 46, 46, 46; /* #2e2e2e */ /* Accent colors */ --ec-accent: 192, 132, 252; /* #c084fc (purple-400) */ --ec-accent-subtle: 88, 28, 135; /* purple-900 */ --ec-accent-text: 216, 180, 254; /* #d8b4fe (purple-300) */ /* Button colors */ --ec-button-bg: 147, 51, 234; /* #9333ea */ --ec-button-text: 255, 255, 255; /* Icon colors */ --ec-icon-color: 161, 161, 161; /* #a1a1a1 */ --ec-icon-hover: 237, 237, 237; /* #ededed */ /* Input colors */ --ec-input-bg: 17, 17, 17; /* #111111 */ --ec-input-border: 46, 46, 46; /* #2e2e2e */ --ec-input-text: 237, 237, 237; /* #ededed */ /* Group/Domain node colors — deep purple on dark */ --ec-group-border: #654dc4; --ec-group-bg: #1e1533; --ec-group-header-bg: #2d1f4e; --ec-group-text: #be93e4; /* Minimap: each resource's colour, lighter on dark */ --ec-minimap-event: 236, 148, 85; --ec-minimap-command: 94, 177, 239; --ec-minimap-query: 91, 185, 139; --ec-minimap-service: 221, 147, 194; --ec-minimap-channel: 187, 187, 187; --ec-minimap-data: 141, 164, 239; --ec-minimap-agent: 61, 185, 207; --ec-minimap-view: 125, 206, 220; --ec-minimap-message-group: 194, 181, 245; --ec-minimap-system: 170, 153, 236; --ec-minimap-external: 190, 147, 228; --ec-minimap-domain: 226, 163, 54; --ec-minimap-actor: 255, 197, 61; --ec-minimap-flow: 83, 185, 171; --ec-minimap-entity: 142, 200, 246; --ec-minimap-note: 255, 186, 24; --ec-minimap-other: 141, 141, 141; } /* Hide download button on small screens without emitting a global .hidden rule */ .ec-download-btn { display: none; } /* Base styles for visualizer container */ .eventcatalog-visualizer { /* Ensure the container itself has dimensions (scoped utilities only apply to descendants) */ width: 100%; height: 100%; display: flex; flex-direction: column; background-color: rgb(var(--ec-page-bg)); /* Light-mode canvas: a neutral off-white (Vercel's #fafafa), with soft dots */ --ec-page-bg: 250, 250, 250; --ec-bg-dots: #cfcfcf; --ec-edge-stroke: #6b7280; --ec-service-node-bg: #fef7fb; --ec-event-node-bg: #fff8f5; --ec-command-node-bg: #f5f8ff; --ec-query-node-bg: #f5fdf8; --ec-channel-node-bg: #f8f8f9; --ec-data-node-bg: #f5f8ff; --ec-dp-node-bg: #f7f5ff; --ec-external-node-bg: #faf5ff; --ec-actor-node-bg: #fffdf5; --ec-custom-node-bg: #f8fbff; --ec-message-group-node-bg: #f9f5ff; --ec-deprecated-stripe: rgba(229, 72, 77, 0.3); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .eventcatalog-visualizer img { margin: 0; background-color: transparent; } /* * Scoped dark mode overrides for the visualizer. * Higher specificity ensures these win over the consuming app's * global [data-theme="dark"] variables, giving the visualizer * its own lighter canvas + lifted card surfaces. */ [data-theme="dark"] .eventcatalog-visualizer { /* Vercel's neutral greys: a #111111 canvas (a step above the app's #0a0a0a pages), cards a step lighter (#1c1c1c) */ --ec-bg-dots: #404040; --ec-edge-stroke: #6e7681; --ec-page-bg: 17, 17, 17; --ec-card-bg: 28, 28, 28; --ec-page-border: 46, 46, 46; --ec-page-text: 237, 237, 237; --ec-page-text-muted: 212, 212, 212; --ec-service-node-bg: rgb(28, 28, 28); --ec-event-node-bg: rgb(28, 28, 28); --ec-command-node-bg: rgb(28, 28, 28); --ec-query-node-bg: rgb(28, 28, 28); --ec-channel-node-bg: rgb(28, 28, 28); --ec-data-node-bg: rgb(28, 28, 28); --ec-dp-node-bg: rgb(28, 28, 28); --ec-external-node-bg: rgb(28, 28, 28); --ec-actor-node-bg: rgb(28, 28, 28); --ec-custom-node-bg: rgb(28, 28, 28); --ec-message-group-node-bg: rgb(28, 28, 28); --ec-deprecated-stripe: rgba(229, 72, 77, 0.25); --ec-input-bg: 17, 17, 17; --ec-input-border: 46, 46, 46; --ec-input-text: 237, 237, 237; --ec-accent: 192, 132, 252; --ec-accent-subtle: 88, 28, 135; --ec-accent-text: 216, 180, 254; --ec-button-bg: 147, 51, 234; --ec-button-text: 255, 255, 255; --ec-icon-color: 161, 161, 161; --ec-icon-hover: 237, 237, 237; } /* Node handle glow (shared across all node types): a ring around each handle, in the colour set by --ec-glow ("r, g, b", see HANDLE_GLOW), pulsing out on the node hovered or selected. Paused while panning/dragging. */ .ec-handle-glow::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(var(--ec-glow), 0.5); pointer-events: none; } /* The ring pulses on the node under the pointer or selected: a pulse on every handle all the time costs a style recalc and paint on every frame (Chrome doesn't composite it), for every node on the canvas */ .react-flow__node:hover .ec-handle-glow::after, .react-flow__node.selected .ec-handle-glow::after { animation: ec-handle-glow 2s ease-in-out infinite; } @keyframes ec-handle-glow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.7); opacity: 0; } } .ec-interaction-active .ec-handle-glow::after { animation-play-state: paused; } /* The step the flow walkthrough is on: ringed in the accent colour, glowing and raised above its neighbours, with a slow pulse radiating out from it (transform and opacity only, so it runs on the compositor) */ .react-flow__node.ec-walkthrough-current { z-index: 1000 !important; } .react-flow__node.ec-walkthrough-current::before, .react-flow__node.ec-walkthrough-current::after { content: ""; position: absolute; inset: -10px; border-radius: 16px; border: 3px solid rgb(var(--ec-accent)); pointer-events: none; } .react-flow__node.ec-walkthrough-current::before { box-shadow: 0 0 0 6px color-mix(in srgb, rgb(var(--ec-accent)) 18%, transparent), 0 0 40px 8px color-mix(in srgb, rgb(var(--ec-accent)) 45%, transparent); } .react-flow__node.ec-walkthrough-current::after { animation: ec-walkthrough-pulse 1.6s ease-out infinite; } @keyframes ec-walkthrough-pulse { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.12); opacity: 0; } } .ec-interaction-active .react-flow__node.ec-walkthrough-current::after { animation-play-state: paused; } @keyframes ec-svc-msg-in { 0% { transform: translateX(-18px) scale(0.7); opacity: 0; } 30% { opacity: 0.7; } 70% { opacity: 0.7; } 100% { transform: translateX(0) scale(0.5); opacity: 0; } } @keyframes ec-svc-msg-out { 0% { transform: translateX(0) scale(0.5); opacity: 0; } 30% { opacity: 0.7; } 70% { opacity: 0.7; } 100% { transform: translateX(18px) scale(0.7); opacity: 0; } } /* ReactFlow customizations */ .react-flow { background-color: #fafafa !important; /* neutral off-white (Vercel's) — light mode default */ } [data-theme="dark"] .react-flow { background-color: rgb(var(--ec-page-bg)) !important; } .react-flow__node { cursor: pointer; } /* Smooth transition when expanding/collapsing message groups */ .ec-animating-layout .react-flow__node { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); } /* Nodes and edges added or removed when changing the level of detail */ .react-flow__node.ec-enter, .react-flow__edge.ec-enter { animation: ec-fade-in 0.5s ease-out; } /* Animations rather than transitions: leaving nodes and edges move to the end of the graph, and a moved element doesn't transition */ .react-flow__node.ec-exit, .react-flow__edge.ec-exit { animation: ec-fade-out 0.4s ease-in forwards; } /* Kept out of sight while the graph's first layout is worked out */ .react-flow.ec-laying-out .react-flow__viewport { opacity: 0; } /* A group shrinking back into the node it expanded from */ .react-flow__node.ec-morph-exit { animation: ec-fade-out 0.5s ease-in forwards; } /* Highlighting cross-domain communication (canvas toolbar): edges to or from other domains stand out in the accent colour, the rest fade back */ .react-flow.ec-highlight-cross-domain .react-flow__edge:not(:has(.ec-cross-domain)), .react-flow.ec-highlight-cross-domain .ec-edge-label:not(.ec-cross-domain) { opacity: 0.15; } .react-flow.ec-highlight-cross-domain .react-flow__edge-path.ec-cross-domain { stroke: rgb(var(--ec-catalog-accent, 79 70 229)) !important; stroke-width: 3px !important; } .react-flow.ec-highlight-cross-domain .ec-edge-label.ec-cross-domain { border-color: rgb(var(--ec-catalog-accent, 79 70 229)) !important; color: rgb(var(--ec-catalog-accent, 79 70 229)) !important; } @keyframes ec-fade-out { from { opacity: 1; } to { opacity: 0; } } @keyframes ec-fade-in { from { opacity: 0; } to { opacity: 1; } } .react-flow__edge-path { stroke: var(--ec-edge-stroke, #6b7280) !important; stroke-width: 1.5 !important; transition: stroke-width 0.15s ease; } /* A channel's edge to its dead letter channel: red (DEAD_LETTER_COLOR), dashed, an error path. Red only while it isn't hovered, highlighted by a hovered node or selected, so those highlight it like any other edge (this rule is more specific than theirs). */ .react-flow__edge.ec-dead-letter-edge .react-flow__edge-path { stroke-dasharray: 6 4; } .react-flow__edge.ec-dead-letter-edge:not(:hover):not(.ec-node-hover-edge):not(.selected) .react-flow__edge-path { stroke: #ef4444 !important; } [data-theme="dark"] .react-flow__edge.ec-dead-letter-edge:not(:hover):not(.ec-node-hover-edge):not(.selected) .react-flow__edge-path { stroke: #f87171 !important; } .react-flow__edges marker[id*="ef4444"] path { fill: #ef4444; stroke: #ef4444; } [data-theme="dark"] .react-flow__edges marker[id*="ef4444"] path { fill: #f87171; stroke: #f87171; } /* Widen the invisible interaction area for edges */ .react-flow__edge-interaction { stroke-width: 40 !important; cursor: pointer; } /* Highlight the entire edge on hover — "electricity flowing" effect */ .react-flow__edge:hover .react-flow__edge-path, .ec-node-hover-edge .react-flow__edge-path { stroke: #2563eb !important; stroke-width: 4 !important; filter: drop-shadow(0 0 8px #2563eb) !important; opacity: 1 !important; stroke-dasharray: 5 5 !important; animation: ec-edge-dash 0.5s linear infinite !important; } /* Bold the edge label on hover */ .react-flow__edge:hover text, .ec-node-hover-edge text { font-weight: 700 !important; font-size: 12px !important; } .react-flow__edge:hover .react-flow__edge-textbg, .ec-node-hover-edge .react-flow__edge-textbg { fill-opacity: 1 !important; } /* Edge label rendered via EdgeLabelRenderer (HTML) */ .react-flow__edge:hover + .react-flow__edgelabel-renderer > div, .react-flow__edge.ec-node-hover-edge + .react-flow__edgelabel-renderer > div { font-weight: 700 !important; } [data-theme="dark"] .react-flow__edge:hover .react-flow__edge-path, [data-theme="dark"] .ec-node-hover-edge .react-flow__edge-path { stroke: #00d9ff !important; filter: drop-shadow(0 0 8px #00d9ff) !important; } @keyframes ec-edge-dash { to { stroke-dashoffset: -10; } } /* A node that shows its card when clicked (a domain or system box: its header), while it's hovered */ .react-flow__node.ec-node-clickable, .ec-node-clickable[data-ec-container-header] { cursor: pointer; } /* Pulse the border of source/target nodes when an edge is hovered */ .ec-edge-hover-node { outline: 3px solid #2563eb !important; outline-offset: 2px; border-radius: 12px !important; animation: ec-node-pulse 1s ease-in-out infinite !important; } @keyframes ec-node-pulse { 0%, 100% { outline-color: rgba(37, 99, 235, 0.8); } 50% { outline-color: rgba(37, 99, 235, 0.2); } } [data-theme="dark"] .ec-edge-hover-node { outline-color: #00d9ff !important; animation-name: ec-node-pulse-dark !important; } @keyframes ec-node-pulse-dark { 0%, 100% { outline-color: rgba(0, 217, 255, 0.8); } 50% { outline-color: rgba(0, 217, 255, 0.2); } } /* Edge label theming for default ReactFlow edges */ .react-flow__edge-textbg { fill: rgb(var(--ec-page-bg)); } .react-flow__edge-text { fill: rgb(var(--ec-page-text)); } /* The zoom controls: neutral, as Vercel's (as the toolbar): muted icons that come forward on a grey when hovered */ .react-flow__controls { background-color: rgb(var(--ec-card-bg)) !important; border: 1px solid rgb(var(--ec-page-border)) !important; border-radius: 8px !important; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -8px rgba(0, 0, 0, 0.18) !important; overflow: hidden; } .react-flow__controls-button { background-color: rgb(var(--ec-card-bg)) !important; color: rgb(var(--ec-page-text-muted)) !important; border-bottom: 1px solid rgb(var(--ec-page-border)) !important; transition: background-color 150ms; } .react-flow__controls-button svg { fill: rgb(var(--ec-page-text-muted)) !important; } .react-flow__controls-button:hover { background-color: color-mix(in srgb, rgb(var(--ec-page-text)) 6%, rgb(var(--ec-card-bg))) !important; } .react-flow__controls-button:hover svg { fill: rgb(var(--ec-page-text)) !important; } /* Notes modal close button */ .ec-notes-close-btn { width: 30px; height: 30px; border-radius: 8px; border: none; background: rgba(0, 0, 0, 0.04); display: flex; align-items: center; justify-content: center; cursor: pointer; color: #94a3b8; flex-shrink: 0; transition: background 0.15s, color 0.15s; } .ec-notes-close-btn:hover { background: rgba(0, 0, 0, 0.08); color: #475569; } /* Hide animated message envelopes/circles during user interaction (drag/pan/zoom), while their SMIL is paused */ .ec-interaction-active .ec-animated-msg { visibility: hidden; } /* React Flow dashes and animates (dashdraw) every path in an edge marked animated: not the envelopes, which would be dashed and repainted on every frame */ .react-flow__edge.animated .ec-animated-msg path { animation: none; stroke-dasharray: none; } /* ...and the edges' own dashes stop while the canvas moves (the envelopes' SMIL is paused with pauseEdgeAnimations: CSS can't pause it) */ .ec-interaction-active .react-flow__edge.animated path { animation-play-state: paused; } /* Minimap: the diagram in miniature (DiagramMiniMap, utils/minimap.ts): each node in its resource's colour, and containers (domains, systems, groups) outlined in theirs, with what's in them inside */ .react-flow__minimap { background-color: rgb(var(--ec-card-bg)); border: 1px solid rgb(var(--ec-page-border)); --xy-minimap-mask-background-color: rgba(var(--ec-page-text), 0.08); } .ec-minimap-node { fill: rgb(var(--ec-minimap-color)); } .ec-minimap-container { fill: rgba(var(--ec-minimap-color), 0.08); stroke: rgb(var(--ec-minimap-color)); stroke-width: 1.5px; vector-effect: non-scaling-stroke; } /* External systems are dashed outlines, as on the diagram */ .ec-minimap-external { stroke: rgb(var(--ec-minimap-color)); stroke-width: 1.5px; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; } .ec-minimap-external:not(.ec-minimap-container) { fill: rgba(var(--ec-minimap-color), 0.25); } .ec-minimap-event { --ec-minimap-color: var(--ec-minimap-event); } .ec-minimap-command { --ec-minimap-color: var(--ec-minimap-command); } .ec-minimap-query { --ec-minimap-color: var(--ec-minimap-query); } .ec-minimap-service { --ec-minimap-color: var(--ec-minimap-service); } .ec-minimap-channel { --ec-minimap-color: var(--ec-minimap-channel); } .ec-minimap-data { --ec-minimap-color: var(--ec-minimap-data); } .ec-minimap-agent { --ec-minimap-color: var(--ec-minimap-agent); } .ec-minimap-view { --ec-minimap-color: var(--ec-minimap-view); } .ec-minimap-message-group { --ec-minimap-color: var(--ec-minimap-message-group); } .ec-minimap-system { --ec-minimap-color: var(--ec-minimap-system); } .ec-minimap-external { --ec-minimap-color: var(--ec-minimap-external); } .ec-minimap-domain { --ec-minimap-color: var(--ec-minimap-domain); } .ec-minimap-actor { --ec-minimap-color: var(--ec-minimap-actor); } .ec-minimap-flow { --ec-minimap-color: var(--ec-minimap-flow); } .ec-minimap-entity { --ec-minimap-color: var(--ec-minimap-entity); } .ec-minimap-note { --ec-minimap-color: var(--ec-minimap-note); } .ec-minimap-other { --ec-minimap-color: var(--ec-minimap-other); }