mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
97 lines
5.3 KiB
TypeScript
97 lines
5.3 KiB
TypeScript
/**
|
|
* Workflow Editor Icons
|
|
* SVG path data and icon components for the workflow editor
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
/**
|
|
* SVG path data for node icons
|
|
*/
|
|
const ICON_PATHS: Record<string, string> = {
|
|
globe: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z',
|
|
clock: 'M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z',
|
|
hand: 'M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z',
|
|
send: 'M2.01 21L23 12 2.01 3 2 10l15 2-15 2z',
|
|
code: 'M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z',
|
|
variable: 'M3 5h2V3H3zm4 14h2v-2H7zm0-4h2v-2H7zm0-4h2V9H7zm0-4h2V5H7zm4 12h2v-2h-2zm4-12h2V5h-2zm4 12h2v-2h-2zm0-8h2V9h-2zm0-4h2V5h-2z',
|
|
split: 'M14 4l2.29 2.29-2.88 2.88 1.42 1.42 2.88-2.88L20 10V4h-6zm-4 0H4v6l2.29-2.29 4.71 4.7V20h2v-8.41l-5.29-5.3L10 4z',
|
|
shuffle: 'M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z',
|
|
merge: 'M17 20.41L18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z',
|
|
'file-input': 'M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11zm-9.18-6.95L7.4 14.46 10.94 18l5.66-5.66-1.41-1.41-4.24 4.24-2.13-2.12z',
|
|
'file-output': 'M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11zM8.82 13.05L7.4 14.46 10.94 18l5.66-5.66-1.41-1.41-4.24 4.24-2.13-2.12z',
|
|
transform: 'M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z',
|
|
mail: 'M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z',
|
|
};
|
|
|
|
/**
|
|
* Get SVG path data for a node icon
|
|
*/
|
|
export const getNodeIcon = (iconName: string): string => {
|
|
return ICON_PATHS[iconName] || ICON_PATHS.code;
|
|
};
|
|
|
|
/**
|
|
* Back navigation icon
|
|
*/
|
|
export const BackIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 20, height: 20, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z' })
|
|
);
|
|
|
|
/**
|
|
* Zoom out icon
|
|
*/
|
|
export const ZoomOutIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 18, height: 18, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z' })
|
|
);
|
|
|
|
/**
|
|
* Zoom in icon
|
|
*/
|
|
export const ZoomInIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 18, height: 18, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm.5-7H9v2H7v1h2v2h1v-2h2V9h-2z' })
|
|
);
|
|
|
|
/**
|
|
* Reset/refresh icon
|
|
*/
|
|
export const ResetIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 18, height: 18, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z' })
|
|
);
|
|
|
|
/**
|
|
* Play/execute icon
|
|
*/
|
|
export const PlayIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M8 5v14l11-7z' })
|
|
);
|
|
|
|
/**
|
|
* Chevron down icon for collapsible sections
|
|
*/
|
|
export const ChevronDownIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z' })
|
|
);
|
|
|
|
/**
|
|
* Notification bell icon
|
|
*/
|
|
export const NotificationIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 20, height: 20, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z' })
|
|
);
|
|
|
|
/**
|
|
* Warning/error icon
|
|
*/
|
|
export const WarningIcon = (): React.ReactElement =>
|
|
React.createElement('svg', { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'currentColor' },
|
|
React.createElement('path', { d: 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z' })
|
|
);
|