@pipedream/connect-react 2.5.0 → 2.6.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.
@@ -126,6 +126,57 @@ declare type ComponentFormProps<T extends ConfigurableProps, U = ConfiguredProps
126
126
 
127
127
  export declare type ComponentLibrary = typeof defaultComponents;
128
128
 
129
+ /**
130
+ * A file picker component that uses the Pipedream SDK's configure endpoint
131
+ * to fetch options for component props, rendering them in a file browser UI.
132
+ */
133
+ export declare const ConfigureFilePicker: FC<ConfigureFilePickerProps>;
134
+
135
+ export declare const ConfigureFilePickerModal: FC<ConfigureFilePickerModalProps>;
136
+
137
+ export declare interface ConfigureFilePickerModalProps extends ConfigureFilePickerProps {
138
+ isOpen: boolean;
139
+ title?: string;
140
+ }
141
+
142
+ /**
143
+ * Props for the ConfigureFilePicker component
144
+ */
145
+ export declare interface ConfigureFilePickerProps {
146
+ /** Component key to use for the file picker (e.g., "sharepoint-select-file") */
147
+ componentKey: string;
148
+ /** App slug (e.g., "sharepoint") - used for app-specific config */
149
+ app: string;
150
+ /** Connected account ID */
151
+ accountId: string;
152
+ /** External user ID for the Pipedream Connect session */
153
+ externalUserId: string;
154
+ /** Callback when user confirms their selection */
155
+ onSelect: (items: FilePickerItem[], configuredProps: Record<string, unknown>) => void;
156
+ /** Callback when user cancels */
157
+ onCancel?: () => void;
158
+ /** Initial configured props (for restoring previous selection) */
159
+ initialConfiguredProps?: Record<string, unknown>;
160
+ /** Confirm button text */
161
+ confirmText?: string;
162
+ /** Cancel button text */
163
+ cancelText?: string;
164
+ /** Allow selecting folders (default: true) */
165
+ selectFolders?: boolean;
166
+ /** Allow selecting files (default: true) */
167
+ selectFiles?: boolean;
168
+ /** Allow selecting multiple items (default: false) */
169
+ multiSelect?: boolean;
170
+ /** Custom app configuration (overrides built-in config for the app) */
171
+ appConfig?: FilePickerAppConfig;
172
+ /** Enable debug logging (default: false) */
173
+ debug?: boolean;
174
+ /** Whether to show file/folder icons (default: true) */
175
+ showIcons?: boolean;
176
+ /** Custom icons for files and folders. Can be strings (emoji) or ReactNodes. */
177
+ icons?: FilePickerIcons;
178
+ }
179
+
129
180
  export declare function Control<T extends ConfigurableProps, U extends ConfigurableProp>(props: ControlProps<T, U>): JSX_2.Element;
130
181
 
131
182
  export declare function ControlAny(): JSX_2.Element;
@@ -320,6 +371,51 @@ declare type FieldProps<T extends ConfigurableProp> = {
320
371
  field: FormFieldContext<T>;
321
372
  };
322
373
 
374
+ /**
375
+ * Pre-built app configurations
376
+ */
377
+ export declare const FILE_PICKER_APPS: Record<string, FilePickerAppConfig>;
378
+
379
+ /**
380
+ * App-specific configuration for the file picker
381
+ */
382
+ export declare interface FilePickerAppConfig {
383
+ /** App slug (e.g., "sharepoint", "google_drive", "dropbox") */
384
+ app: string;
385
+ /** The camelCase prop name used in the component (e.g., "sharepoint") */
386
+ appPropName: string;
387
+ /** Prop hierarchy to navigate through (e.g., ["siteId", "driveId", "fileOrFolderIds"]) */
388
+ propHierarchy: string[];
389
+ /** Prop labels for display (e.g., { siteId: "Sites", driveId: "Drives" }) */
390
+ propLabels: Record<string, string>;
391
+ /** The prop name that shows selectable files/folders */
392
+ fileOrFolderProp: string;
393
+ /** The prop name used for folder navigation (set when drilling into folders) */
394
+ folderProp?: string;
395
+ }
396
+
397
+ /**
398
+ * Icon configuration for the file picker
399
+ */
400
+ export declare interface FilePickerIcons {
401
+ /** Icon for folders (string emoji or ReactNode) */
402
+ folder?: ReactNode;
403
+ /** Icon for files (string emoji or ReactNode) */
404
+ file?: ReactNode;
405
+ }
406
+
407
+ /**
408
+ * Represents an item (file or folder) in the file picker
409
+ */
410
+ export declare interface FilePickerItem {
411
+ id: string;
412
+ label: string;
413
+ value: unknown;
414
+ isFolder?: boolean;
415
+ size?: number;
416
+ raw?: unknown;
417
+ }
418
+
323
419
  export declare type FormContext<T extends ConfigurableProps> = {
324
420
  component: Component;
325
421
  configurableProps: T;
@@ -403,6 +499,15 @@ declare const LoadMoreButton: (props: ButtonProps) => JSX_2.Element;
403
499
 
404
500
  export declare function mergeTheme(target: Theme, ...sources: (PartialTheme | undefined)[]): Theme;
405
501
 
502
+ /**
503
+ * Represents a navigation level in the picker hierarchy
504
+ */
505
+ export declare interface NavigationLevel {
506
+ propName: string;
507
+ label: string;
508
+ value: unknown;
509
+ }
510
+
406
511
  export declare const OptionalFieldButton: (props: OptionalFieldButtonProps) => JSX_2.Element;
407
512
 
408
513
  declare type OptionalFieldButtonProps = {