api_binding_ui 0.0.0-stage → 1.0.0

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.
@@ -0,0 +1,244 @@
1
+ /* src/styles/highradius-bridge.css */
2
+
3
+
4
+ /* src/styles/index.css */
5
+
6
+
7
+ /* src/styles/workspace.css */
8
+ .binding-workspace, .api-binding, .binding-v2 {
9
+ display: flex;
10
+ background: var(--ds-color-background, #fff);
11
+ color: var(--ds-color-foreground, #0f172a);
12
+ font-family: var(--ds-font-family-sans, sans-serif);
13
+ flex-direction: column;
14
+ height: 100vh;
15
+ }
16
+
17
+ .binding-workspace h1, .api-binding h1, .binding-v2 h1 {
18
+ font-size: var(--ds-font-size-2xl, 1.5rem);
19
+ font-weight: var(--ds-font-weight-bold, 700);
20
+ margin: 0;
21
+ }
22
+
23
+ .binding-workspace h2, .api-binding h2, .binding-v2 h2 {
24
+ font-size: var(--ds-font-size-lg, 1.125rem);
25
+ font-weight: var(--ds-font-weight-semibold, 600);
26
+ margin: 0;
27
+ }
28
+
29
+ .binding-workspace h3, .api-binding h3, .binding-v2 h3 {
30
+ font-size: var(--ds-font-size-base, .875rem);
31
+ font-weight: var(--ds-font-weight-semibold, 600);
32
+ margin: 0;
33
+ }
34
+
35
+ .binding-workspace p, .api-binding p, .binding-v2 p {
36
+ line-height: var(--ds-line-height-normal, 1.5);
37
+ margin: 0;
38
+ }
39
+
40
+ .binding-header, .binding-footer, .binding-v2-header, .binding-v2-footer {
41
+ padding: var(--ds-page-padding, 1rem 1.5rem);
42
+ display: flex;
43
+ gap: var(--ds-space-4, 1rem);
44
+ flex-wrap: wrap;
45
+ justify-content: space-between;
46
+ align-items: center;
47
+ }
48
+
49
+ .binding-header, .binding-v2-header {
50
+ border-bottom-width: var(--ds-screen-surface-border-width, 1px);
51
+ border-bottom-style: solid;
52
+ border-bottom-color: var(--ds-color-border, #e2e8f0);
53
+ }
54
+
55
+ .binding-body, .binding-v2-body {
56
+ overflow: auto;
57
+ position: relative;
58
+ padding: var(--ds-page-padding, 1rem 1.5rem);
59
+ flex: 1;
60
+ min-height: 0;
61
+ }
62
+
63
+ .binding-columns, .binding-v2-columns {
64
+ isolation: isolate;
65
+ display: flex;
66
+ gap: var(--ds-space-8, 2rem);
67
+ flex-wrap: wrap;
68
+ align-items: start;
69
+ }
70
+
71
+ .binding-main, .binding-v2-main {
72
+ flex-grow: 1;
73
+ flex-basis: var(--ds-dialog-form-min-width, 32rem);
74
+ padding-bottom: var(--ds-space-12, 3rem);
75
+ }
76
+
77
+ .binding-main, .binding-stack, .binding-v2-main, .binding-v2-stack {
78
+ display: flex;
79
+ gap: var(--ds-space-4, 1rem);
80
+ flex-direction: column;
81
+ min-width: 0;
82
+ }
83
+
84
+ .binding-section, .binding-v2-section {
85
+ padding-bottom: var(--ds-space-6, 1.5rem);
86
+ display: flex;
87
+ gap: var(--ds-space-4, 1rem);
88
+ border-bottom-width: var(--ds-screen-surface-border-width, 1px);
89
+ border-bottom-style: solid;
90
+ border-bottom-color: var(--ds-color-border, #e2e8f0);
91
+ flex-direction: column;
92
+ }
93
+
94
+ .binding-section-title, .binding-v2-section-title {
95
+ display: flex;
96
+ justify-content: space-between;
97
+ align-items: center;
98
+ gap: var(--ds-space-4, 1rem);
99
+ }
100
+
101
+ .binding-muted, .binding-v2-muted {
102
+ color: var(--ds-color-muted-foreground, #64748b);
103
+ font-size: var(--ds-font-size-sm, .8125rem);
104
+ }
105
+
106
+ .binding-preview, .binding-v2-preview {
107
+ flex-basis: var(--ds-dialog-min-width, 24rem);
108
+ position: sticky;
109
+ background: var(--ds-color-surface, #fff);
110
+ border-width: var(--ds-screen-surface-border-width, 1px);
111
+ border-style: solid;
112
+ border-color: var(--ds-color-border, #e2e8f0);
113
+ border-radius: var(--ds-radius-md, 6px);
114
+ padding: var(--ds-space-6, 1.5rem);
115
+ display: flex;
116
+ gap: var(--ds-space-4, 1rem);
117
+ flex-direction: column;
118
+ flex-grow: 0;
119
+ max-width: 100%;
120
+ top: 0;
121
+ }
122
+
123
+ .binding-panel, .binding-v2-panel {
124
+ position: absolute;
125
+ width: var(--ds-dialog-form-min-width, 32rem);
126
+ background: var(--ds-color-background, #fff);
127
+ border-left-width: var(--ds-screen-surface-border-width, 1px);
128
+ border-left-style: solid;
129
+ border-left-color: var(--ds-color-border, #e2e8f0);
130
+ box-shadow: var(--ds-shadow-md, 0 4px 6px -1px #0000001a);
131
+ padding: var(--ds-space-6, 1.5rem);
132
+ display: flex;
133
+ gap: var(--ds-space-6, 1.5rem);
134
+ z-index: var(--ds-focus-z-index, 50);
135
+ flex-direction: column;
136
+ max-width: 100%;
137
+ min-height: 100%;
138
+ top: 0;
139
+ right: 0;
140
+ }
141
+
142
+ .binding-details, .binding-v2-details {
143
+ display: flex;
144
+ gap: var(--ds-space-2, .5rem);
145
+ font-size: var(--ds-font-size-sm, .8125rem);
146
+ overflow-wrap: anywhere;
147
+ flex-direction: column;
148
+ }
149
+
150
+ .binding-details summary, .binding-v2-details summary {
151
+ cursor: pointer;
152
+ color: var(--ds-color-muted-foreground, #64748b);
153
+ }
154
+
155
+ .binding-footer, .binding-v2-footer {
156
+ border-top-width: var(--ds-screen-surface-border-width, 1px);
157
+ border-top-style: solid;
158
+ border-top-color: var(--ds-color-border, #e2e8f0);
159
+ background: var(--ds-color-background, #fff);
160
+ }
161
+
162
+ .binding-simulation, .binding-v2-simulation {
163
+ display: flex;
164
+ gap: var(--ds-space-4, 1rem);
165
+ flex-direction: column;
166
+ }
167
+
168
+ .binding-empty, .binding-v2-empty {
169
+ padding: var(--ds-space-12, 3rem);
170
+ margin: auto;
171
+ }
172
+
173
+ .binding-error, .binding-v2-error {
174
+ color: var(--ds-color-destructive, #ef4444);
175
+ }
176
+
177
+ .binding-stack-tight, .binding-v2-stack-tight {
178
+ display: flex;
179
+ align-items: flex-start;
180
+ gap: var(--ds-space-1, .25rem);
181
+ flex-direction: column;
182
+ }
183
+
184
+ .binding-list, .binding-v2-list {
185
+ padding-left: var(--ds-space-4, 1rem);
186
+ margin: 0;
187
+ }
188
+
189
+ .binding-panel-wide, .binding-v2-panel-wide {
190
+ width: var(--ds-dialog-width-large, 48rem);
191
+ overflow: auto;
192
+ }
193
+
194
+ .binding-call, .binding-v2-call {
195
+ display: flex;
196
+ gap: var(--ds-space-3, .75rem);
197
+ padding: var(--ds-space-4, 1rem);
198
+ border-width: var(--ds-screen-surface-border-width, 1px);
199
+ border-style: solid;
200
+ border-color: var(--ds-color-border, #e2e8f0);
201
+ border-radius: var(--ds-radius-md, 6px);
202
+ flex-direction: column;
203
+ min-width: 0;
204
+ }
205
+
206
+ .binding-call-grid, .binding-v2-call-grid {
207
+ display: grid;
208
+ grid-template-columns: repeat(auto-fill, minmax(var(--ds-menu-min-width, 12rem), 1fr));
209
+ gap: var(--ds-space-3, .75rem);
210
+ }
211
+
212
+ .binding-params, .binding-v2-params {
213
+ display: flex;
214
+ gap: var(--ds-space-2, .5rem);
215
+ flex-direction: column;
216
+ }
217
+
218
+ .binding-param, .binding-v2-param {
219
+ display: grid;
220
+ grid-template-columns: repeat(3, minmax(0, 1fr));
221
+ gap: var(--ds-space-3, .75rem);
222
+ overflow-wrap: anywhere;
223
+ align-items: start;
224
+ }
225
+
226
+ .binding-endpoint, .binding-v2-endpoint {
227
+ font-family: var(--ds-font-family-mono, monospace);
228
+ font-size: var(--ds-font-size-sm, .8125rem);
229
+ overflow-wrap: anywhere;
230
+ }
231
+
232
+ .binding-preview-parts, .binding-v2-preview-parts {
233
+ display: grid;
234
+ grid-template-columns: repeat(auto-fill, minmax(var(--ds-menu-min-width, 12rem), 1fr));
235
+ gap: var(--ds-space-3, .75rem);
236
+ }
237
+
238
+ .binding-pre, .binding-v2-pre {
239
+ font-family: var(--ds-font-family-mono, monospace);
240
+ font-size: var(--ds-font-size-sm, .8125rem);
241
+ white-space: pre-wrap;
242
+ overflow-wrap: anywhere;
243
+ margin: 0;
244
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import type { ApiBindingContext, WorkspaceComponents } from "../types";
3
+ import "../styles/workspace.css";
4
+ export interface ApiBindingWorkspaceProps {
5
+ pageKey: string;
6
+ initialContext?: ApiBindingContext;
7
+ components?: Partial<WorkspaceComponents>;
8
+ }
9
+ export declare function ApiBindingWorkspace({ pageKey, initialContext, components, }: ApiBindingWorkspaceProps): React.JSX.Element;
10
+ export declare const ApiBindingStudio: typeof ApiBindingWorkspace;
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import type { ApiBindingConfig, ApiBindingContext } from "../types";
3
+ export declare const TIMING_OPTIONS: {
4
+ value: string;
5
+ label: string;
6
+ }[];
7
+ export declare const FRESHNESS_OPTIONS: {
8
+ value: string;
9
+ label: string;
10
+ }[];
11
+ /**
12
+ * The single canonical API-mapping editor. The global entry shows every call;
13
+ * a field or action entry passes `focus` and sees only calls targeting it or sending its value.
14
+ */
15
+ export declare function ApiMappings({ config, context, focus, defaultTarget, onChange, }: {
16
+ config: ApiBindingConfig;
17
+ context: ApiBindingContext;
18
+ focus?: string;
19
+ defaultTarget?: string;
20
+ onChange: (updater: (old: ApiBindingConfig) => ApiBindingConfig) => void;
21
+ }): React.JSX.Element;
@@ -0,0 +1,41 @@
1
+ import * as React from "react";
2
+ import type { ApiDefinition, BindingGrid, BindingOption, MappingFile, SnapshotComponent, SnapshotContext, WindowKind, WindowTrigger } from "../types";
3
+ export interface BindApiButtonProps {
4
+ appId?: string;
5
+ windowId: string;
6
+ /** Source window, screen, or action name, e.g. "Add Notes", "Create P2P", "Invoice Details" */
7
+ source: string;
8
+ /** Parent grid, panel, or screen name, e.g. "Worklist Grid", "Dashboard", "Main Screen" */
9
+ parent: string;
10
+ /** Optional Grid context (selected rows and columns) if triggered from or acting upon a grid */
11
+ grid?: BindingGrid;
12
+ /** Parent windows / screens context hierarchy */
13
+ parents?: SnapshotContext[];
14
+ /** UI presentation kind (modal, drawer, screen, form, etc.) */
15
+ kind?: WindowKind;
16
+ /** Action trigger info */
17
+ trigger?: WindowTrigger;
18
+ /** Captured dropdown/combobox options from the host form */
19
+ options?: Record<string, BindingOption[]>;
20
+ /** Registered API definitions catalog */
21
+ definitions?: ApiDefinition[];
22
+ /** Existing saved mapping file */
23
+ mappingFile?: MappingFile | null;
24
+ /** Base route for the Studio in the router (defaults to `/api-binding`) */
25
+ routeBase?: string;
26
+ /** Optional container ref to override automatic DOM discovery */
27
+ containerRef?: React.RefObject<HTMLElement | null>;
28
+ /** Optional container CSS selector to locate screen root */
29
+ containerSelector?: string;
30
+ /** Explicit root DOM element */
31
+ rootElement?: HTMLElement | null;
32
+ /** Optional HTML form id */
33
+ formId?: string;
34
+ /** Explicit components / fields override if not discovered via DOM */
35
+ components?: SnapshotComponent[];
36
+ /** Explicit action buttons override */
37
+ buttons?: string[];
38
+ className?: string;
39
+ children?: React.ReactNode;
40
+ }
41
+ export declare function BindApiButton({ appId, windowId, source, parent, grid, parents, kind, trigger, options, definitions, mappingFile, routeBase, containerRef, containerSelector, rootElement, formId, components: explicitComponents, buttons: explicitButtons, className, children, }: BindApiButtonProps): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import type { RequestPreviewItem } from "../types";
3
+ /** Simulated requests in call order. Nothing here is sent over network. */
4
+ export declare function RequestPreview({ title, requests }: {
5
+ title: string;
6
+ requests: RequestPreviewItem[];
7
+ }): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { ApiBindingConfig, ApiBindingContext } from "../types";
3
+ export declare function SimulationDialog({ config, context, onClose, onVerified, }: {
4
+ config: ApiBindingConfig;
5
+ context: ApiBindingContext;
6
+ onClose: () => void;
7
+ onVerified: (signature: string) => void;
8
+ }): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import type { WorkspaceComponents } from "../types";
3
+ export declare function WorkspaceComponentsProvider({ components, children, }: {
4
+ components?: Partial<WorkspaceComponents>;
5
+ children: React.ReactNode;
6
+ }): React.JSX.Element;
7
+ export declare function useWorkspaceComponents(): Required<WorkspaceComponents>;
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ export interface AppGridColDef<T = unknown> {
3
+ field?: keyof T | string;
4
+ headerName: string;
5
+ fill?: boolean;
6
+ type?: "number" | "badge" | "action";
7
+ badgeVariants?: Record<string, "success" | "warning" | "danger" | "neutral">;
8
+ labelField?: keyof T | string;
9
+ icon?: string;
10
+ onClick?: (row: T) => void;
11
+ render?: (row: T) => React.ReactNode;
12
+ }
13
+ export declare function createActionColumn<T>(spec: {
14
+ headerName: string;
15
+ labelField: keyof T | string;
16
+ icon?: string;
17
+ onClick: (row: T) => void;
18
+ }): AppGridColDef<T>;
19
+ export interface AppGridProps<T> {
20
+ rows: T[];
21
+ columns: AppGridColDef<T>[];
22
+ getRowKey?: (row: T, index: number) => string | number;
23
+ className?: string;
24
+ filtering?: boolean;
25
+ height?: string;
26
+ }
27
+ export declare function AppGrid<T extends Record<string, any>>({ rows, columns, getRowKey, className, }: AppGridProps<T>): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ export type BadgeVariant = "neutral" | "info" | "success" | "warning" | "danger" | "brand";
3
+ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ variant?: BadgeVariant;
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ }
9
+ export declare function Badge({ variant, children, className, style, ...rest }: BadgeProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export type BannerTone = "caution" | "resolved" | "danger";
3
+ export interface BannerProps {
4
+ tone?: BannerTone;
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ }
8
+ export declare function Banner({ tone, children, className }: BannerProps): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ import { type ActionIcon } from "./Icons";
3
+ export type ButtonVariant = "primary" | "secondary" | "ghost" | "destructive" | "outline";
4
+ export type ButtonSize = "sm" | "md";
5
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ variant?: ButtonVariant;
7
+ size?: ButtonSize;
8
+ icon?: ActionIcon;
9
+ tooltip?: string | false;
10
+ children?: React.ReactNode;
11
+ className?: string;
12
+ }
13
+ export declare function Button({ variant, size, icon, tooltip, children, className, type, ...rest }: ButtonProps): React.JSX.Element;
14
+ export interface ButtonBarProps {
15
+ justify?: "between" | "start" | "end";
16
+ children: React.ReactNode;
17
+ className?: string;
18
+ }
19
+ export declare function ButtonBar({ justify, children, className }: ButtonBarProps): React.JSX.Element;
20
+ export interface ButtonGroupOption<T extends string> {
21
+ value: T;
22
+ label: string;
23
+ }
24
+ export interface ButtonGroupProps<T extends string> {
25
+ value: T;
26
+ onChange: (value: T) => void;
27
+ options: ButtonGroupOption<T>[];
28
+ "aria-label"?: string;
29
+ className?: string;
30
+ }
31
+ export declare function ButtonGroup<T extends string>({ value, onChange, options, "aria-label": ariaLabel, className, }: ButtonGroupProps<T>): React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export interface DetailCardField {
3
+ label: string;
4
+ value?: React.ReactNode;
5
+ }
6
+ export interface DetailCardProps {
7
+ title?: string;
8
+ subtitle?: string;
9
+ actions?: React.ReactNode;
10
+ fields?: DetailCardField[];
11
+ dense?: boolean;
12
+ className?: string;
13
+ }
14
+ export declare function DetailCard({ title, subtitle, actions, fields, dense, className, }: DetailCardProps): React.JSX.Element;
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ export interface DialogProps {
3
+ open?: boolean;
4
+ title: string;
5
+ description?: string;
6
+ submitLabel?: string;
7
+ cancelLabel?: string;
8
+ onCancel?: () => void;
9
+ onSubmit?: () => void;
10
+ children: React.ReactNode;
11
+ size?: "large" | "medium";
12
+ formId?: string;
13
+ className?: string;
14
+ }
15
+ export declare function Dialog({ open, title, description, submitLabel, cancelLabel, onCancel, onSubmit, children, size, formId, className, }: DialogProps): React.JSX.Element | null;
16
+ export declare function actionFormDialogTemplateV1(spec: {
17
+ open: boolean;
18
+ title: string;
19
+ description: string;
20
+ size?: "large" | "medium";
21
+ formId: string;
22
+ submitLabel: string;
23
+ cancelLabel: string;
24
+ onCancel: () => void;
25
+ onSubmit: () => void;
26
+ children: React.ReactNode;
27
+ }): {
28
+ open: boolean;
29
+ title: string;
30
+ description: string;
31
+ size?: "large" | "medium";
32
+ formId: string;
33
+ submitLabel: string;
34
+ cancelLabel: string;
35
+ onCancel: () => void;
36
+ onSubmit: () => void;
37
+ children: React.ReactNode;
38
+ };
39
+ export declare function alertDialogTemplateV1(spec: {
40
+ open: boolean;
41
+ kind?: "destructive" | "neutral" | string;
42
+ title: string;
43
+ message: string;
44
+ confirmLabel?: string;
45
+ cancelLabel?: string;
46
+ primaryAction?: {
47
+ label: string;
48
+ onClick: () => void;
49
+ };
50
+ onConfirm?: () => void;
51
+ onCancel: () => void;
52
+ }): {
53
+ open: boolean;
54
+ title: string;
55
+ description: string;
56
+ submitLabel: string;
57
+ cancelLabel: string;
58
+ onSubmit: (() => void) | undefined;
59
+ onCancel: () => void;
60
+ children: null;
61
+ };
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ export interface IconProps extends React.SVGProps<SVGSVGElement> {
3
+ size?: number | string;
4
+ className?: string;
5
+ }
6
+ export declare const LinkIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
7
+ export declare const PencilIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
8
+ export declare const SettingsIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
9
+ export declare const PlusIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
10
+ export declare const Trash2Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
11
+ export declare const ArrowUpIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
12
+ export declare const ArrowDownIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
13
+ export declare const PlayIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
14
+ export declare const CheckIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
15
+ export declare const XIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
16
+ export declare const SearchIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
17
+ export declare const AlertTriangleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
18
+ export declare const AlertCircleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
19
+ export declare const iconMap: Record<string, React.ComponentType<IconProps>>;
20
+ export type ActionIcon = string | React.ReactNode;
21
+ export declare function renderIcon(icon?: ActionIcon, props?: IconProps): React.ReactNode;
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
+ label?: string;
4
+ required?: boolean;
5
+ }
6
+ export declare function Input({ label, required, className, id, ...rest }: InputProps): React.JSX.Element;
7
+ export interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
8
+ label?: string;
9
+ required?: boolean;
10
+ }
11
+ export declare function TextArea({ label, required, className, id, ...rest }: TextAreaProps): React.JSX.Element;
12
+ export interface SelectOption {
13
+ value: string;
14
+ label: string;
15
+ description?: string;
16
+ }
17
+ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "onChange" | "value"> {
18
+ label?: string;
19
+ required?: boolean;
20
+ value?: string | null;
21
+ options?: SelectOption[];
22
+ onChange?: (value: string | null) => void;
23
+ placeholder?: string;
24
+ }
25
+ export declare function Select({ label, required, value, options, onChange, placeholder, disabled, className, id, ...rest }: SelectProps): React.JSX.Element;
26
+ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
27
+ label: string;
28
+ checked?: boolean;
29
+ onChange?: (checked: boolean) => void;
30
+ }
31
+ export declare function Checkbox({ label, checked, onChange, disabled, className, id, ...rest }: CheckboxProps): React.JSX.Element;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Snapshot extraction, DOM inspection, and context building utilities.
3
+ * Completely generic: works on modals, drawers, panels, cards, and full screens.
4
+ */
5
+ import type { BindingGrid, BindingSnapshot, SnapshotComponent, SnapshotContext, WindowKind, WindowTrigger } from "../types";
6
+ export declare const FREE_TEXT_SOURCE = "freeText";
7
+ export declare const FREE_TEXT_OPTION: {
8
+ value: string;
9
+ label: string;
10
+ };
11
+ export declare function storageKey(key: string): string;
12
+ export declare function storeSnapshot(snapshot: BindingSnapshot): void;
13
+ export declare function readSnapshot(key: string): BindingSnapshot | null;
14
+ export declare function windowIds({ appId, windowId, gridId, parentWindowIds, }: {
15
+ appId: string;
16
+ windowId: string;
17
+ gridId?: string;
18
+ parentWindowIds?: string[];
19
+ }): {
20
+ appId: string;
21
+ windowId: string;
22
+ gridId: string | undefined;
23
+ parentWindowIds: string[] | undefined;
24
+ key: string;
25
+ };
26
+ export declare function gridPropertyPaths({ gridId, rows }: {
27
+ gridId: string;
28
+ rows: Record<string, unknown>[];
29
+ }): string[];
30
+ export declare function contextComponents(snapshot: BindingSnapshot): Array<{
31
+ value: string;
32
+ label: string;
33
+ }>;
34
+ export declare function sourceComponents(snapshot: BindingSnapshot): Array<{
35
+ value: string;
36
+ label: string;
37
+ }>;
38
+ /**
39
+ * Intelligently locates the nearest enclosing screen, modal, drawer, form, or panel container
40
+ * where the trigger button resides.
41
+ */
42
+ export declare function findEnclosingContextElement(triggerElement: HTMLElement | null, options?: {
43
+ containerRef?: React.RefObject<HTMLElement | null>;
44
+ containerSelector?: string;
45
+ rootElement?: HTMLElement | null;
46
+ formId?: string;
47
+ }): HTMLElement | null;
48
+ export declare function discoverFormComponents(root: HTMLElement | null): SnapshotComponent[];
49
+ export declare function discoverButtons(root: HTMLElement | null): string[];
50
+ export declare function buildSnapshot({ ids, source, parent, root, grid, kind, trigger, contexts, components: explicitComponents, buttons: explicitButtons, }: {
51
+ ids: {
52
+ appId: string;
53
+ windowId: string;
54
+ gridId?: string;
55
+ parentWindowIds?: string[];
56
+ key: string;
57
+ };
58
+ source: string;
59
+ parent: string;
60
+ root: HTMLElement | null;
61
+ grid?: BindingGrid;
62
+ kind?: WindowKind;
63
+ trigger?: WindowTrigger;
64
+ contexts?: SnapshotContext[];
65
+ components?: SnapshotComponent[];
66
+ buttons?: string[];
67
+ }): BindingSnapshot;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * API Catalog builder and validator for API Binding Studio.
3
+ */
4
+ import type { ApiDefinition, ApiParameter } from "../types";
5
+ export declare function friendlyLabel(operationId?: string): string | undefined;
6
+ export type RawBindings = Record<string, Record<string, {
7
+ operationId?: string;
8
+ [key: string]: unknown;
9
+ }>>;
10
+ export declare function buildCatalogFromRegistry({ bindings, hookResolver, paramsResolver, availabilityChecker, }: {
11
+ bindings: RawBindings;
12
+ hookResolver?: (api: string, method: string) => string | undefined;
13
+ paramsResolver?: (api: string, method: string) => ApiParameter[];
14
+ availabilityChecker?: (api: string, method: string) => {
15
+ available: boolean;
16
+ problem?: string;
17
+ };
18
+ }): ApiDefinition[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Component ID utilities for normalized component identification.
3
+ */
4
+ export interface ComponentDescriptor {
5
+ kind: "field" | "button" | string;
6
+ name: string;
7
+ parentId?: string;
8
+ }
9
+ export declare function componentId(c: ComponentDescriptor): string;
10
+ export declare function isButtonId(id: string): boolean;
11
+ export declare function parseComponentId(id: string): ComponentDescriptor;
12
+ export declare function normalizeComponent(id: string): string;