@startsimpli/funnels 0.1.4 → 0.1.6

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 (151) hide show
  1. package/package.json +9 -31
  2. package/src/api/README.md +507 -0
  3. package/src/api/adapter.ts +106 -0
  4. package/src/api/client.test.ts +640 -0
  5. package/src/api/client.ts +385 -0
  6. package/src/api/default-adapter.ts +243 -0
  7. package/src/api/index.ts +24 -0
  8. package/src/components/FilterRuleEditor/ARCHITECTURE.md +354 -0
  9. package/src/components/FilterRuleEditor/FieldSelector.tsx +91 -0
  10. package/src/components/FilterRuleEditor/FilterRuleEditor.stories.tsx +462 -0
  11. package/src/components/FilterRuleEditor/FilterRuleEditor.test.tsx +520 -0
  12. package/src/components/FilterRuleEditor/FilterRuleEditor.tsx +225 -0
  13. package/src/components/FilterRuleEditor/LogicToggle.tsx +64 -0
  14. package/src/components/FilterRuleEditor/OperatorSelector.tsx +75 -0
  15. package/src/components/FilterRuleEditor/README.md +291 -0
  16. package/src/components/FilterRuleEditor/RuleRow.tsx +246 -0
  17. package/src/components/FilterRuleEditor/ValueInputs/BooleanValueInput.tsx +54 -0
  18. package/src/components/FilterRuleEditor/ValueInputs/ChoiceValueInput.tsx +83 -0
  19. package/src/components/FilterRuleEditor/ValueInputs/DateValueInput.tsx +70 -0
  20. package/src/components/FilterRuleEditor/ValueInputs/MultiChoiceValueInput.tsx +132 -0
  21. package/src/components/FilterRuleEditor/ValueInputs/NumberValueInput.tsx +73 -0
  22. package/src/components/FilterRuleEditor/ValueInputs/TextValueInput.tsx +50 -0
  23. package/src/components/FilterRuleEditor/ValueInputs/index.ts +12 -0
  24. package/src/components/FilterRuleEditor/constants.ts +64 -0
  25. package/src/components/FilterRuleEditor/index.ts +14 -0
  26. package/src/components/FunnelCard/DESIGN.md +447 -0
  27. package/src/components/FunnelCard/FunnelCard.stories.tsx +484 -0
  28. package/src/components/FunnelCard/FunnelCard.test.ts +257 -0
  29. package/src/components/FunnelCard/FunnelCard.test.tsx +336 -0
  30. package/src/components/FunnelCard/FunnelCard.tsx +204 -0
  31. package/src/components/FunnelCard/FunnelStats.tsx +68 -0
  32. package/src/components/FunnelCard/IMPLEMENTATION_SUMMARY.md +505 -0
  33. package/src/components/FunnelCard/INSTALLATION.md +304 -0
  34. package/src/components/FunnelCard/MatchBar.tsx +49 -0
  35. package/src/components/FunnelCard/README.md +294 -0
  36. package/src/components/FunnelCard/StageIndicator.tsx +62 -0
  37. package/src/components/FunnelCard/StatusBadge.tsx +52 -0
  38. package/src/components/FunnelCard/index.ts +14 -0
  39. package/src/components/FunnelPreview/EntityCard.tsx +72 -0
  40. package/src/components/FunnelPreview/FunnelPreview.stories.tsx +227 -0
  41. package/src/components/FunnelPreview/FunnelPreview.test.tsx +316 -0
  42. package/src/components/FunnelPreview/FunnelPreview.tsx +249 -0
  43. package/src/components/FunnelPreview/LoadingPreview.tsx +60 -0
  44. package/src/components/FunnelPreview/PreviewStats.tsx +78 -0
  45. package/src/components/FunnelPreview/README.md +337 -0
  46. package/src/components/FunnelPreview/StageBreakdown.tsx +94 -0
  47. package/src/components/FunnelPreview/example.tsx +286 -0
  48. package/src/components/FunnelPreview/index.ts +14 -0
  49. package/src/components/FunnelRunHistory/COMPONENT_SUMMARY.md +246 -0
  50. package/src/components/FunnelRunHistory/FunnelRunHistory.stories.tsx +272 -0
  51. package/src/components/FunnelRunHistory/FunnelRunHistory.test.tsx +323 -0
  52. package/src/components/FunnelRunHistory/FunnelRunHistory.tsx +329 -0
  53. package/src/components/FunnelRunHistory/README.md +325 -0
  54. package/src/components/FunnelRunHistory/RunActions.tsx +168 -0
  55. package/src/components/FunnelRunHistory/RunDetailsModal.tsx +221 -0
  56. package/src/components/FunnelRunHistory/RunFilters.tsx +128 -0
  57. package/src/components/FunnelRunHistory/RunRow.tsx +122 -0
  58. package/src/components/FunnelRunHistory/RunStatusBadge.tsx +75 -0
  59. package/src/components/FunnelRunHistory/StageBreakdownList.tsx +110 -0
  60. package/src/components/FunnelRunHistory/index.ts +51 -0
  61. package/src/components/FunnelRunHistory/types.ts +40 -0
  62. package/src/components/FunnelRunHistory/utils.test.ts +126 -0
  63. package/src/components/FunnelRunHistory/utils.ts +100 -0
  64. package/src/components/FunnelStageBuilder/AddStageButton.tsx +52 -0
  65. package/src/components/FunnelStageBuilder/FunnelStageBuilder.css +413 -0
  66. package/src/components/FunnelStageBuilder/FunnelStageBuilder.stories.tsx +312 -0
  67. package/src/components/FunnelStageBuilder/FunnelStageBuilder.test.tsx +304 -0
  68. package/src/components/FunnelStageBuilder/FunnelStageBuilder.tsx +321 -0
  69. package/src/components/FunnelStageBuilder/README.md +341 -0
  70. package/src/components/FunnelStageBuilder/StageActions.test.tsx +205 -0
  71. package/src/components/FunnelStageBuilder/StageActions.tsx +126 -0
  72. package/src/components/FunnelStageBuilder/StageCard.tsx +202 -0
  73. package/src/components/FunnelStageBuilder/StageForm.tsx +262 -0
  74. package/src/components/FunnelStageBuilder/TagInput.test.tsx +178 -0
  75. package/src/components/FunnelStageBuilder/TagInput.tsx +129 -0
  76. package/src/components/FunnelStageBuilder/index.ts +21 -0
  77. package/src/components/FunnelVisualFlow/FlowLegend.tsx +77 -0
  78. package/{dist/components/index.css → src/components/FunnelVisualFlow/FunnelVisualFlow.css} +89 -13
  79. package/src/components/FunnelVisualFlow/FunnelVisualFlow.stories.tsx +254 -0
  80. package/src/components/FunnelVisualFlow/FunnelVisualFlow.test.tsx +208 -0
  81. package/src/components/FunnelVisualFlow/FunnelVisualFlow.tsx +229 -0
  82. package/src/components/FunnelVisualFlow/README.md +323 -0
  83. package/src/components/FunnelVisualFlow/StageNode.tsx +188 -0
  84. package/src/components/FunnelVisualFlow/example.tsx +227 -0
  85. package/src/components/FunnelVisualFlow/index.ts +10 -0
  86. package/src/components/index.ts +102 -0
  87. package/src/core/README.md +307 -0
  88. package/src/core/engine.test.ts +1087 -0
  89. package/src/core/engine.ts +329 -0
  90. package/src/core/evaluator.example.ts +353 -0
  91. package/src/core/evaluator.test.ts +639 -0
  92. package/src/core/evaluator.ts +261 -0
  93. package/src/core/field-resolver.example.ts +175 -0
  94. package/src/core/field-resolver.test.ts +541 -0
  95. package/src/core/field-resolver.ts +247 -0
  96. package/src/core/index.ts +34 -0
  97. package/src/core/operators.test.ts +539 -0
  98. package/src/core/operators.ts +241 -0
  99. package/src/hooks/index.ts +5 -0
  100. package/src/hooks/useDebouncedValue.ts +28 -0
  101. package/src/index.ts +155 -0
  102. package/src/store/README.md +342 -0
  103. package/src/store/create-funnel-store.test.ts +686 -0
  104. package/src/store/create-funnel-store.ts +538 -0
  105. package/src/store/index.ts +9 -0
  106. package/src/store/types.ts +294 -0
  107. package/src/stories/CrossDomain.stories.tsx +149 -0
  108. package/src/stories/Welcome.stories.tsx +81 -0
  109. package/src/stories/demo-data/index.ts +3 -0
  110. package/src/stories/demo-data/investors.ts +216 -0
  111. package/src/stories/demo-data/leads.ts +223 -0
  112. package/src/stories/demo-data/recipes.ts +217 -0
  113. package/src/test/setup.ts +5 -0
  114. package/src/types/index.ts +843 -0
  115. package/dist/client-3ESO2NHy.d.ts +0 -310
  116. package/dist/client-CZu03ACp.d.cts +0 -310
  117. package/dist/components/index.cjs +0 -3241
  118. package/dist/components/index.cjs.map +0 -1
  119. package/dist/components/index.css.map +0 -1
  120. package/dist/components/index.d.cts +0 -726
  121. package/dist/components/index.d.ts +0 -726
  122. package/dist/components/index.js +0 -3194
  123. package/dist/components/index.js.map +0 -1
  124. package/dist/core/index.cjs +0 -500
  125. package/dist/core/index.cjs.map +0 -1
  126. package/dist/core/index.d.cts +0 -359
  127. package/dist/core/index.d.ts +0 -359
  128. package/dist/core/index.js +0 -486
  129. package/dist/core/index.js.map +0 -1
  130. package/dist/hooks/index.cjs +0 -20
  131. package/dist/hooks/index.cjs.map +0 -1
  132. package/dist/hooks/index.d.cts +0 -11
  133. package/dist/hooks/index.d.ts +0 -11
  134. package/dist/hooks/index.js +0 -18
  135. package/dist/hooks/index.js.map +0 -1
  136. package/dist/index-BGDEXbuz.d.cts +0 -434
  137. package/dist/index-BGDEXbuz.d.ts +0 -434
  138. package/dist/index.cjs +0 -4499
  139. package/dist/index.cjs.map +0 -1
  140. package/dist/index.css +0 -198
  141. package/dist/index.css.map +0 -1
  142. package/dist/index.d.cts +0 -99
  143. package/dist/index.d.ts +0 -99
  144. package/dist/index.js +0 -4421
  145. package/dist/index.js.map +0 -1
  146. package/dist/store/index.cjs +0 -389
  147. package/dist/store/index.cjs.map +0 -1
  148. package/dist/store/index.d.cts +0 -225
  149. package/dist/store/index.d.ts +0 -225
  150. package/dist/store/index.js +0 -386
  151. package/dist/store/index.js.map +0 -1
@@ -1,726 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
3
- import { i as Funnel, k as FunnelRun, n as FunnelStatus, m as FunnelStage, o as StageStats, h as FilterRule, b as FieldDefinition, g as FilterLogic, O as Operator, M as MatchAction, N as NoMatchAction, l as FunnelRunStatus, T as TriggerType } from '../index-BGDEXbuz.cjs';
4
- import { NodeProps } from '@xyflow/react';
5
- import { F as FunnelApiClient } from '../client-CZu03ACp.cjs';
6
-
7
- /**
8
- * StageBreakdown Component
9
- *
10
- * Shows per-stage statistics in a funnel flow visualization.
11
- *
12
- * Design Rationale:
13
- * - Sequential list shows funnel flow from top to bottom
14
- * - Stage numbers (①②③) provide clear ordering
15
- * - Exclusion count (-N) shows entities removed at each stage
16
- * - Remaining count shows entities continuing to next stage
17
- * - Color coding: gray for excluded, green for final matched
18
- *
19
- * Accessibility:
20
- * - Semantic list structure
21
- * - Clear text labels for all metrics
22
- * - Color is supplementary to text
23
- */
24
- interface StagePreviewStats {
25
- stage_id: string;
26
- stage_name: string;
27
- input_count: number;
28
- excluded_count: number;
29
- remaining_count: number;
30
- }
31
- interface StageBreakdownProps {
32
- stageStats: Record<string, StagePreviewStats>;
33
- stages: Array<{
34
- id: string;
35
- name: string;
36
- order: number;
37
- }>;
38
- className?: string;
39
- }
40
- declare function StageBreakdown({ stageStats, stages, className, }: StageBreakdownProps): react_jsx_runtime.JSX.Element;
41
-
42
- interface PreviewResult {
43
- totalMatched: number;
44
- totalExcluded: number;
45
- matchPercentage: number;
46
- previewEntities: any[];
47
- stageStats: Record<string, StagePreviewStats>;
48
- }
49
- interface FunnelPreviewProps {
50
- funnel: Funnel;
51
- sampleEntities: any[];
52
- onPreview?: (result: PreviewResult) => void;
53
- renderEntity?: (entity: any) => ReactNode;
54
- maxPreviewEntities?: number;
55
- className?: string;
56
- }
57
- declare function FunnelPreview({ funnel, sampleEntities, onPreview, renderEntity, maxPreviewEntities, className, }: FunnelPreviewProps): react_jsx_runtime.JSX.Element | null;
58
-
59
- /**
60
- * PreviewStats Component
61
- *
62
- * Progress bar showing matched vs excluded entities with percentage.
63
- *
64
- * Design Rationale:
65
- * - Horizontal progress bar shows match rate at a glance
66
- * - Green (matched) and red (excluded) create clear visual distinction
67
- * - Percentage provides quick understanding of funnel effectiveness
68
- * - Counts below bar provide exact numbers
69
- *
70
- * Accessibility:
71
- * - ARIA progressbar role for screen readers
72
- * - Text labels provide non-visual indication
73
- * - Sufficient color contrast
74
- */
75
- interface PreviewStatsProps {
76
- totalMatched: number;
77
- totalExcluded: number;
78
- matchPercentage: number;
79
- className?: string;
80
- }
81
- declare function PreviewStats({ totalMatched, totalExcluded, matchPercentage, className, }: PreviewStatsProps): react_jsx_runtime.JSX.Element;
82
-
83
- interface EntityCardProps {
84
- entity: any;
85
- renderEntity?: (entity: any) => ReactNode;
86
- className?: string;
87
- }
88
- declare function EntityCard({ entity, renderEntity, className, }: EntityCardProps): react_jsx_runtime.JSX.Element;
89
-
90
- /**
91
- * LoadingPreview Component
92
- *
93
- * Skeleton loading state for FunnelPreview.
94
- *
95
- * Design Rationale:
96
- * - Skeleton shapes match actual content layout
97
- * - Pulse animation indicates loading
98
- * - Gray placeholders maintain visual hierarchy
99
- * - Reduces perceived loading time
100
- *
101
- * Accessibility:
102
- * - ARIA live region announces loading state
103
- * - Screen readers informed of status change
104
- */
105
- declare function LoadingPreview(): react_jsx_runtime.JSX.Element;
106
-
107
- interface FunnelCardProps {
108
- /** Funnel definition (BRUTALLY GENERIC - works for any entity type) */
109
- funnel: Funnel;
110
- /** Latest run results (optional - shows "no runs yet" state if missing) */
111
- latestRun?: FunnelRun;
112
- /** Callback when "View Flow" is clicked */
113
- onViewFlow?: (funnel: Funnel) => void;
114
- /** Callback when edit action is triggered (future: click on card header) */
115
- onEdit?: (funnel: Funnel) => void;
116
- /** Additional CSS classes */
117
- className?: string;
118
- }
119
- declare function FunnelCard({ funnel, latestRun, onViewFlow, onEdit, className }: FunnelCardProps): react_jsx_runtime.JSX.Element;
120
-
121
- interface StatusBadgeProps {
122
- status: FunnelStatus;
123
- className?: string;
124
- }
125
- declare function StatusBadge({ status, className }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
126
-
127
- /**
128
- * StageIndicator Component
129
- *
130
- * Displays a numbered circle badge for funnel stages with connecting vertical line.
131
- *
132
- * Design Rationale:
133
- * - Numbered circles (①②③) provide clear sequential ordering
134
- * - Vertical connecting line shows flow/progression
135
- * - Compact layout conserves vertical space
136
- * - Gray text for rule count de-emphasizes secondary info
137
- *
138
- * Accessibility:
139
- * - Sufficient color contrast (4.5:1 minimum)
140
- * - Semantic HTML structure
141
- */
142
- interface StageIndicatorProps {
143
- order: number;
144
- name: string;
145
- ruleCount: number;
146
- isLast?: boolean;
147
- className?: string;
148
- }
149
- declare function StageIndicator({ order, name, ruleCount, isLast, className }: StageIndicatorProps): react_jsx_runtime.JSX.Element;
150
-
151
- /**
152
- * MatchBar Component
153
- *
154
- * Progress bar showing match percentage with count label.
155
- *
156
- * Design Rationale:
157
- * - Green gradient conveys success/completion
158
- * - Rounded corners match card aesthetic
159
- * - Label shows absolute count (more actionable than percentage alone)
160
- * - Gray background shows full scale
161
- *
162
- * Accessibility:
163
- * - Text label provides non-visual indication of value
164
- * - Sufficient contrast between bar and background
165
- */
166
- interface MatchBarProps {
167
- matched: number;
168
- total: number;
169
- className?: string;
170
- }
171
- declare function MatchBar({ matched, total, className }: MatchBarProps): react_jsx_runtime.JSX.Element;
172
-
173
- /**
174
- * FunnelStats Component
175
- *
176
- * Three-column stats display showing INPUT / MATCHED / EXCLUDED counts.
177
- *
178
- * Design Rationale:
179
- * - Three equal columns for balance
180
- * - Color coding: Blue (input/neutral), Green (matched/success), Red (excluded/warning)
181
- * - Large numbers draw attention to key metrics
182
- * - Labels use uppercase for consistency with status badge
183
- *
184
- * Accessibility:
185
- * - Semantic HTML (dl/dt/dd structure)
186
- * - Color is supplementary (text labels provide meaning)
187
- */
188
- interface FunnelStatsProps {
189
- input: number;
190
- matched: number;
191
- excluded: number;
192
- className?: string;
193
- }
194
- declare function FunnelStats({ input, matched, excluded, className }: FunnelStatsProps): react_jsx_runtime.JSX.Element;
195
-
196
- interface FunnelVisualFlowProps {
197
- /** Funnel definition */
198
- funnel: Funnel;
199
- /** Optional run data for showing counts */
200
- runData?: FunnelRun;
201
- /** Callback when stage node is clicked */
202
- onStageClick?: (stage: FunnelStage) => void;
203
- /** Callback when edge is clicked (fromStageId, toStageId) */
204
- onEdgeClick?: (fromStage: string, toStage: string) => void;
205
- /** Additional CSS classes */
206
- className?: string;
207
- /** Height of the flow container (default: 600px) */
208
- height?: number | string;
209
- }
210
- /**
211
- * Generate circled numbers for stage indicators (①②③)
212
- */
213
- declare function getCircledNumber(num: number): string;
214
- declare function FunnelVisualFlow({ funnel, runData, onStageClick, onEdgeClick, className, height, }: FunnelVisualFlowProps): react_jsx_runtime.JSX.Element;
215
-
216
- interface StageNodeData {
217
- stage: FunnelStage;
218
- stats?: StageStats;
219
- onStageClick?: (stage: FunnelStage) => void;
220
- }
221
- declare function StageNode({ data }: NodeProps): react_jsx_runtime.JSX.Element;
222
-
223
- /**
224
- * FlowLegend Component
225
- *
226
- * Legend explaining the color coding of funnel stages.
227
- *
228
- * Design:
229
- * - Minimal, non-intrusive panel in bottom-right
230
- * - Color swatches with labels
231
- * - Collapsible to save space
232
- *
233
- * Colors:
234
- * - Blue: Continue to next stage
235
- * - Red: Exclude entities
236
- * - Yellow: Tag entities
237
- * - Green: Final output
238
- */
239
- declare function FlowLegend(): react_jsx_runtime.JSX.Element;
240
-
241
- interface FilterRuleEditorProps {
242
- /** Current filter rules */
243
- rules: FilterRule[];
244
- /** Callback when rules change */
245
- onChange: (rules: FilterRule[]) => void;
246
- /** Field registry for the entity type */
247
- fieldRegistry: FieldDefinition[];
248
- /** Filter logic (AND/OR) */
249
- logic?: FilterLogic;
250
- /** Callback when logic changes */
251
- onLogicChange?: (logic: FilterLogic) => void;
252
- /** Additional CSS classes */
253
- className?: string;
254
- }
255
- declare function FilterRuleEditor({ rules, onChange, fieldRegistry, logic, onLogicChange, className, }: FilterRuleEditorProps): react_jsx_runtime.JSX.Element;
256
-
257
- interface LogicToggleProps {
258
- logic: FilterLogic;
259
- onChange: (logic: FilterLogic) => void;
260
- className?: string;
261
- }
262
- declare function LogicToggle({ logic, onChange, className }: LogicToggleProps): react_jsx_runtime.JSX.Element;
263
-
264
- interface FieldSelectorProps {
265
- fields: FieldDefinition[];
266
- value: string;
267
- onChange: (fieldName: string) => void;
268
- error?: string;
269
- className?: string;
270
- }
271
- declare function FieldSelector({ fields, value, onChange, error, className, }: FieldSelectorProps): react_jsx_runtime.JSX.Element;
272
-
273
- interface OperatorSelectorProps {
274
- operators: Operator[];
275
- value: Operator | '';
276
- onChange: (operator: Operator) => void;
277
- disabled?: boolean;
278
- error?: string;
279
- className?: string;
280
- }
281
- declare function OperatorSelector({ operators, value, onChange, disabled, error, className, }: OperatorSelectorProps): react_jsx_runtime.JSX.Element;
282
-
283
- interface RuleRowProps {
284
- rule: FilterRule;
285
- onChange: (rule: FilterRule) => void;
286
- onRemove: () => void;
287
- fieldRegistry: FieldDefinition[];
288
- className?: string;
289
- }
290
- declare function RuleRow({ rule, onChange, onRemove, fieldRegistry, className, }: RuleRowProps): react_jsx_runtime.JSX.Element;
291
-
292
- /**
293
- * TextValueInput Component
294
- *
295
- * Text input for string values.
296
- *
297
- * Design Goal:
298
- * Simple text entry for string comparisons (contains, equals, etc.).
299
- *
300
- * Visual Hierarchy Rationale:
301
- * - Standard text input styling
302
- * - Placeholder text provides context
303
- * - Error state clearly indicated with red border
304
- */
305
- interface TextValueInputProps {
306
- value: string;
307
- onChange: (value: string) => void;
308
- placeholder?: string;
309
- error?: string;
310
- className?: string;
311
- }
312
- declare function TextValueInput({ value, onChange, placeholder, error, className, }: TextValueInputProps): react_jsx_runtime.JSX.Element;
313
-
314
- /**
315
- * NumberValueInput Component
316
- *
317
- * Numeric input for number comparisons.
318
- *
319
- * Design Goal:
320
- * Precise number entry with validation for numeric fields.
321
- *
322
- * Visual Hierarchy Rationale:
323
- * - Standard number input with browser controls
324
- * - Constraints (min/max) applied if provided
325
- * - Error state clearly indicated
326
- *
327
- * Interaction Notes:
328
- * - Arrow keys increment/decrement
329
- * - Scroll wheel adjusts value (browser default)
330
- * - Respects min/max constraints
331
- */
332
- interface NumberValueInputProps {
333
- value: number | null;
334
- onChange: (value: number | null) => void;
335
- min?: number;
336
- max?: number;
337
- placeholder?: string;
338
- error?: string;
339
- className?: string;
340
- }
341
- declare function NumberValueInput({ value, onChange, min, max, placeholder, error, className, }: NumberValueInputProps): react_jsx_runtime.JSX.Element;
342
-
343
- /**
344
- * DateValueInput Component
345
- *
346
- * Date input for date comparisons.
347
- *
348
- * Design Goal:
349
- * Intuitive date selection with browser-native date picker.
350
- *
351
- * Visual Hierarchy Rationale:
352
- * - Native date input for familiar UX
353
- * - Calendar picker on click (browser default)
354
- * - ISO date format for consistency
355
- *
356
- * Interaction Notes:
357
- * - Click to open calendar picker
358
- * - Keyboard entry also supported (YYYY-MM-DD)
359
- * - Respects min/max constraints
360
- *
361
- * Accessibility Considerations:
362
- * - Native date input is screen reader friendly
363
- * - Keyboard navigation supported
364
- */
365
- interface DateValueInputProps {
366
- value: string | null;
367
- onChange: (value: string | null) => void;
368
- min?: string;
369
- max?: string;
370
- placeholder?: string;
371
- error?: string;
372
- className?: string;
373
- }
374
- declare function DateValueInput({ value, onChange, min, max, placeholder, error, className, }: DateValueInputProps): react_jsx_runtime.JSX.Element;
375
-
376
- /**
377
- * BooleanValueInput Component
378
- *
379
- * Checkbox input for boolean values.
380
- *
381
- * Design Goal:
382
- * Simple true/false toggle for boolean fields.
383
- *
384
- * Visual Hierarchy Rationale:
385
- * - Checkbox with clear label
386
- * - Aligned with other value inputs
387
- * - Checked state visually distinct
388
- *
389
- * Interaction Notes:
390
- * - Click checkbox or label to toggle
391
- * - Space bar toggles when focused
392
- *
393
- * Accessibility Considerations:
394
- * - Proper label association
395
- * - Keyboard accessible
396
- * - Focus visible
397
- */
398
- interface BooleanValueInputProps {
399
- value: boolean;
400
- onChange: (value: boolean) => void;
401
- label?: string;
402
- error?: string;
403
- className?: string;
404
- }
405
- declare function BooleanValueInput({ value, onChange, label, error, className, }: BooleanValueInputProps): react_jsx_runtime.JSX.Element;
406
-
407
- /**
408
- * ChoiceValueInput Component
409
- *
410
- * Single-select dropdown for choice fields.
411
- *
412
- * Design Goal:
413
- * Select a single value from predefined choices (e.g., firm stage, recipe cuisine).
414
- *
415
- * Visual Hierarchy Rationale:
416
- * - Standard select dropdown
417
- * - Choices provided by field definition
418
- * - Clear placeholder when nothing selected
419
- *
420
- * Interaction Notes:
421
- * - Click to open dropdown
422
- * - Keyboard navigation supported
423
- * - Selected value shown in dropdown
424
- *
425
- * Accessibility Considerations:
426
- * - Proper label association
427
- * - Keyboard navigation (arrow keys)
428
- * - Focus visible
429
- */
430
- interface ChoiceValueInputProps {
431
- value: string;
432
- onChange: (value: string) => void;
433
- choices: any[];
434
- placeholder?: string;
435
- error?: string;
436
- className?: string;
437
- }
438
- declare function ChoiceValueInput({ value, onChange, choices, placeholder, error, className, }: ChoiceValueInputProps): react_jsx_runtime.JSX.Element;
439
-
440
- /**
441
- * MultiChoiceValueInput Component
442
- *
443
- * Multi-select for choosing multiple values from choices.
444
- *
445
- * Design Goal:
446
- * Select multiple values for 'in', 'has_any', 'has_all' operators.
447
- * For example: "Firm stage is one of [Series A, Series B, Series C]".
448
- *
449
- * Visual Hierarchy Rationale:
450
- * - Tag-based interface shows selected values as pills
451
- * - Each tag has an X button to remove
452
- * - Dropdown allows adding more selections
453
- * - Compact layout for multiple values
454
- *
455
- * Interaction Notes:
456
- * - Select from dropdown to add value
457
- * - Click X on tag to remove value
458
- * - Can select multiple values
459
- * - Already-selected values hidden from dropdown
460
- *
461
- * Accessibility Considerations:
462
- * - Keyboard navigation for dropdown
463
- * - Focus management for tag removal
464
- * - Screen reader announces selected items
465
- */
466
- interface MultiChoiceValueInputProps {
467
- value: string[];
468
- onChange: (value: string[]) => void;
469
- choices: any[];
470
- placeholder?: string;
471
- error?: string;
472
- className?: string;
473
- }
474
- declare function MultiChoiceValueInput({ value, onChange, choices, placeholder, error, className, }: MultiChoiceValueInputProps): react_jsx_runtime.JSX.Element;
475
-
476
- /**
477
- * FilterRuleEditor Constants
478
- *
479
- * Operator labels and field type mappings
480
- */
481
-
482
- declare const OPERATOR_LABELS: Record<Operator, string>;
483
- /**
484
- * Operators that don't require a value input
485
- */
486
- declare const NULL_VALUE_OPERATORS: Operator[];
487
- /**
488
- * Operators that require array/multi-value input
489
- */
490
- declare const MULTI_VALUE_OPERATORS: Operator[];
491
-
492
- interface FunnelStageBuilderProps {
493
- /** The funnel being edited */
494
- funnel: Funnel;
495
- /** Callback when funnel is updated */
496
- onUpdate: (funnel: Funnel) => void;
497
- /** Available fields for filter rules */
498
- fieldRegistry: FieldDefinition[];
499
- /** Optional CSS class */
500
- className?: string;
501
- }
502
- /**
503
- * Main FunnelStageBuilder component
504
- */
505
- declare function FunnelStageBuilder({ funnel, onUpdate, fieldRegistry, className, }: FunnelStageBuilderProps): react_jsx_runtime.JSX.Element;
506
-
507
- interface StageCardProps {
508
- /** The stage to display */
509
- stage: FunnelStage;
510
- /** Whether stage is expanded */
511
- expanded: boolean;
512
- /** Toggle expanded state */
513
- onToggleExpanded: () => void;
514
- /** Update stage */
515
- onUpdate: (stage: FunnelStage) => void;
516
- /** Remove stage */
517
- onRemove: () => void;
518
- /** Available fields */
519
- fieldRegistry: FieldDefinition[];
520
- /** Validation error */
521
- error?: string;
522
- /** Show warnings */
523
- showWarnings?: boolean;
524
- }
525
- /**
526
- * StageCard component
527
- */
528
- declare function StageCard({ stage, expanded, onToggleExpanded, onUpdate, onRemove, fieldRegistry, error, showWarnings, }: StageCardProps): react_jsx_runtime.JSX.Element;
529
-
530
- interface StageFormProps {
531
- /** The stage being edited */
532
- stage: FunnelStage;
533
- /** Update stage */
534
- onUpdate: (stage: FunnelStage) => void;
535
- /** Available fields */
536
- fieldRegistry: FieldDefinition[];
537
- }
538
- /**
539
- * StageForm component
540
- */
541
- declare function StageForm({ stage, onUpdate, fieldRegistry, }: StageFormProps): react_jsx_runtime.JSX.Element;
542
-
543
- interface StageActionsProps {
544
- /** The stage being configured */
545
- stage: FunnelStage;
546
- /** Match action change handler */
547
- onMatchActionChange: (action: MatchAction) => void;
548
- /** No match action change handler */
549
- onNoMatchActionChange: (action: NoMatchAction) => void;
550
- }
551
- /**
552
- * StageActions component
553
- */
554
- declare function StageActions({ stage, onMatchActionChange, onNoMatchActionChange, }: StageActionsProps): react_jsx_runtime.JSX.Element;
555
-
556
- /**
557
- * TagInput - Multi-tag input component
558
- *
559
- * Features:
560
- * - Add tags with Enter or comma
561
- * - Remove tags with click
562
- * - Visual tag chips
563
- * - Duplicate prevention
564
- */
565
- interface TagInputProps {
566
- /** Current tags */
567
- tags: string[];
568
- /** Change handler */
569
- onChange: (tags: string[]) => void;
570
- /** Input placeholder */
571
- placeholder?: string;
572
- /** Optional CSS class */
573
- className?: string;
574
- }
575
- /**
576
- * TagInput component
577
- */
578
- declare function TagInput({ tags, onChange, placeholder, className, }: TagInputProps): react_jsx_runtime.JSX.Element;
579
-
580
- /**
581
- * AddStageButton - Button to add new stages
582
- *
583
- * Features:
584
- * - Different styles for top/bottom/inline positions
585
- * - Clear visual affordance
586
- */
587
- interface AddStageButtonProps {
588
- /** Click handler */
589
- onClick: () => void;
590
- /** Position context */
591
- position: 'top' | 'bottom' | 'inline';
592
- /** Optional CSS class */
593
- className?: string;
594
- }
595
- /**
596
- * AddStageButton component
597
- */
598
- declare function AddStageButton({ onClick, position, className, }: AddStageButtonProps): react_jsx_runtime.JSX.Element;
599
-
600
- interface FunnelRunHistoryProps {
601
- funnelId: string;
602
- apiClient: FunnelApiClient;
603
- onViewResults?: (run: FunnelRun) => void;
604
- className?: string;
605
- }
606
- declare function FunnelRunHistory({ funnelId, apiClient, onViewResults, className, }: FunnelRunHistoryProps): react_jsx_runtime.JSX.Element;
607
-
608
- interface RunStatusBadgeProps {
609
- status: FunnelRunStatus;
610
- className?: string;
611
- }
612
- declare function RunStatusBadge({ status, className }: RunStatusBadgeProps): react_jsx_runtime.JSX.Element;
613
-
614
- /**
615
- * FunnelRunHistory Types
616
- *
617
- * Shared types for the run history component suite
618
- */
619
-
620
- /**
621
- * Filter state for run history
622
- */
623
- interface RunFilters$1 {
624
- status?: FunnelRunStatus | 'all';
625
- trigger_type?: TriggerType | 'all';
626
- date_range?: 'all' | 'today' | 'week' | 'month' | 'custom';
627
- start_date?: Date;
628
- end_date?: Date;
629
- }
630
- /**
631
- * Sort configuration for run history
632
- */
633
- interface RunSort {
634
- field: 'started_at' | 'status' | 'match_rate' | 'duration_ms';
635
- direction: 'asc' | 'desc';
636
- }
637
- /**
638
- * Pagination state
639
- */
640
- interface Pagination {
641
- page: number;
642
- page_size: number;
643
- total: number;
644
- }
645
- /**
646
- * Run action types
647
- */
648
- type RunAction = 'view_details' | 'view_results' | 're_run' | 'cancel';
649
-
650
- interface RunFiltersProps {
651
- filters: RunFilters$1;
652
- onFiltersChange: (filters: RunFilters$1) => void;
653
- className?: string;
654
- }
655
- declare function RunFilters({ filters, onFiltersChange, className, }: RunFiltersProps): react_jsx_runtime.JSX.Element;
656
-
657
- interface RunRowProps {
658
- run: FunnelRun;
659
- onViewDetails: (run: FunnelRun) => void;
660
- onViewResults: (run: FunnelRun) => void;
661
- onReRun: (run: FunnelRun) => void;
662
- onCancel?: (run: FunnelRun) => void;
663
- }
664
- declare function RunRow({ run, onViewDetails, onViewResults, onReRun, onCancel, }: RunRowProps): react_jsx_runtime.JSX.Element;
665
-
666
- interface RunActionsProps {
667
- run: FunnelRun;
668
- onViewDetails: (run: FunnelRun) => void;
669
- onViewResults: (run: FunnelRun) => void;
670
- onReRun: (run: FunnelRun) => void;
671
- onCancel?: (run: FunnelRun) => void;
672
- className?: string;
673
- }
674
- declare function RunActions({ run, onViewDetails, onViewResults, onReRun, onCancel, className, }: RunActionsProps): react_jsx_runtime.JSX.Element;
675
-
676
- interface RunDetailsModalProps {
677
- run: FunnelRun | null;
678
- onClose: () => void;
679
- onViewResults?: (run: FunnelRun) => void;
680
- onReRun?: (run: FunnelRun) => void;
681
- }
682
- declare function RunDetailsModal({ run, onClose, onViewResults, onReRun, }: RunDetailsModalProps): react_jsx_runtime.JSX.Element | null;
683
-
684
- interface StageBreakdownListProps {
685
- stages: StageStats[];
686
- className?: string;
687
- }
688
- declare function StageBreakdownList({ stages, className, }: StageBreakdownListProps): react_jsx_runtime.JSX.Element;
689
-
690
- /**
691
- * FunnelRunHistory Utilities
692
- *
693
- * Helper functions for formatting and calculations
694
- */
695
- /**
696
- * Format duration in milliseconds to human-readable string
697
- *
698
- * Examples:
699
- * - 1234 → "1.2s"
700
- * - 65000 → "1m 5s"
701
- * - 3661000 → "1h 1m"
702
- */
703
- declare function formatDuration(ms?: number): string;
704
- /**
705
- * Format relative time
706
- *
707
- * Examples:
708
- * - 5 minutes ago → "5m ago"
709
- * - 2 hours ago → "2h ago"
710
- * - Yesterday → "1d ago"
711
- */
712
- declare function formatRelativeTime(date: Date | string): string;
713
- /**
714
- * Calculate match rate percentage
715
- */
716
- declare function calculateMatchRate(matched: number, total: number): number;
717
- /**
718
- * Format number with commas
719
- */
720
- declare function formatNumber(num: number): string;
721
- /**
722
- * Format full timestamp for tooltips
723
- */
724
- declare function formatFullTimestamp(date: Date | string): string;
725
-
726
- export { AddStageButton, type AddStageButtonProps, BooleanValueInput, ChoiceValueInput, DateValueInput, EntityCard, FieldSelector, FilterRuleEditor, type FilterRuleEditorProps, FlowLegend, FunnelCard, type FunnelCardProps, FunnelPreview, type FunnelPreviewProps, FunnelRunHistory, FunnelStageBuilder, type FunnelStageBuilderProps, FunnelStats, FunnelVisualFlow, type FunnelVisualFlowProps, LoadingPreview, LogicToggle, MULTI_VALUE_OPERATORS, MatchBar, MultiChoiceValueInput, NULL_VALUE_OPERATORS, NumberValueInput, OPERATOR_LABELS, OperatorSelector, type Pagination, type PreviewResult, PreviewStats, RuleRow, type RunAction, RunActions, RunDetailsModal, RunFilters, type RunFilters$1 as RunFiltersType, RunRow, type RunSort, RunStatusBadge, StageActions, type StageActionsProps, StageBreakdown, StageBreakdownList, StageCard, type StageCardProps, StageForm, type StageFormProps, StageIndicator, StageNode, type StageNodeData, type StagePreviewStats, StatusBadge, TagInput, type TagInputProps, TextValueInput, calculateMatchRate, formatDuration, formatFullTimestamp, formatNumber, formatRelativeTime, getCircledNumber };