@habit.analytics/habit-claims-journey-components 1.1.13 → 1.1.15
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/components/NavLink.d.ts +8 -0
- package/dist/components/journey-builder/ConditionalEdge.d.ts +10 -0
- package/dist/components/journey-builder/CreateNodeDialog.d.ts +18 -0
- package/dist/components/journey-builder/EdgePropertiesEditor.d.ts +1 -0
- package/dist/components/journey-builder/FormPreviewPanel.d.ts +3 -0
- package/dist/components/journey-builder/GraphValidationPanel.d.ts +1 -0
- package/dist/components/journey-builder/ImportJourneyDialog.d.ts +1 -0
- package/dist/components/journey-builder/JourneyBuilder.d.ts +12 -0
- package/dist/components/journey-builder/JourneyBuilderWidget.d.ts +81 -0
- package/dist/components/journey-builder/JourneyCanvas.d.ts +4 -0
- package/dist/components/journey-builder/KeyboardShortcutsHelp.d.ts +6 -0
- package/dist/components/journey-builder/NodePropertiesEditor.d.ts +1 -0
- package/dist/components/journey-builder/NodeSearchPalette.d.ts +6 -0
- package/dist/components/journey-builder/PortalContext.d.ts +7 -0
- package/dist/components/journey-builder/PropertiesPanel.d.ts +1 -0
- package/dist/components/journey-builder/QuestionNode.d.ts +11 -0
- package/dist/components/journey-builder/SpecsCatalog.d.ts +17 -0
- package/dist/components/journey-builder/SpecsContext.d.ts +3 -0
- package/dist/components/journey-builder/edge-editor/ConditionRow.d.ts +13 -0
- package/dist/components/journey-builder/edge-editor/ConditionTemplates.d.ts +6 -0
- package/dist/components/journey-builder/edge-editor/ConditionTestPanel.d.ts +9 -0
- package/dist/components/journey-builder/edge-editor/VisualConditionEditor.d.ts +11 -0
- package/dist/components/journey-builder/edge-editor/condition-utils.d.ts +24 -0
- package/dist/components/journey-builder/preview-widgets/CurrencyWidget.d.ts +9 -0
- package/dist/components/journey-builder/preview-widgets/DateTimeWidget.d.ts +10 -0
- package/dist/components/journey-builder/preview-widgets/DateWidget.d.ts +10 -0
- package/dist/components/journey-builder/preview-widgets/EmailWidget.d.ts +10 -0
- package/dist/components/journey-builder/preview-widgets/LocationWidget.d.ts +9 -0
- package/dist/components/journey-builder/preview-widgets/PhoneWidget.d.ts +10 -0
- package/dist/components/journey-builder/preview-widgets/SelectWidget.d.ts +10 -0
- package/dist/components/journey-builder/preview-widgets/TextWidget.d.ts +10 -0
- package/dist/components/journey-builder/preview-widgets/TimeWidget.d.ts +14 -0
- package/dist/components/journey-builder/preview-widgets/UploadWidget.d.ts +12 -0
- package/dist/components/journey-builder/preview-widgets/WidgetRenderer.d.ts +12 -0
- package/dist/components/runner/AnswerHistoryList.d.ts +11 -0
- package/dist/components/runner/FormRunnerWidget.d.ts +21 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/carousel.d.ts +18 -0
- package/dist/components/ui/chart.d.ts +62 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/command.d.ts +82 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/drawer.d.ts +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-otp.d.ts +34 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +33 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +23 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +66 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/toast.d.ts +15 -0
- package/dist/components/ui/toaster.d.ts +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/use-toast.d.ts +2 -0
- package/dist/data/country-codes.d.ts +7 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts +44 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +20 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/locales/en.d.ts +163 -0
- package/dist/i18n/locales/es.d.ts +3 -0
- package/dist/i18n/locales/pl.d.ts +3 -0
- package/dist/i18n/locales/pt.d.ts +3 -0
- package/dist/i18n/useTranslation.d.ts +19 -0
- package/dist/index.cjs +69 -107
- package/{src/index.ts → dist/index.d.ts} +1 -23
- package/dist/index.mjs +9517 -16075
- package/dist/lib/graph-validation.d.ts +15 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/stores/journeyBuilderStore.d.ts +72 -0
- package/dist/types/journey.d.ts +326 -0
- package/package.json +6 -7
- package/src/types/journey.ts +0 -273
- package/src/types/json-logic-js.d.ts +0 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NavLinkProps } from 'react-router-dom';
|
|
2
|
+
interface NavLinkCompatProps extends Omit<NavLinkProps, "className"> {
|
|
3
|
+
className?: string;
|
|
4
|
+
activeClassName?: string;
|
|
5
|
+
pendingClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const NavLink: import('react').ForwardRefExoticComponent<NavLinkCompatProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
8
|
+
export { NavLink };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EdgeProps } from '@xyflow/react';
|
|
2
|
+
import { JourneyEdgeData } from '../../types/journey';
|
|
3
|
+
interface ConditionalEdgeProps extends Omit<EdgeProps, 'data'> {
|
|
4
|
+
data?: JourneyEdgeData & {
|
|
5
|
+
isInPreviewPath?: boolean;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare function ConditionalEdge({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, selected, }: ConditionalEdgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const _default: import('react').MemoExoticComponent<typeof ConditionalEdge>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClaimPropertySpec, ClaimPropertySpecOption } from '../../types/journey';
|
|
2
|
+
interface CreateNodeDialogProps {
|
|
3
|
+
specs: ClaimPropertySpec[];
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
onCreateNode: (nodeData: {
|
|
7
|
+
label: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
schema: string;
|
|
10
|
+
options: ClaimPropertySpecOption[] | null;
|
|
11
|
+
bindings: {
|
|
12
|
+
target_namespace: string;
|
|
13
|
+
spec_id?: string;
|
|
14
|
+
}[];
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function CreateNodeDialog({ specs, open, onOpenChange, onCreateNode }: CreateNodeDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EdgePropertiesEditor(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GraphValidationPanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ImportJourneyDialog(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ClaimPropertySpec } from '../../types/journey';
|
|
2
|
+
interface JourneyBuilderProps {
|
|
3
|
+
specs: ClaimPropertySpec[];
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
onSave?: () => void;
|
|
6
|
+
onPublish?: () => void;
|
|
7
|
+
onUnlockEdit?: () => void;
|
|
8
|
+
onOpenRunner?: () => void;
|
|
9
|
+
googleMapsApiKey?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function JourneyBuilder({ specs, readOnly, onSave, onPublish, onUnlockEdit, onOpenRunner, googleMapsApiKey }: JourneyBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ClaimPropertySpec, JourneySpec } from '../../types/journey';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the {@link JourneyBuilderWidget} component.
|
|
4
|
+
*
|
|
5
|
+
* The widget is a self-contained, embeddable graph editor.
|
|
6
|
+
* All data is provided via props — the widget makes no API calls.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <JourneyBuilderWidget
|
|
11
|
+
* specs={mySpecs}
|
|
12
|
+
* journey={existingJourney}
|
|
13
|
+
* onSave={(j) => api.saveJourney(j)}
|
|
14
|
+
* onChange={(j) => console.log('changed', j)}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface JourneyBuilderWidgetProps {
|
|
19
|
+
/**
|
|
20
|
+
* Field specifications displayed in the drag-and-drop catalog.
|
|
21
|
+
* Each spec defines a question type, schema, label, and options.
|
|
22
|
+
*/
|
|
23
|
+
specs: ClaimPropertySpec[];
|
|
24
|
+
/**
|
|
25
|
+
* An existing journey to load into the editor on mount.
|
|
26
|
+
* Pass `null` or omit for a blank canvas.
|
|
27
|
+
*/
|
|
28
|
+
journey?: JourneySpec | null;
|
|
29
|
+
/**
|
|
30
|
+
* Called when the user explicitly saves/exports the journey
|
|
31
|
+
* (e.g. via the Export JSON toolbar button).
|
|
32
|
+
*/
|
|
33
|
+
onSave?: (journeySpec: JourneySpec) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Called when the user clicks "Publish" in the toolbar.
|
|
36
|
+
* Only visible when readOnly is false.
|
|
37
|
+
*/
|
|
38
|
+
onPublish?: (journeySpec: JourneySpec) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Called when the user clicks "Unlock Edit" in the toolbar.
|
|
41
|
+
* Only visible when readOnly is true.
|
|
42
|
+
*/
|
|
43
|
+
onUnlockEdit?: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Called on every graph mutation — node add/remove/move,
|
|
46
|
+
* edge connect/disconnect, property edits, etc.
|
|
47
|
+
* Useful for auto-save or real-time sync.
|
|
48
|
+
*/
|
|
49
|
+
onChange?: (journeySpec: JourneySpec) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when the user clicks "Open Runner" in the toolbar.
|
|
52
|
+
* If omitted, the button is hidden.
|
|
53
|
+
*/
|
|
54
|
+
onOpenRunner?: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* When true, the builder is displayed in read-only mode.
|
|
57
|
+
* Editing, saving, and drag-and-drop are disabled.
|
|
58
|
+
* Use this for displaying published journeys.
|
|
59
|
+
*/
|
|
60
|
+
readOnly?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Google Maps API key for the location autocomplete widget.
|
|
63
|
+
* Required only when using location-type fields.
|
|
64
|
+
*/
|
|
65
|
+
googleMapsApiKey?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A self-contained visual journey builder widget.
|
|
69
|
+
*
|
|
70
|
+
* Renders a three-panel layout:
|
|
71
|
+
* - **Left** — searchable specs catalog with drag-and-drop
|
|
72
|
+
* - **Center** — React Flow canvas for building the graph
|
|
73
|
+
* - **Right** — property editor for the selected node or edge
|
|
74
|
+
* - **Bottom** — collapsible form preview panel
|
|
75
|
+
*
|
|
76
|
+
* All state is managed internally via a Zustand store.
|
|
77
|
+
* The widget communicates outward only through `onSave` and `onChange` callbacks.
|
|
78
|
+
*
|
|
79
|
+
* @param props - See {@link JourneyBuilderWidgetProps}
|
|
80
|
+
*/
|
|
81
|
+
export declare function JourneyBuilderWidget({ specs, journey, onSave, onPublish, onUnlockEdit, onChange, onOpenRunner, readOnly, googleMapsApiKey }: JourneyBuilderWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NodePropertiesEditor(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context that provides a DOM container for Radix portals.
|
|
3
|
+
* When set, all Dialog/Select/Sheet portals render inside this container
|
|
4
|
+
* instead of document.body — critical for embedding in host app dialogs.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PortalContainerContext: import('react').Context<HTMLElement>;
|
|
7
|
+
export declare function usePortalContainer(): HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PropertiesPanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JourneyNodeData } from '../../types/journey';
|
|
2
|
+
interface QuestionNodeProps {
|
|
3
|
+
data: JourneyNodeData & {
|
|
4
|
+
isInPreviewPath?: boolean;
|
|
5
|
+
isCurrentPreviewNode?: boolean;
|
|
6
|
+
};
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function QuestionNode({ data, selected }: QuestionNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const _default: import('react').MemoExoticComponent<typeof QuestionNode>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ClaimPropertySpec, ClaimPropertySpecOption } from '../../types/journey';
|
|
2
|
+
interface SpecsCatalogProps {
|
|
3
|
+
specs: ClaimPropertySpec[];
|
|
4
|
+
onDragStart: (spec: ClaimPropertySpec) => void;
|
|
5
|
+
onCreateCustomNode: (nodeData: {
|
|
6
|
+
label: string;
|
|
7
|
+
namespace: string;
|
|
8
|
+
schema: string;
|
|
9
|
+
options: ClaimPropertySpecOption[] | null;
|
|
10
|
+
bindings: {
|
|
11
|
+
target_namespace: string;
|
|
12
|
+
spec_id?: string;
|
|
13
|
+
}[];
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function SpecsCatalog({ specs, onDragStart, onCreateCustomNode }: SpecsCatalogProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VisualRule } from './condition-utils';
|
|
2
|
+
interface ConditionRowProps {
|
|
3
|
+
rule: VisualRule;
|
|
4
|
+
availableFields: {
|
|
5
|
+
namespace: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
canRemove: boolean;
|
|
9
|
+
onChange: (updates: Partial<VisualRule>) => void;
|
|
10
|
+
onRemove: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function ConditionRow({ rule, availableFields, canRemove, onChange, onRemove }: ConditionRowProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VisualConditions } from './condition-utils';
|
|
2
|
+
interface ConditionTemplatesProps {
|
|
3
|
+
onSelect: (conditions: VisualConditions) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function ConditionTemplates({ onSelect }: ConditionTemplatesProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ConditionTestPanelProps {
|
|
2
|
+
condition: Record<string, unknown> | null;
|
|
3
|
+
availableFields: {
|
|
4
|
+
namespace: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
}
|
|
8
|
+
export declare function ConditionTestPanel({ condition, availableFields }: ConditionTestPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VisualConditions } from './condition-utils';
|
|
2
|
+
interface VisualConditionEditorProps {
|
|
3
|
+
conditions: VisualConditions;
|
|
4
|
+
availableFields: {
|
|
5
|
+
namespace: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
onChange: (conditions: VisualConditions) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function VisualConditionEditor({ conditions, availableFields, onChange }: VisualConditionEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface VisualRule {
|
|
2
|
+
field: string;
|
|
3
|
+
operator: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface VisualConditions {
|
|
7
|
+
mode: 'and' | 'or';
|
|
8
|
+
rules: VisualRule[];
|
|
9
|
+
}
|
|
10
|
+
export declare const OPERATORS: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const VALUE_LESS_OPERATORS: string[];
|
|
15
|
+
export declare function parseConditions(condition: Record<string, unknown> | null): VisualConditions;
|
|
16
|
+
export declare function buildConditions(visual: VisualConditions): Record<string, unknown> | null;
|
|
17
|
+
export declare function createEmptyRule(): VisualRule;
|
|
18
|
+
/**
|
|
19
|
+
* Get all ancestor node IDs by traversing edges backwards from a given node.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAncestorNodeIds(nodeId: string, edges: {
|
|
22
|
+
source: string;
|
|
23
|
+
target: string;
|
|
24
|
+
}[]): Set<string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface CurrencyWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
helpText?: string;
|
|
6
|
+
currency?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CurrencyWidget({ label, value, onChange, helpText, currency, }: CurrencyWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface DateTimeWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
helpText?: string;
|
|
6
|
+
/** When false, future dates are disabled. Defaults to true. */
|
|
7
|
+
allowFuture?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function DateTimeWidget({ label, value, onChange, helpText, allowFuture, }: DateTimeWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface DateWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
helpText?: string;
|
|
6
|
+
/** When false (default), future dates are disabled. */
|
|
7
|
+
allowFuture?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function DateWidget({ label, value, onChange, helpText, allowFuture, }: DateWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface EmailWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
helpText?: string;
|
|
7
|
+
onValidationChange?: (hasError: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function EmailWidget({ label, value, onChange, placeholder, helpText, onValidationChange, }: EmailWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface LocationWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: unknown) => void;
|
|
5
|
+
onValidationChange?: (hasError: boolean) => void;
|
|
6
|
+
googleMapsApiKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function LocationWidget({ label, value, onChange, onValidationChange, googleMapsApiKey }: LocationWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface PhoneWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
helpText?: string;
|
|
7
|
+
onValidationChange?: (hasError: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function PhoneWidget({ label, value, onChange, placeholder, helpText, onValidationChange, }: PhoneWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClaimPropertySpecOption } from '../../../types/journey';
|
|
2
|
+
interface SelectWidgetProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
options: ClaimPropertySpecOption[];
|
|
7
|
+
helpText?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function SelectWidget({ label, value, onChange, options, helpText, }: SelectWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface TextWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
helpText?: string;
|
|
7
|
+
multiline?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function TextWidget({ label, value, onChange, placeholder, helpText, multiline, }: TextWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface TimeWidgetProps {
|
|
2
|
+
label: string;
|
|
3
|
+
/** ISO 8601 datetime string (we extract HH:mm) or empty */
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
helpText?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Adaptive time picker.
|
|
10
|
+
* Stores values as `HH:mm` (24h string). The native <input type="time">
|
|
11
|
+
* automatically renders 12h/24h based on the user's OS/browser locale.
|
|
12
|
+
*/
|
|
13
|
+
export declare function TimeWidget({ label, value, onChange, helpText }: TimeWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UploadResult } from '../../../types/journey';
|
|
2
|
+
interface UploadWidgetProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | UploadResult;
|
|
5
|
+
onChange: (value: string | UploadResult) => void;
|
|
6
|
+
onFileSelect?: (file: File) => Promise<string | UploadResult | void> | void;
|
|
7
|
+
helpText?: string;
|
|
8
|
+
accept?: string;
|
|
9
|
+
maxSizeMB?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function UploadWidget({ label, value, onChange, onFileSelect, helpText, accept, maxSizeMB, }: UploadWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JourneyNodeData, UploadResult } from '../../../types/journey';
|
|
2
|
+
interface WidgetRendererProps {
|
|
3
|
+
nodeData: JourneyNodeData;
|
|
4
|
+
value: unknown;
|
|
5
|
+
onChange: (value: unknown) => void;
|
|
6
|
+
onValidationChange?: (hasError: boolean) => void;
|
|
7
|
+
onFileSelect?: (file: File) => Promise<string | UploadResult | void> | void;
|
|
8
|
+
googleMapsApiKey?: string;
|
|
9
|
+
hideLabel?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function WidgetRenderer({ nodeData, value, onChange, onValidationChange, onFileSelect, googleMapsApiKey, hideLabel }: WidgetRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JourneyNodeData } from '../../types/journey';
|
|
2
|
+
import { Node } from '@xyflow/react';
|
|
3
|
+
interface AnswerHistoryListProps {
|
|
4
|
+
path: string[];
|
|
5
|
+
currentNodeId: string | null;
|
|
6
|
+
nodes: Node<JourneyNodeData>[];
|
|
7
|
+
answers: Record<string, unknown>;
|
|
8
|
+
onJumpTo: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function AnswerHistoryList({ path, currentNodeId, nodes, answers, onJumpTo }: AnswerHistoryListProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JourneySpec, ClaimPropertySpec, UploadResult } from '../../types/journey';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the {@link FormRunnerWidget} component.
|
|
4
|
+
*/
|
|
5
|
+
export interface FormRunnerWidgetProps {
|
|
6
|
+
journey: JourneySpec;
|
|
7
|
+
specs?: ClaimPropertySpec[];
|
|
8
|
+
onSubmit?: (answers: Record<string, unknown>) => void;
|
|
9
|
+
onSave?: (partialAnswers: Record<string, unknown>) => void;
|
|
10
|
+
onFileSelect?: (file: File, questionKey: string) => Promise<string | UploadResult | void> | void;
|
|
11
|
+
enrichedOutput?: boolean;
|
|
12
|
+
initialAnswers?: Record<string, unknown>;
|
|
13
|
+
googleMapsApiKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* When true (default), the widget fills the full viewport height (`min-h-screen`).
|
|
16
|
+
* Set to false when embedding inside a sized container — the widget will
|
|
17
|
+
* fill its parent (`h-full`) instead, so the parent must provide an explicit height.
|
|
18
|
+
*/
|
|
19
|
+
fullScreen?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function FormRunnerWidget({ journey, onSubmit, onSave, onFileSelect, enrichedOutput, initialAnswers, googleMapsApiKey, fullScreen }: FormRunnerWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
|
+
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
6
|
+
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const AlertDialogHeader: {
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
declare const AlertDialogFooter: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: {
|
|
4
|
+
variant?: "default" | "destructive";
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
5
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: {
|
|
4
|
+
variant?: "default" | "secondary" | "destructive" | "outline";
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
3
|
+
separator?: React.ReactNode;
|
|
4
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
7
|
+
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
declare const BreadcrumbSeparator: {
|
|
12
|
+
({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
declare const BreadcrumbEllipsis: {
|
|
16
|
+
({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: {
|
|
4
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost";
|
|
5
|
+
size?: "icon" | "default" | "sm" | "lg";
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DayPicker } from 'react-day-picker';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace Calendar {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as useEmblaCarousel, UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
4
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
5
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
6
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
7
|
+
type CarouselProps = {
|
|
8
|
+
opts?: CarouselOptions;
|
|
9
|
+
plugins?: CarouselPlugin;
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
setApi?: (api: CarouselApi) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import('./button').ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import('./button').ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext };
|