@osdk/react-components 0.6.0 → 0.6.1-main-22b4e35a5621ede1c0a937cf2df728a28feb6f65

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 (45) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  3. package/build/browser/action-form/fields/RadioButtonsField.js +3 -1
  4. package/build/browser/action-form/fields/RadioButtonsField.js.map +1 -1
  5. package/build/browser/action-form/fields/RadioButtonsField.module.css +5 -0
  6. package/build/browser/object-table/hooks/useFunctionColumnsData.js +2 -4
  7. package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  8. package/build/browser/styles.css +5 -0
  9. package/build/browser/util/UserAgent.js +1 -1
  10. package/build/browser/util/UserAgent.js.map +1 -1
  11. package/build/cjs/{chunk-IQZ6IABQ.cjs → chunk-C5NV5WN4.cjs} +3 -3
  12. package/build/cjs/chunk-C5NV5WN4.cjs.map +1 -0
  13. package/build/cjs/{chunk-NFG6NXZN.cjs → chunk-CJUYL7F3.cjs} +4 -4
  14. package/build/cjs/{chunk-NFG6NXZN.cjs.map → chunk-CJUYL7F3.cjs.map} +1 -1
  15. package/build/cjs/{chunk-FF7DFNVC.cjs → chunk-D7B5BTZO.cjs} +5 -5
  16. package/build/cjs/chunk-D7B5BTZO.cjs.map +1 -0
  17. package/build/cjs/{chunk-HSA4UIKA.cjs → chunk-I6WKIWKX.cjs} +7 -5
  18. package/build/cjs/chunk-I6WKIWKX.cjs.map +1 -0
  19. package/build/cjs/{chunk-GDKDKZ4H.cjs → chunk-TJWJ75QY.cjs} +4 -4
  20. package/build/cjs/{chunk-GDKDKZ4H.cjs.map → chunk-TJWJ75QY.cjs.map} +1 -1
  21. package/build/cjs/public/experimental/action-form.cjs +4 -4
  22. package/build/cjs/public/experimental/action-form.css +4 -0
  23. package/build/cjs/public/experimental/action-form.css.map +1 -1
  24. package/build/cjs/public/experimental/action-form.d.cts +7 -0
  25. package/build/cjs/public/experimental/filter-list.cjs +6 -6
  26. package/build/cjs/public/experimental/object-table.cjs +6 -6
  27. package/build/cjs/public/experimental/pdf-viewer.cjs +24 -24
  28. package/build/cjs/public/experimental.cjs +37 -37
  29. package/build/cjs/public/experimental.css +4 -0
  30. package/build/cjs/public/experimental.css.map +1 -1
  31. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  32. package/build/esm/action-form/fields/RadioButtonsField.js +3 -1
  33. package/build/esm/action-form/fields/RadioButtonsField.js.map +1 -1
  34. package/build/esm/action-form/fields/RadioButtonsField.module.css +5 -0
  35. package/build/esm/object-table/hooks/useFunctionColumnsData.js +2 -4
  36. package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  37. package/build/esm/util/UserAgent.js +1 -1
  38. package/build/esm/util/UserAgent.js.map +1 -1
  39. package/build/types/action-form/FormFieldApi.d.ts +7 -0
  40. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  41. package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -1
  42. package/package.json +4 -4
  43. package/build/cjs/chunk-FF7DFNVC.cjs.map +0 -1
  44. package/build/cjs/chunk-HSA4UIKA.cjs.map +0 -1
  45. package/build/cjs/chunk-IQZ6IABQ.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @osdk/react-components
2
2
 
3
+ ## 0.6.1-main-22b4e35a5621ede1c0a937cf2df728a28feb6f65
4
+
5
+ ### Patch Changes
6
+
7
+ - 22b4e35: Add horizontal orientation support to RadioButtonsField
8
+ - 5a45dc0: Fix stableObjectSet by using a useStableObjectSet hook
9
+ - Updated dependencies [5a45dc0]
10
+ - @osdk/react@0.13.1-main-22b4e35a5621ede1c0a937cf2df728a28feb6f65
11
+
3
12
  ## 0.6.0
4
13
 
5
14
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldApi.js","names":["EMPTY_RANGE"],"sources":["FormFieldApi.ts"],"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 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 */\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 customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (value: FieldValueType<Q, K>) => Promise<string | undefined>;\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 FormManagedProps<\n ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>\n >\n >;\n}\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangeInputFieldProps;\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 /**\n * Formats a Date for display in the input field when not editing.\n * When typing, the input shows the parsable format (YYYY-MM-DD or YYYY-MM-DD HH:mm).\n * Provide a matching `parseDate` if using a custom format.\n */\n formatDate?: (date: Date) => string;\n\n /**\n * Parses a user-typed string back into a Date.\n * Must be the inverse of `formatDate` — if `formatDate(d)` produces string `s`,\n * then `parseDate(s)` must return an equivalent Date.\n * When omitted, defaults to parsing \"YYYY-MM-DD\" (date-only) or \"YYYY-MM-DD HH:mm\" (with time).\n */\n parseDate?: (text: string) => Date | undefined;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * A date range represented as a start/end tuple.\n * Either element may be `null` when the range is partially selected.\n */\nexport type DateRange = readonly [Date | null, Date | null];\n\n/** Default empty range — both bounds are null. */\nexport const EMPTY_RANGE: DateRange = [null, null];\n\n/**\n * Date range input field props.\n *\n * Renders two text inputs (start / end) with a shared calendar popover\n * that supports range selection.\n */\nexport interface DateRangeInputFieldProps\n extends BaseFormFieldProps<DateRange>\n{\n /** The earliest selectable date. */\n min?: Date;\n\n /** The latest selectable date. */\n max?: Date;\n\n /** Whether to show time pickers for both dates. */\n showTime?: boolean;\n\n /** Placeholder text for the start date input. */\n placeholderStart?: string;\n\n /** Placeholder text for the end date input. */\n placeholderEnd?: string;\n\n /** Whether to allow start and end on the same day. @default true */\n allowSingleDayRange?: boolean;\n\n /** Formats a Date for display. Defaults to \"YYYY-MM-DD\". */\n formatDate?: (date: Date) => string;\n\n /** Parses a user-typed string back into a Date. */\n parseDate?: (text: string) => Date | undefined;\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 /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\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 * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\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 BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\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 Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\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 validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\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 | \"DATE_RANGE_INPUT\"\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 * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\"\n : \"onChange\";\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 isRequired?: boolean;\n placeholder?: string;\n helperText?: string;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: Omit<FormFieldPropsByType[K], FormManagedProps<K>>;\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":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;;AAqFA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;;AAoDA;AACA;AACA;AACA;;AAGA;AACA,OAAO,MAAMA,WAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;;AA6BA;AACA;AACA;;AAiFA;AACA;AACA;;AAqCA;AACA;AACA;;AAyBA;AACA;AACA;;AAYA;AACA;AACA;;AAMA;AACA;AACA;;AAYA;AACA;AACA;;AAkDA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;;AAMA;AACA;AACA;;AAaA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldApi.js","names":["EMPTY_RANGE"],"sources":["FormFieldApi.ts"],"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 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 */\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 customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (value: FieldValueType<Q, K>) => Promise<string | undefined>;\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 FormManagedProps<\n ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>\n >\n >;\n}\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangeInputFieldProps;\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 /**\n * Formats a Date for display in the input field when not editing.\n * When typing, the input shows the parsable format (YYYY-MM-DD or YYYY-MM-DD HH:mm).\n * Provide a matching `parseDate` if using a custom format.\n */\n formatDate?: (date: Date) => string;\n\n /**\n * Parses a user-typed string back into a Date.\n * Must be the inverse of `formatDate` — if `formatDate(d)` produces string `s`,\n * then `parseDate(s)` must return an equivalent Date.\n * When omitted, defaults to parsing \"YYYY-MM-DD\" (date-only) or \"YYYY-MM-DD HH:mm\" (with time).\n */\n parseDate?: (text: string) => Date | undefined;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * A date range represented as a start/end tuple.\n * Either element may be `null` when the range is partially selected.\n */\nexport type DateRange = readonly [Date | null, Date | null];\n\n/** Default empty range — both bounds are null. */\nexport const EMPTY_RANGE: DateRange = [null, null];\n\n/**\n * Date range input field props.\n *\n * Renders two text inputs (start / end) with a shared calendar popover\n * that supports range selection.\n */\nexport interface DateRangeInputFieldProps\n extends BaseFormFieldProps<DateRange>\n{\n /** The earliest selectable date. */\n min?: Date;\n\n /** The latest selectable date. */\n max?: Date;\n\n /** Whether to show time pickers for both dates. */\n showTime?: boolean;\n\n /** Placeholder text for the start date input. */\n placeholderStart?: string;\n\n /** Placeholder text for the end date input. */\n placeholderEnd?: string;\n\n /** Whether to allow start and end on the same day. @default true */\n allowSingleDayRange?: boolean;\n\n /** Formats a Date for display. Defaults to \"YYYY-MM-DD\". */\n formatDate?: (date: Date) => string;\n\n /** Parses a user-typed string back into a Date. */\n parseDate?: (text: string) => Date | undefined;\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 /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\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 * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\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 BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\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 * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\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 Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\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 validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\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 | \"DATE_RANGE_INPUT\"\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 * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\"\n : \"onChange\";\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 isRequired?: boolean;\n placeholder?: string;\n helperText?: string;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: Omit<FormFieldPropsByType[K], FormManagedProps<K>>;\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":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;;AAqFA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;;AAoDA;AACA;AACA;AACA;;AAGA;AACA,OAAO,MAAMA,WAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;;AA6BA;AACA;AACA;;AAiFA;AACA;AACA;;AAqCA;AACA;AACA;;AAyBA;AACA;AACA;;AAoBA;AACA;AACA;;AAMA;AACA;AACA;;AAYA;AACA;AACA;;AAkDA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;;AAMA;AACA;AACA;;AAaA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA","ignoreList":[]}
@@ -23,7 +23,8 @@ export const RadioButtonsField = typedReactMemo(function ({
23
23
  id,
24
24
  value,
25
25
  onChange,
26
- options
26
+ options,
27
+ orientation
27
28
  }) {
28
29
  const selectedLabel = useMemo(() => value != null ? options.find(opt => opt.value === value)?.label : undefined, [options, value]);
29
30
  const handleValueChange = useCallback(nextLabel => {
@@ -33,6 +34,7 @@ export const RadioButtonsField = typedReactMemo(function ({
33
34
  return /*#__PURE__*/React.createElement(RadioGroup, {
34
35
  id: id,
35
36
  className: styles.osdkRadioGroup,
37
+ "data-orientation": orientation ?? "vertical",
36
38
  value: selectedLabel,
37
39
  onValueChange: handleValueChange
38
40
  }, options.map(option => /*#__PURE__*/React.createElement(RadioItem, {
@@ -1 +1 @@
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,EAAEC,OAAO,QAAQ,OAAO;AACzD,SAASC,cAAc,QAAQ,2BAA2B;AAE1D,OAAOC,MAAM,MAAM,gCAAgC;AAEnD,OAAO,MAAMC,iBAEU,GAAGF,cAAc,CAAC,UAAiC;EACxEG,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC;AACyB,CAAC,EAAsB;EAChD,MAAMC,aAAa,GAAGR,OAAO,CAC3B,MACEK,KAAK,IAAI,IAAI,GACTE,OAAO,CAACE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACL,KAAK,KAAKA,KAAK,C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]}
1
+ {"version":3,"file":"RadioButtonsField.js","names":["Radio","RadioGroup","React","memo","useCallback","useMemo","typedReactMemo","styles","RadioButtonsField","id","value","onChange","options","orientation","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 orientation,\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 data-orientation={orientation ?? \"vertical\"}\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,EAAEC,OAAO,QAAQ,OAAO;AACzD,SAASC,cAAc,QAAQ,2BAA2B;AAE1D,OAAOC,MAAM,MAAM,gCAAgC;AAEnD,OAAO,MAAMC,iBAEU,GAAGF,cAAc,CAAC,UAAiC;EACxEG,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,OAAO;EACPC;AACyB,CAAC,EAAsB;EAChD,MAAMC,aAAa,GAAGT,OAAO,CAC3B,MACEK,KAAK,IAAI,IAAI,GACTE,OAAO,CAACG,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACN,KAAK,KAAKA,KAAK,CAAC,EAAEO,KAAK,GACjDC,SAAS,EACf,CAACN,OAAO,EAAEF,KAAK,CACjB,CAAC;EAED,MAAMS,iBAAiB,GAAGf,WAAW,CAClCgB,SAAkB,IAAK;IACtB,MAAMC,KAAK,GAAGT,OAAO,CAACG,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,KAAK,KAAKG,SAAS,CAAC;IAC5DT,QAAQ,GAAGU,KAAK,EAAEX,KAAK,IAAI,IAAI,CAAC;EAClC,CAAC,EACD,CAACE,OAAO,EAAED,QAAQ,CACpB,CAAC;EAED,oBACET,KAAA,CAAAoB,aAAA,CAACrB,UAAU;IACTQ,EAAE,EAAEA,EAAG;IACPc,SAAS,EAAEhB,MAAM,CAACiB,cAAe;IACjC,oBAAkBX,WAAW,IAAI,UAAW;IAC5CH,KAAK,EAAEI,aAAc;IACrBW,aAAa,EAAEN;EAAkB,GAEhCP,OAAO,CAACc,GAAG,CAAEC,MAAM,iBAClBzB,KAAA,CAAAoB,aAAA,CAACM,SAAS;IAACC,GAAG,EAAEF,MAAM,CAACV,KAAM;IAACU,MAAM,EAAEA;EAAO,CAAE,CAChD,CACS,CAAC;AAEjB,CAAC,CAAC;AAEF,MAAMC,SAAS,gBAAGzB,IAAI,CAAC,UAAqB;EAC1CwB;AAGF,CAAC,EAAsB;EACrB,oBACEzB,KAAA,CAAAoB,aAAA;IAAOC,SAAS,EAAEhB,MAAM,CAACuB;EAAc,gBACrC5B,KAAA,CAAAoB,aAAA,CAACtB,KAAK,CAAC+B,IAAI;IAACrB,KAAK,EAAEiB,MAAM,CAACV,KAAM;IAACM,SAAS,EAAEhB,MAAM,CAACyB;EAAc,gBAC/D9B,KAAA,CAAAoB,aAAA,CAACtB,KAAK,CAACiC,SAAS;IAACV,SAAS,EAAEhB,MAAM,CAAC2B;EAAmB,CAAE,CAC9C,CAAC,eACbhC,KAAA,CAAAoB,aAAA;IAAMC,SAAS,EAAEhB,MAAM,CAAC4B;EAAe,GAAER,MAAM,CAACV,KAAY,CACvD,CAAC;AAEZ,CAAC,CAAC","ignoreList":[]}
@@ -18,6 +18,11 @@
18
18
  display: flex;
19
19
  flex-direction: column;
20
20
  gap: var(--osdk-radio-gap);
21
+
22
+ &[data-orientation="horizontal"] {
23
+ flex-direction: row;
24
+ flex-wrap: wrap;
25
+ }
21
26
  }
22
27
 
23
28
  .osdkRadioItem {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { useOsdkFunctions } from "@osdk/react/experimental";
17
+ import { useOsdkFunctions, useStableObjectSet } from "@osdk/react/experimental";
18
18
  import { chunk } from "lodash-es";
19
19
  import { useMemo, useRef } from "react";
20
20
  import { addFilterClauseToObjectSet } from "../utils/addFilterClauseToObjectSet.js";
@@ -30,9 +30,7 @@ export function useFunctionColumnsData({
30
30
  }) {
31
31
  const prevDataRef = useRef({});
32
32
  const stableObjects = useStableObjects(objects);
33
- // TODO: replace with useDeepEqual when it's added
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
- const stableObjectSet = useMemo(() => objectSet, [JSON.stringify(objectSet)]);
33
+ const stableObjectSet = useStableObjectSet(objectSet);
36
34
  const functionColDefs = useMemo(() => extractFunctionLocators(columnDefinitions), [columnDefinitions]);
37
35
  const disabled = !stableObjectSet || !stableObjects?.length || functionColDefs.length === 0;
38
36
 
@@ -1 +1 @@
1
- {"version":3,"file":"useFunctionColumnsData.js","names":["useOsdkFunctions","chunk","useMemo","useRef","addFilterClauseToObjectSet","createAsyncCellData","DEFAULT_FUNCTION_COLUMN_DEDUPE_INTERVAL_MS","DEFAULT_MAX_CONCURRENT_REQUESTS","DEFAULT_PAGE_SIZE","stripDerivedPropertiesFromParams","useFunctionColumnsData","objectSet","objects","columnDefinitions","primaryKeyApiName","pageSize","prevDataRef","stableObjects","useStableObjects","stableObjectSet","JSON","stringify","functionColDefs","extractFunctionLocators","disabled","length","pagedObjectSets","buildPagedObjectSets","queryGrid","EMPTY_QUERY_GRID","buildQueryGrid","results","queries","enabled","maxConcurrent","mergedResults","mergePagedResults","numColumns","data","columnData","buildFunctionColumnData","current","filter","colDef","locator","type","map","page","whereClause","$in","obj","$primaryKey","pagedObjectSet","push","queryDefinition","options","params","getFunctionParams","dedupeIntervalMs","merged","Array","from","isLoading","error","undefined","functionsMap","forEach","result","index","entry","pageData","Object","assign","prevColumnData","columnId","String","id","key","prevData","resolveCell","getKey","getValue","objectKey","rawData","item","$apiName","sort","a","b","localeCompare"],"sources":["useFunctionColumnsData.ts"],"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 type {\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport {\n type FunctionQueryParams,\n useOsdkFunctions,\n type UseOsdkFunctionsResult,\n} from \"@osdk/react/experimental\";\nimport { chunk } from \"lodash-es\";\nimport { useMemo, useRef } from \"react\";\nimport type {\n ColumnDefinition,\n FunctionColumnLocator,\n} from \"../ObjectTableApi.js\";\nimport { addFilterClauseToObjectSet } from \"../utils/addFilterClauseToObjectSet.js\";\nimport {\n type AsyncCellData,\n createAsyncCellData,\n} from \"../utils/AsyncCellData.js\";\nimport {\n DEFAULT_FUNCTION_COLUMN_DEDUPE_INTERVAL_MS,\n DEFAULT_MAX_CONCURRENT_REQUESTS,\n DEFAULT_PAGE_SIZE,\n} from \"../utils/constants.js\";\nimport { stripDerivedPropertiesFromParams } from \"../utils/stripDerivedPropertiesFromParams.js\";\n\nexport interface FunctionColumnData {\n [columnId: string]: {\n [objectPrimaryKey: string]: AsyncCellData;\n };\n}\n\nexport interface UseFunctionColumnsDataOptions<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n objectSet: ObjectSet<Q, RDPs> | undefined;\n objects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined;\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n primaryKeyApiName?: string;\n pageSize?: number;\n}\n\nexport function useFunctionColumnsData<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n {\n objectSet,\n objects,\n columnDefinitions,\n primaryKeyApiName,\n pageSize = DEFAULT_PAGE_SIZE,\n }: UseFunctionColumnsDataOptions<Q, RDPs, FunctionColumns>,\n): FunctionColumnData {\n const prevDataRef = useRef<FunctionColumnData>({});\n\n const stableObjects = useStableObjects(objects);\n // TODO: replace with useDeepEqual when it's added\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const stableObjectSet = useMemo(() => objectSet, [JSON.stringify(objectSet)]);\n\n const functionColDefs = useMemo(\n () => extractFunctionLocators<Q, RDPs, FunctionColumns>(columnDefinitions),\n [columnDefinitions],\n );\n\n const disabled = !stableObjectSet || !stableObjects?.length\n || functionColDefs.length === 0;\n\n // When a new page loads, only that page's queries fire — old pages\n // hit the dedupeIntervalMs cache since their params are unchanged.\n const pagedObjectSets = useMemo(() => {\n if (!stableObjectSet || !stableObjects?.length) return [];\n return buildPagedObjectSets(\n stableObjectSet,\n stableObjects,\n primaryKeyApiName,\n pageSize,\n );\n }, [stableObjectSet, stableObjects, primaryKeyApiName, pageSize]);\n\n const queryGrid = useMemo(() => {\n if (pagedObjectSets.length === 0 || functionColDefs.length === 0) {\n return EMPTY_QUERY_GRID;\n }\n return buildQueryGrid<Q, RDPs, FunctionColumns>(\n pagedObjectSets,\n functionColDefs,\n );\n }, [pagedObjectSets, functionColDefs]);\n\n const results = useOsdkFunctions({\n queries: queryGrid.queries,\n enabled: !disabled,\n maxConcurrent: DEFAULT_MAX_CONCURRENT_REQUESTS,\n });\n\n const mergedResults = useMemo(\n () => mergePagedResults(results, queryGrid.numColumns),\n [results, queryGrid.numColumns],\n );\n\n const data = useMemo(() => {\n const columnData = buildFunctionColumnData(\n mergedResults,\n functionColDefs,\n stableObjects,\n disabled,\n prevDataRef.current,\n );\n prevDataRef.current = columnData;\n return columnData;\n }, [mergedResults, functionColDefs, stableObjects, disabled]);\n\n return data;\n}\n\n/**\n * Pairs a flat queries array with the layout metadata needed to recover per-column\n * results back into per-column groups. The numColumns value is produced by\n * the same function that builds the queries, so the two are always in sync.\n */\ninterface QueryGrid {\n queries: FunctionQueryParams<QueryDefinition<unknown>>[];\n numColumns: number;\n}\n\ninterface MergedResult {\n isLoading: boolean;\n error: unknown;\n functionsMap: Record<string, unknown>;\n}\n\nconst EMPTY_QUERY_GRID: QueryGrid = { queries: [], numColumns: 0 };\n\n/** Filters columnDefinitions down to only function-backed locators. */\nfunction extractFunctionLocators<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n columnDefinitions:\n | Array<ColumnDefinition<Q, RDPs, FunctionColumns>>\n | undefined,\n): FunctionColumnLocator<Q, RDPs, FunctionColumns>[] {\n if (!columnDefinitions) return [];\n\n return columnDefinitions\n .filter(colDef => colDef.locator.type === \"function\")\n .map(colDef =>\n colDef.locator as FunctionColumnLocator<Q, RDPs, FunctionColumns>\n );\n}\n\n/** Chunks objects into pages and creates a filtered ObjectSet per page. */\nfunction buildPagedObjectSets<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n objectSet: ObjectSet<Q, RDPs>,\n objects: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[],\n primaryKeyApiName: string | undefined,\n pageSize: number,\n): unknown[] {\n if (!primaryKeyApiName) {\n return [stripDerivedPropertiesFromParams(objectSet)];\n }\n\n return chunk(objects, pageSize).map(page => {\n const whereClause = {\n [primaryKeyApiName]: {\n $in: page.map(obj => obj.$primaryKey),\n },\n } as WhereClause<Q, RDPs>;\n\n return stripDerivedPropertiesFromParams(\n addFilterClauseToObjectSet(objectSet, whereClause),\n );\n });\n}\n\n/**\n * Builds a flat query array and the layout metadata needed to recover per-column results.\n *\n * Layout: [page0_col0, page0_col1, ..., page1_col0, page1_col1, ...]\n * Page-first ordering ensures first concurrent queries prioritizes the first page,\n * so visible rows get all their columns populated before later pages.\n */\nfunction buildQueryGrid<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n pagedObjectSets: unknown[],\n functionColDefs: FunctionColumnLocator<Q, RDPs, FunctionColumns>[],\n): QueryGrid {\n const queries: FunctionQueryParams<QueryDefinition<unknown>>[] = [];\n\n for (const pagedObjectSet of pagedObjectSets) {\n for (const locator of functionColDefs) {\n queries.push({\n queryDefinition: locator.queryDefinition,\n options: {\n params: locator.getFunctionParams(\n pagedObjectSet as ObjectSet<Q, RDPs>,\n ),\n dedupeIntervalMs: locator.dedupeIntervalMs\n ?? DEFAULT_FUNCTION_COLUMN_DEDUPE_INTERVAL_MS,\n } as FunctionQueryParams<QueryDefinition<unknown>>[\"options\"],\n });\n }\n }\n\n return { queries, numColumns: functionColDefs.length };\n}\n\n/**\n * Merges paged results into one merged result per column.\n * Each column has results spread across pages — this combines their\n * functionsMaps so buildFunctionColumnData can look up any object by key.\n *\n * Relies on QueryGrid layout: results[i] belongs to column (i % numColumns).\n * i.e. the first N results are the first page of each column, the next N results are the second page, etc.\n */\nfunction mergePagedResults(\n results: UseOsdkFunctionsResult,\n numColumns: number,\n): MergedResult[] {\n if (numColumns === 0) return [];\n\n const merged: MergedResult[] = Array.from(\n { length: numColumns },\n () => ({ isLoading: false, error: undefined, functionsMap: {} }),\n );\n\n results.forEach((result, index) => {\n const columnIndex = index % numColumns;\n const entry = merged[columnIndex];\n\n if (result.isLoading) {\n entry.isLoading = true;\n }\n if (result.error) {\n entry.error = result.error;\n }\n const pageData = result.data as Record<string, unknown> | undefined;\n if (pageData) {\n Object.assign(entry.functionsMap, pageData);\n }\n });\n\n return merged;\n}\n\nfunction buildFunctionColumnData<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n results: MergedResult[],\n functionColDefs: FunctionColumnLocator<Q, RDPs, FunctionColumns>[],\n objects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined,\n disabled: boolean,\n prevColumnData: FunctionColumnData,\n): FunctionColumnData {\n const columnData: FunctionColumnData = {};\n\n if (disabled || !objects) return columnData;\n\n results.forEach((result, index) => {\n const locator = functionColDefs[index];\n if (!locator) return;\n\n const columnId = String(locator.id);\n\n columnData[columnId] = {};\n\n objects.forEach(obj => {\n const key = String(obj.$primaryKey);\n const prevData = prevColumnData[columnId]?.[key]?.data;\n\n columnData[columnId][key] = createAsyncCellData(\n resolveCell(\n result,\n locator.getKey(obj),\n locator.getValue,\n prevData,\n ),\n );\n });\n });\n\n return columnData;\n}\n\n/** Resolves the cell state: error, loaded, or loading with previous data. */\nfunction resolveCell(\n result: MergedResult,\n objectKey: string,\n getValue: ((cellData: unknown) => unknown) | undefined,\n prevData: unknown,\n): Omit<AsyncCellData, \"__asyncCell\"> {\n if (result.error) {\n return { isLoading: false, error: result.error };\n }\n if (objectKey in result.functionsMap) {\n const rawData = result.functionsMap[objectKey];\n return { isLoading: false, data: getValue ? getValue(rawData) : rawData };\n }\n // Key not in results — still loading, or query returned no data for this object\n // Return with previous data\n return { isLoading: result.isLoading, data: prevData };\n}\n\nconst useStableObjects = <\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n objects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined,\n):\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined =>\n{\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => objects, [\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(\n (objects ?? []).map(item => ({\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey,\n })).sort((a, b) => {\n if (a.$apiName !== b.$apiName) {\n return a.$apiName.localeCompare(b.$apiName);\n }\n return String(a.$primaryKey).localeCompare(String(b.$primaryKey));\n }),\n ),\n ]);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,SAEEA,gBAAgB,QAEX,0BAA0B;AACjC,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAKvC,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAEEC,mBAAmB,QACd,2BAA2B;AAClC,SACEC,0CAA0C,EAC1CC,+BAA+B,EAC/BC,iBAAiB,QACZ,uBAAuB;AAC9B,SAASC,gCAAgC,QAAQ,8CAA8C;AAyB/F,OAAO,SAASC,sBAAsBA,CAQpC;EACEC,SAAS;EACTC,OAAO;EACPC,iBAAiB;EACjBC,iBAAiB;EACjBC,QAAQ,GAAGP;AAC4C,CAAC,EACtC;EACpB,MAAMQ,WAAW,GAAGb,MAAM,CAAqB,CAAC,CAAC,CAAC;EAElD,MAAMc,aAAa,GAAGC,gBAAgB,CAACN,OAAO,CAAC;EAC/C;EACA;EACA,MAAMO,eAAe,GAAGjB,OAAO,CAAC,MAAMS,SAAS,EAAE,CAACS,IAAI,CAACC,SAAS,CAACV,SAAS,CAAC,CAAC,CAAC;EAE7E,MAAMW,eAAe,GAAGpB,OAAO,CAC7B,MAAMqB,uBAAuB,CAA2BV,iBAAiB,CAAC,EAC1E,CAACA,iBAAiB,CACpB,CAAC;EAED,MAAMW,QAAQ,GAAG,CAACL,eAAe,IAAI,CAACF,aAAa,EAAEQ,MAAM,IACtDH,eAAe,CAACG,MAAM,KAAK,CAAC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CAACL,SAAS;IAAExB,IAAI,EAAEwC;EAAS,CAAC;AACxD;AAEA,MAAM5D,gBAAgB,GAIpBN,OAEa,IAIf;EACE;EACA,OAAOV,OAAO,CAAC,MAAMU,OAAO,EAAE;EAC5B;EACAQ,IAAI,CAACC,SAAS,CACZ,CAACT,OAAO,IAAI,EAAE,EAAEkC,GAAG,CAACsC,IAAI,KAAK;IAC3BC,QAAQ,EAAED,IAAI,CAACC,QAAQ;IACvBlC,WAAW,EAAEiC,IAAI,CAACjC;EACpB,CAAC,CAAC,CAAC,CAACmC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACjB,IAAID,CAAC,CAACF,QAAQ,KAAKG,CAAC,CAACH,QAAQ,EAAE;MAC7B,OAAOE,CAAC,CAACF,QAAQ,CAACI,aAAa,CAACD,CAAC,CAACH,QAAQ,CAAC;IAC7C;IACA,OAAOV,MAAM,CAACY,CAAC,CAACpC,WAAW,CAAC,CAACsC,aAAa,CAACd,MAAM,CAACa,CAAC,CAACrC,WAAW,CAAC,CAAC;EACnE,CAAC,CACH,CAAC,CACF,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useFunctionColumnsData.js","names":["useOsdkFunctions","useStableObjectSet","chunk","useMemo","useRef","addFilterClauseToObjectSet","createAsyncCellData","DEFAULT_FUNCTION_COLUMN_DEDUPE_INTERVAL_MS","DEFAULT_MAX_CONCURRENT_REQUESTS","DEFAULT_PAGE_SIZE","stripDerivedPropertiesFromParams","useFunctionColumnsData","objectSet","objects","columnDefinitions","primaryKeyApiName","pageSize","prevDataRef","stableObjects","useStableObjects","stableObjectSet","functionColDefs","extractFunctionLocators","disabled","length","pagedObjectSets","buildPagedObjectSets","queryGrid","EMPTY_QUERY_GRID","buildQueryGrid","results","queries","enabled","maxConcurrent","mergedResults","mergePagedResults","numColumns","data","columnData","buildFunctionColumnData","current","filter","colDef","locator","type","map","page","whereClause","$in","obj","$primaryKey","pagedObjectSet","push","queryDefinition","options","params","getFunctionParams","dedupeIntervalMs","merged","Array","from","isLoading","error","undefined","functionsMap","forEach","result","index","entry","pageData","Object","assign","prevColumnData","columnId","String","id","key","prevData","resolveCell","getKey","getValue","objectKey","rawData","JSON","stringify","item","$apiName","sort","a","b","localeCompare"],"sources":["useFunctionColumnsData.ts"],"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 type {\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport {\n type FunctionQueryParams,\n useOsdkFunctions,\n type UseOsdkFunctionsResult,\n useStableObjectSet,\n} from \"@osdk/react/experimental\";\nimport { chunk } from \"lodash-es\";\nimport { useMemo, useRef } from \"react\";\nimport type {\n ColumnDefinition,\n FunctionColumnLocator,\n} from \"../ObjectTableApi.js\";\nimport { addFilterClauseToObjectSet } from \"../utils/addFilterClauseToObjectSet.js\";\nimport {\n type AsyncCellData,\n createAsyncCellData,\n} from \"../utils/AsyncCellData.js\";\nimport {\n DEFAULT_FUNCTION_COLUMN_DEDUPE_INTERVAL_MS,\n DEFAULT_MAX_CONCURRENT_REQUESTS,\n DEFAULT_PAGE_SIZE,\n} from \"../utils/constants.js\";\nimport { stripDerivedPropertiesFromParams } from \"../utils/stripDerivedPropertiesFromParams.js\";\n\nexport interface FunctionColumnData {\n [columnId: string]: {\n [objectPrimaryKey: string]: AsyncCellData;\n };\n}\n\nexport interface UseFunctionColumnsDataOptions<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n objectSet: ObjectSet<Q, RDPs> | undefined;\n objects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined;\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n primaryKeyApiName?: string;\n pageSize?: number;\n}\n\nexport function useFunctionColumnsData<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n {\n objectSet,\n objects,\n columnDefinitions,\n primaryKeyApiName,\n pageSize = DEFAULT_PAGE_SIZE,\n }: UseFunctionColumnsDataOptions<Q, RDPs, FunctionColumns>,\n): FunctionColumnData {\n const prevDataRef = useRef<FunctionColumnData>({});\n\n const stableObjects = useStableObjects(objects);\n const stableObjectSet = useStableObjectSet(objectSet);\n\n const functionColDefs = useMemo(\n () => extractFunctionLocators<Q, RDPs, FunctionColumns>(columnDefinitions),\n [columnDefinitions],\n );\n\n const disabled = !stableObjectSet || !stableObjects?.length\n || functionColDefs.length === 0;\n\n // When a new page loads, only that page's queries fire — old pages\n // hit the dedupeIntervalMs cache since their params are unchanged.\n const pagedObjectSets = useMemo(() => {\n if (!stableObjectSet || !stableObjects?.length) return [];\n return buildPagedObjectSets(\n stableObjectSet,\n stableObjects,\n primaryKeyApiName,\n pageSize,\n );\n }, [stableObjectSet, stableObjects, primaryKeyApiName, pageSize]);\n\n const queryGrid = useMemo(() => {\n if (pagedObjectSets.length === 0 || functionColDefs.length === 0) {\n return EMPTY_QUERY_GRID;\n }\n return buildQueryGrid<Q, RDPs, FunctionColumns>(\n pagedObjectSets,\n functionColDefs,\n );\n }, [pagedObjectSets, functionColDefs]);\n\n const results = useOsdkFunctions({\n queries: queryGrid.queries,\n enabled: !disabled,\n maxConcurrent: DEFAULT_MAX_CONCURRENT_REQUESTS,\n });\n\n const mergedResults = useMemo(\n () => mergePagedResults(results, queryGrid.numColumns),\n [results, queryGrid.numColumns],\n );\n\n const data = useMemo(() => {\n const columnData = buildFunctionColumnData(\n mergedResults,\n functionColDefs,\n stableObjects,\n disabled,\n prevDataRef.current,\n );\n prevDataRef.current = columnData;\n return columnData;\n }, [mergedResults, functionColDefs, stableObjects, disabled]);\n\n return data;\n}\n\n/**\n * Pairs a flat queries array with the layout metadata needed to recover per-column\n * results back into per-column groups. The numColumns value is produced by\n * the same function that builds the queries, so the two are always in sync.\n */\ninterface QueryGrid {\n queries: FunctionQueryParams<QueryDefinition<unknown>>[];\n numColumns: number;\n}\n\ninterface MergedResult {\n isLoading: boolean;\n error: unknown;\n functionsMap: Record<string, unknown>;\n}\n\nconst EMPTY_QUERY_GRID: QueryGrid = { queries: [], numColumns: 0 };\n\n/** Filters columnDefinitions down to only function-backed locators. */\nfunction extractFunctionLocators<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n columnDefinitions:\n | Array<ColumnDefinition<Q, RDPs, FunctionColumns>>\n | undefined,\n): FunctionColumnLocator<Q, RDPs, FunctionColumns>[] {\n if (!columnDefinitions) return [];\n\n return columnDefinitions\n .filter(colDef => colDef.locator.type === \"function\")\n .map(colDef =>\n colDef.locator as FunctionColumnLocator<Q, RDPs, FunctionColumns>\n );\n}\n\n/** Chunks objects into pages and creates a filtered ObjectSet per page. */\nfunction buildPagedObjectSets<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n objectSet: ObjectSet<Q, RDPs>,\n objects: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[],\n primaryKeyApiName: string | undefined,\n pageSize: number,\n): unknown[] {\n if (!primaryKeyApiName) {\n return [stripDerivedPropertiesFromParams(objectSet)];\n }\n\n return chunk(objects, pageSize).map(page => {\n const whereClause = {\n [primaryKeyApiName]: {\n $in: page.map(obj => obj.$primaryKey),\n },\n } as WhereClause<Q, RDPs>;\n\n return stripDerivedPropertiesFromParams(\n addFilterClauseToObjectSet(objectSet, whereClause),\n );\n });\n}\n\n/**\n * Builds a flat query array and the layout metadata needed to recover per-column results.\n *\n * Layout: [page0_col0, page0_col1, ..., page1_col0, page1_col1, ...]\n * Page-first ordering ensures first concurrent queries prioritizes the first page,\n * so visible rows get all their columns populated before later pages.\n */\nfunction buildQueryGrid<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n pagedObjectSets: unknown[],\n functionColDefs: FunctionColumnLocator<Q, RDPs, FunctionColumns>[],\n): QueryGrid {\n const queries: FunctionQueryParams<QueryDefinition<unknown>>[] = [];\n\n for (const pagedObjectSet of pagedObjectSets) {\n for (const locator of functionColDefs) {\n queries.push({\n queryDefinition: locator.queryDefinition,\n options: {\n params: locator.getFunctionParams(\n pagedObjectSet as ObjectSet<Q, RDPs>,\n ),\n dedupeIntervalMs: locator.dedupeIntervalMs\n ?? DEFAULT_FUNCTION_COLUMN_DEDUPE_INTERVAL_MS,\n } as FunctionQueryParams<QueryDefinition<unknown>>[\"options\"],\n });\n }\n }\n\n return { queries, numColumns: functionColDefs.length };\n}\n\n/**\n * Merges paged results into one merged result per column.\n * Each column has results spread across pages — this combines their\n * functionsMaps so buildFunctionColumnData can look up any object by key.\n *\n * Relies on QueryGrid layout: results[i] belongs to column (i % numColumns).\n * i.e. the first N results are the first page of each column, the next N results are the second page, etc.\n */\nfunction mergePagedResults(\n results: UseOsdkFunctionsResult,\n numColumns: number,\n): MergedResult[] {\n if (numColumns === 0) return [];\n\n const merged: MergedResult[] = Array.from(\n { length: numColumns },\n () => ({ isLoading: false, error: undefined, functionsMap: {} }),\n );\n\n results.forEach((result, index) => {\n const columnIndex = index % numColumns;\n const entry = merged[columnIndex];\n\n if (result.isLoading) {\n entry.isLoading = true;\n }\n if (result.error) {\n entry.error = result.error;\n }\n const pageData = result.data as Record<string, unknown> | undefined;\n if (pageData) {\n Object.assign(entry.functionsMap, pageData);\n }\n });\n\n return merged;\n}\n\nfunction buildFunctionColumnData<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>(\n results: MergedResult[],\n functionColDefs: FunctionColumnLocator<Q, RDPs, FunctionColumns>[],\n objects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined,\n disabled: boolean,\n prevColumnData: FunctionColumnData,\n): FunctionColumnData {\n const columnData: FunctionColumnData = {};\n\n if (disabled || !objects) return columnData;\n\n results.forEach((result, index) => {\n const locator = functionColDefs[index];\n if (!locator) return;\n\n const columnId = String(locator.id);\n\n columnData[columnId] = {};\n\n objects.forEach(obj => {\n const key = String(obj.$primaryKey);\n const prevData = prevColumnData[columnId]?.[key]?.data;\n\n columnData[columnId][key] = createAsyncCellData(\n resolveCell(\n result,\n locator.getKey(obj),\n locator.getValue,\n prevData,\n ),\n );\n });\n });\n\n return columnData;\n}\n\n/** Resolves the cell state: error, loaded, or loading with previous data. */\nfunction resolveCell(\n result: MergedResult,\n objectKey: string,\n getValue: ((cellData: unknown) => unknown) | undefined,\n prevData: unknown,\n): Omit<AsyncCellData, \"__asyncCell\"> {\n if (result.error) {\n return { isLoading: false, error: result.error };\n }\n if (objectKey in result.functionsMap) {\n const rawData = result.functionsMap[objectKey];\n return { isLoading: false, data: getValue ? getValue(rawData) : rawData };\n }\n // Key not in results — still loading, or query returned no data for this object\n // Return with previous data\n return { isLoading: result.isLoading, data: prevData };\n}\n\nconst useStableObjects = <\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n objects:\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined,\n):\n | Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>[]\n | undefined =>\n{\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => objects, [\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(\n (objects ?? []).map(item => ({\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey,\n })).sort((a, b) => {\n if (a.$apiName !== b.$apiName) {\n return a.$apiName.localeCompare(b.$apiName);\n }\n return String(a.$primaryKey).localeCompare(String(b.$primaryKey));\n }),\n ),\n ]);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,SAEEA,gBAAgB,EAEhBC,kBAAkB,QACb,0BAA0B;AACjC,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAKvC,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAEEC,mBAAmB,QACd,2BAA2B;AAClC,SACEC,0CAA0C,EAC1CC,+BAA+B,EAC/BC,iBAAiB,QACZ,uBAAuB;AAC9B,SAASC,gCAAgC,QAAQ,8CAA8C;AAyB/F,OAAO,SAASC,sBAAsBA,CAQpC;EACEC,SAAS;EACTC,OAAO;EACPC,iBAAiB;EACjBC,iBAAiB;EACjBC,QAAQ,GAAGP;AAC4C,CAAC,EACtC;EACpB,MAAMQ,WAAW,GAAGb,MAAM,CAAqB,CAAC,CAAC,CAAC;EAElD,MAAMc,aAAa,GAAGC,gBAAgB,CAACN,OAAO,CAAC;EAC/C,MAAMO,eAAe,GAAGnB,kBAAkB,CAACW,SAAS,CAAC;EAErD,MAAMS,eAAe,GAAGlB,OAAO,CAC7B,MAAMmB,uBAAuB,CAA2BR,iBAAiB,CA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;MAAExB,IAAI,EAAE2C,QAAQ,GAAGA,QAAQ,CAACE,OAAO,CAAC,GAAGA;IAAQ,CAAC;EAC3E;EACA;EACA;EACA,OAAO;IAAErB,SAAS,EAAEK,MAAM,CAACL,SAAS;IAAExB,IAAI,EAAEwC;EAAS,CAAC;AACxD;AAEA,MAAM1D,gBAAgB,GAIpBN,OAEa,IAIf;EACE;EACA,OAAOV,OAAO,CAAC,MAAMU,OAAO,EAAE;EAC5B;EACAsE,IAAI,CAACC,SAAS,CACZ,CAACvE,OAAO,IAAI,EAAE,EAAEgC,GAAG,CAACwC,IAAI,KAAK;IAC3BC,QAAQ,EAAED,IAAI,CAACC,QAAQ;IACvBpC,WAAW,EAAEmC,IAAI,CAACnC;EACpB,CAAC,CAAC,CAAC,CAACqC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACjB,IAAID,CAAC,CAACF,QAAQ,KAAKG,CAAC,CAACH,QAAQ,EAAE;MAC7B,OAAOE,CAAC,CAACF,QAAQ,CAACI,aAAa,CAACD,CAAC,CAACH,QAAQ,CAAC;IAC7C;IACA,OAAOZ,MAAM,CAACc,CAAC,CAACtC,WAAW,CAAC,CAACwC,aAAa,CAAChB,MAAM,CAACe,CAAC,CAACvC,WAAW,CAAC,CAAC;EACnE,CAAC,CACH,CAAC,CACF,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -2496,6 +2496,11 @@
2496
2496
  display: flex;
2497
2497
  flex-direction: column;
2498
2498
  gap: var(--osdk-radio-gap);
2499
+
2500
+ &[data-orientation="horizontal"] {
2501
+ flex-direction: row;
2502
+ flex-wrap: wrap;
2503
+ }
2499
2504
  }
2500
2505
 
2501
2506
  .RadioButtonsField-module__osdkRadioItem___1OaMMDkR {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const PACKAGE_USER_AGENT = `osdk-react-components/${"0.6.0"}`;
17
+ const PACKAGE_USER_AGENT = `osdk-react-components/${"0.6.1-main-22b4e35a5621ede1c0a937cf2df728a28feb6f65"}`;
18
18
  export function componentUserAgent(componentName) {
19
19
  return `${PACKAGE_USER_AGENT}/${componentName}`;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.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\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,kCAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.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\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,gFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
@@ -10,7 +10,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
10
10
  // src/util/withOsdkMetrics.ts
11
11
 
12
12
  // src/util/UserAgent.ts
13
- var PACKAGE_USER_AGENT = `osdk-react-components/${"0.6.0"}`;
13
+ var PACKAGE_USER_AGENT = `osdk-react-components/${"0.6.1-main-22b4e35a5621ede1c0a937cf2df728a28feb6f65"}`;
14
14
  function componentUserAgent(componentName) {
15
15
  return `${PACKAGE_USER_AGENT}/${componentName}`;
16
16
  }
@@ -26,5 +26,5 @@ function withOsdkMetrics(Component, name) {
26
26
  }
27
27
 
28
28
  exports.withOsdkMetrics = withOsdkMetrics;
29
- //# sourceMappingURL=chunk-IQZ6IABQ.cjs.map
30
- //# sourceMappingURL=chunk-IQZ6IABQ.cjs.map
29
+ //# sourceMappingURL=chunk-C5NV5WN4.cjs.map
30
+ //# sourceMappingURL=chunk-C5NV5WN4.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/util/UserAgent.ts","../../src/util/withOsdkMetrics.ts"],"names":["useRegisterUserAgent","React"],"mappings":";;;;;;;;;;;;AAgBA,IAAM,kBAAA,GAAqB,yBAAyB,qDAA2B,CAAA,CAAA;AACxE,SAAS,mBAAmB,aAAA,EAAe;AAChD,EAAA,OAAO,CAAA,EAAG,kBAAkB,CAAA,CAAA,EAAI,aAAa,CAAA,CAAA;AAC/C;;;ACKO,SAAS,eAAA,CAAgB,WAAW,IAAA,EAAM;AAC/C,EAAA,MAAM,UAAU,CAAA,KAAA,KAAS;AACvB,IAAAA,iCAAA,CAAqB,kBAAA,CAAmB,IAAI,CAAC,CAAA;AAC7C,IAAA,uBAAoBC,sBAAA,CAAM,aAAA,CAAc,SAAA,EAAW,KAAK,CAAA;AAAA,EAC1D,CAAA;AACA,EAAA,OAAA,CAAQ,WAAA,GAAc,mBAAmB,IAAI,CAAA,CAAA,CAAA;AAC7C,EAAA,OAAO,OAAA;AACT","file":"chunk-C5NV5WN4.cjs","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\nconst PACKAGE_USER_AGENT = `osdk-react-components/${process.env.PACKAGE_VERSION}`;\nexport function componentUserAgent(componentName) {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}","/*\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 { useRegisterUserAgent } from \"@osdk/react/experimental\";\nimport React from \"react\";\nimport { componentUserAgent } from \"./UserAgent.js\";\n\n// `any` is required: FunctionComponent defaults to FunctionComponent<{}> which\n// rejects components with required props. A generic P parameter doesn't help\n// because TS can't infer both P and C simultaneously from a single argument.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withOsdkMetrics(Component, name) {\n const Wrapped = props => {\n useRegisterUserAgent(componentUserAgent(name));\n return /*#__PURE__*/React.createElement(Component, props);\n };\n Wrapped.displayName = `withOsdkMetrics(${name})`;\n return Wrapped;\n}"]}
@@ -4,7 +4,7 @@ var chunkUCTQICPR_cjs = require('./chunk-UCTQICPR.cjs');
4
4
  var chunkOHKKNZZS_cjs = require('./chunk-OHKKNZZS.cjs');
5
5
  var chunkYQIMVHDC_cjs = require('./chunk-YQIMVHDC.cjs');
6
6
  var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
7
- var chunkIQZ6IABQ_cjs = require('./chunk-IQZ6IABQ.cjs');
7
+ var chunkC5NV5WN4_cjs = require('./chunk-C5NV5WN4.cjs');
8
8
  var button = require('@base-ui/react/button');
9
9
  var classnames3 = require('classnames');
10
10
  var React18 = require('react');
@@ -4039,11 +4039,11 @@ function deserializeFilterStates(json) {
4039
4039
  }
4040
4040
 
4041
4041
  // src/public/experimental/filter-list.ts
4042
- var FilterList2 = chunkIQZ6IABQ_cjs.withOsdkMetrics(FilterList, "FilterList");
4042
+ var FilterList2 = chunkC5NV5WN4_cjs.withOsdkMetrics(FilterList, "FilterList");
4043
4043
 
4044
4044
  exports.BaseFilterList = BaseFilterList;
4045
4045
  exports.FilterList = FilterList2;
4046
4046
  exports.deserializeFilterStates = deserializeFilterStates;
4047
4047
  exports.serializeFilterStates = serializeFilterStates;
4048
- //# sourceMappingURL=chunk-NFG6NXZN.cjs.map
4049
- //# sourceMappingURL=chunk-NFG6NXZN.cjs.map
4048
+ //# sourceMappingURL=chunk-CJUYL7F3.cjs.map
4049
+ //# sourceMappingURL=chunk-CJUYL7F3.cjs.map