@osdk/react-components 0.2.0-beta.25 → 0.2.0-beta.27

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 (107) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +28 -0
  3. package/build/browser/action-form/ActionForm.js +15 -11
  4. package/build/browser/action-form/ActionForm.js.map +1 -1
  5. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  6. package/build/browser/action-form/fields/CustomField.js +30 -0
  7. package/build/browser/action-form/fields/CustomField.js.map +1 -0
  8. package/build/browser/action-form/fields/FormFieldRenderer.js +13 -21
  9. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  10. package/build/browser/action-form/fields/RadioButtonsField.js +1 -1
  11. package/build/browser/action-form/fields/RadioButtonsField.js.map +1 -1
  12. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +97 -10
  13. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  14. package/build/browser/base-components/dialog/Dialog.js +4 -2
  15. package/build/browser/base-components/dialog/Dialog.js.map +1 -1
  16. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  17. package/build/browser/object-table/hooks/useFunctionColumnsData.js +57 -192
  18. package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  19. package/build/browser/pdf-viewer/PdfViewer.js +10 -5
  20. package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
  21. package/build/browser/pdf-viewer/PdfViewerContext.js +108 -0
  22. package/build/browser/pdf-viewer/PdfViewerContext.js.map +1 -0
  23. package/build/browser/pdf-viewer/hooks/usePdfFormFields.js +26 -11
  24. package/build/browser/pdf-viewer/hooks/usePdfFormFields.js.map +1 -1
  25. package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js +29 -1
  26. package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -1
  27. package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
  28. package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
  29. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
  30. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
  31. package/build/browser/pdf-viewer/hooks/usePdfViewerState.js +3 -3
  32. package/build/browser/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
  33. package/build/browser/pdf-viewer/types.js.map +1 -1
  34. package/build/browser/public/experimental.js +2 -0
  35. package/build/browser/public/experimental.js.map +1 -1
  36. package/build/cjs/{chunk-GT6IV6LV.cjs → chunk-MRRRZN44.cjs} +6 -4
  37. package/build/cjs/chunk-MRRRZN44.cjs.map +1 -0
  38. package/build/cjs/public/experimental.cjs +1384 -1343
  39. package/build/cjs/public/experimental.cjs.map +1 -1
  40. package/build/cjs/public/experimental.d.cts +115 -8
  41. package/build/cjs/public/primitives.cjs +5 -5
  42. package/build/cjs/public/primitives.d.cts +3 -2
  43. package/build/esm/action-form/ActionForm.js +15 -11
  44. package/build/esm/action-form/ActionForm.js.map +1 -1
  45. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  46. package/build/esm/action-form/fields/CustomField.js +30 -0
  47. package/build/esm/action-form/fields/CustomField.js.map +1 -0
  48. package/build/esm/action-form/fields/FormFieldRenderer.js +13 -21
  49. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  50. package/build/esm/action-form/fields/RadioButtonsField.js +1 -1
  51. package/build/esm/action-form/fields/RadioButtonsField.js.map +1 -1
  52. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +97 -10
  53. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  54. package/build/esm/base-components/dialog/Dialog.js +4 -2
  55. package/build/esm/base-components/dialog/Dialog.js.map +1 -1
  56. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  57. package/build/esm/object-table/hooks/useFunctionColumnsData.js +57 -192
  58. package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  59. package/build/esm/pdf-viewer/PdfViewer.js +10 -5
  60. package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
  61. package/build/esm/pdf-viewer/PdfViewerContext.js +108 -0
  62. package/build/esm/pdf-viewer/PdfViewerContext.js.map +1 -0
  63. package/build/esm/pdf-viewer/hooks/usePdfFormFields.js +26 -11
  64. package/build/esm/pdf-viewer/hooks/usePdfFormFields.js.map +1 -1
  65. package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js +29 -1
  66. package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -1
  67. package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
  68. package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
  69. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
  70. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
  71. package/build/esm/pdf-viewer/hooks/usePdfViewerState.js +3 -3
  72. package/build/esm/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
  73. package/build/esm/pdf-viewer/types.js.map +1 -1
  74. package/build/esm/public/experimental.js +2 -0
  75. package/build/esm/public/experimental.js.map +1 -1
  76. package/build/types/action-form/FormFieldApi.d.ts +3 -3
  77. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  78. package/build/types/action-form/fields/CustomField.d.ts +9 -0
  79. package/build/types/action-form/fields/CustomField.d.ts.map +1 -0
  80. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  81. package/build/types/action-form/fields/RadioButtonsField.d.ts +2 -2
  82. package/build/types/action-form/fields/RadioButtonsField.d.ts.map +1 -1
  83. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +7 -4
  84. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -1
  85. package/build/types/base-components/dialog/Dialog.d.ts +3 -2
  86. package/build/types/base-components/dialog/Dialog.d.ts.map +1 -1
  87. package/build/types/object-table/ObjectTableApi.d.ts +4 -3
  88. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  89. package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -1
  90. package/build/types/pdf-viewer/PdfViewer.d.ts +2 -2
  91. package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
  92. package/build/types/pdf-viewer/PdfViewerContext.d.ts +64 -0
  93. package/build/types/pdf-viewer/PdfViewerContext.d.ts.map +1 -0
  94. package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts +1 -0
  95. package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts.map +1 -1
  96. package/build/types/pdf-viewer/types.d.ts +47 -0
  97. package/build/types/pdf-viewer/types.d.ts.map +1 -1
  98. package/build/types/public/experimental.d.ts +2 -0
  99. package/build/types/public/experimental.d.ts.map +1 -1
  100. package/package.json +9 -9
  101. package/build/browser/action-form/utils/getDefaultFieldComponent.js +0 -56
  102. package/build/browser/action-form/utils/getDefaultFieldComponent.js.map +0 -1
  103. package/build/cjs/chunk-GT6IV6LV.cjs.map +0 -1
  104. package/build/esm/action-form/utils/getDefaultFieldComponent.js +0 -56
  105. package/build/esm/action-form/utils/getDefaultFieldComponent.js.map +0 -1
  106. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts +0 -6
  107. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode, ReactElement, RefObject } from 'react';
3
- import { ObjectTypeDefinition, ObjectSet, WhereClause, PropertyKeys, LinkNames, LinkedType, WirePropertyTypes, CompileTimeMetadata, ObjectOrInterfaceDefinition, SimplePropertyDef, QueryDefinition, QueryMetadata, Osdk, DerivedProperty, PrimaryKeyType, Media, ActionDefinition, ActionMetadata, ActionParam, DataValueClientToWire, ActionEditResponse, ActionValidationResponse } from '@osdk/api';
3
+ import { ObjectTypeDefinition, ObjectSet, WhereClause, PropertyKeys, LinkNames, LinkedType, WirePropertyTypes, CompileTimeMetadata, ObjectOrInterfaceDefinition, SimplePropertyDef, QueryDefinition, Osdk, DerivedProperty, PrimaryKeyType, Media, ActionDefinition, ActionMetadata, ActionParam, DataValueClientToWire, ActionEditResponse, ActionValidationResponse } from '@osdk/api';
4
+ import { QueryParameterType } from '@osdk/client/unstable-do-not-use';
4
5
  import { RowData, Table, Cell, VisibilityState, ColumnOrderState } from '@tanstack/react-table';
5
6
  import { PDFDocumentProxy } from 'pdfjs-dist';
6
7
  import { PDFViewer, EventBus, PDFFindController } from 'pdfjs-dist/web/pdf_viewer.mjs';
@@ -604,7 +605,7 @@ type ColumnDefinition<Q extends ObjectOrInterfaceDefinition, RDPs extends Record
604
605
  */
605
606
  renderHeader?: () => React.ReactNode;
606
607
  };
607
- type ExtractQueryParameters<TQueryDef extends QueryDefinition> = TQueryDef["__DefinitionMetadata"] extends QueryMetadata ? TQueryDef["__DefinitionMetadata"]["parameters"] : never;
608
+ type ExtractQueryParameters<Q extends QueryDefinition> = CompileTimeMetadata<Q>["parameters"] extends Record<string, never> ? undefined : QueryParameterType<CompileTimeMetadata<Q>["parameters"]>;
608
609
  interface PropertyColumnLocator<Q extends ObjectOrInterfaceDefinition> {
609
610
  type: "property";
610
611
  id: PropertyKeys<Q>;
@@ -622,7 +623,7 @@ interface FunctionColumnLocator<Q extends ObjectOrInterfaceDefinition, RDPs exte
622
623
  * @param objectSet - The current object set.
623
624
  * @returns - The function's input parameters including the object set.
624
625
  */
625
- getFunctionParams: (objectSet: ObjectSet<Q>) => ExtractQueryParameters<FunctionColumns[keyof FunctionColumns]>;
626
+ getFunctionParams: (objectSet: ObjectSet<Q, RDPs>) => ExtractQueryParameters<FunctionColumns[keyof FunctionColumns]>;
626
627
  /**
627
628
  * Function to generate keys for looking up results in the FunctionsMap.
628
629
  * @param object - The object instance
@@ -986,6 +987,8 @@ type PdfDownloadResult = {
986
987
  type PdfFormFieldValue = string | boolean | string[];
987
988
  /** Data emitted when the user creates a text highlight via the highlight editor. */
988
989
  interface PdfTextHighlightEvent {
990
+ /** Internal PDF.js editor ID. Use with `deleteHighlight` to programmatically remove. */
991
+ editorId: string;
989
992
  /** Page number (1-indexed) */
990
993
  page: number;
991
994
  /** Bounding rects in PDF coordinate space (bottom-left origin) */
@@ -995,6 +998,51 @@ interface PdfTextHighlightEvent {
995
998
  /** Highlight color as CSS color string */
996
999
  color: string;
997
1000
  }
1001
+ /** Imperative handle for programmatic control of a {@link PdfViewer} or {@link BasePdfViewer}. */
1002
+ interface PdfViewerHandle {
1003
+ /** Scroll the viewer to the given page number (1-indexed). */
1004
+ scrollToPage: (page: number) => void;
1005
+ /** Programmatically delete a highlight by its `editorId` (from {@link PdfTextHighlightEvent}). */
1006
+ deleteHighlight: (editorId: string) => void;
1007
+ }
1008
+ /**
1009
+ * Options for {@link usePdfViewerInstance}.
1010
+ * Equivalent to {@link PdfViewerProps} minus the `className` rendering concern.
1011
+ */
1012
+ interface PdfViewerInstanceOptions {
1013
+ /** PDF source — URL string or ArrayBuffer */
1014
+ src: string | ArrayBuffer;
1015
+ /** Annotations to overlay on the PDF */
1016
+ annotations?: PdfAnnotation[];
1017
+ /** Callback fired when an annotation is clicked */
1018
+ onAnnotationClick?: (annotation: PdfAnnotation) => void;
1019
+ /** Callback fired when a download completes or fails */
1020
+ onDownload?: (result: PdfDownloadResult) => void;
1021
+ /** Whether the highlight toggle button is shown in the toolbar */
1022
+ highlightEnabled?: boolean;
1023
+ /** Callback fired when the user creates a text highlight */
1024
+ onTextHighlight?: (event: PdfTextHighlightEvent) => void;
1025
+ /** Callback fired when the user deletes a highlight */
1026
+ onHighlightDelete?: (event: PdfTextHighlightEvent) => void;
1027
+ /** Initial form field values keyed by field name */
1028
+ formData?: Record<string, PdfFormFieldValue>;
1029
+ /** Callback fired when the user clicks the save button */
1030
+ onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;
1031
+ /** Callback fired when any form field value changes */
1032
+ onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;
1033
+ /** Initial page number (1-indexed, default 1) */
1034
+ initialPage?: number;
1035
+ /** Initial zoom scale (default 1.0) */
1036
+ initialScale?: number;
1037
+ /** Whether the sidebar is initially open (default false) */
1038
+ initialSidebarOpen?: boolean;
1039
+ /** Whether the download button is shown in the toolbar */
1040
+ enableDownload?: boolean;
1041
+ /** Which sidebar panel to show: thumbnails or document outline */
1042
+ sidebarMode?: SidebarMode;
1043
+ /** Custom icon components for each outline depth level (0-indexed) */
1044
+ outlineIcons?: Partial<Record<number, React__default.ComponentType>>;
1045
+ }
998
1046
  /** Props for the {@link PdfViewer} component. */
999
1047
  interface PdfViewerProps {
1000
1048
  /** PDF source — URL string or ArrayBuffer */
@@ -1082,7 +1130,7 @@ interface PdfViewerProps {
1082
1130
  className?: string;
1083
1131
  }
1084
1132
 
1085
- declare function BasePdfViewer({ src, annotations, onAnnotationClick, onDownload, enableHighlight, onTextHighlight, onHighlightDelete, formData, onFormSubmit, onFormChange, initialPage, initialScale, initialSidebarOpen, enableDownload, sidebarMode: sidebarModeProp, outlineIcons, className, }: PdfViewerProps): React__default.ReactElement;
1133
+ declare const BasePdfViewer: React__default.ForwardRefExoticComponent<PdfViewerProps & React__default.RefAttributes<PdfViewerHandle>>;
1086
1134
 
1087
1135
  interface PdfViewerAnnotationLayerProps {
1088
1136
  annotations: PdfAnnotation[];
@@ -1220,6 +1268,7 @@ interface UsePdfHighlightModeOptions {
1220
1268
  interface UsePdfHighlightModeResult {
1221
1269
  highlightModeActive: boolean;
1222
1270
  toggleHighlightMode: () => void;
1271
+ deleteHighlight: (editorId: string) => void;
1223
1272
  }
1224
1273
  /**
1225
1274
  * Hook that manages the PDF.js built-in highlight annotation editor mode.
@@ -1262,6 +1311,64 @@ declare function usePdfViewerSync({ pdfViewerRef, eventBusRef, document, scale,
1262
1311
  scrollToPage: (page: number) => void;
1263
1312
  };
1264
1313
 
1314
+ /** The shape of the value provided by {@link PdfViewerProvider}. */
1315
+ interface PdfViewerContextValue {
1316
+ document: PDFDocumentProxy | undefined;
1317
+ numPages: number;
1318
+ loading: boolean;
1319
+ error: Error | undefined;
1320
+ containerRef: RefObject<HTMLDivElement>;
1321
+ viewerRef: RefObject<HTMLDivElement>;
1322
+ currentPage: number;
1323
+ scrollToPage: (page: number) => void;
1324
+ scale: number;
1325
+ setScale: (scale: number) => void;
1326
+ zoomIn: () => void;
1327
+ zoomOut: () => void;
1328
+ rotation: number;
1329
+ rotateLeft: () => void;
1330
+ rotateRight: () => void;
1331
+ sidebarOpen: boolean;
1332
+ sidebarMode: SidebarMode;
1333
+ setSidebarMode: (mode: SidebarMode) => void;
1334
+ toggleSidebar: () => void;
1335
+ search: UsePdfViewerSearchResult;
1336
+ outlineItems: OutlineItem[];
1337
+ download: (filename?: string) => void;
1338
+ portalTargets: AnnotationPortalTarget[];
1339
+ highlightEnabled: boolean;
1340
+ highlightModeActive: boolean;
1341
+ toggleHighlightMode: () => void;
1342
+ hasFormFields: boolean;
1343
+ submitFormData: () => void;
1344
+ annotations: PdfAnnotation[];
1345
+ annotationsByPage: Record<number, PdfAnnotation[]>;
1346
+ onAnnotationClick: ((annotation: PdfAnnotation) => void) | undefined;
1347
+ enableDownload: boolean;
1348
+ enableFormSave: boolean;
1349
+ outlineIcons: Partial<Record<number, React__default.ComponentType>> | undefined;
1350
+ pdfViewerRef: RefObject<PDFViewer | null>;
1351
+ eventBusRef: RefObject<EventBus | null>;
1352
+ findControllerRef: RefObject<PDFFindController | null>;
1353
+ }
1354
+ interface PdfViewerProviderProps {
1355
+ value: PdfViewerContextValue;
1356
+ children: React__default.ReactNode;
1357
+ }
1358
+ /** Provides {@link PdfViewerContextValue} to descendant components. */
1359
+ declare function PdfViewerProvider({ value, children }: PdfViewerProviderProps): React__default.ReactElement;
1360
+ /**
1361
+ * Returns the nearest {@link PdfViewerContextValue} from a {@link PdfViewerProvider}.
1362
+ * Throws if called outside a provider.
1363
+ */
1364
+ declare function usePdfViewerContext(): PdfViewerContextValue;
1365
+ /**
1366
+ * Consumer-facing setup hook analogous to react-hook-form's `useForm()`.
1367
+ * Accepts viewer options and returns a {@link PdfViewerContextValue} suitable
1368
+ * for passing to {@link PdfViewerProvider}.
1369
+ */
1370
+ declare function usePdfViewerInstance(options: PdfViewerInstanceOptions): PdfViewerContextValue;
1371
+
1265
1372
  interface UsePdfViewerCoreOptions {
1266
1373
  /** PDF source — URL string or ArrayBuffer */
1267
1374
  src: string | ArrayBuffer;
@@ -1404,9 +1511,9 @@ interface FormFieldDefinition<Q extends ActionDefinition<unknown>, K extends Fie
1404
1511
  validate?: (value: FieldValueType<Q, K>) => Promise<boolean>;
1405
1512
  /**
1406
1513
  * The component props for the form field
1407
- * Excludes runtime props (key, onChange) which are managed by ActionForm
1514
+ * Excludes runtime props (value, onChange) which are managed by ActionForm
1408
1515
  */
1409
- fieldComponentProps?: Omit<FormFieldPropsByType[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>], "key" | "onChange">;
1516
+ fieldComponentProps: Omit<FormFieldPropsByType[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>], "value" | "onChange">;
1410
1517
  }
1411
1518
  type ValidationError = {
1412
1519
  type: ValidationRule;
@@ -1662,7 +1769,7 @@ type RendererFieldDefinition = {
1662
1769
  placeholder?: string;
1663
1770
  helperText?: string;
1664
1771
  helperTextPlacement?: "bottom" | "tooltip";
1665
- fieldComponentProps?: Omit<FormFieldPropsByType[K], "value" | "onChange">;
1772
+ fieldComponentProps: Omit<FormFieldPropsByType[K], "value" | "onChange">;
1666
1773
  };
1667
1774
  }[FieldComponent];
1668
1775
  /**
@@ -1766,4 +1873,4 @@ declare const ActionForm: <Q extends ActionDefinition<unknown>>(props: ActionFor
1766
1873
 
1767
1874
  declare const BaseForm: React__default.FC<BaseFormProps>;
1768
1875
 
1769
- export { ActionForm, type ActionFormProps, type ActionParameters, type AnnotationPortalTarget, type AnnotationType, BaseFilterList, type BaseFilterListProps, BaseForm, type BaseFormFieldProps, type BaseFormProps, BasePdfViewer, BaseTable, type BaseTableProps, type CellEditInfo, ColumnConfigDialog, type ColumnConfigDialogProps, type ColumnConfigOptions, type ColumnDefinition, type ColumnDefinitionLocator, type CustomColumnLocator, type CustomFieldProps, type DatetimePickerFieldProps, type DropdownFieldProps, type FieldComponent, type FieldValueType, type FilePickerProps, type FilterComponentType, type FilterDefinitionUnion, FilterList, type FilterListItemProps, type FilterListProps, type FilterState, type FormError, type FormFieldDefinition, type FormFieldPropsByType, type FormState, type FunctionColumnLocator, type NumberInputFieldProps, type ObjectSetFieldProps, ObjectTable, type ObjectTableProps, type Option, type OutlineItem, type PdfAnnotation, type PdfAnnotationRenderProps, type PdfCustomAnnotation, type PdfDownloadResult, type PdfFormFieldValue, type PdfRect, type PdfTextHighlightEvent, PdfViewer, PdfViewerAnnotationLayer, type PdfViewerAnnotationLayerProps, PdfViewerContent, type PdfViewerContentProps, type PdfViewerMediaProps, PdfViewerOutlineSidebar, type PdfViewerOutlineSidebarProps, type PdfViewerProps, PdfViewerSearchBar, type PdfViewerSearchBarProps, PdfViewerSidebar, type PdfViewerSidebarProps, PdfViewerToolbar, type PdfViewerToolbarProps, type PropertyColumnLocator, type PropertyFilterDefinition, type RadioButtonsFieldProps, type RdpColumnLocator, type RenderFilterInput, type RendererFieldDefinition, type SidebarMode, type TextAreaFieldProps, type TextInputFieldProps, type UsePdfFormFieldsOptions, type UsePdfFormFieldsResult, type UsePdfHighlightModeOptions, type UsePdfHighlightModeResult, type UsePdfViewerCoreOptions, type UsePdfViewerCoreResult, type UsePdfViewerResult, type UsePdfViewerSearchResult, type UsePdfViewerStateOptions, type UsePdfViewerStateResult, deserializeFilterStates, serializeFilterStates, usePdfAnnotationPortals, usePdfAnnotationsByPage, usePdfDocument, usePdfFormFields, usePdfHighlightMode, usePdfOutline, usePdfViewer, usePdfViewerCore, usePdfViewerSearch, usePdfViewerState, usePdfViewerSync };
1876
+ export { ActionForm, type ActionFormProps, type ActionParameters, type AnnotationPortalTarget, type AnnotationType, BaseFilterList, type BaseFilterListProps, BaseForm, type BaseFormFieldProps, type BaseFormProps, BasePdfViewer, BaseTable, type BaseTableProps, type CellEditInfo, ColumnConfigDialog, type ColumnConfigDialogProps, type ColumnConfigOptions, type ColumnDefinition, type ColumnDefinitionLocator, type CustomColumnLocator, type CustomFieldProps, type DatetimePickerFieldProps, type DropdownFieldProps, type FieldComponent, type FieldValueType, type FilePickerProps, type FilterComponentType, type FilterDefinitionUnion, FilterList, type FilterListItemProps, type FilterListProps, type FilterState, type FormError, type FormFieldDefinition, type FormFieldPropsByType, type FormState, type FunctionColumnLocator, type NumberInputFieldProps, type ObjectSetFieldProps, ObjectTable, type ObjectTableProps, type Option, type OutlineItem, type PdfAnnotation, type PdfAnnotationRenderProps, type PdfCustomAnnotation, type PdfDownloadResult, type PdfFormFieldValue, type PdfRect, type PdfTextHighlightEvent, PdfViewer, PdfViewerAnnotationLayer, type PdfViewerAnnotationLayerProps, PdfViewerContent, type PdfViewerContentProps, type PdfViewerContextValue, type PdfViewerHandle, type PdfViewerInstanceOptions, type PdfViewerMediaProps, PdfViewerOutlineSidebar, type PdfViewerOutlineSidebarProps, type PdfViewerProps, PdfViewerProvider, PdfViewerSearchBar, type PdfViewerSearchBarProps, PdfViewerSidebar, type PdfViewerSidebarProps, PdfViewerToolbar, type PdfViewerToolbarProps, type PropertyColumnLocator, type PropertyFilterDefinition, type RadioButtonsFieldProps, type RdpColumnLocator, type RenderFilterInput, type RendererFieldDefinition, type SidebarMode, type TextAreaFieldProps, type TextInputFieldProps, type UsePdfFormFieldsOptions, type UsePdfFormFieldsResult, type UsePdfHighlightModeOptions, type UsePdfHighlightModeResult, type UsePdfViewerCoreOptions, type UsePdfViewerCoreResult, type UsePdfViewerResult, type UsePdfViewerSearchResult, type UsePdfViewerStateOptions, type UsePdfViewerStateResult, deserializeFilterStates, serializeFilterStates, usePdfAnnotationPortals, usePdfAnnotationsByPage, usePdfDocument, usePdfFormFields, usePdfHighlightMode, usePdfOutline, usePdfViewer, usePdfViewerContext, usePdfViewerCore, usePdfViewerInstance, usePdfViewerSearch, usePdfViewerState, usePdfViewerSync };
@@ -1,25 +1,25 @@
1
1
  'use strict';
2
2
 
3
- var chunkGT6IV6LV_cjs = require('../chunk-GT6IV6LV.cjs');
3
+ var chunkMRRRZN44_cjs = require('../chunk-MRRRZN44.cjs');
4
4
  require('../chunk-HMQTYQEX.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "ActionButton", {
9
9
  enumerable: true,
10
- get: function () { return chunkGT6IV6LV_cjs.ActionButton; }
10
+ get: function () { return chunkMRRRZN44_cjs.ActionButton; }
11
11
  });
12
12
  Object.defineProperty(exports, "Dialog", {
13
13
  enumerable: true,
14
- get: function () { return chunkGT6IV6LV_cjs.Dialog; }
14
+ get: function () { return chunkMRRRZN44_cjs.Dialog; }
15
15
  });
16
16
  Object.defineProperty(exports, "Tooltip", {
17
17
  enumerable: true,
18
- get: function () { return chunkGT6IV6LV_cjs.Tooltip; }
18
+ get: function () { return chunkMRRRZN44_cjs.Tooltip; }
19
19
  });
20
20
  Object.defineProperty(exports, "TooltipArrow", {
21
21
  enumerable: true,
22
- get: function () { return chunkGT6IV6LV_cjs.TooltipArrow; }
22
+ get: function () { return chunkMRRRZN44_cjs.TooltipArrow; }
23
23
  });
24
24
  //# sourceMappingURL=primitives.cjs.map
25
25
  //# sourceMappingURL=primitives.cjs.map
@@ -8,13 +8,14 @@ declare function ActionButton({ variant, className, ...rest }: ButtonProps): Rea
8
8
 
9
9
  interface DialogProps {
10
10
  isOpen: boolean;
11
- onOpenChange: () => void;
11
+ onOpenChange: (open: boolean) => void;
12
12
  title: React__default.ReactNode;
13
13
  children: React__default.ReactNode;
14
14
  footer?: React__default.ReactNode;
15
15
  className?: string;
16
+ disablePointerDismissal?: boolean;
16
17
  }
17
- declare function Dialog({ isOpen, onOpenChange, title, children, footer, className, }: DialogProps): React__default.ReactElement;
18
+ declare function Dialog({ isOpen, onOpenChange, title, children, footer, className, disablePointerDismissal, }: DialogProps): React__default.ReactElement;
18
19
 
19
20
  interface TooltipProps extends Omit<TooltipRootProps, "className"> {
20
21
  }
@@ -53,17 +53,21 @@ export const ActionForm = typedReactMemo(function ({
53
53
  }
54
54
  }, [metadataError, onError]);
55
55
  const parameters = metadata?.parameters;
56
- const resolvedFieldDefinitions = useMemo(() => formFieldDefinitions ?? (metadata != null ? getDefaultFieldDefinitions(metadata) : EMPTY_FIELD_DEFINITIONS), [formFieldDefinitions, metadata]);
57
- const rendererFieldDefinitions = useMemo(() =>
58
- // RendererFieldDefinition is a discriminated union keyed by fieldComponent.
59
- // TypeScript can't verify that the spread preserves the fieldComponent ↔
60
- // fieldComponentProps pairing, but FormFieldDefinition guarantees it.
61
- resolvedFieldDefinitions.map(def => ({
62
- ...def,
63
- fieldKey: String(def.fieldKey),
64
- fieldType: parameters?.[String(def.fieldKey)]?.type,
65
- defaultValue: def.defaultValue
66
- })), [resolvedFieldDefinitions, parameters]);
56
+ const customFieldDefinitions = useMemo(() => {
57
+ if (formFieldDefinitions == null) {
58
+ return null;
59
+ }
60
+ // RendererFieldDefinition is a discriminated union keyed by fieldComponent.
61
+ // TypeScript can't verify that the spread preserves the fieldComponent ↔
62
+ // fieldComponentProps pairing, but FormFieldDefinition guarantees it.
63
+ return formFieldDefinitions.map(def => ({
64
+ ...def,
65
+ fieldKey: String(def.fieldKey),
66
+ fieldType: parameters?.[String(def.fieldKey)]?.type,
67
+ defaultValue: def.defaultValue
68
+ }));
69
+ }, [formFieldDefinitions, parameters]);
70
+ const rendererFieldDefinitions = useMemo(() => customFieldDefinitions ?? (metadata != null ? getDefaultFieldDefinitions(metadata) : EMPTY_FIELD_DEFINITIONS), [customFieldDefinitions, metadata]);
67
71
  const coerceFormState = useCallback(rawState => {
68
72
  const coerced = {};
69
73
  for (const [key, value] of Object.entries(rawState)) {
@@ -1 +1 @@
1
- {"version":3,"file":"ActionForm.js","names":["useOsdkMetadata","useOsdkAction","React","useCallback","useEffect","useMemo","typedReactMemo","BaseForm","coerceFieldValue","getDefaultFieldDefinitions","EMPTY_FIELD_DEFINITIONS","ActionForm","actionDefinition","formTitle","formFieldDefinitions","formState","controlledFormState","onFormStateChange","isSubmitDisabled","onSubmit","onValidationResponse","_onValidationResponse","onSuccess","onError","applyAction","osdkApplyAction","isPending","metadata","loading","metadataLoading","error","metadataError","type","parameters","resolvedFieldDefinitions","rendererFieldDefinitions","map","def","fieldKey","String","fieldType","defaultValue","coerceFormState","rawState","coerced","key","value","Object","entries","handleSubmit","rawFormState","result","e","handleFieldValueChange","prev","resolvedTitle","displayName","apiName","commonProps","fieldDefinitions","isLoading","onFieldValueChange","createElement","_extends"],"sources":["ActionForm.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionDefinition } from \"@osdk/api\";\nimport { useOsdkMetadata } from \"@osdk/react\";\nimport { useOsdkAction } from \"@osdk/react/experimental\";\nimport React, { useCallback, useEffect, useMemo } from \"react\";\nimport { typedReactMemo } from \"../shared/typedMemo.js\";\nimport type { ActionFormProps, FormState } from \"./ActionFormApi.js\";\nimport { BaseForm } from \"./BaseForm.js\";\nimport type { RendererFieldDefinition } from \"./FormFieldApi.js\";\nimport { coerceFieldValue } from \"./utils/coerceFieldValue.js\";\nimport { getDefaultFieldDefinitions } from \"./utils/getDefaultFieldDefinitions.js\";\n\nconst EMPTY_FIELD_DEFINITIONS: readonly [] = [];\n\nexport const ActionForm: <Q extends ActionDefinition<unknown>>(\n props: ActionFormProps<Q>,\n) => React.ReactElement = typedReactMemo(function ActionFormFn<\n Q extends ActionDefinition<unknown>,\n>({\n actionDefinition,\n formTitle,\n formFieldDefinitions,\n formState: controlledFormState,\n onFormStateChange,\n isSubmitDisabled,\n onSubmit,\n onValidationResponse: _onValidationResponse,\n onSuccess,\n onError,\n}: ActionFormProps<Q>): React.ReactElement {\n const { applyAction: osdkApplyAction, isPending } = useOsdkAction(\n actionDefinition,\n );\n const {\n metadata,\n loading: metadataLoading,\n error: metadataError,\n } = useOsdkMetadata(actionDefinition);\n\n useEffect(\n function saveMetadataError() {\n if (metadataError != null) {\n onError?.({ type: \"unknown\", error: metadataError });\n }\n },\n [metadataError, onError],\n );\n\n const parameters = metadata?.parameters;\n\n const resolvedFieldDefinitions = useMemo(\n () =>\n formFieldDefinitions\n ?? (metadata != null\n ? getDefaultFieldDefinitions<Q>(metadata)\n : EMPTY_FIELD_DEFINITIONS),\n [formFieldDefinitions, metadata],\n );\n\n const rendererFieldDefinitions: ReadonlyArray<RendererFieldDefinition> =\n useMemo(\n () =>\n // RendererFieldDefinition is a discriminated union keyed by fieldComponent.\n // TypeScript can't verify that the spread preserves the fieldComponent ↔\n // fieldComponentProps pairing, but FormFieldDefinition guarantees it.\n resolvedFieldDefinitions.map((def) =>\n ({\n ...def,\n fieldKey: String(def.fieldKey),\n fieldType: parameters?.[String(def.fieldKey)]?.type,\n defaultValue: def.defaultValue,\n }) as RendererFieldDefinition\n ),\n [resolvedFieldDefinitions, parameters],\n );\n\n const coerceFormState = useCallback(\n (rawState: Record<string, unknown>): Record<string, unknown> => {\n const coerced: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rawState)) {\n coerced[key] = coerceFieldValue(parameters?.[key]?.type, value);\n }\n return coerced;\n },\n [parameters],\n );\n\n const handleSubmit = useCallback(\n async (rawFormState: Record<string, unknown>) => {\n const formState = coerceFormState(rawFormState) as FormState<Q>;\n try {\n if (onSubmit != null) {\n await onSubmit(formState, osdkApplyAction);\n } else {\n const result = await osdkApplyAction(formState);\n onSuccess?.(result);\n }\n } catch (e) {\n onError?.({ type: \"submission\", error: e });\n }\n },\n [coerceFormState, onSubmit, osdkApplyAction, onSuccess, onError],\n );\n\n const handleFieldValueChange = useCallback(\n (fieldKey: string, value: unknown) => {\n onFormStateChange?.(\n (prev) =>\n ({\n ...prev,\n [fieldKey]: value,\n }) as FormState<Q>,\n );\n },\n [onFormStateChange],\n );\n\n const resolvedTitle = formTitle ?? metadata?.displayName\n ?? actionDefinition.apiName;\n\n const isControlled = controlledFormState != null;\n\n const commonProps = {\n formTitle: resolvedTitle,\n fieldDefinitions: rendererFieldDefinitions,\n onSubmit: handleSubmit,\n isSubmitDisabled,\n isPending,\n isLoading: metadataLoading,\n onFieldValueChange: handleFieldValueChange,\n };\n\n if (!isControlled) {\n return <BaseForm {...commonProps} />;\n }\n\n return <BaseForm {...commonProps} formState={controlledFormState} />;\n});\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,aAAa;AAC7C,SAASC,aAAa,QAAQ,0BAA0B;AACxD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,wBAAwB;AAEvD,SAASC,QAAQ,QAAQ,eAAe;AAExC,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,0BAA0B,QAAQ,uCAAuC;AAElF,MAAMC,uBAAoC,GAAG,EAAE;AAE/C,OAAO,MAAMC,UAEU,GAAGL,cAAc,CAAC,UAEvC;EACAM,gBAAgB;EAChBC,SAAS;EACTC,oBAAoB;EACpBC,SAAS,EAAEC,mBAAmB;EAC9BC,iBAAiB;EACjBC,gBAAgB;EAChBC,QAAQ;EACRC,oBAAoB,EAAEC,qBAAqB;EAC3CC,SAAS;EACTC;AACkB,CAAC,EAAsB;EACzC,MAAM;IAAEC,WAAW,EAAEC,eAAe;IAAEC;EAAU,CAAC,GAAGzB,aAAa,CAC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IACjB,oBAAOd,KAAA,CAAA4D,aAAA,CAACvD,QAAQ,EAAKmD,WAAc,CAAC;EACtC;EAEA,oBAAOxD,KAAA,CAAA4D,aAAA,CAACvD,QAAQ,EAAAwD,QAAA,KAAKL,WAAW;IAAE3C,SAAS,EAAEC;EAAoB,EAAE,CAAC;AACtE,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ActionForm.js","names":["useOsdkMetadata","useOsdkAction","React","useCallback","useEffect","useMemo","typedReactMemo","BaseForm","coerceFieldValue","getDefaultFieldDefinitions","EMPTY_FIELD_DEFINITIONS","ActionForm","actionDefinition","formTitle","formFieldDefinitions","formState","controlledFormState","onFormStateChange","isSubmitDisabled","onSubmit","onValidationResponse","_onValidationResponse","onSuccess","onError","applyAction","osdkApplyAction","isPending","metadata","loading","metadataLoading","error","metadataError","type","parameters","customFieldDefinitions","map","def","fieldKey","String","fieldType","defaultValue","rendererFieldDefinitions","coerceFormState","rawState","coerced","key","value","Object","entries","handleSubmit","rawFormState","result","e","handleFieldValueChange","prev","resolvedTitle","displayName","apiName","commonProps","fieldDefinitions","isLoading","onFieldValueChange","createElement","_extends"],"sources":["ActionForm.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionDefinition } from \"@osdk/api\";\nimport { useOsdkMetadata } from \"@osdk/react\";\nimport { useOsdkAction } from \"@osdk/react/experimental\";\nimport React, { useCallback, useEffect, useMemo } from \"react\";\nimport { typedReactMemo } from \"../shared/typedMemo.js\";\nimport type { ActionFormProps, FormState } from \"./ActionFormApi.js\";\nimport { BaseForm } from \"./BaseForm.js\";\nimport type { RendererFieldDefinition } from \"./FormFieldApi.js\";\nimport { coerceFieldValue } from \"./utils/coerceFieldValue.js\";\nimport { getDefaultFieldDefinitions } from \"./utils/getDefaultFieldDefinitions.js\";\n\nconst EMPTY_FIELD_DEFINITIONS: readonly [] = [];\n\nexport const ActionForm: <Q extends ActionDefinition<unknown>>(\n props: ActionFormProps<Q>,\n) => React.ReactElement = typedReactMemo(function ActionFormFn<\n Q extends ActionDefinition<unknown>,\n>({\n actionDefinition,\n formTitle,\n formFieldDefinitions,\n formState: controlledFormState,\n onFormStateChange,\n isSubmitDisabled,\n onSubmit,\n onValidationResponse: _onValidationResponse,\n onSuccess,\n onError,\n}: ActionFormProps<Q>): React.ReactElement {\n const { applyAction: osdkApplyAction, isPending } = useOsdkAction(\n actionDefinition,\n );\n const {\n metadata,\n loading: metadataLoading,\n error: metadataError,\n } = useOsdkMetadata(actionDefinition);\n\n useEffect(\n function saveMetadataError() {\n if (metadataError != null) {\n onError?.({ type: \"unknown\", error: metadataError });\n }\n },\n [metadataError, onError],\n );\n\n const parameters = metadata?.parameters;\n\n const customFieldDefinitions: ReadonlyArray<RendererFieldDefinition> | null =\n useMemo(() => {\n if (formFieldDefinitions == null) {\n return null;\n }\n // RendererFieldDefinition is a discriminated union keyed by fieldComponent.\n // TypeScript can't verify that the spread preserves the fieldComponent ↔\n // fieldComponentProps pairing, but FormFieldDefinition guarantees it.\n return formFieldDefinitions.map(\n (def) =>\n ({\n ...def,\n fieldKey: String(def.fieldKey),\n fieldType: parameters?.[String(def.fieldKey)]?.type,\n defaultValue: def.defaultValue,\n }) as RendererFieldDefinition,\n );\n }, [formFieldDefinitions, parameters]);\n\n const rendererFieldDefinitions = useMemo(\n () =>\n customFieldDefinitions\n ?? (metadata != null\n ? getDefaultFieldDefinitions(metadata)\n : EMPTY_FIELD_DEFINITIONS),\n [customFieldDefinitions, metadata],\n );\n\n const coerceFormState = useCallback(\n (rawState: Record<string, unknown>): Record<string, unknown> => {\n const coerced: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rawState)) {\n coerced[key] = coerceFieldValue(parameters?.[key]?.type, value);\n }\n return coerced;\n },\n [parameters],\n );\n\n const handleSubmit = useCallback(\n async (rawFormState: Record<string, unknown>) => {\n const formState = coerceFormState(rawFormState) as FormState<Q>;\n try {\n if (onSubmit != null) {\n await onSubmit(formState, osdkApplyAction);\n } else {\n const result = await osdkApplyAction(formState);\n onSuccess?.(result);\n }\n } catch (e) {\n onError?.({ type: \"submission\", error: e });\n }\n },\n [coerceFormState, onSubmit, osdkApplyAction, onSuccess, onError],\n );\n\n const handleFieldValueChange = useCallback(\n (fieldKey: string, value: unknown) => {\n onFormStateChange?.(\n (prev) =>\n ({\n ...prev,\n [fieldKey]: value,\n }) as FormState<Q>,\n );\n },\n [onFormStateChange],\n );\n\n const resolvedTitle = formTitle ?? metadata?.displayName\n ?? actionDefinition.apiName;\n\n const isControlled = controlledFormState != null;\n\n const commonProps = {\n formTitle: resolvedTitle,\n fieldDefinitions: rendererFieldDefinitions,\n onSubmit: handleSubmit,\n isSubmitDisabled,\n isPending,\n isLoading: metadataLoading,\n onFieldValueChange: handleFieldValueChange,\n };\n\n if (!isControlled) {\n return <BaseForm {...commonProps} />;\n }\n\n return <BaseForm {...commonProps} formState={controlledFormState} />;\n});\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,aAAa;AAC7C,SAASC,aAAa,QAAQ,0BAA0B;AACxD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,wBAAwB;AAEvD,SAASC,QAAQ,QAAQ,eAAe;AAExC,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,0BAA0B,QAAQ,uCAAuC;AAElF,MAAMC,uBAAoC,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CAAC,CACL,CAAC;EACH,CAAC,EACD,CAAC7B,iBAAiB,CACpB,CAAC;EAED,MAAMsC,aAAa,GAAG1C,SAAS,IAAIc,QAAQ,EAAE6B,WAAW,IACnD5C,gBAAgB,CAAC6C,OAAO;EAI7B,MAAMC,WAAW,GAAG;IAClB7C,SAAS,EAAE0C,aAAa;IACxBI,gBAAgB,EAAElB,wBAAwB;IAC1CtB,QAAQ,EAAE8B,YAAY;IACtB/B,gBAAgB;IAChBQ,SAAS;IACTkC,SAAS,EAAE/B,eAAe;IAC1BgC,kBAAkB,EAAER;EACtB,CAAC;EAED,IAAI,EAZiBrC,mBAAmB,IAAI,IAAI,CAY/B,EAAE;IACjB,oBAAOd,KAAA,CAAA4D,aAAA,CAACvD,QAAQ,EAAKmD,WAAc,CAAC;EACtC;EAEA,oBAAOxD,KAAA,CAAA4D,aAAA,CAACvD,QAAQ,EAAAwD,QAAA,KAAKL,WAAW;IAAE3C,SAAS,EAAEC;EAAoB,EAAE,CAAC;AACtE,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldApi.js","names":[],"sources":["FormFieldApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\n/**\n * A form field definition specifies configuration for a single field\n */\nexport interface FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n * If not provided, the form field will not show any label.\n */\n label?: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field\n * The placement of helper text depends on the value of helperTextPlacement prop\n */\n helperText?: string;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n isDisabled?: boolean;\n\n /**\n * A callback to return a custom error message if validation failed\n *\n * @param validationRule the validation rule that failed with the error message\n * @returns the error message to display\n */\n onValidationError?: (error: ValidationError) => string;\n\n /**\n * Additional function to validate the field\n *\n * @param value the current field value\n * @returns a boolean promise indicating whether the value is valid\n */\n validate?: (value: FieldValueType<Q, K>) => Promise<boolean>;\n\n /**\n * The component props for the form field\n * Excludes runtime props (key, onChange) which are managed by ActionForm\n */\n fieldComponentProps?: Omit<\n FormFieldPropsByType[\n ValidFormFieldForPropertyType<\n FieldDescriptorType<Q, K>\n >\n ],\n \"key\" | \"onChange\"\n >;\n}\n\ntype ValidationError = { type: ValidationRule; error: string };\n\ntype ValidationRule =\n | \"required\"\n | \"min\"\n | \"max\"\n | \"minLength\"\n | \"maxLength\"\n | \"pattern\"\n | \"validate\";\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATETIME_PICKER: DatetimePickerFieldProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n}\n\n/**\n * Datetime picker field props.\n *\n * When `formatDate` is omitted, ISO-like format is used (YYYY-MM-DD / YYYY-MM-DD HH:mm).\n */\nexport interface DatetimePickerFieldProps extends BaseFormFieldProps<Date> {\n /**\n * The earliest date the user can select.\n * If provided, this will be added to the field validation.\n */\n min?: Date;\n\n /**\n * The latest date the user can select.\n * If provided, this will be added to the field validation.\n */\n max?: Date;\n\n /**\n * Whether to show time picker.\n */\n showTime?: boolean;\n\n /**\n * Whether to close the popover after selecting a date.\n * @default true when `showTime` is false, false when `showTime` is true\n */\n closeOnSelection?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /** Formats a Date for display in the trigger button. */\n formatDate?: (date: Date) => string;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends\n BaseFormFieldProps<number>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"min\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"max\"\n | \"step\"\n >\n{}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n}\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends BaseFormFieldProps<ObjectSet<T>>\n{}\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n *\n * TODO: Re-use `BaseType`\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"RADIO_BUTTONS\"\n | \"OBJECT_SET\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label?: string;\n defaultValue?: unknown;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: string;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n fieldComponentProps?: Omit<FormFieldPropsByType[K], \"value\" | \"onChange\">;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n P extends \"objectSet\" ? \"OBJECT_SET\"\n : P extends \"object\" ? \"DROPDOWN\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldApi.js","names":[],"sources":["FormFieldApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\n/**\n * A form field definition specifies configuration for a single field\n */\nexport interface FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n * If not provided, the form field will not show any label.\n */\n label?: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field\n * The placement of helper text depends on the value of helperTextPlacement prop\n */\n helperText?: string;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n isDisabled?: boolean;\n\n /**\n * A callback to return a custom error message if validation failed\n *\n * @param validationRule the validation rule that failed with the error message\n * @returns the error message to display\n */\n onValidationError?: (error: ValidationError) => string;\n\n /**\n * Additional function to validate the field\n *\n * @param value the current field value\n * @returns a boolean promise indicating whether the value is valid\n */\n validate?: (value: FieldValueType<Q, K>) => Promise<boolean>;\n\n /**\n * The component props for the form field\n * Excludes runtime props (value, onChange) which are managed by ActionForm\n */\n fieldComponentProps: Omit<\n FormFieldPropsByType[\n ValidFormFieldForPropertyType<\n FieldDescriptorType<Q, K>\n >\n ],\n \"value\" | \"onChange\"\n >;\n}\n\ntype ValidationError = { type: ValidationRule; error: string };\n\ntype ValidationRule =\n | \"required\"\n | \"min\"\n | \"max\"\n | \"minLength\"\n | \"maxLength\"\n | \"pattern\"\n | \"validate\";\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATETIME_PICKER: DatetimePickerFieldProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n}\n\n/**\n * Datetime picker field props.\n *\n * When `formatDate` is omitted, ISO-like format is used (YYYY-MM-DD / YYYY-MM-DD HH:mm).\n */\nexport interface DatetimePickerFieldProps extends BaseFormFieldProps<Date> {\n /**\n * The earliest date the user can select.\n * If provided, this will be added to the field validation.\n */\n min?: Date;\n\n /**\n * The latest date the user can select.\n * If provided, this will be added to the field validation.\n */\n max?: Date;\n\n /**\n * Whether to show time picker.\n */\n showTime?: boolean;\n\n /**\n * Whether to close the popover after selecting a date.\n * @default true when `showTime` is false, false when `showTime` is true\n */\n closeOnSelection?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /** Formats a Date for display in the trigger button. */\n formatDate?: (date: Date) => string;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends\n BaseFormFieldProps<number>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"min\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"max\"\n | \"step\"\n >\n{}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n}\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends BaseFormFieldProps<ObjectSet<T>>\n{}\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n *\n * TODO: Re-use `BaseType`\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"RADIO_BUTTONS\"\n | \"OBJECT_SET\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label?: string;\n defaultValue?: unknown;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: string;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n fieldComponentProps: Omit<FormFieldPropsByType[K], \"value\" | \"onChange\">;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n P extends \"objectSet\" ? \"OBJECT_SET\"\n : P extends \"object\" ? \"DROPDOWN\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React, { memo } from "react";
18
+ /**
19
+ * Renders a user-provided custom field. Delegates all rendering to the
20
+ * `customRenderer` callback, passing through the standard form field props
21
+ * (value, onChange, id) so the custom implementation can participate in
22
+ * form state management.
23
+ */
24
+ export const CustomField = /*#__PURE__*/memo(function ({
25
+ customRenderer: CustomRenderer,
26
+ ...baseProps
27
+ }) {
28
+ return /*#__PURE__*/React.createElement(CustomRenderer, baseProps);
29
+ });
30
+ //# sourceMappingURL=CustomField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomField.js","names":["React","memo","CustomField","customRenderer","CustomRenderer","baseProps","createElement"],"sources":["CustomField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport type { CustomFieldProps } from \"../FormFieldApi.js\";\n\n/**\n * Renders a user-provided custom field. Delegates all rendering to the\n * `customRenderer` callback, passing through the standard form field props\n * (value, onChange, id) so the custom implementation can participate in\n * form state management.\n */\nexport const CustomField: React.FC<CustomFieldProps<unknown>> = memo(\n function CustomFieldFn({ customRenderer: CustomRenderer, ...baseProps }) {\n return <CustomRenderer {...baseProps} />;\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAGnC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAgD,gBAAGD,IAAI,CAClE,UAAuB;EAAEE,cAAc,EAAEC,cAAc;EAAE,GAAGC;AAAU,CAAC,EAAE;EACvE,oBAAOL,KAAA,CAAAM,aAAA,CAACF,cAAc,EAAKC,SAAY,CAAC;AAC1C,CACF,CAAC","ignoreList":[]}
@@ -17,13 +17,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
17
17
 
18
18
  import React, { memo } from "react";
19
19
  import { FormField } from "../FormField.js";
20
+ import { CustomField } from "./CustomField.js";
20
21
  import { DatetimePickerField } from "./DatetimePickerField.js";
21
22
  import { DropdownField } from "./DropdownField.js";
22
23
  import { RadioButtonsField } from "./RadioButtonsField.js";
23
24
  import { TextAreaField } from "./TextAreaField.js";
24
25
  import { TextInputField } from "./TextInputField.js";
25
- const EMPTY_ITEMS = [];
26
- const EMPTY_OPTIONS = [];
27
26
  export const FormFieldRenderer = /*#__PURE__*/memo(function ({
28
27
  fieldDefinition,
29
28
  value,
@@ -60,16 +59,11 @@ function renderFieldComponent(fieldDefinition, value, onChange) {
60
59
  }, fieldDefinition.fieldComponentProps));
61
60
  case "DROPDOWN":
62
61
  {
63
- const {
64
- items = EMPTY_ITEMS,
65
- ...dropdownProps
66
- } = fieldDefinition.fieldComponentProps ?? {};
67
62
  return /*#__PURE__*/React.createElement(DropdownField, _extends({
68
63
  value: value,
69
64
  onChange: onChange,
70
- items: items,
71
65
  placeholder: fieldDefinition.placeholder
72
- }, dropdownProps));
66
+ }, fieldDefinition.fieldComponentProps));
73
67
  }
74
68
  case "DATETIME_PICKER":
75
69
  return /*#__PURE__*/React.createElement(DatetimePickerField, _extends({
@@ -81,22 +75,20 @@ function renderFieldComponent(fieldDefinition, value, onChange) {
81
75
  onChange: onChange
82
76
  }, fieldDefinition.fieldComponentProps));
83
77
  case "RADIO_BUTTONS":
84
- {
85
- const {
86
- options = EMPTY_OPTIONS,
87
- ...radioProps
88
- } = fieldDefinition.fieldComponentProps ?? {};
89
- return /*#__PURE__*/React.createElement(RadioButtonsField, _extends({
90
- id: fieldDefinition.fieldKey,
91
- value: value,
92
- onChange: onChange,
93
- options: options
94
- }, radioProps));
95
- }
78
+ return /*#__PURE__*/React.createElement(RadioButtonsField, _extends({
79
+ id: fieldDefinition.fieldKey,
80
+ value: value,
81
+ onChange: onChange
82
+ }, fieldDefinition.fieldComponentProps));
83
+ case "CUSTOM":
84
+ return /*#__PURE__*/React.createElement(CustomField, _extends({
85
+ id: fieldDefinition.fieldKey,
86
+ value: value,
87
+ onChange: onChange
88
+ }, fieldDefinition.fieldComponentProps));
96
89
  case "NUMBER_INPUT":
97
90
  case "FILE_PICKER":
98
91
  case "OBJECT_SET":
99
- case "CUSTOM":
100
92
  return /*#__PURE__*/React.createElement("div", null, "Unsupported field type: ", fieldDefinition.fieldComponent);
101
93
  default:
102
94
  return assertUnreachableFieldComponent(fieldDefinition);
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldRenderer.js","names":["React","memo","FormField","DatetimePickerField","DropdownField","RadioButtonsField","TextAreaField","TextInputField","EMPTY_ITEMS","EMPTY_OPTIONS","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","undefined","renderFieldComponent","onChange","fieldComponent","_extends","id","String","placeholder","fieldComponentProps","items","dropdownProps","Date","options","radioProps","assertUnreachableFieldComponent","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport { FormField } from \"../FormField.js\";\nimport type { Option, RendererFieldDefinition } from \"../FormFieldApi.js\";\nimport { DatetimePickerField } from \"./DatetimePickerField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { RadioButtonsField } from \"./RadioButtonsField.js\";\nimport { TextAreaField } from \"./TextAreaField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nconst EMPTY_ITEMS: unknown[] = [];\nconst EMPTY_OPTIONS: Option<never>[] = [];\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperTextPlacement !== \"tooltip\" ? helperText : undefined}\n >\n {renderFieldComponent(fieldDefinition, value, onFieldValueChange)}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"TEXT_INPUT\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"TEXT_AREA\":\n return (\n <TextAreaField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"DROPDOWN\": {\n const { items = EMPTY_ITEMS, ...dropdownProps } =\n fieldDefinition.fieldComponentProps ?? {};\n return (\n <DropdownField\n value={value}\n onChange={onChange}\n items={items}\n placeholder={fieldDefinition.placeholder}\n {...dropdownProps}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatetimePickerField\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"RADIO_BUTTONS\": {\n const { options = EMPTY_OPTIONS, ...radioProps } =\n fieldDefinition.fieldComponentProps ?? {};\n return (\n <RadioButtonsField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n options={options}\n {...radioProps}\n />\n );\n }\n case \"NUMBER_INPUT\":\n case \"FILE_PICKER\":\n case \"OBJECT_SET\":\n case \"CUSTOM\":\n return <div>Unsupported field type: {fieldDefinition.fieldComponent}\n </div>;\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: ${String(value)}`);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAMC,WAAsB,GAAG,EAAE;AACjC,MAAMC,aAA8B,GAAG,EAAE;AAQzC,OAAO,MAAMC,iBAAmD,gBAAGT,IAAI,CACrE,UAA6B;EAC3BU,eAAe;EACfC,KAAK;EACLC;AACsB,CAAC,EAAsB;EAC7C,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAoB,CAAC,GAC1DN,eAAe;EAEjB,oBACEX,KAAA,CAAAkB,aAAA,CAAChB,SAAS;IACRY,KAAK,EAAEA,KAAM;IACbC,UAAU,EAAEA,UAAW;IACvBI,QAAQ,EAAER,eAAe,CAACQ,QAAS;IACnCH,UAAU,EAAEC,mBAAmB,KAAK,SAAS,GAAGD,UAAU,GAAGI;EAAU,GAEtEC,oBAAoB,CAACV,eAAe,EAAEC,KAAK,EAAEC,kBAAkB,CACvD,CAAC;AAEhB,CACF,CAAC;AAED,SAASQ,oBAAoBA,CAC3BV,eAAwC,EACxCC,KAAc,EACdU,QAAkC,EACd;EACpB,QAAQX,eAAe,CAACY,cAAc;IACpC,KAAK,YAAY;MACf,oBACEvB,KAAA,CAAAkB,aAAA,CAACX,cAAc,EAAAiB,QAAA;QACbC,EAAE,EAAEd,eAAe,CAACQ,QAAS;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E,GAAGwB;QAAW,CAAC,GAC9CtB,eAAe,CAACiB,mBAAmB,IAAI,CAAC,CAAC;QAC3C,oBACE5B,KAAA,CAAAkB,aAAA,CAACb,iBAAiB,EAAAmB,QAAA;UAChBC,EAAE,EAAEd,eAAe,CAACQ,QAAS;UAC7BP,KAAK,EAAEA,KAAM;UACbU,QAAQ,EAAEA,QAAS;UACnBU,OAAO,EAAEA;QAAQ,GACbC,UAAU,CACf,CAAC;MAEN;IACA,KAAK,cAAc;IACnB,KAAK,aAAa;IAClB,KAAK,YAAY;IACjB,KAAK,QAAQ;MACX,oBAAOjC,KAAA,CAAAkB,aAAA,cAAK,0BAAwB,EAACP,eAAe,CAACY,cAChD,CAAC;IACR;MACE,OAAOW,+BAA+B,CAACvB,eAAe,CAAC;EAC3D;AACF;AAEA,SAASuB,+BAA+BA,CAACtB,KAAY,EAAS;EAC5D,MAAM,IAAIuB,KAAK,CAAC,8BAA8BT,MAAM,CAACd,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldRenderer.js","names":["React","memo","FormField","CustomField","DatetimePickerField","DropdownField","RadioButtonsField","TextAreaField","TextInputField","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","undefined","renderFieldComponent","onChange","fieldComponent","_extends","id","String","placeholder","fieldComponentProps","Date","assertUnreachableFieldComponent","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport { FormField } from \"../FormField.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\nimport { CustomField } from \"./CustomField.js\";\nimport { DatetimePickerField } from \"./DatetimePickerField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { RadioButtonsField } from \"./RadioButtonsField.js\";\nimport { TextAreaField } from \"./TextAreaField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperTextPlacement !== \"tooltip\" ? helperText : undefined}\n >\n {renderFieldComponent(fieldDefinition, value, onFieldValueChange)}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"TEXT_INPUT\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"TEXT_AREA\":\n return (\n <TextAreaField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"DROPDOWN\": {\n return (\n <DropdownField\n value={value}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatetimePickerField\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"RADIO_BUTTONS\":\n return (\n <RadioButtonsField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"CUSTOM\":\n return (\n <CustomField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"NUMBER_INPUT\":\n case \"FILE_PICKER\":\n case \"OBJECT_SET\":\n return <div>Unsupported field type: {fieldDefinition.fieldComponent}\n </div>;\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: ${String(value)}`);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AAQpD,OAAO,MAAMC,iBAAmD,gBAAGR,IAAI,CACrE,UAA6B;EAC3BS,eAAe;EACfC,KAAK;EACLC;AACsB,CAAC,EAAsB;EAC7C,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAoB,CAAC,GAC1DN,eAAe;EAEjB,oBACEV,KAAA,CAAAiB,aAAA,CAACf,SAAS;IACRW,KAAK,EAAEA,KAAM;IACbC,UAAU,EAAEA,UAAW;IACvBI,QAAQ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eAAe,CAACQ,QAAS;QAC7BQ,WAAW,EAAEhB,eAAe,CAACgB;QAC7B;QAAA;QACAf,KAAK,EAAEA,KAAK,YAAYiB,IAAI,GAAGjB,KAAK,GAAG,IAAK;QAC5CU,QAAQ,EAAEA;MAAS,GACfX,eAAe,CAACiB,mBAAmB,CACxC,CAAC;IAEN,KAAK,eAAe;MAClB,oBACE3B,KAAA,CAAAiB,aAAA,CAACX,iBAAiB,EAAAiB,QAAA;QAChBC,EAAE,EAAEd,eAAe,CAACQ,QAAS;QAC7BP,KAAK,EAAEA,KAAM;QACbU,QAAQ,EAAEA;MAAS,GACfX,eAAe,CAACiB,mBAAmB,CACxC,CAAC;IAEN,KAAK,QAAQ;MACX,oBACE3B,KAAA,CAAAiB,aAAA,CAACd,WAAW,EAAAoB,QAAA;QACVC,EAAE,EAAEd,eAAe,CAACQ,QAAS;QAC7BP,KAAK,EAAEA,KAAM;QACbU,QAAQ,EAAEA;MAAS,GACfX,eAAe,CAACiB,mBAAmB,CACxC,CAAC;IAEN,KAAK,cAAc;IACnB,KAAK,aAAa;IAClB,KAAK,YAAY;MACf,oBAAO3B,KAAA,CAAAiB,aAAA,cAAK,0BAAwB,EAACP,eAAe,CAACY,cAChD,CAAC;IACR;MACE,OAAOO,+BAA+B,CAACnB,eAAe,CAAC;EAC3D;AACF;AAEA,SAASmB,+BAA+BA,CAAClB,KAAY,EAAS;EAC5D,MAAM,IAAImB,KAAK,CAAC,8BAA8BL,MAAM,CAACd,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { Radio } from "@base-ui/react/radio";
18
18
  import { RadioGroup } from "@base-ui/react/radio-group";
19
- import { memo, useCallback, useMemo } from "react";
19
+ import React, { memo, useCallback, useMemo } from "react";
20
20
  import { typedReactMemo } from "../../shared/typedMemo.js";
21
21
  import styles from "./RadioButtonsField.module.css";
22
22
  export const RadioButtonsField = typedReactMemo(function ({
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButtonsField.js","names":["Radio","RadioGroup","memo","useCallback","useMemo","typedReactMemo","styles","RadioButtonsField","id","value","onChange","options","selectedLabel","find","opt","label","undefined","handleValueChange","nextLabel","match","React","createElement","className","osdkRadioGroup","onValueChange","map","option","RadioItem","key","osdkRadioItem","Root","osdkRadioRoot","Indicator","osdkRadioIndicator","osdkRadioLabel"],"sources":["RadioButtonsField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup } from \"@base-ui/react/radio-group\";\nimport { memo, type ReactElement, useCallback, useMemo } from \"react\";\nimport { typedReactMemo } from \"../../shared/typedMemo.js\";\nimport type { Option, RadioButtonsFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./RadioButtonsField.module.css\";\n\nexport const RadioButtonsField: <V>(\n props: RadioButtonsFieldProps<V>,\n) => ReactElement = typedReactMemo(function RadioButtonsFieldFn<V,>({\n id,\n value,\n onChange,\n options,\n}: RadioButtonsFieldProps<V>): ReactElement {\n const selectedLabel = useMemo(\n () =>\n value != null\n ? options.find((opt) => opt.value === value)?.label\n : undefined,\n [options, value],\n );\n\n const handleValueChange = useCallback(\n (nextLabel: unknown) => {\n const match = options.find((opt) => opt.label === nextLabel);\n onChange?.(match?.value ?? null);\n },\n [options, onChange],\n );\n\n return (\n <RadioGroup\n id={id}\n className={styles.osdkRadioGroup}\n value={selectedLabel}\n onValueChange={handleValueChange}\n >\n {options.map((option) => (\n <RadioItem key={option.label} option={option} />\n ))}\n </RadioGroup>\n );\n});\n\nconst RadioItem = memo(function RadioItemFn({\n option,\n}: {\n option: Option<unknown>;\n}): ReactElement {\n return (\n <label className={styles.osdkRadioItem}>\n <Radio.Root value={option.label} className={styles.osdkRadioRoot}>\n <Radio.Indicator className={styles.osdkRadioIndicator} />\n </Radio.Root>\n <span className={styles.osdkRadioLabel}>{option.label}</span>\n </label>\n );\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAASC,IAAI,EAAqBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACrE,SAASC,cAAc,QAAQ,2BAA2B;AAE1D,OAAOC,MAAM,MAAM,gCAAgC;AAEnD,OAAO,MAAMC,iBAEI,GAAGF,cAAc,CAAC,UAAiC;EAClEG,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC;AACyB,CAAC,EAAgB;EAC1C,MAAMC,aAAa,GAAGR,OAAO,CAC3B,MACEK,KAAK,IAAI,IAAI,GACTE,OAAO,CAACE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACL,KAAK,KAAKA,KAAK,CAAC,EAAEM,KAAK,GACjDC,SAAS,EACf,CAACL,OAAO,EAAEF,KAAK,CACjB,CAAC;EAED,MAAMQ,iBAAiB,GAAGd,WAAW,CAClCe,SAAkB,IAAK;IACtB,MAAMC,KAAK,GAAGR,OAAO,CAACE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,KAAK,KAAKG,SAAS,CAAC;IAC5DR,QAAQ,GAAGS,KAAK,EAAEV,KAAK,IAAI,IAAI,CAAC;EAClC,CAAC,EACD,CAACE,OAAO,EAAED,QAAQ,CACpB,CAAC;EAED,oBACEU,KAAA,CAAAC,aAAA,CAACpB,UAAU;IACTO,EAAE,EAAEA,EAAG;IACPc,SAAS,EAAEhB,MAAM,CAACiB,cAAe;IACjCd,KAAK,EAAEG,aAAc;IACrBY,aAAa,EAAEP;EAAkB,GAEhCN,OAAO,CAACc,GAAG,CAAEC,MAAM,iBAClBN,KAAA,CAAAC,aAAA,CAACM,SAAS;IAACC,GAAG,EAAEF,MAAM,CAACX,KAAM;IAACW,MAAM,EAAEA;EAAO,CAAE,CAChD,CACS,CAAC;AAEjB,CAAC,CAAC;AAEF,MAAMC,SAAS,gBAAGzB,IAAI,CAAC,UAAqB;EAC1CwB;AAGF,CAAC,EAAgB;EACf,oBACEN,KAAA,CAAAC,aAAA;IAAOC,SAAS,EAAEhB,MAAM,CAACuB;EAAc,gBACrCT,KAAA,CAAAC,aAAA,CAACrB,KAAK,CAAC8B,IAAI;IAACrB,KAAK,EAAEiB,MAAM,CAACX,KAAM;IAACO,SAAS,EAAEhB,MAAM,CAACyB;EAAc,gBAC/DX,KAAA,CAAAC,aAAA,CAACrB,KAAK,CAACgC,SAAS;IAACV,SAAS,EAAEhB,MAAM,CAAC2B;EAAmB,CAAE,CAC9C,CAAC,eACbb,KAAA,CAAAC,aAAA;IAAMC,SAAS,EAAEhB,MAAM,CAAC4B;EAAe,GAAER,MAAM,CAACX,KAAY,CACvD,CAAC;AAEZ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"RadioButtonsField.js","names":["Radio","RadioGroup","React","memo","useCallback","useMemo","typedReactMemo","styles","RadioButtonsField","id","value","onChange","options","selectedLabel","find","opt","label","undefined","handleValueChange","nextLabel","match","createElement","className","osdkRadioGroup","onValueChange","map","option","RadioItem","key","osdkRadioItem","Root","osdkRadioRoot","Indicator","osdkRadioIndicator","osdkRadioLabel"],"sources":["RadioButtonsField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup } from \"@base-ui/react/radio-group\";\nimport React, { memo, useCallback, useMemo } from \"react\";\nimport { typedReactMemo } from \"../../shared/typedMemo.js\";\nimport type { Option, RadioButtonsFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./RadioButtonsField.module.css\";\n\nexport const RadioButtonsField: <V>(\n props: RadioButtonsFieldProps<V>,\n) => React.ReactElement = typedReactMemo(function RadioButtonsFieldFn<V,>({\n id,\n value,\n onChange,\n options,\n}: RadioButtonsFieldProps<V>): React.ReactElement {\n const selectedLabel = useMemo(\n () =>\n value != null\n ? options.find((opt) => opt.value === value)?.label\n : undefined,\n [options, value],\n );\n\n const handleValueChange = useCallback(\n (nextLabel: unknown) => {\n const match = options.find((opt) => opt.label === nextLabel);\n onChange?.(match?.value ?? null);\n },\n [options, onChange],\n );\n\n return (\n <RadioGroup\n id={id}\n className={styles.osdkRadioGroup}\n value={selectedLabel}\n onValueChange={handleValueChange}\n >\n {options.map((option) => (\n <RadioItem key={option.label} option={option} />\n ))}\n </RadioGroup>\n );\n});\n\nconst RadioItem = memo(function RadioItemFn({\n option,\n}: {\n option: Option<unknown>;\n}): React.ReactElement {\n return (\n <label className={styles.osdkRadioItem}>\n <Radio.Root value={option.label} className={styles.osdkRadioRoot}>\n <Radio.Indicator className={styles.osdkRadioIndicator} />\n </Radio.Root>\n <span className={styles.osdkRadioLabel}>{option.label}</span>\n </label>\n );\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,OAAOC,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAA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