@procaaso/alphinity-ui-components 1.0.0 → 1.0.2

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/index.d.cts CHANGED
@@ -1,52 +1,17 @@
1
- import React from 'react';
1
+ import * as react from 'react';
2
+ import react__default from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
5
+ import * as _emotion_styled from '@emotion/styled';
6
+ import * as _emotion_react from '@emotion/react';
7
+ import * as _mui_system from '@mui/system';
8
+ import * as _mui_material from '@mui/material';
2
9
 
3
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
10
+ interface ButtonProps extends react__default.ButtonHTMLAttributes<HTMLButtonElement> {
4
11
  variant?: 'primary' | 'secondary';
5
- children: React.ReactNode;
12
+ children: react__default.ReactNode;
6
13
  }
7
- declare const Button: React.FC<ButtonProps>;
8
-
9
- interface ValueEntryProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
10
- /** Current value */
11
- value: number | string;
12
- /** Callback when value changes */
13
- onChange: (value: number | string) => void;
14
- /** Unit of measurement to display */
15
- unit?: string;
16
- /** Status state for visual feedback */
17
- status?: 'normal' | 'alarm' | 'warning' | 'disabled';
18
- /** Minimum allowed value (for numeric inputs) */
19
- min?: number;
20
- /** Maximum allowed value (for numeric inputs) */
21
- max?: number;
22
- /** Number of decimal places (for numeric inputs) */
23
- precision?: number;
24
- /** Input type - numeric or text */
25
- inputType?: 'numeric' | 'text';
26
- /** Label for the input */
27
- label?: string;
28
- /** Whether the input is read-only */
29
- readOnly?: boolean;
30
- }
31
- declare const ValueEntry: React.FC<ValueEntryProps>;
32
-
33
- interface StatusIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
34
- /** Status state determining color and behavior */
35
- status: 'off' | 'normal' | 'alarm' | 'warning' | 'active' | 'fault';
36
- /** Size of the indicator */
37
- size?: 'small' | 'medium' | 'large';
38
- /** Animation behavior */
39
- animation?: 'none' | 'pulse' | 'blink' | 'flash';
40
- /** Label text to display next to indicator */
41
- label?: string;
42
- /** Position of label relative to indicator */
43
- labelPosition?: 'left' | 'right' | 'top' | 'bottom';
44
- /** Shape of the indicator */
45
- shape?: 'circle' | 'square' | 'diamond';
46
- /** Whether the indicator should have a 3D LED effect */
47
- led?: boolean;
48
- }
49
- declare const StatusIndicator: React.FC<StatusIndicatorProps>;
14
+ declare const Button: react__default.FC<ButtonProps>;
50
15
 
51
16
  interface SelectorOption {
52
17
  /** Unique value for the option */
@@ -58,7 +23,7 @@ interface SelectorOption {
58
23
  /** Optional description for tooltip or additional context */
59
24
  description?: string;
60
25
  }
61
- interface SelectorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
26
+ interface SelectorProps extends Omit<react__default.HTMLAttributes<HTMLDivElement>, 'onChange'> {
62
27
  /** Currently selected value */
63
28
  value: string;
64
29
  /** Callback when selection changes */
@@ -78,7 +43,7 @@ interface SelectorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onCh
78
43
  /** Whether the dropdown should open upward */
79
44
  dropdownUp?: boolean;
80
45
  }
81
- declare const Selector: React.FC<SelectorProps>;
46
+ declare const Selector: react__default.FC<SelectorProps>;
82
47
 
83
48
  interface ModeConfig {
84
49
  /** Units for this mode */
@@ -104,7 +69,7 @@ interface ModeConfig {
104
69
  /** Precision for second setpoint */
105
70
  secondPrecision?: number;
106
71
  }
107
- interface ControlPanelProps extends React.HTMLAttributes<HTMLDivElement> {
72
+ interface ControlPanelProps extends react__default.HTMLAttributes<HTMLDivElement> {
108
73
  /** Panel title/identifier */
109
74
  title: string;
110
75
  /** Currently selected mode */
@@ -156,7 +121,300 @@ interface ControlPanelProps extends React.HTMLAttributes<HTMLDivElement> {
156
121
  /** Custom stop button text */
157
122
  stopButtonText?: string;
158
123
  }
159
- declare const ControlPanel: React.FC<ControlPanelProps>;
124
+ declare const ControlPanel: react__default.FC<ControlPanelProps>;
125
+
126
+ interface StatusIndicatorProps extends react__default.HTMLAttributes<HTMLDivElement> {
127
+ /** Status state determining color and behavior */
128
+ status: 'off' | 'normal' | 'alarm' | 'warning' | 'active' | 'fault';
129
+ /** Size of the indicator */
130
+ size?: 'small' | 'medium' | 'large';
131
+ /** Animation behavior */
132
+ animation?: 'none' | 'pulse' | 'blink' | 'flash';
133
+ /** Label text to display next to indicator */
134
+ label?: string;
135
+ /** Position of label relative to indicator */
136
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
137
+ /** Shape of the indicator */
138
+ shape?: 'circle' | 'square' | 'diamond';
139
+ /** Whether the indicator should have a 3D LED effect */
140
+ led?: boolean;
141
+ }
142
+ declare const StatusIndicator: react__default.FC<StatusIndicatorProps>;
143
+
144
+ interface ValueEntryProps extends Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
145
+ /** Current value */
146
+ value: number | string;
147
+ /** Callback when value changes */
148
+ onChange: (value: number | string) => void;
149
+ /** Unit of measurement to display */
150
+ unit?: string;
151
+ /** Status state for visual feedback */
152
+ status?: 'normal' | 'alarm' | 'warning' | 'disabled';
153
+ /** Minimum allowed value (for numeric inputs) */
154
+ min?: number;
155
+ /** Maximum allowed value (for numeric inputs) */
156
+ max?: number;
157
+ /** Number of decimal places (for numeric inputs) */
158
+ precision?: number;
159
+ /** Input type - numeric or text */
160
+ inputType?: 'numeric' | 'text';
161
+ /** Label for the input */
162
+ label?: string;
163
+ /** Whether the input is read-only */
164
+ readOnly?: boolean;
165
+ }
166
+ declare const ValueEntry: react__default.FC<ValueEntryProps>;
167
+
168
+ interface LegacyValueEntryProps extends Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
169
+ /** Current value */
170
+ value: number | string;
171
+ /** Callback when value changes */
172
+ onChange: (value: number | string) => void;
173
+ /** Unit of measurement to display */
174
+ unit?: string;
175
+ /** Status state for visual feedback */
176
+ status?: 'normal' | 'alarm' | 'warning' | 'disabled';
177
+ /** Minimum allowed value (for numeric inputs) */
178
+ min?: number;
179
+ /** Maximum allowed value (for numeric inputs) */
180
+ max?: number;
181
+ /** Number of decimal places (for numeric inputs) */
182
+ precision?: number;
183
+ /** Input type - numeric or text */
184
+ inputType?: 'numeric' | 'text';
185
+ /** Label for the input */
186
+ label?: string;
187
+ /** Whether the input is read-only */
188
+ readOnly?: boolean;
189
+ }
190
+ declare const LegacyValueEntry: react__default.FC<LegacyValueEntryProps>;
191
+
192
+ type DisplayMode = 'standard' | 'dashboard';
193
+ interface FullscreenContainerProps {
194
+ leftCollapsed: boolean;
195
+ rightCollapsed: boolean;
196
+ }
197
+ type OverlayTheme = 'tank' | 'pressure' | 'vessel' | 'flow';
198
+ interface SVGLockedOverlayProps {
199
+ svgX: number;
200
+ svgY: number;
201
+ children: react__default.ReactNode;
202
+ theme?: OverlayTheme;
203
+ style?: react__default.CSSProperties;
204
+ className?: string;
205
+ onClick?: () => void;
206
+ containerSelector?: string;
207
+ }
208
+ interface TrendLineProps {
209
+ values: number[];
210
+ width?: number;
211
+ height?: number;
212
+ color?: string;
213
+ strokeWidth?: number;
214
+ backgroundColor?: string;
215
+ }
216
+ interface CircularGaugeProps {
217
+ value: number;
218
+ max: number;
219
+ unit: string;
220
+ label: string;
221
+ size?: number;
222
+ color?: string;
223
+ }
224
+ interface SparklineProps {
225
+ data: number[];
226
+ width: number;
227
+ height: number;
228
+ color: string;
229
+ }
230
+ interface EquipmentIndicatorWithSparklineProps {
231
+ svgX: number;
232
+ svgY: number;
233
+ color: string;
234
+ label: string;
235
+ size?: number;
236
+ sparklineData?: number[];
237
+ sparklineOffset?: {
238
+ x: number;
239
+ y: number;
240
+ };
241
+ }
242
+ interface EquipmentIndicatorProps {
243
+ svgX: number;
244
+ svgY: number;
245
+ color: string;
246
+ label: string;
247
+ size?: number;
248
+ style?: react__default.CSSProperties;
249
+ className?: string;
250
+ }
251
+ interface FullscreenWorkspaceTab {
252
+ label: string;
253
+ value: string;
254
+ content: react__default.ReactNode;
255
+ }
256
+ interface FullscreenWorkspaceProps extends react__default.HTMLAttributes<HTMLDivElement> {
257
+ svgContent: react__default.ReactNode;
258
+ overlays?: react__default.ReactNode;
259
+ leftPanel?: react__default.ReactNode;
260
+ rightPanel?: react__default.ReactNode;
261
+ footer?: react__default.ReactNode;
262
+ tabs?: FullscreenWorkspaceTab[];
263
+ activeTab?: string;
264
+ onTabChange?: (value: string) => void;
265
+ defaultLeftCollapsed?: boolean;
266
+ defaultRightCollapsed?: boolean;
267
+ leftCollapsed?: boolean;
268
+ rightCollapsed?: boolean;
269
+ onLeftCollapseChange?: (collapsed: boolean) => void;
270
+ onRightCollapseChange?: (collapsed: boolean) => void;
271
+ displayMode?: DisplayMode;
272
+ defaultDisplayMode?: DisplayMode;
273
+ onDisplayModeChange?: (mode: DisplayMode) => void;
274
+ showDisplayModeToggle?: boolean;
275
+ showZoomControls?: boolean;
276
+ onZoomIn?: () => void;
277
+ onZoomOut?: () => void;
278
+ onResetZoom?: () => void;
279
+ zoomDisabled?: boolean;
280
+ }
281
+
282
+ declare const FullscreenContainer: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
283
+ theme?: _emotion_react.Theme;
284
+ } & FullscreenContainerProps, {}, {}>;
285
+ declare const LeftPanel: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
286
+ theme?: _emotion_react.Theme;
287
+ } & {
288
+ collapsed: boolean;
289
+ }, {}, {}>;
290
+ declare const RightPanel: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
291
+ theme?: _emotion_react.Theme;
292
+ } & {
293
+ collapsed: boolean;
294
+ }, {}, {}>;
295
+ declare const SVGArea: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
296
+ theme?: _emotion_react.Theme;
297
+ }, {}, {}>;
298
+ declare const LeftToggleButton: _emotion_styled.StyledComponent<_mui_material.IconButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children" | "className" | "disabled" | "style" | "tabIndex" | "color" | "size" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "loading" | "loadingIndicator"> & {
299
+ theme?: _emotion_react.Theme;
300
+ } & {
301
+ collapsed: boolean;
302
+ }, {}, {}>;
303
+ declare const RightToggleButton: _emotion_styled.StyledComponent<_mui_material.IconButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children" | "className" | "disabled" | "style" | "tabIndex" | "color" | "size" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "loading" | "loadingIndicator"> & {
304
+ theme?: _emotion_react.Theme;
305
+ } & {
306
+ collapsed: boolean;
307
+ }, {}, {}>;
308
+ declare const DisplayModeToggle: _emotion_styled.StyledComponent<_mui_material.IconButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children" | "className" | "disabled" | "style" | "tabIndex" | "color" | "size" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "loading" | "loadingIndicator"> & {
309
+ theme?: _emotion_react.Theme;
310
+ } & {
311
+ mode: DisplayMode;
312
+ }, {}, {}>;
313
+ declare const ZoomControls: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
314
+ theme?: _emotion_react.Theme;
315
+ }, {}, {}>;
316
+ declare const ZoomButton: _emotion_styled.StyledComponent<_mui_material.IconButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children" | "className" | "disabled" | "style" | "tabIndex" | "color" | "size" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "loading" | "loadingIndicator"> & {
317
+ theme?: _emotion_react.Theme;
318
+ }, {}, {}>;
319
+ declare const FooterPanel: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
320
+ theme?: _emotion_react.Theme;
321
+ }, {}, {}>;
322
+ declare const PanelTabs: _emotion_styled.StyledComponent<_mui_material.TabsOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "variant" | "children" | "className" | "value" | "style" | "aria-label" | "aria-labelledby" | "onChange" | "sx" | "classes" | "action" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "orientation" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar" | "slots" | "slotProps"> & {
323
+ theme?: _emotion_react.Theme;
324
+ }, {}, {}>;
325
+ declare const PanelContent: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
326
+ theme?: _emotion_react.Theme;
327
+ }, {}, {}>;
328
+ declare const FixedSVGContainer: _emotion_styled.StyledComponent<{
329
+ theme?: _emotion_react.Theme;
330
+ as?: React.ElementType;
331
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
332
+ declare const ScrollableSVGWrapper: _emotion_styled.StyledComponent<{
333
+ theme?: _emotion_react.Theme;
334
+ as?: React.ElementType;
335
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
336
+
337
+ declare const baseOverlayStyles: {
338
+ readonly tank: {
339
+ readonly background: "linear-gradient(135deg, rgba(69, 90, 120, 0.95) 0%, rgba(52, 73, 94, 0.95) 100%)";
340
+ readonly border: "1px solid #455a64";
341
+ readonly color: "white";
342
+ readonly borderRadius: "4px";
343
+ readonly fontSize: "12px";
344
+ readonly fontWeight: "500";
345
+ readonly textAlign: "center";
346
+ readonly padding: "8px";
347
+ readonly minWidth: "60px";
348
+ readonly boxShadow: "0 1px 4px rgba(69, 90, 120, 0.2)";
349
+ };
350
+ readonly pressure: {
351
+ readonly background: "linear-gradient(135deg, rgba(30, 50, 90, 0.75) 0%, rgba(20, 35, 70, 0.75) 100%)";
352
+ readonly border: "1px solid #1e3a8a";
353
+ readonly color: "white";
354
+ readonly borderRadius: "4px";
355
+ readonly fontSize: "11px";
356
+ readonly fontWeight: "500";
357
+ readonly textAlign: "center";
358
+ readonly padding: "6px";
359
+ readonly minWidth: "50px";
360
+ readonly boxShadow: "0 1px 4px rgba(30, 50, 90, 0.15)";
361
+ };
362
+ readonly vessel: {
363
+ readonly background: "linear-gradient(135deg, rgba(84, 110, 122, 0.95) 0%, rgba(69, 90, 100, 0.95) 100%)";
364
+ readonly border: "1px solid #546e7a";
365
+ readonly color: "white";
366
+ readonly borderRadius: "4px";
367
+ readonly fontSize: "13px";
368
+ readonly fontWeight: "500";
369
+ readonly textAlign: "center";
370
+ readonly padding: "8px";
371
+ readonly minWidth: "70px";
372
+ readonly boxShadow: "0 1px 4px rgba(84, 110, 122, 0.2)";
373
+ };
374
+ readonly flow: {
375
+ readonly background: "linear-gradient(135deg, rgba(102, 125, 102, 0.95) 0%, rgba(85, 107, 85, 0.95) 100%)";
376
+ readonly border: "1px solid #689f38";
377
+ readonly color: "white";
378
+ readonly borderRadius: "4px";
379
+ readonly fontSize: "11px";
380
+ readonly fontWeight: "500";
381
+ readonly textAlign: "center";
382
+ readonly padding: "5px";
383
+ readonly minWidth: "60px";
384
+ readonly boxShadow: "0 1px 4px rgba(102, 125, 102, 0.2)";
385
+ };
386
+ };
387
+ declare const overlayStyles: Record<OverlayTheme, typeof baseOverlayStyles[OverlayTheme]>;
388
+ declare const SVGLockedOverlay: ({ svgX, svgY, children, theme, style, className, onClick, containerSelector, }: SVGLockedOverlayProps) => react_jsx_runtime.JSX.Element;
389
+ declare const DashboardCard: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
390
+ theme?: _emotion_react.Theme;
391
+ } & {
392
+ svgX: number;
393
+ svgY: number;
394
+ cardType?: string;
395
+ }, {}, {}>;
396
+ declare const CardHeader: _emotion_styled.StyledComponent<{
397
+ theme?: _emotion_react.Theme;
398
+ as?: React.ElementType;
399
+ } & {
400
+ color?: string;
401
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
402
+ declare const CardValue: _emotion_styled.StyledComponent<{
403
+ theme?: _emotion_react.Theme;
404
+ as?: React.ElementType;
405
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
406
+ declare const CardUnit: _emotion_styled.StyledComponent<{
407
+ theme?: _emotion_react.Theme;
408
+ as?: React.ElementType;
409
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
410
+
411
+ declare const TrendLine: ({ values, width, height, color, strokeWidth, backgroundColor, }: TrendLineProps) => react_jsx_runtime.JSX.Element;
412
+ declare const CircularGauge: ({ value, max, unit, label, size, color, }: CircularGaugeProps) => react_jsx_runtime.JSX.Element;
413
+ declare const Sparkline: ({ data, width, height, color }: SparklineProps) => react_jsx_runtime.JSX.Element | null;
414
+ declare const EquipmentIndicatorWithSparkline: ({ svgX, svgY, color, label, size, sparklineData, sparklineOffset, }: EquipmentIndicatorWithSparklineProps) => react_jsx_runtime.JSX.Element;
415
+ declare const EquipmentIndicator: ({ svgX, svgY, color, label, size, style, className, }: EquipmentIndicatorProps) => react_jsx_runtime.JSX.Element;
416
+
417
+ declare function FullscreenWorkspace({ svgContent, overlays, leftPanel, rightPanel, footer, tabs, activeTab, onTabChange, defaultLeftCollapsed, defaultRightCollapsed, leftCollapsed: leftCollapsedProp, rightCollapsed: rightCollapsedProp, onLeftCollapseChange, onRightCollapseChange, displayMode, defaultDisplayMode, onDisplayModeChange, showDisplayModeToggle, showZoomControls, onZoomIn, onZoomOut, onResetZoom, zoomDisabled, className, ...rest }: FullscreenWorkspaceProps): react__default.ReactElement;
160
418
 
161
419
  type Theme = 'modern' | 'hmi';
162
420
  interface ThemeContextType {
@@ -166,16 +424,690 @@ interface ThemeContextType {
166
424
  }
167
425
  declare const useTheme: () => ThemeContextType;
168
426
  interface ThemeProviderProps {
169
- children: React.ReactNode;
427
+ children: react__default.ReactNode;
170
428
  }
171
- declare const ThemeProvider: React.FC<ThemeProviderProps>;
429
+ declare const ThemeProvider: react__default.FC<ThemeProviderProps>;
172
430
 
173
- interface ThemeToggleProps extends React.HTMLAttributes<HTMLDivElement> {
431
+ interface ThemeToggleProps extends react__default.HTMLAttributes<HTMLDivElement> {
174
432
  /** Size of the toggle */
175
433
  size?: 'small' | 'medium' | 'large';
176
434
  /** Position of the toggle */
177
435
  position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'inline';
178
436
  }
179
- declare const ThemeToggle: React.FC<ThemeToggleProps>;
437
+ declare const ThemeToggle: react__default.FC<ThemeToggleProps>;
438
+
439
+ interface NodeInstance {
440
+ id: string;
441
+ symbolId: string;
442
+ transform: Transform;
443
+ ports?: PortInstance[];
444
+ visible?: boolean;
445
+ label?: string;
446
+ labelOffset?: {
447
+ x: number;
448
+ y: number;
449
+ };
450
+ metadata?: Record<string, unknown>;
451
+ }
452
+ interface Transform {
453
+ x: number;
454
+ y: number;
455
+ rotation: number;
456
+ scale?: number;
457
+ flipX?: boolean;
458
+ flipY?: boolean;
459
+ }
460
+ interface PortInstance {
461
+ id: string;
462
+ x: number;
463
+ y: number;
464
+ type: PortType;
465
+ label?: string;
466
+ }
467
+ type PortType = 'inlet' | 'outlet' | 'control' | 'signal';
468
+
469
+ interface PipeEdge {
470
+ id: string;
471
+ fromNodeId: string;
472
+ fromPortId?: string;
473
+ toNodeId: string;
474
+ toPortId?: string;
475
+ routePoints: Point[];
476
+ visible?: boolean;
477
+ style?: PipeStyle;
478
+ label?: string;
479
+ showLabel?: boolean;
480
+ labelOffset?: {
481
+ x: number;
482
+ y: number;
483
+ };
484
+ metadata?: Record<string, unknown>;
485
+ }
486
+ interface Point {
487
+ x: number;
488
+ y: number;
489
+ }
490
+ interface PipeStyle {
491
+ stroke: string;
492
+ strokeWidth: number;
493
+ strokeDasharray?: string;
494
+ opacity?: number;
495
+ }
496
+
497
+ interface Overlay {
498
+ id: string;
499
+ type: OverlayType;
500
+ anchorType: AnchorType;
501
+ anchorId?: string;
502
+ offset: Point;
503
+ binding?: DataBinding;
504
+ content?: OverlayContent;
505
+ style?: React.CSSProperties;
506
+ }
507
+ type OverlayType = 'value' | 'label' | 'gauge' | 'trend' | 'custom';
508
+ type AnchorType = 'node' | 'pipe' | 'absolute';
509
+ interface DataBinding {
510
+ sourceType: 'tag' | 'expression' | 'static';
511
+ source: string;
512
+ format?: string;
513
+ updateInterval?: number;
514
+ transform?: string;
515
+ }
516
+ interface OverlayContent {
517
+ text?: string;
518
+ component?: string;
519
+ props?: Record<string, unknown>;
520
+ }
521
+
522
+ interface Diagram {
523
+ id: string;
524
+ name: string;
525
+ version: string;
526
+ viewBox: ViewBox;
527
+ nodes: NodeInstance[];
528
+ pipes: PipeEdge[];
529
+ overlays: Overlay[];
530
+ metadata?: DiagramMetadata;
531
+ }
532
+ interface ViewBox {
533
+ x: number;
534
+ y: number;
535
+ width: number;
536
+ height: number;
537
+ }
538
+ interface DiagramMetadata {
539
+ author?: string;
540
+ created?: string;
541
+ modified?: string;
542
+ tags?: string[];
543
+ description?: string;
544
+ }
545
+
546
+ interface SymbolDefinition {
547
+ id: string;
548
+ name: string;
549
+ category: SymbolCategory;
550
+ svgContent: string;
551
+ viewBox: ViewBox;
552
+ ports: PortDefinition[];
553
+ thumbnail?: string;
554
+ metadata?: SymbolMetadata;
555
+ }
556
+ type SymbolCategory = 'valve' | 'pump' | 'vessel' | 'heat-exchanger' | 'instrument' | 'actuator' | 'sensor' | 'other';
557
+ interface PortDefinition {
558
+ id: string;
559
+ x: number;
560
+ y: number;
561
+ type: PortType;
562
+ label?: string;
563
+ direction?: 'in' | 'out' | 'bi';
564
+ }
565
+ interface SymbolMetadata {
566
+ description?: string;
567
+ manufacturer?: string;
568
+ modelNumber?: string;
569
+ tags?: string[];
570
+ }
571
+
572
+ /**
573
+ * Status levels for telemetry values
574
+ */
575
+ type TelemetryStatus$1 = 'normal' | 'warning' | 'alarm' | 'fault' | 'off';
576
+ /**
577
+ * Live telemetry value with status
578
+ */
579
+ interface TelemetryValue {
580
+ /** Current value */
581
+ value: number | string | boolean;
582
+ /** Status/severity level */
583
+ status: TelemetryStatus$1;
584
+ /** Unit of measurement (optional) */
585
+ unit?: string;
586
+ /** Timestamp of last update */
587
+ timestamp?: number;
588
+ /** Quality indicator (0-100, where 100 is good) */
589
+ quality?: number;
590
+ }
591
+ /**
592
+ * Telemetry data binding for a node
593
+ */
594
+ interface TelemetryBinding {
595
+ /** Node ID this telemetry is bound to */
596
+ nodeId: string;
597
+ /** Tag/variable name for the telemetry source */
598
+ tag: string;
599
+ /** Current telemetry value */
600
+ value: TelemetryValue;
601
+ /** Historical values for sparkline/trend (optional) */
602
+ history?: number[];
603
+ /** Thresholds for status determination */
604
+ thresholds?: {
605
+ /** High-High threshold (value >= this triggers alarm) */
606
+ highHigh?: number;
607
+ /** High threshold (value >= this triggers warning) */
608
+ high?: number;
609
+ /** Low threshold (value <= this triggers warning) */
610
+ low?: number;
611
+ /** Low-Low threshold (value <= this triggers alarm/fault) */
612
+ lowLow?: number;
613
+ /** Custom label for high-high threshold */
614
+ highHighLabel?: string;
615
+ /** Custom label for high threshold */
616
+ highLabel?: string;
617
+ /** Custom label for low threshold */
618
+ lowLabel?: string;
619
+ /** Custom label for low-low threshold */
620
+ lowLowLabel?: string;
621
+ };
622
+ /** Custom colors for status levels */
623
+ statusColors?: {
624
+ normal?: string;
625
+ warning?: string;
626
+ alarm?: string;
627
+ fault?: string;
628
+ off?: string;
629
+ };
630
+ /** Display configuration */
631
+ display?: {
632
+ /** Show value overlay above node */
633
+ showValue?: boolean;
634
+ /** Show status indicator */
635
+ showStatus?: boolean;
636
+ /** Custom label for the value */
637
+ label?: string;
638
+ /** Number of decimal places for numeric values */
639
+ precision?: number;
640
+ /** Show sparkline trend (requires history) */
641
+ showSparkline?: boolean;
642
+ /** Sparkline color (defaults to status color) */
643
+ sparklineColor?: string;
644
+ /** Custom background color (hex code or 'status' for status-based color) */
645
+ backgroundColor?: string;
646
+ /** Custom text color for value display (hex code) */
647
+ textColor?: string;
648
+ /** Horizontal offset from node center */
649
+ offsetX?: number;
650
+ /** Vertical offset from node center */
651
+ offsetY?: number;
652
+ };
653
+ }
654
+ /**
655
+ * Map of telemetry bindings by node ID
656
+ */
657
+ type TelemetryMap = Map<string, TelemetryBinding>;
658
+
659
+ interface UseViewBoxOptions {
660
+ /** Initial viewBox configuration */
661
+ initialViewBox: ViewBox;
662
+ /** Enable pan interaction (default: true) */
663
+ enablePan?: boolean;
664
+ /** Enable zoom interaction (default: true) */
665
+ enableZoom?: boolean;
666
+ /** Minimum zoom level (smaller = more zoomed in, default: 0.1) */
667
+ minZoom?: number;
668
+ /** Maximum zoom level (larger = more zoomed out, default: 10) */
669
+ maxZoom?: number;
670
+ /** Zoom sensitivity (default: 0.001) */
671
+ zoomSensitivity?: number;
672
+ /** Allow left-click drag for panning (default: true for touch-friendly) */
673
+ allowLeftClickPan?: boolean;
674
+ }
675
+ interface UseViewBoxResult {
676
+ /** Current viewBox state */
677
+ viewBox: ViewBox;
678
+ /** Reset viewBox to initial state */
679
+ resetViewBox: () => void;
680
+ /** Zoom in (decrease viewBox size) */
681
+ zoomIn: () => void;
682
+ /** Zoom out (increase viewBox size) */
683
+ zoomOut: () => void;
684
+ /** Convert screen coordinates to world (SVG) coordinates */
685
+ screenToWorld: (screenX: number, screenY: number) => {
686
+ x: number;
687
+ y: number;
688
+ };
689
+ /** SVG element ref to attach event listeners */
690
+ svgRef: React.RefObject<SVGSVGElement | null>;
691
+ }
692
+ /**
693
+ * Custom hook for managing ViewBox state with pan and zoom interactions
694
+ *
695
+ * Pan controls:
696
+ * - Left mouse button + drag (if allowLeftClickPan=true, default)
697
+ * - Middle mouse button + drag (always)
698
+ * - Space + left mouse button + drag (always)
699
+ * - Touch drag (single finger)
700
+ *
701
+ * Zoom controls:
702
+ * - Mouse wheel (zoom to cursor position)
703
+ * - Pinch gesture (touch devices)
704
+ * - Programmatic zoomIn/zoomOut functions
705
+ */
706
+ declare function useViewBox(options: UseViewBoxOptions): UseViewBoxResult;
707
+
708
+ interface SelectionState {
709
+ /** IDs of selected nodes */
710
+ selectedNodeIds: Set<string>;
711
+ /** IDs of selected pipes */
712
+ selectedPipeIds: Set<string>;
713
+ }
714
+ interface UseSelectionOptions {
715
+ /** Allow multiple selection with Ctrl/Cmd key (default: true) */
716
+ multiSelect?: boolean;
717
+ /** Initial selection state */
718
+ initialSelection?: SelectionState;
719
+ /** Callback when selection changes */
720
+ onSelectionChange?: (selection: SelectionState) => void;
721
+ }
722
+ interface UseSelectionResult {
723
+ /** Current selection state */
724
+ selection: SelectionState;
725
+ /** Check if a node is selected */
726
+ isNodeSelected: (nodeId: string) => boolean;
727
+ /** Check if a pipe is selected */
728
+ isPipeSelected: (pipeId: string) => boolean;
729
+ /** Select a node */
730
+ selectNode: (nodeId: string, multiSelect?: boolean) => void;
731
+ /** Select a pipe */
732
+ selectPipe: (pipeId: string, multiSelect?: boolean) => void;
733
+ /** Clear all selections */
734
+ clearSelection: () => void;
735
+ /** Select multiple nodes */
736
+ selectNodes: (nodeIds: string[]) => void;
737
+ /** Select multiple pipes */
738
+ selectPipes: (pipeIds: string[]) => void;
739
+ }
740
+ /**
741
+ * Custom hook for managing selection state in P&ID diagrams
742
+ *
743
+ * Supports:
744
+ * - Single selection (click)
745
+ * - Multi-selection (Ctrl+click)
746
+ * - Programmatic selection
747
+ * - Selection callbacks
748
+ */
749
+ declare function useSelection(options?: UseSelectionOptions): UseSelectionResult;
750
+
751
+ interface UseTelemetryOptions {
752
+ /** Initial telemetry bindings */
753
+ initialBindings?: TelemetryBinding[];
754
+ /** Callback when telemetry values change */
755
+ onTelemetryChange?: (bindings: TelemetryMap) => void;
756
+ /** Auto-refresh interval in milliseconds (0 = disabled) */
757
+ refreshInterval?: number;
758
+ }
759
+ interface UseTelemetryResult {
760
+ /** Current telemetry bindings map */
761
+ telemetry: TelemetryMap;
762
+ /** Update a single telemetry value */
763
+ updateTelemetry: (nodeId: string, value: TelemetryValue) => void;
764
+ /** Update multiple telemetry values at once */
765
+ updateTelemetryBatch: (updates: Array<{
766
+ nodeId: string;
767
+ value: TelemetryValue;
768
+ history?: number[];
769
+ }>) => void;
770
+ /** Get telemetry for a specific node */
771
+ getTelemetry: (nodeId: string) => TelemetryBinding | undefined;
772
+ /** Clear all telemetry data */
773
+ clearTelemetry: () => void;
774
+ /** Set telemetry bindings */
775
+ setBindings: (bindings: TelemetryBinding[]) => void;
776
+ }
777
+ /**
778
+ * Custom hook for managing telemetry data bindings
779
+ *
780
+ * Supports:
781
+ * - Real-time value updates
782
+ * - Status monitoring (normal, warning, alarm, fault, off)
783
+ * - Batch updates for performance
784
+ * - Auto-refresh capability
785
+ * - Quality indicators
786
+ */
787
+ declare function useTelemetry(options?: UseTelemetryOptions): UseTelemetryResult;
788
+
789
+ interface DragPoint {
790
+ x: number;
791
+ y: number;
792
+ }
793
+ interface DragState {
794
+ /** Whether drag is currently active */
795
+ isDragging: boolean;
796
+ /** Initial position when drag started */
797
+ startPosition: DragPoint | null;
798
+ /** Current drag offset from start */
799
+ offset: DragPoint;
800
+ /** ID of the item being dragged */
801
+ draggedId: string | null;
802
+ }
803
+ interface UseDragOptions {
804
+ /** Callback when drag starts */
805
+ onDragStart?: (id: string, position: DragPoint) => void;
806
+ /** Callback during drag movement */
807
+ onDragMove?: (id: string, offset: DragPoint, position: DragPoint) => void;
808
+ /** Callback when drag ends */
809
+ onDragEnd?: (id: string, offset: DragPoint, finalPosition: DragPoint) => void;
810
+ /** Snap to grid size (0 = no snap) */
811
+ snapToGrid?: number;
812
+ /** Minimum drag distance before triggering (prevents accidental drags) */
813
+ dragThreshold?: number;
814
+ /** Convert screen coordinates to world coordinates */
815
+ screenToWorld?: (screenX: number, screenY: number) => DragPoint;
816
+ }
817
+ interface UseDragResult {
818
+ /** Current drag state */
819
+ dragState: DragState;
820
+ /** Start dragging an item */
821
+ startDrag: (id: string, event: React.MouseEvent | React.TouchEvent, itemPosition: DragPoint) => void;
822
+ /** Cancel current drag */
823
+ cancelDrag: () => void;
824
+ /** Check if a specific item is being dragged */
825
+ isDraggingItem: (id: string) => boolean;
826
+ }
827
+ /**
828
+ * Custom hook for drag-and-drop functionality in P&ID diagrams
829
+ *
830
+ * Supports:
831
+ * - Mouse drag
832
+ * - Touch drag
833
+ * - Snap-to-grid
834
+ * - World coordinate conversion (for SVG viewBox)
835
+ * - Drag threshold to prevent accidental drags
836
+ */
837
+ declare function useDrag(options?: UseDragOptions): UseDragResult;
838
+
839
+ interface KeyboardShortcutsOptions {
840
+ /** Callback when Delete or Backspace is pressed */
841
+ onDelete?: () => void;
842
+ /** Callback when Ctrl+C is pressed */
843
+ onCopy?: () => void;
844
+ /** Callback when Ctrl+V is pressed */
845
+ onPaste?: () => void;
846
+ /** Callback when Ctrl+Z is pressed (undo) */
847
+ onUndo?: () => void;
848
+ /** Callback when Ctrl+Y or Ctrl+Shift+Z is pressed (redo) */
849
+ onRedo?: () => void;
850
+ /** Callback when Ctrl+A is pressed (select all) */
851
+ onSelectAll?: () => void;
852
+ /** Enable keyboard shortcuts (default: true) */
853
+ enabled?: boolean;
854
+ }
855
+ /**
856
+ * Custom hook for handling keyboard shortcuts in P&ID diagrams
857
+ *
858
+ * Supported shortcuts:
859
+ * - Delete/Backspace: Delete selected items
860
+ * - Ctrl+C: Copy selected items
861
+ * - Ctrl+V: Paste copied items
862
+ * - Ctrl+Z: Undo last action
863
+ * - Ctrl+Y / Ctrl+Shift+Z: Redo
864
+ * - Ctrl+A: Select all
865
+ */
866
+ declare function useKeyboardShortcuts(options: KeyboardShortcutsOptions): void;
867
+
868
+ interface PIDCanvasFeatures {
869
+ /** Enable pan interaction (default: true) */
870
+ pan?: boolean;
871
+ /** Enable zoom interaction (default: true) */
872
+ zoom?: boolean;
873
+ /** Enable selection interaction (default: false) */
874
+ selection?: boolean;
875
+ /** Allow multi-selection with Ctrl/Cmd key (default: true) */
876
+ multiSelect?: boolean;
877
+ /** Enable telemetry data overlays (default: false) */
878
+ telemetry?: boolean;
879
+ /** Enable drag-and-drop for nodes (default: false) */
880
+ dragNodes?: boolean;
881
+ /** Snap dragged nodes to grid (0 = no snap) */
882
+ snapToGrid?: number;
883
+ /** Enable keyboard shortcuts for delete/copy/paste (default: false) */
884
+ keyboardShortcuts?: boolean;
885
+ /** Enable pipe waypoint editing (drag waypoints, add/remove) (default: false) */
886
+ editPipeRoutes?: boolean;
887
+ /** Enable dropping symbols from library to add nodes (default: false) */
888
+ allowSymbolDrop?: boolean;
889
+ /** Enable connection drawing mode to create pipes between nodes (default: false) */
890
+ connectionMode?: boolean;
891
+ }
892
+ interface PIDCanvasProps extends react__default.HTMLAttributes<HTMLDivElement> {
893
+ /** The diagram to render */
894
+ diagram: Diagram;
895
+ /** Optional className for the container */
896
+ className?: string;
897
+ /** Optional inline styles for the container */
898
+ style?: react__default.CSSProperties;
899
+ /** Enable interactive features (pan, zoom, selection, telemetry, dragNodes) */
900
+ features?: PIDCanvasFeatures;
901
+ /** Callback when selection changes */
902
+ onSelectionChange?: (selection: SelectionState) => void;
903
+ /** Callback when a node is clicked */
904
+ onNodeClick?: (nodeId: string) => void;
905
+ /** Callback when a pipe is clicked */
906
+ onPipeClick?: (pipeId: string) => void;
907
+ /** Callback when a node is moved (drag-and-drop) */
908
+ onNodeMove?: (nodeId: string, newX: number, newY: number) => void;
909
+ /** Callback when diagram changes (for internal state updates) */
910
+ onDiagramChange?: (diagram: Diagram) => void;
911
+ /** Callback when items are deleted */
912
+ onDelete?: (nodeIds: string[], pipeIds: string[]) => void;
913
+ /** Callback when items are copied (returns copied data for external storage) */
914
+ onItemsCopied?: (nodeIds: string[], pipeIds: string[]) => void;
915
+ /** Callback when paste is requested (external code should handle the paste logic) */
916
+ onPaste?: () => void;
917
+ /** Callback when a symbol is dropped onto canvas (returns symbol ID and position) */
918
+ onSymbolDrop?: (symbolId: string, position: {
919
+ x: number;
920
+ y: number;
921
+ }) => void;
922
+ /** Callback when a pipe is created via connection mode */
923
+ onPipeCreated?: (sourceNodeId: string, targetNodeId: string, sourcePortId?: string, targetPortId?: string) => void;
924
+ /** Telemetry data bindings for live values */
925
+ telemetry?: TelemetryMap;
926
+ }
927
+ /**
928
+ * PIDCanvas - Interactive canvas for rendering P&ID diagrams
929
+ *
930
+ * Features:
931
+ * - Renders nodes (PR #3) and pipes (PR #4) with static layout
932
+ * - Drag-and-drop: Drag nodes to reposition (PR #8)
933
+ *
934
+ * Future: Editing tools, symbol library UI
935
+ */
936
+ declare function PIDCanvas({ diagram, className, style, features, onSelectionChange, onNodeClick, onPipeClick, onNodeMove, onDiagramChange, onDelete, onItemsCopied, onPaste, onSymbolDrop, onPipeCreated, telemetry, ...props }: PIDCanvasProps): react__default.ReactElement;
937
+
938
+ interface SymbolLibraryProps {
939
+ /** Optional className for styling */
940
+ className?: string;
941
+ /** Callback when a symbol drag starts */
942
+ onSymbolDragStart?: (symbolId: string, event: react__default.DragEvent) => void;
943
+ /** Show category filter */
944
+ showCategories?: boolean;
945
+ /** Custom symbol categories */
946
+ categories?: string[];
947
+ }
948
+ /**
949
+ * SymbolLibrary - Browse and drag symbols onto the canvas
950
+ *
951
+ * Displays available symbols organized by category
952
+ * Supports drag-and-drop to add new nodes to diagrams
953
+ */
954
+ declare function SymbolLibrary({ className, onSymbolDragStart, showCategories, categories, }: SymbolLibraryProps): react__default.ReactElement;
955
+
956
+ interface NodeConfigPanelProps {
957
+ /** Selected node to configure */
958
+ node: NodeInstance;
959
+ /** Telemetry binding for the node (if any) */
960
+ binding: TelemetryBinding | null;
961
+ /** Callback when node properties are updated */
962
+ onUpdateNode: (updates: Partial<NodeInstance>) => void;
963
+ /** Callback when telemetry is added/updated */
964
+ onUpdateTelemetry: (updates: any) => void;
965
+ /** Callback when telemetry binding is added for the first time */
966
+ onAddTelemetry?: () => void;
967
+ /** Callback when node is removed */
968
+ onRemove: () => void;
969
+ /** Additional CSS class name */
970
+ className?: string;
971
+ /** Custom styles */
972
+ style?: react__default.CSSProperties;
973
+ }
974
+ /**
975
+ * NodeConfigPanel - Reusable configuration panel for editing node properties and telemetry
976
+ *
977
+ * @example
978
+ * ```tsx
979
+ * <NodeConfigPanel
980
+ * node={selectedNode}
981
+ * binding={telemetry.get(selectedNode.id)}
982
+ * onUpdateNode={(updates) => updateNode(selectedNode.id, updates)}
983
+ * onUpdateTelemetry={(updates) => updateTelemetryBatch([updates])}
984
+ * onRemove={() => removeNode(selectedNode.id)}
985
+ * />
986
+ * ```
987
+ */
988
+ declare function NodeConfigPanel({ node, binding, onUpdateNode, onUpdateTelemetry, onAddTelemetry, onRemove, className, style, }: NodeConfigPanelProps): react_jsx_runtime.JSX.Element;
989
+
990
+ /**
991
+ * Validates a diagram object structure
992
+ */
993
+ declare function validateDiagram(diagram: unknown): {
994
+ valid: boolean;
995
+ errors: string[];
996
+ };
997
+ /**
998
+ * Serializes a diagram to JSON string
999
+ */
1000
+ declare function exportDiagram(diagram: Diagram): string;
1001
+ /**
1002
+ * Parses a diagram from JSON string
1003
+ */
1004
+ declare function importDiagram(json: string): Diagram;
1005
+
1006
+ /**
1007
+ * Calculate the world position of a port on a node instance
1008
+ *
1009
+ * Takes into account the node's transform (position, rotation, scale, flip)
1010
+ * and the port's position within the symbol's viewBox
1011
+ */
1012
+ declare function getPortWorldPosition(node: NodeInstance, portId: string): Point | null;
1013
+ /**
1014
+ * Generate route points for a pipe from source port to destination port
1015
+ *
1016
+ * Options:
1017
+ * - direct: Straight line from source to destination
1018
+ * - orthogonal: Right-angle routing (future enhancement)
1019
+ * - custom: Provide your own waypoints
1020
+ */
1021
+ declare function generateRoutePoints(fromNode: NodeInstance, fromPortId: string, toNode: NodeInstance, toPortId: string, options?: {
1022
+ style?: 'direct' | 'orthogonal';
1023
+ waypoints?: Point[];
1024
+ }): Point[];
1025
+ /**
1026
+ * Validate that a node has a specific port
1027
+ */
1028
+ declare function nodeHasPort(node: NodeInstance, portId: string): boolean;
1029
+
1030
+ /**
1031
+ * Example P&ID diagram with a simple valve-pump-tank flow
1032
+ * Uses automatic port-to-port connection routing
1033
+ */
1034
+ declare const exampleDiagram: Diagram;
1035
+
1036
+ /**
1037
+ * Mock symbol library with basic P&ID shapes
1038
+ * Phase 4 will add proper symbol library management
1039
+ */
1040
+ declare const mockSymbolLibrary: Record<string, SymbolDefinition>;
1041
+ /**
1042
+ * Get symbol definition by ID
1043
+ */
1044
+ declare function getSymbolDefinition(symbolId: string): SymbolDefinition | undefined;
1045
+ /**
1046
+ * Get all available symbol IDs
1047
+ */
1048
+ declare function getAvailableSymbols(): string[];
1049
+
1050
+ /**
1051
+ * Telemetry status type
1052
+ */
1053
+ type TelemetryStatus = 'normal' | 'warning' | 'alarm' | 'fault' | 'off';
1054
+ /**
1055
+ * Threshold configuration
1056
+ */
1057
+ interface Thresholds {
1058
+ highHigh?: number;
1059
+ high?: number;
1060
+ low?: number;
1061
+ lowLow?: number;
1062
+ }
1063
+ /**
1064
+ * Calculate status based on value and thresholds
1065
+ * @param value - Current numeric value
1066
+ * @param thresholds - Threshold configuration
1067
+ * @returns Status string
1068
+ */
1069
+ declare function calculateThresholdStatus(value: number, thresholds?: Thresholds): TelemetryStatus;
1070
+ /**
1071
+ * Default thresholds for typical industrial processes (percentage-based)
1072
+ */
1073
+ declare const DEFAULT_THRESHOLDS: Thresholds;
1074
+
1075
+ /**
1076
+ * Options for simulation behavior
1077
+ */
1078
+ interface SimulationOptions {
1079
+ /** Update interval in milliseconds (default: 2000) */
1080
+ interval?: number;
1081
+ /** Whether simulation is enabled (default: true) */
1082
+ enabled?: boolean;
1083
+ /** Maximum change per update (default: 10) */
1084
+ maxChange?: number;
1085
+ /** Minimum value clamp (default: 0) */
1086
+ minValue?: number;
1087
+ /** Maximum value clamp (default: 100) */
1088
+ maxValue?: number;
1089
+ /** Maximum history length (default: 10) */
1090
+ historyLength?: number;
1091
+ /** Custom value generator function */
1092
+ generateValue?: (currentValue: number, nodeId: string) => number;
1093
+ }
1094
+ /**
1095
+ * Hook to automatically simulate telemetry data updates
1096
+ * Randomly updates numeric telemetry values and calculates status based on thresholds
1097
+ *
1098
+ * @param telemetry - Telemetry map from useTelemetry
1099
+ * @param updateTelemetryBatch - Batch update function from useTelemetry
1100
+ * @param options - Simulation configuration options
1101
+ *
1102
+ * @example
1103
+ * ```tsx
1104
+ * const { telemetry, updateTelemetryBatch } = useTelemetry();
1105
+ * useSimulation(telemetry, updateTelemetryBatch, {
1106
+ * interval: 2000,
1107
+ * enabled: mode === 'runtime'
1108
+ * });
1109
+ * ```
1110
+ */
1111
+ declare function useSimulation(telemetry: TelemetryMap, updateTelemetryBatch: (updates: Array<any>) => void, options?: SimulationOptions): void;
180
1112
 
181
- export { Button, type ButtonProps, ControlPanel, type ControlPanelProps, type ModeConfig, Selector, type SelectorOption, type SelectorProps, StatusIndicator, type StatusIndicatorProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, ValueEntry, type ValueEntryProps, useTheme };
1113
+ export { type AnchorType, Button, type ButtonProps, CardHeader, CardUnit, CardValue, CircularGauge, type CircularGaugeProps, ControlPanel, type ControlPanelProps, DEFAULT_THRESHOLDS, DashboardCard, type DataBinding, type Diagram, type DiagramMetadata, type DisplayMode, DisplayModeToggle, type DragPoint, type DragState, EquipmentIndicator, type EquipmentIndicatorProps, EquipmentIndicatorWithSparkline, type EquipmentIndicatorWithSparklineProps, FixedSVGContainer, FooterPanel, FullscreenContainer, FullscreenWorkspace, type FullscreenWorkspaceProps, type FullscreenWorkspaceTab, type KeyboardShortcutsOptions, LeftPanel, LeftToggleButton, LegacyValueEntry, type LegacyValueEntryProps, type ModeConfig, NodeConfigPanel, type NodeConfigPanelProps, type NodeInstance, type Overlay, type OverlayContent, type OverlayTheme, type OverlayType, PIDCanvas, type PIDCanvasProps, PanelContent, PanelTabs, type PipeEdge, type PipeStyle, type Point, type PortDefinition, type PortInstance, type PortType, RightPanel, RightToggleButton, SVGArea, SVGLockedOverlay, type SVGLockedOverlayProps, ScrollableSVGWrapper, type SelectionState, Selector, type SelectorOption, type SelectorProps, type SimulationOptions, Sparkline, type SparklineProps, StatusIndicator, type StatusIndicatorProps, type SymbolCategory, type SymbolDefinition, SymbolLibrary, type SymbolLibraryProps, type SymbolMetadata, type TelemetryBinding, type TelemetryMap, type TelemetryStatus$1 as TelemetryStatus, type TelemetryValue, ThemeProvider, ThemeToggle, type ThemeToggleProps, type Thresholds, type Transform, TrendLine, type TrendLineProps, type UseDragOptions, type UseDragResult, type UseSelectionOptions, type UseSelectionResult, type UseTelemetryOptions, type UseTelemetryResult, type UseViewBoxOptions, type UseViewBoxResult, ValueEntry, type ValueEntryProps, type ViewBox, ZoomButton, ZoomControls, calculateThresholdStatus, exampleDiagram, exportDiagram, generateRoutePoints, getAvailableSymbols, getPortWorldPosition, getSymbolDefinition, importDiagram, mockSymbolLibrary, nodeHasPort, overlayStyles, useDrag, useKeyboardShortcuts, useSelection, useSimulation, useTelemetry, useTheme, useViewBox, validateDiagram };