@camstack/ui-library 0.1.39 → 0.1.41

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.
Files changed (159) hide show
  1. package/dist/composites/addon-global-settings-form.d.ts +60 -0
  2. package/dist/composites/addon-page-props.d.ts +12 -0
  3. package/dist/composites/agent-step-editor.d.ts +15 -0
  4. package/dist/composites/app-shell/app-shell.d.ts +19 -0
  5. package/dist/composites/app-shell/index.d.ts +3 -0
  6. package/dist/composites/app-shell/sidebar-item.d.ts +10 -0
  7. package/dist/composites/app-shell/sidebar.d.ts +14 -0
  8. package/dist/composites/audio-classification-list.d.ts +20 -0
  9. package/dist/composites/audio-level-waveform.d.ts +35 -0
  10. package/dist/composites/audio-waveform.d.ts +20 -0
  11. package/dist/composites/battery-badge.d.ts +12 -0
  12. package/dist/composites/breadcrumb.d.ts +25 -0
  13. package/dist/composites/camera-stream-player.d.ts +87 -0
  14. package/dist/composites/code-block.d.ts +6 -0
  15. package/dist/composites/config-form-builder.d.ts +18 -0
  16. package/dist/composites/config-form-field.d.ts +70 -0
  17. package/dist/composites/confirm-action-button.d.ts +41 -0
  18. package/dist/composites/confirm-dialog.d.ts +13 -0
  19. package/dist/composites/data-table/data-table-header.d.ts +10 -0
  20. package/dist/composites/data-table/data-table-pagination.d.ts +9 -0
  21. package/dist/composites/data-table/data-table-row.d.ts +10 -0
  22. package/dist/composites/data-table/data-table.d.ts +2 -0
  23. package/dist/composites/data-table/index.d.ts +2 -0
  24. package/dist/composites/data-table/types.d.ts +34 -0
  25. package/dist/composites/data-table.d.ts +37 -0
  26. package/dist/composites/detection-canvas.d.ts +29 -0
  27. package/dist/composites/detection-colors.d.ts +15 -0
  28. package/dist/composites/detection-overlay.d.ts +9 -0
  29. package/dist/composites/detection-result-tree.d.ts +11 -0
  30. package/dist/composites/dev-shell.d.ts +20 -0
  31. package/dist/composites/device-activity-panel.d.ts +29 -0
  32. package/dist/composites/device-card.d.ts +38 -0
  33. package/dist/composites/device-grid.d.ts +12 -0
  34. package/dist/composites/device-item/actions.d.ts +9 -0
  35. package/dist/composites/device-item/children-accordion.d.ts +11 -0
  36. package/dist/composites/device-item/features.d.ts +17 -0
  37. package/dist/composites/device-item/header.d.ts +14 -0
  38. package/dist/composites/device-item/helpers.d.ts +147 -0
  39. package/dist/composites/device-item/index.d.ts +5 -0
  40. package/dist/composites/device-item/preview.d.ts +23 -0
  41. package/dist/composites/device-item/status-dot.d.ts +5 -0
  42. package/dist/composites/device-list/empty-state.d.ts +6 -0
  43. package/dist/composites/device-list/filter-chips.d.ts +19 -0
  44. package/dist/composites/device-list/group.d.ts +6 -0
  45. package/dist/composites/device-list/index.d.ts +31 -0
  46. package/dist/composites/device-list/pagination.d.ts +18 -0
  47. package/dist/composites/device-list/url-state.d.ts +24 -0
  48. package/dist/composites/discovery-panel.d.ts +26 -0
  49. package/dist/composites/doorbell-recent-panel.d.ts +10 -0
  50. package/dist/composites/empty-state.d.ts +10 -0
  51. package/dist/composites/event-stream.d.ts +48 -0
  52. package/dist/composites/filter-bar.d.ts +28 -0
  53. package/dist/composites/form-field.d.ts +11 -0
  54. package/dist/composites/image-selector.d.ts +25 -0
  55. package/dist/composites/index.d.ts +99 -0
  56. package/dist/composites/inference-config-selector.d.ts +44 -0
  57. package/dist/composites/kebab-menu.d.ts +39 -0
  58. package/dist/composites/key-value-list.d.ts +9 -0
  59. package/dist/composites/log-stream.d.ts +61 -0
  60. package/dist/composites/login-form.d.ts +8 -0
  61. package/dist/composites/mount-addon-page.d.ts +16 -0
  62. package/dist/composites/node-picker.d.ts +15 -0
  63. package/dist/composites/page-header.d.ts +8 -0
  64. package/dist/composites/phase-icon.d.ts +5 -0
  65. package/dist/composites/pipeline-builder.d.ts +43 -0
  66. package/dist/composites/pipeline-runtime-selector.d.ts +16 -0
  67. package/dist/composites/pipeline-step.d.ts +65 -0
  68. package/dist/composites/pipeline-tree-matrix.d.ts +31 -0
  69. package/dist/composites/provider-badge.d.ts +7 -0
  70. package/dist/composites/ptz-overlay.d.ts +20 -0
  71. package/dist/composites/response-log.d.ts +9 -0
  72. package/dist/composites/slide-over-panel.d.ts +11 -0
  73. package/dist/composites/snapshot-button.d.ts +25 -0
  74. package/dist/composites/stat-card.d.ts +10 -0
  75. package/dist/composites/state-values-stream.d.ts +30 -0
  76. package/dist/composites/status-badge.d.ts +10 -0
  77. package/dist/composites/step-timings.d.ts +9 -0
  78. package/dist/composites/step-tree-master.d.ts +28 -0
  79. package/dist/composites/stream-panel.d.ts +143 -0
  80. package/dist/composites/version-badge.d.ts +24 -0
  81. package/dist/composites/widget-slot.d.ts +20 -0
  82. package/dist/contexts/custom-field-renderers.d.ts +26 -0
  83. package/dist/contexts/device-context.d.ts +20 -0
  84. package/dist/contexts/player-overlays.d.ts +56 -0
  85. package/dist/contexts/system-context.d.ts +19 -0
  86. package/dist/contexts/widget-registry.d.ts +68 -0
  87. package/dist/contexts/zone-editing.d.ts +59 -0
  88. package/dist/generated/system-hooks.d.ts +933 -0
  89. package/dist/hooks/index.d.ts +27 -0
  90. package/dist/hooks/use-cluster-nodes.d.ts +17 -0
  91. package/dist/hooks/use-debounced-string.d.ts +1 -0
  92. package/dist/hooks/use-device-battery.d.ts +14 -0
  93. package/dist/hooks/use-device-capability.d.ts +17 -0
  94. package/dist/hooks/use-device-detections.d.ts +50 -0
  95. package/dist/hooks/use-device-features.d.ts +25 -0
  96. package/dist/hooks/use-device-proxy.d.ts +106 -0
  97. package/dist/hooks/use-device-snapshot.d.ts +10 -0
  98. package/dist/hooks/use-device-webrtc.d.ts +108 -0
  99. package/dist/hooks/use-devices.d.ts +13 -0
  100. package/dist/hooks/use-doorbell-events.d.ts +20 -0
  101. package/dist/hooks/use-event-invalidation.d.ts +1 -0
  102. package/dist/hooks/use-event-stream.d.ts +5 -0
  103. package/dist/hooks/use-is-mobile.d.ts +8 -0
  104. package/dist/hooks/use-live-buffer.d.ts +8 -0
  105. package/dist/hooks/use-live-event.d.ts +3 -0
  106. package/dist/hooks/use-ptz.d.ts +54 -0
  107. package/dist/hooks/use-system-query.d.ts +12 -0
  108. package/dist/icons/index.d.ts +2 -0
  109. package/dist/icons/provider-icons.d.ts +3 -0
  110. package/dist/icons/status-icons.d.ts +3 -0
  111. package/dist/index.cjs +23485 -14252
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.ts +14 -3787
  114. package/dist/index.js +22811 -13741
  115. package/dist/index.js.map +1 -1
  116. package/dist/lib/cn.d.ts +2 -0
  117. package/dist/lib/index.d.ts +8 -0
  118. package/dist/lib/mf-runtime-init.d.ts +1 -0
  119. package/dist/lib/phase-config.d.ts +16 -0
  120. package/dist/lib/pipeline-mirror.d.ts +23 -0
  121. package/dist/lib/responsive.d.ts +81 -0
  122. package/dist/lib/shared-context.d.ts +5 -0
  123. package/dist/lib/validate-template.d.ts +2 -0
  124. package/dist/primitives/badge.d.ts +11 -0
  125. package/dist/primitives/bottom-sheet.d.ts +9 -0
  126. package/dist/primitives/button.d.ts +10 -0
  127. package/dist/primitives/card.d.ts +9 -0
  128. package/dist/primitives/checkbox.d.ts +4 -0
  129. package/dist/primitives/collapsible-card.d.ts +15 -0
  130. package/dist/primitives/dialog.d.ts +20 -0
  131. package/dist/primitives/dropdown.d.ts +19 -0
  132. package/dist/primitives/floating-panel.d.ts +22 -0
  133. package/dist/primitives/icon-button.d.ts +13 -0
  134. package/dist/primitives/index.d.ts +21 -0
  135. package/dist/primitives/input.d.ts +11 -0
  136. package/dist/primitives/label.d.ts +4 -0
  137. package/dist/primitives/mobile-drawer.d.ts +10 -0
  138. package/dist/primitives/popover.d.ts +10 -0
  139. package/dist/primitives/scroll-area.d.ts +4 -0
  140. package/dist/primitives/select.d.ts +9 -0
  141. package/dist/primitives/separator.d.ts +9 -0
  142. package/dist/primitives/skeleton.d.ts +4 -0
  143. package/dist/primitives/switch.d.ts +7 -0
  144. package/dist/primitives/tabs.d.ts +17 -0
  145. package/dist/primitives/tooltip.d.ts +6 -0
  146. package/dist/theme/create-theme.d.ts +2 -0
  147. package/dist/theme/defaults.d.ts +4 -0
  148. package/dist/theme/index.cjs +228 -248
  149. package/dist/theme/index.cjs.map +1 -1
  150. package/dist/theme/index.d.ts +6 -128
  151. package/dist/theme/index.js +212 -214
  152. package/dist/theme/index.js.map +1 -1
  153. package/dist/theme/theme-provider.d.ts +10 -0
  154. package/dist/theme/theme-to-css.d.ts +2 -0
  155. package/dist/theme/{index.d.cts → types.d.ts} +5 -27
  156. package/dist/theme/use-theme-mode.d.ts +2 -0
  157. package/dist/trpc-react.d.ts +7 -0
  158. package/package.json +5 -3
  159. package/dist/index.d.cts +0 -3787
@@ -0,0 +1,60 @@
1
+ import { ConfigUISchemaWithValues } from '@camstack/types';
2
+ interface AddonGlobalSettingsFormTrpc {
3
+ addonSettings: {
4
+ getGlobalSettings: {
5
+ query: (input: {
6
+ addonId: string;
7
+ nodeId?: string;
8
+ overlay?: Record<string, unknown>;
9
+ }) => Promise<ConfigUISchemaWithValues | null>;
10
+ };
11
+ updateGlobalSettings: {
12
+ mutate: (input: {
13
+ addonId: string;
14
+ nodeId?: string;
15
+ patch: Record<string, unknown>;
16
+ }) => Promise<unknown>;
17
+ };
18
+ };
19
+ }
20
+ interface AddonGlobalSettingsFormProps {
21
+ readonly trpc: AddonGlobalSettingsFormTrpc;
22
+ readonly addonId: string;
23
+ readonly nodeId: string;
24
+ readonly title?: string;
25
+ readonly disabled?: boolean;
26
+ readonly onAfterChange?: () => void;
27
+ /** Bump to force refetch (e.g. after an external mutation). */
28
+ readonly refreshToken?: number;
29
+ /**
30
+ * Render as collapsible. When true, the form body is hidden until
31
+ * the operator expands the header (click). Defaults to open so
32
+ * callers that always want the form visible don't have to opt out.
33
+ */
34
+ readonly collapsible?: boolean;
35
+ /** When `collapsible`, start expanded (true) or collapsed (false). Defaults to false. */
36
+ readonly defaultOpen?: boolean;
37
+ /**
38
+ * - `'persist'` (default): edits call `updateGlobalSettings` and
39
+ * re-fetch — the live store is mutated. Use in settings editors
40
+ * (NodePipelineTab, device details).
41
+ * - `'override'`: edits stay local (never touch the store).
42
+ * `onOverrideChange` receives the current override values on
43
+ * every edit so the caller can pass them to a per-run action.
44
+ * Use in the benchmark tabs — operator tweaks for a single
45
+ * bench run without mutating the addon's saved settings.
46
+ */
47
+ readonly mode?: 'persist' | 'override';
48
+ /**
49
+ * Called on every edit when `mode: 'override'`. `patch` is the sparse
50
+ * diff vs the persisted baseline (only the fields the operator touched).
51
+ * `effective` is the baseline merged with the patch — every field a
52
+ * downstream action might need, with the operator's override applied.
53
+ * Callers that need to emit a full engine triple (runtime+backend+format)
54
+ * should read from `effective`, not `patch`, so partial edits (e.g.
55
+ * operator tweaks only `device`) still produce a complete payload.
56
+ */
57
+ readonly onOverrideChange?: (patch: Record<string, unknown>, effective: Record<string, unknown>) => void;
58
+ }
59
+ export declare function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, collapsible, defaultOpen, mode, onOverrideChange, }: AddonGlobalSettingsFormProps): import("react/jsx-runtime").JSX.Element;
60
+ export {};
@@ -0,0 +1,12 @@
1
+ import { TRPCClient } from '@trpc/client';
2
+ import { AppRouter } from '@camstack/types';
3
+ export interface AddonPageProps {
4
+ /** Vanilla tRPC client — fully typed access for non-React call sites. */
5
+ readonly trpc: TRPCClient<AppRouter>;
6
+ /** Current theme state */
7
+ readonly theme: {
8
+ readonly isDark: boolean;
9
+ };
10
+ /** Navigate to a route within the admin UI */
11
+ readonly navigate: (path: string) => void;
12
+ }
@@ -0,0 +1,15 @@
1
+ import { PipelineAddonSchema, AgentAddonConfig, CameraStepOverridePatch } from '@camstack/types';
2
+ export type EditorMode = 'agent' | 'device';
3
+ export interface AgentStepEditorProps {
4
+ readonly mode: EditorMode;
5
+ readonly addon: PipelineAddonSchema;
6
+ /** L1 base — always visible as the "inherited" baseline. */
7
+ readonly agentDefault: AgentAddonConfig;
8
+ readonly agentNodeId: string;
9
+ /** Device mode only — current L2.5 patch for (agent, addon). */
10
+ readonly currentPatch?: CameraStepOverridePatch | null;
11
+ readonly onChangeAgentConfig?: (next: AgentAddonConfig) => void;
12
+ readonly onChangePatch?: (next: CameraStepOverridePatch | null) => void;
13
+ readonly engineFormat: string;
14
+ }
15
+ export declare function AgentStepEditor(props: AgentStepEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { SidebarProps } from './sidebar';
3
+ export interface AppShellProps {
4
+ sidebar: SidebarProps;
5
+ header?: {
6
+ breadcrumbs?: {
7
+ label: string;
8
+ href?: string;
9
+ }[];
10
+ actions?: ReactNode;
11
+ };
12
+ /** Content shown in the center of the mobile top bar (e.g. logo) */
13
+ mobileLogo?: ReactNode;
14
+ /** Content shown on the right side of the mobile top bar (e.g. avatar menu) */
15
+ mobileActions?: ReactNode;
16
+ children: ReactNode;
17
+ className?: string;
18
+ }
19
+ export declare function AppShell({ sidebar, header, mobileLogo, mobileActions, children, className }: AppShellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './sidebar-item';
2
+ export * from './sidebar';
3
+ export * from './app-shell';
@@ -0,0 +1,10 @@
1
+ import { LucideIcon } from 'lucide-react';
2
+ export interface SidebarItemProps {
3
+ label: string;
4
+ icon: LucideIcon;
5
+ href: string;
6
+ badge?: string | number;
7
+ active?: boolean;
8
+ className?: string;
9
+ }
10
+ export declare function SidebarItem({ label, icon: Icon, href, badge, active, className, }: SidebarItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { SidebarItemProps } from './sidebar-item';
3
+ export interface SidebarSection {
4
+ label?: string;
5
+ items: SidebarItemProps[];
6
+ }
7
+ export interface SidebarProps {
8
+ logo?: ReactNode;
9
+ sections: SidebarSection[];
10
+ footer?: SidebarItemProps[];
11
+ onNavigate?: () => void;
12
+ className?: string;
13
+ }
14
+ export declare function Sidebar({ logo, sections, footer, onNavigate, className }: SidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ export interface AudioClassification {
2
+ readonly className: string;
3
+ readonly score: number;
4
+ }
5
+ export interface AudioClassificationListProps {
6
+ /** Sorted classifications (highest score first) */
7
+ readonly classifications: readonly AudioClassification[];
8
+ /** Processing state indicator */
9
+ readonly processing?: boolean;
10
+ /** Inference time in ms */
11
+ readonly inferenceMs?: number;
12
+ /** Max items to show (default: 10) */
13
+ readonly maxItems?: number;
14
+ /** Optional className */
15
+ readonly className?: string;
16
+ }
17
+ /**
18
+ * Displays audio classification results as a ranked list with score bars.
19
+ */
20
+ export declare function AudioClassificationList({ classifications, processing, inferenceMs, maxItems, className, }: AudioClassificationListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ export interface AudioLevelSample {
2
+ readonly dbfs: number;
3
+ readonly timestamp: number;
4
+ }
5
+ export interface AudioLevelWaveformProps {
6
+ /** Current dBFS level — push a new value to append to the internal ring buffer. */
7
+ readonly currentDbfs: number | null;
8
+ /** How many seconds of history to display (default 30) */
9
+ readonly durationSec?: number;
10
+ /** Max samples to keep in memory (default 120 ≈ 60s at 2 samples/s) */
11
+ readonly maxSamples?: number;
12
+ /** Height in pixels (default 64) */
13
+ readonly height?: number;
14
+ /** CSS class for the container */
15
+ readonly className?: string;
16
+ /** Bar color (CSS) */
17
+ readonly color?: string;
18
+ /** Clipping color when dBFS > threshold (default red) */
19
+ readonly clipColor?: string;
20
+ /** dBFS threshold for clipping color (default -6) */
21
+ readonly clipThreshold?: number;
22
+ /** Min dBFS to display (default -96) */
23
+ readonly minDbfs?: number;
24
+ }
25
+ /**
26
+ * Canvas-based live audio level waveform with internal state.
27
+ *
28
+ * Receives `currentDbfs` — each time it changes, a new sample is appended
29
+ * to an internal ring buffer and the canvas is redrawn. The component
30
+ * manages its own history, so callers just push the latest dBFS value.
31
+ *
32
+ * Designed to be fed from the `pipeline.audio-inference-result` event
33
+ * (each chunk, ~0.5s, produces one sample via `frame.level.dbfs`).
34
+ */
35
+ export declare function AudioLevelWaveform({ currentDbfs, durationSec, maxSamples, height, className, color, clipColor, clipThreshold, minDbfs, }: AudioLevelWaveformProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ export interface AudioWaveformProps {
2
+ /** Raw audio samples (mono Float32Array, -1..1 range) */
3
+ readonly samples: Float32Array | null;
4
+ /** Sample rate in Hz (for time axis labels) */
5
+ readonly sampleRate?: number;
6
+ /** Height in pixels */
7
+ readonly height?: number;
8
+ /** CSS class for the container */
9
+ readonly className?: string;
10
+ /** Waveform color (CSS color string) */
11
+ readonly color?: string;
12
+ /** Background color */
13
+ readonly bgColor?: string;
14
+ }
15
+ /**
16
+ * Canvas-based audio waveform visualization.
17
+ * Renders a waveform from Float32Array audio samples.
18
+ * Downsamples to pixel resolution for performance.
19
+ */
20
+ export declare function AudioWaveform({ samples, sampleRate, height, className, color, bgColor, }: AudioWaveformProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export interface BatteryStatusLike {
2
+ readonly percentage: number;
3
+ readonly charging: 'dc' | 'solar' | 'none';
4
+ readonly sleeping: boolean;
5
+ }
6
+ export interface BatteryBadgeProps {
7
+ readonly status: BatteryStatusLike | null | undefined;
8
+ /** `'compact'` shows only icon + %; `'full'` adds the source label. */
9
+ readonly variant?: 'compact' | 'full';
10
+ readonly className?: string;
11
+ }
12
+ export declare function BatteryBadge({ status, variant, className }: BatteryBadgeProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,25 @@
1
+ export interface BreadcrumbItem {
2
+ /** Display label */
3
+ label: string;
4
+ /** If provided, renders as a clickable link. Last item is never a link. */
5
+ href?: string;
6
+ /** Click handler — used instead of href for SPA navigation */
7
+ onClick?: () => void;
8
+ }
9
+ export interface BreadcrumbProps {
10
+ items: BreadcrumbItem[];
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Breadcrumb navigation component.
15
+ *
16
+ * Usage with react-router:
17
+ * ```tsx
18
+ * <Breadcrumb items={[
19
+ * { label: 'Integrations', onClick: () => navigate('/integrations') },
20
+ * { label: 'RTSP Cameras', onClick: () => navigate('/integrations/int_0001') },
21
+ * { label: 'Front Door' },
22
+ * ]} />
23
+ * ```
24
+ */
25
+ export declare function Breadcrumb({ items, className }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,87 @@
1
+ import { ReactNode } from 'react';
2
+ export type PlayerConnectionState = 'connecting' | 'playing' | 'error' | 'disconnected' | 'idle';
3
+ /**
4
+ * Signaling function for WebRTC connection.
5
+ * Called by the player to establish the WebRTC session.
6
+ * Must return an RTCSessionDescription (the server's offer or answer depending on mode).
7
+ *
8
+ * Server-offer mode (default):
9
+ * 1. signalingFn is called with streamId → returns { sessionId, sdpOffer }
10
+ * 2. Player sets remote description (server offer), creates answer
11
+ * 3. Player calls answerFn(sessionId, sdpAnswer) to complete
12
+ *
13
+ * WHEP mode (legacy):
14
+ * 1. Player creates offer, gathers ICE
15
+ * 2. signalingFn is called with the client SDP offer → returns sdpAnswer
16
+ * 3. Player sets remote description (answer)
17
+ */
18
+ export interface SignalingResult {
19
+ /** Server-offer mode: session ID + SDP offer from server */
20
+ sessionId: string;
21
+ sdpOffer: string;
22
+ }
23
+ /**
24
+ * Client-side capabilities sent to the server at session creation.
25
+ * The server uses these to pick the best native source for adaptive
26
+ * streams (e.g. a 320×180 thumbnail player on a slow link gets the
27
+ * camera's low stream rather than ffmpeg-transcoded 4K).
28
+ *
29
+ * All fields are optional — when omitted the server defaults to its
30
+ * highest-quality registered source.
31
+ */
32
+ export interface ClientStreamHints {
33
+ viewportWidth?: number;
34
+ viewportHeight?: number;
35
+ devicePixelRatio?: number;
36
+ downlinkMbps?: number;
37
+ prefersTier?: string;
38
+ }
39
+ export interface CameraStreamPlayerProps {
40
+ /** Server base URL (e.g. window.location.origin) */
41
+ serverUrl: string;
42
+ /**
43
+ * Stable key used for React reconciliation (the player remounts when
44
+ * this changes), the snapshot filename, and WHEP fallback URL. The
45
+ * value is opaque to the player — no parsing, no semantic meaning.
46
+ * Typical values: a `StreamChoice.id` (`'profile:high'`, `'stream:native:main'`).
47
+ */
48
+ streamKey: string;
49
+ /** Human-readable label shown in overlay */
50
+ label?: string;
51
+ /** Auto-play on mount (default: true) */
52
+ autoPlay?: boolean;
53
+ /** Start muted (default: true) */
54
+ muted?: boolean;
55
+ /** Show toolbar controls (default: true) */
56
+ showControls?: boolean;
57
+ /** Additional CSS classes for the root container */
58
+ className?: string;
59
+ /** Called on connection state change */
60
+ onStateChange?: (state: PlayerConnectionState) => void;
61
+ /** Called on error */
62
+ onError?: (error: string) => void;
63
+ /** Custom overlay rendered on top of the video */
64
+ overlay?: ReactNode;
65
+ /**
66
+ * Create a WebRTC session (server-offer signaling). When provided,
67
+ * uses server-offer mode instead of WHEP. The caller closes over the
68
+ * target (profile / cam-stream / adaptive) and any device context;
69
+ * the player just hands it the auto-derived `hints` (viewport,
70
+ * downlink) so the server can score adaptive selections.
71
+ */
72
+ createSession?: (hints?: ClientStreamHints) => Promise<SignalingResult>;
73
+ /**
74
+ * Send the client's SDP answer (server-offer signaling).
75
+ * Required when createSession is provided.
76
+ */
77
+ sendAnswer?: (sessionId: string, sdpAnswer: string) => Promise<void>;
78
+ /** Explicitly close the WebRTC session on server (cleanup on unmount). */
79
+ closeSession?: (sessionId: string) => Promise<void>;
80
+ /**
81
+ * Override client hints sent to the server at session creation.
82
+ * Values provided here replace the auto-computed browser values.
83
+ * Use for network simulation (benchmark) or manual tier forcing.
84
+ */
85
+ hintsOverride?: Partial<ClientStreamHints>;
86
+ }
87
+ export declare function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay, muted: initialMuted, showControls, className, onStateChange, onError, overlay, createSession, sendAnswer, closeSession, hintsOverride, }: CameraStreamPlayerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface CodeBlockProps {
2
+ children: string;
3
+ maxHeight?: number;
4
+ className?: string;
5
+ }
6
+ export declare function CodeBlock({ children, maxHeight, className }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ConfigUISchema, FieldProbeResult } from '@camstack/types';
2
+ import { ProbeState } from './config-form-field';
3
+ export type TranslationFn = (key: string) => string;
4
+ export declare function resolveLabel(value: string | undefined, t?: TranslationFn): string | undefined;
5
+ interface FormBuilderProps {
6
+ schema: ConfigUISchema;
7
+ values: Record<string, unknown>;
8
+ onChange: (values: Record<string, unknown>) => void;
9
+ disabled?: boolean;
10
+ translationFn?: TranslationFn;
11
+ onTestField?: (key: string, value: unknown) => Promise<FieldProbeResult>;
12
+ /** External probe results from useProbeAll hook */
13
+ probeResults?: Record<string, ProbeState>;
14
+ /** Callback to clear a probe result when a field value changes */
15
+ onClearProbe?: (key: string) => void;
16
+ }
17
+ export declare function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe }: FormBuilderProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,70 @@
1
+ import { ConfigField, ConfigNodeSelectField, ConfigNodeMultiSelectField, FieldProbeResult } from '@camstack/types';
2
+ import { TranslationFn } from './config-form-builder';
3
+ /** Probe state for a single field — exported for callers that need to track probe lifecycle externally. */
4
+ export interface ProbeState {
5
+ status: 'probing' | 'ok' | 'error';
6
+ result?: FieldProbeResult;
7
+ }
8
+ interface FormFieldProps {
9
+ field: ConfigField;
10
+ values: Record<string, unknown>;
11
+ onChange: (key: string, value: unknown) => void;
12
+ disabled?: boolean;
13
+ translationFn?: TranslationFn;
14
+ /**
15
+ * Dedicated probe callback — used by the device-creation dialog where
16
+ * the device doesn't exist yet so the generic `onAction` routing
17
+ * cannot resolve an addon owner. For existing-device forms prefer
18
+ * `onAction` with action `'test-probe'`: the probe field falls back
19
+ * to it when `onTestField` is absent, so the two paths converge.
20
+ */
21
+ onTestField?: (key: string, value: unknown) => Promise<FieldProbeResult>;
22
+ /** External probe result (from "Test All" button) */
23
+ externalProbe?: {
24
+ status: 'probing' | 'ok' | 'error';
25
+ result?: FieldProbeResult;
26
+ };
27
+ /**
28
+ * Inline-action callback. Fired by icon buttons on any field
29
+ * (copy-value, regenerate-rtsp-token, …) and by the probe field's
30
+ * Test button when `onTestField` is not provided — in that case the
31
+ * action name is `'test-probe'` and the current field value flows
32
+ * through the third arg so the handler can probe it.
33
+ *
34
+ * Returns `Promise<unknown>` (not `void`) because some actions yield
35
+ * a result the caller wants (the probe returns a `FieldProbeResult`).
36
+ */
37
+ onAction?: (action: string, key: string, value?: unknown) => Promise<unknown>;
38
+ /** All fields in the section — used to resolve defaults for showWhen conditions */
39
+ allFields?: readonly ConfigField[];
40
+ }
41
+ export declare function NodeSelectField({ field, value, onChange, disabled, translationFn, }: {
42
+ field: ConfigNodeSelectField;
43
+ value: unknown;
44
+ onChange: (v: unknown) => void;
45
+ disabled?: boolean;
46
+ translationFn?: TranslationFn;
47
+ }): import("react/jsx-runtime").JSX.Element;
48
+ export declare function NodeMultiSelectField({ field, value, onChange, disabled, translationFn, }: {
49
+ field: ConfigNodeMultiSelectField;
50
+ value: unknown;
51
+ onChange: (v: unknown) => void;
52
+ disabled?: boolean;
53
+ translationFn?: TranslationFn;
54
+ }): import("react/jsx-runtime").JSX.Element;
55
+ /**
56
+ * Resolve a `ConfigCondition` against the form's flat values bag and the
57
+ * sibling-field list (used to recover schema defaults when the
58
+ * referenced field hasn't been touched yet). Returns `true` for fields
59
+ * with no `showWhen` — i.e. always visible — and for fields whose
60
+ * condition is missing a recognised operator (forward-compat: a future
61
+ * operator added to `ConfigCondition` won't accidentally hide every
62
+ * field on older clients).
63
+ *
64
+ * Exported so callers (FormBuilder section renderer, future
65
+ * sub-tab visibility checks, …) can pre-evaluate which fields would be
66
+ * rendered without instantiating a React subtree.
67
+ */
68
+ export declare function isFieldVisible(field: ConfigField, values: Record<string, unknown>, allFields?: readonly ConfigField[]): boolean;
69
+ export declare function FormField({ field, values, onChange, disabled, translationFn, onTestField, externalProbe, allFields, onAction }: FormFieldProps): import("react/jsx-runtime").JSX.Element | null;
70
+ export { FormField as ConfigFormField };
@@ -0,0 +1,41 @@
1
+ import { ReactNode, ComponentType } from 'react';
2
+ import { ButtonProps } from '../primitives/button';
3
+ export interface ConfirmActionButtonProps<TResult> {
4
+ /** Visible label on the trigger button. */
5
+ readonly label: string;
6
+ /** Icon component (lucide-react) rendered inside the trigger. */
7
+ readonly icon?: ComponentType<{
8
+ className?: string;
9
+ }>;
10
+ /** Dialog title. Defaults to "Confirm action". */
11
+ readonly title?: string;
12
+ /**
13
+ * Dialog body — accepts either a string (rendered as DialogDescription)
14
+ * or arbitrary ReactNode for callers that need lists, code blocks, etc.
15
+ */
16
+ readonly description?: ReactNode;
17
+ /** Label on the confirm button inside the dialog. Defaults to `label`. */
18
+ readonly confirmLabel?: string;
19
+ /** Visual variant for the trigger button (defaults to `outline`). */
20
+ readonly triggerVariant?: ButtonProps['variant'];
21
+ /**
22
+ * Visual variant for the confirm button inside the dialog. Defaults to
23
+ * `danger` since this component is meant for destructive actions.
24
+ */
25
+ readonly confirmVariant?: ButtonProps['variant'];
26
+ /** Trigger button size — propagated to the underlying Button. */
27
+ readonly size?: ButtonProps['size'];
28
+ /** Disable the trigger entirely (gates rendering instead of UX state). */
29
+ readonly disabled?: boolean;
30
+ /** Optional extra class name on the trigger. */
31
+ readonly className?: string;
32
+ /**
33
+ * The async action to run on confirm. Must throw on failure so this
34
+ * component can surface the error inline. The result is returned to
35
+ * `onSuccess` for callers that need it (e.g. to invalidate queries).
36
+ */
37
+ readonly action: () => Promise<TResult>;
38
+ /** Called after `action` resolves, with the result. */
39
+ readonly onSuccess?: (result: TResult) => void;
40
+ }
41
+ export declare function ConfirmActionButton<TResult>({ label, icon: Icon, title, description, confirmLabel, triggerVariant, confirmVariant, size, disabled, className, action, onSuccess, }: ConfirmActionButtonProps<TResult>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ interface ConfirmOptions {
3
+ title: string;
4
+ message: string;
5
+ confirmLabel?: string;
6
+ cancelLabel?: string;
7
+ variant?: 'danger' | 'warning' | 'default';
8
+ }
9
+ export declare function useConfirm(): (options: ConfirmOptions) => Promise<boolean>;
10
+ export declare function ConfirmDialogProvider({ children }: {
11
+ children: ReactNode;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import { HeaderGroup, flexRender } from '@tanstack/react-table';
2
+ import { SortingState } from './types';
3
+ interface DataTableHeaderProps<T> {
4
+ headerGroups: HeaderGroup<T>[];
5
+ onSortingChange?: (sorting: SortingState) => void;
6
+ stickyHeader?: boolean;
7
+ flexRender: typeof flexRender;
8
+ }
9
+ export declare function DataTableHeader<T>({ headerGroups, onSortingChange, stickyHeader, flexRender: render, }: DataTableHeaderProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import { PaginationState } from './types';
2
+ interface DataTablePaginationProps {
3
+ page: number;
4
+ pageSize: number;
5
+ total: number;
6
+ onPaginationChange?: (pagination: PaginationState) => void;
7
+ }
8
+ export declare function DataTablePagination({ page, pageSize, total, onPaginationChange, }: DataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Row, flexRender } from '@tanstack/react-table';
2
+ import { DataTableAction } from './types';
3
+ interface DataTableRowProps<T> {
4
+ row: Row<T>;
5
+ onRowClick?: (row: T) => void;
6
+ rowActions?: (row: T) => DataTableAction[];
7
+ flexRender: typeof flexRender;
8
+ }
9
+ export declare function DataTableRow<T>({ row, onRowClick, rowActions, flexRender: render, }: DataTableRowProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { DataTableProps } from './types';
2
+ export declare function DataTable<T>({ data, columns: userColumns, sorting, onSortingChange, filtering, onFilteringChange, pagination, onPaginationChange, loading, emptyState, rowActions, onRowClick, selectable, compact, stickyHeader, className, mobileMode, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DataTable } from './data-table';
2
+ export type { DataTableProps, ColumnDef, SortingState, ColumnFiltersState, PaginationState, DataTableAction, } from './types';
@@ -0,0 +1,34 @@
1
+ import { ColumnDef, SortingState, ColumnFiltersState, PaginationState } from '@tanstack/react-table';
2
+ import { ReactNode } from 'react';
3
+ import { LucideIcon } from 'lucide-react';
4
+ export type { ColumnDef, SortingState, ColumnFiltersState, PaginationState };
5
+ export interface DataTableAction {
6
+ label: string;
7
+ icon?: LucideIcon;
8
+ onClick: () => void;
9
+ variant?: 'danger' | 'default';
10
+ }
11
+ export interface DataTableProps<T> {
12
+ data: T[];
13
+ columns: ColumnDef<T, unknown>[];
14
+ sorting?: SortingState;
15
+ onSortingChange?: (sorting: SortingState) => void;
16
+ filtering?: ColumnFiltersState;
17
+ onFilteringChange?: (filtering: ColumnFiltersState) => void;
18
+ pagination?: {
19
+ page: number;
20
+ pageSize: number;
21
+ total: number;
22
+ };
23
+ onPaginationChange?: (pagination: PaginationState) => void;
24
+ loading?: boolean;
25
+ emptyState?: ReactNode;
26
+ rowActions?: (row: T) => DataTableAction[];
27
+ onRowClick?: (row: T) => void;
28
+ selectable?: boolean;
29
+ compact?: boolean;
30
+ stickyHeader?: boolean;
31
+ className?: string;
32
+ /** How to render on mobile. 'scroll' keeps table with horizontal scroll. 'cards' renders each row as a card. Default: 'scroll' */
33
+ mobileMode?: 'scroll' | 'cards';
34
+ }
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DataColumn<T> {
3
+ /** Stable key for React reconciliation + tests. */
4
+ readonly key: string;
5
+ /** Plain text header. Mutually exclusive with `headerRender`. */
6
+ readonly header?: string;
7
+ /** Custom header markup — overrides `header`. */
8
+ readonly headerRender?: () => ReactNode;
9
+ /** Cell horizontal alignment. Default: `left`. */
10
+ readonly align?: 'left' | 'right' | 'center';
11
+ /** Suppress text wrapping on header + cell. Default: header `true`, cell `false`. */
12
+ readonly nowrap?: boolean;
13
+ /** Cell renderer. Receives the row value. */
14
+ readonly render: (row: T, rowIndex: number) => ReactNode;
15
+ /** Optional explicit Tailwind width class (e.g. `'w-24'`). */
16
+ readonly width?: string;
17
+ }
18
+ export interface DataTableProps<T> {
19
+ readonly columns: readonly DataColumn<T>[];
20
+ readonly rows: readonly T[];
21
+ /** Stable key per row. Default: rowIndex (works for stable lists). */
22
+ readonly rowKey?: (row: T, rowIndex: number) => string | number;
23
+ /** Click handler attached to each row. Adds hover + cursor-pointer. */
24
+ readonly onRowClick?: (row: T, rowIndex: number) => void;
25
+ /** Min width in px for the inner table. Default: 480. */
26
+ readonly minWidthPx?: number;
27
+ /** Empty-state message. Default: hides the table when rows=[]. */
28
+ readonly emptyMessage?: string;
29
+ /** Additional className for the outer container. */
30
+ readonly className?: string;
31
+ /** Wrapper border style — set false to drop the rounded border (e.g. when the
32
+ * table sits inside another bordered card). Default: `true`. */
33
+ readonly bordered?: boolean;
34
+ /** Per-row className resolver (e.g. status-coloured backgrounds). */
35
+ readonly rowClassName?: (row: T, rowIndex: number) => string | undefined;
36
+ }
37
+ export declare function DataTable<T>({ columns, rows, rowKey, onRowClick, minWidthPx, emptyMessage, className, bordered, rowClassName, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,29 @@
1
+ import { ReactNode } from 'react';
2
+ import { ObjectDetection } from '@camstack/types';
3
+ export type { ObjectDetection, ScoredLabel, DetectionBoundingBox } from '@camstack/types';
4
+ /** Legacy alias kept so pre-rework consumers don't need a coordinated rename. */
5
+ export type Detection = ObjectDetection;
6
+ export interface DetectionCanvasProps {
7
+ /** Image source (data URL or regular URL) */
8
+ readonly src: string | null;
9
+ /** Image dimensions (used for bbox coordinate mapping) */
10
+ readonly imageWidth: number;
11
+ readonly imageHeight: number;
12
+ /** Detections to overlay — flat list (first-level + details). */
13
+ readonly detections?: readonly ObjectDetection[];
14
+ /** Custom class → hex color mapping (merged with defaults) */
15
+ readonly classColors?: Readonly<Record<string, string>>;
16
+ /** Aspect ratio CSS value (default: auto based on image dimensions) */
17
+ readonly aspectRatio?: string;
18
+ /** Additional CSS classes on the container */
19
+ readonly className?: string;
20
+ /** Placeholder content when no image is loaded */
21
+ readonly placeholder?: ReactNode;
22
+ /** Show confidence percentage in bbox labels */
23
+ readonly showConfidence?: boolean;
24
+ /** Minimum confidence to display (0-1, default: 0) */
25
+ readonly minConfidence?: number;
26
+ /** Border width for bboxes in px (default: 2) */
27
+ readonly borderWidth?: number;
28
+ }
29
+ export declare function DetectionCanvas({ src, imageWidth, imageHeight, detections, classColors, aspectRatio, className, placeholder, showConfidence, minConfidence, borderWidth, }: DetectionCanvasProps): import("react/jsx-runtime").JSX.Element;