@osdk/react-components 0.2.0-beta.16 → 0.2.0-beta.18

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 (206) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +91 -3
  3. package/build/browser/action-form/ActionForm.js +109 -0
  4. package/build/browser/action-form/ActionForm.js.map +1 -0
  5. package/build/browser/action-form/ActionFormApi.js.map +1 -1
  6. package/build/browser/action-form/BaseForm.js +74 -0
  7. package/build/browser/action-form/BaseForm.js.map +1 -0
  8. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  9. package/build/browser/action-form/fields/FieldBridge.js +45 -0
  10. package/build/browser/action-form/fields/FieldBridge.js.map +1 -0
  11. package/build/browser/action-form/fields/FormFieldRenderer.js +68 -0
  12. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -0
  13. package/build/browser/action-form/fields/TextInputField.js +38 -0
  14. package/build/browser/action-form/fields/TextInputField.js.map +1 -0
  15. package/build/browser/action-form/utils/coerceFieldValue.js +93 -0
  16. package/build/browser/action-form/utils/coerceFieldValue.js.map +1 -0
  17. package/build/browser/action-form/utils/getDefaultFieldComponent.js +56 -0
  18. package/build/browser/action-form/utils/getDefaultFieldComponent.js.map +1 -0
  19. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +33 -0
  20. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -0
  21. package/build/browser/base-components/tooltip/Tooltip.js +91 -0
  22. package/build/browser/base-components/tooltip/Tooltip.js.map +1 -0
  23. package/build/browser/base-components/tooltip/Tooltip.module.css +70 -0
  24. package/build/browser/base-components/tooltip/Tooltip.module.css.js +11 -0
  25. package/build/browser/base-components/tooltip/index.js +18 -0
  26. package/build/browser/base-components/tooltip/index.js.map +1 -0
  27. package/build/browser/filter-list/base/BaseFilterList.js +23 -11
  28. package/build/browser/filter-list/base/BaseFilterList.js.map +1 -1
  29. package/build/browser/filter-list/base/FilterIcons.js +48 -13
  30. package/build/browser/filter-list/base/FilterIcons.js.map +1 -1
  31. package/build/browser/filter-list/base/FilterList.module.css +57 -13
  32. package/build/browser/filter-list/base/FilterList.module.css.js +5 -2
  33. package/build/browser/filter-list/base/FilterListHeader.js +10 -15
  34. package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
  35. package/build/browser/filter-list/base/FilterListHeader.module.css +13 -41
  36. package/build/browser/filter-list/base/FilterListHeader.module.css.js +1 -4
  37. package/build/browser/filter-list/hooks/useFilterListState.js +25 -7
  38. package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
  39. package/build/browser/filter-list/utils/assertUnreachable.js +1 -8
  40. package/build/browser/filter-list/utils/assertUnreachable.js.map +1 -1
  41. package/build/browser/filter-list/utils/filterStateToWhereClause.js +121 -91
  42. package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
  43. package/build/browser/object-table/DefaultCellRenderer.js +6 -1
  44. package/build/browser/object-table/DefaultCellRenderer.js.map +1 -1
  45. package/build/browser/object-table/EditableCell.js +76 -9
  46. package/build/browser/object-table/EditableCell.js.map +1 -1
  47. package/build/browser/object-table/EditableCell.module.css +47 -8
  48. package/build/browser/object-table/EditableCell.module.css.js +5 -1
  49. package/build/browser/object-table/MultiColumnSortDialog.js +4 -1
  50. package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -1
  51. package/build/browser/object-table/ObjectTable.js +4 -1
  52. package/build/browser/object-table/ObjectTable.js.map +1 -1
  53. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  54. package/build/browser/object-table/SelectionCells.js +1 -0
  55. package/build/browser/object-table/SelectionCells.js.map +1 -1
  56. package/build/browser/object-table/Table.js +2 -2
  57. package/build/browser/object-table/Table.js.map +1 -1
  58. package/build/browser/object-table/TableBody.js +1 -1
  59. package/build/browser/object-table/TableBody.js.map +1 -1
  60. package/build/browser/object-table/TableEditContainer.js +27 -16
  61. package/build/browser/object-table/TableEditContainer.js.map +1 -1
  62. package/build/browser/object-table/TableEditContainer.module.css +27 -0
  63. package/build/browser/object-table/TableEditContainer.module.css.js +5 -1
  64. package/build/browser/object-table/TableHeader.js +4 -1
  65. package/build/browser/object-table/TableHeader.js.map +1 -1
  66. package/build/browser/object-table/TableHeader.module.css +2 -1
  67. package/build/browser/object-table/TableHeader.module.css.js +1 -0
  68. package/build/browser/object-table/TableRow.js +2 -2
  69. package/build/browser/object-table/TableRow.js.map +1 -1
  70. package/build/browser/object-table/hooks/useColumnDefs.js +2 -1
  71. package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
  72. package/build/browser/object-table/hooks/useEditableTable.js +21 -2
  73. package/build/browser/object-table/hooks/useEditableTable.js.map +1 -1
  74. package/build/browser/object-table/utils/types.js.map +1 -1
  75. package/build/browser/shared/assertUnreachable.js +25 -0
  76. package/build/browser/shared/assertUnreachable.js.map +1 -0
  77. package/build/browser/shared/typedMemo.js +25 -0
  78. package/build/browser/shared/typedMemo.js.map +1 -0
  79. package/build/browser/styles.css +219 -63
  80. package/build/cjs/public/experimental.cjs +1212 -966
  81. package/build/cjs/public/experimental.cjs.map +1 -1
  82. package/build/cjs/public/experimental.css +167 -55
  83. package/build/cjs/public/experimental.css.map +1 -1
  84. package/build/cjs/public/experimental.d.cts +18 -4
  85. package/build/esm/action-form/ActionForm.js +109 -0
  86. package/build/esm/action-form/ActionForm.js.map +1 -0
  87. package/build/esm/action-form/ActionFormApi.js.map +1 -1
  88. package/build/esm/action-form/BaseForm.js +74 -0
  89. package/build/esm/action-form/BaseForm.js.map +1 -0
  90. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  91. package/build/esm/action-form/fields/FieldBridge.js +45 -0
  92. package/build/esm/action-form/fields/FieldBridge.js.map +1 -0
  93. package/build/esm/action-form/fields/FormFieldRenderer.js +68 -0
  94. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -0
  95. package/build/esm/action-form/fields/TextInputField.js +38 -0
  96. package/build/esm/action-form/fields/TextInputField.js.map +1 -0
  97. package/build/esm/action-form/utils/coerceFieldValue.js +93 -0
  98. package/build/esm/action-form/utils/coerceFieldValue.js.map +1 -0
  99. package/build/esm/action-form/utils/getDefaultFieldComponent.js +56 -0
  100. package/build/esm/action-form/utils/getDefaultFieldComponent.js.map +1 -0
  101. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +33 -0
  102. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -0
  103. package/build/esm/base-components/tooltip/Tooltip.js +91 -0
  104. package/build/esm/base-components/tooltip/Tooltip.js.map +1 -0
  105. package/build/esm/base-components/tooltip/Tooltip.module.css +70 -0
  106. package/build/esm/base-components/tooltip/index.js +18 -0
  107. package/build/esm/base-components/tooltip/index.js.map +1 -0
  108. package/build/esm/filter-list/base/BaseFilterList.js +23 -11
  109. package/build/esm/filter-list/base/BaseFilterList.js.map +1 -1
  110. package/build/esm/filter-list/base/FilterIcons.js +48 -13
  111. package/build/esm/filter-list/base/FilterIcons.js.map +1 -1
  112. package/build/esm/filter-list/base/FilterList.module.css +57 -13
  113. package/build/esm/filter-list/base/FilterListHeader.js +10 -15
  114. package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
  115. package/build/esm/filter-list/base/FilterListHeader.module.css +13 -41
  116. package/build/esm/filter-list/hooks/useFilterListState.js +25 -7
  117. package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
  118. package/build/esm/filter-list/utils/assertUnreachable.js +1 -8
  119. package/build/esm/filter-list/utils/assertUnreachable.js.map +1 -1
  120. package/build/esm/filter-list/utils/filterStateToWhereClause.js +121 -91
  121. package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
  122. package/build/esm/object-table/DefaultCellRenderer.js +6 -1
  123. package/build/esm/object-table/DefaultCellRenderer.js.map +1 -1
  124. package/build/esm/object-table/EditableCell.js +76 -9
  125. package/build/esm/object-table/EditableCell.js.map +1 -1
  126. package/build/esm/object-table/EditableCell.module.css +47 -8
  127. package/build/esm/object-table/MultiColumnSortDialog.js +4 -1
  128. package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -1
  129. package/build/esm/object-table/ObjectTable.js +4 -1
  130. package/build/esm/object-table/ObjectTable.js.map +1 -1
  131. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  132. package/build/esm/object-table/SelectionCells.js +1 -0
  133. package/build/esm/object-table/SelectionCells.js.map +1 -1
  134. package/build/esm/object-table/Table.js +2 -2
  135. package/build/esm/object-table/Table.js.map +1 -1
  136. package/build/esm/object-table/TableBody.js +1 -1
  137. package/build/esm/object-table/TableBody.js.map +1 -1
  138. package/build/esm/object-table/TableEditContainer.js +27 -16
  139. package/build/esm/object-table/TableEditContainer.js.map +1 -1
  140. package/build/esm/object-table/TableEditContainer.module.css +27 -0
  141. package/build/esm/object-table/TableHeader.js +4 -1
  142. package/build/esm/object-table/TableHeader.js.map +1 -1
  143. package/build/esm/object-table/TableHeader.module.css +2 -1
  144. package/build/esm/object-table/TableRow.js +2 -2
  145. package/build/esm/object-table/TableRow.js.map +1 -1
  146. package/build/esm/object-table/hooks/useColumnDefs.js +2 -1
  147. package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
  148. package/build/esm/object-table/hooks/useEditableTable.js +21 -2
  149. package/build/esm/object-table/hooks/useEditableTable.js.map +1 -1
  150. package/build/esm/object-table/utils/types.js.map +1 -1
  151. package/build/esm/shared/assertUnreachable.js +25 -0
  152. package/build/esm/shared/assertUnreachable.js.map +1 -0
  153. package/build/esm/shared/typedMemo.js +25 -0
  154. package/build/esm/shared/typedMemo.js.map +1 -0
  155. package/build/types/action-form/ActionForm.d.ts +4 -0
  156. package/build/types/action-form/ActionForm.d.ts.map +1 -0
  157. package/build/types/action-form/ActionFormApi.d.ts +48 -32
  158. package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
  159. package/build/types/action-form/BaseForm.d.ts +3 -0
  160. package/build/types/action-form/BaseForm.d.ts.map +1 -0
  161. package/build/types/action-form/FormFieldApi.d.ts +58 -18
  162. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  163. package/build/types/action-form/fields/FieldBridge.d.ts +9 -0
  164. package/build/types/action-form/fields/FieldBridge.d.ts.map +1 -0
  165. package/build/types/action-form/fields/FormFieldRenderer.d.ts +8 -0
  166. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -0
  167. package/build/types/action-form/fields/TextInputField.d.ts +3 -0
  168. package/build/types/action-form/fields/TextInputField.d.ts.map +1 -0
  169. package/build/types/action-form/utils/coerceFieldValue.d.ts +10 -0
  170. package/build/types/action-form/utils/coerceFieldValue.d.ts.map +1 -0
  171. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts +6 -0
  172. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts.map +1 -0
  173. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +6 -0
  174. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -0
  175. package/build/types/base-components/tooltip/Tooltip.d.ts +31 -0
  176. package/build/types/base-components/tooltip/Tooltip.d.ts.map +1 -0
  177. package/build/types/base-components/tooltip/index.d.ts +1 -0
  178. package/build/types/base-components/tooltip/index.d.ts.map +1 -0
  179. package/build/types/filter-list/base/BaseFilterList.d.ts.map +1 -1
  180. package/build/types/filter-list/base/FilterIcons.d.ts +7 -0
  181. package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -1
  182. package/build/types/filter-list/base/FilterListHeader.d.ts.map +1 -1
  183. package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -1
  184. package/build/types/filter-list/utils/assertUnreachable.d.ts +1 -6
  185. package/build/types/filter-list/utils/assertUnreachable.d.ts.map +1 -1
  186. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +5 -1
  187. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -1
  188. package/build/types/object-table/EditableCell.d.ts +8 -2
  189. package/build/types/object-table/EditableCell.d.ts.map +1 -1
  190. package/build/types/object-table/ObjectTableApi.d.ts +7 -0
  191. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  192. package/build/types/object-table/Table.d.ts +4 -0
  193. package/build/types/object-table/Table.d.ts.map +1 -1
  194. package/build/types/object-table/TableEditContainer.d.ts +1 -1
  195. package/build/types/object-table/TableEditContainer.d.ts.map +1 -1
  196. package/build/types/object-table/TableHeader.d.ts.map +1 -1
  197. package/build/types/object-table/TableRow.d.ts +2 -2
  198. package/build/types/object-table/TableRow.d.ts.map +1 -1
  199. package/build/types/object-table/hooks/useEditableTable.d.ts.map +1 -1
  200. package/build/types/object-table/utils/types.d.ts +7 -4
  201. package/build/types/object-table/utils/types.d.ts.map +1 -1
  202. package/build/types/shared/assertUnreachable.d.ts +6 -0
  203. package/build/types/shared/assertUnreachable.d.ts.map +1 -0
  204. package/build/types/shared/typedMemo.d.ts +6 -0
  205. package/build/types/shared/typedMemo.d.ts.map +1 -0
  206. package/package.json +6 -5
@@ -22,6 +22,14 @@ export function useEditableTable({
22
22
  }) {
23
23
  const [isActive, setActive] = useState(editMode === "always");
24
24
  const [cellEdits, setCellEdits] = useState({});
25
+ const [validationErrors, setValidationErrors] = useState(new Map());
26
+ const clearCellValidationError = useCallback(cellId => {
27
+ setValidationErrors(prev => {
28
+ const newErrors = new Map(prev);
29
+ newErrors.delete(cellId);
30
+ return newErrors;
31
+ });
32
+ }, []);
25
33
  const handleCellEdit = useCallback((cellId, info) => {
26
34
  // If value is changed back to original, remove it from edits
27
35
  if (info.newValue === info.oldValue) {
@@ -42,12 +50,20 @@ export function useEditableTable({
42
50
  }, [onCellValueChanged]);
43
51
  const clearEdits = useCallback(() => {
44
52
  setCellEdits({});
53
+ setValidationErrors(new Map());
45
54
  }, []);
46
55
  const handleSubmitEdits = useCallback(async () => {
47
56
  const edits = Object.values(cellEdits);
48
57
  return onSubmitEdits ? onSubmitEdits(edits) : false;
49
58
  }, [cellEdits, onSubmitEdits]);
50
- const editModeConfig = editMode === "always" ? {
59
+ const onCellValidationError = useCallback((cellId, error) => {
60
+ setValidationErrors(prev => {
61
+ const newErrors = new Map(prev);
62
+ newErrors.set(cellId, error);
63
+ return newErrors;
64
+ });
65
+ }, []);
66
+ const editModeState = editMode === "always" ? {
51
67
  type: "always",
52
68
  isActive: true
53
69
  } : {
@@ -60,7 +76,10 @@ export function useEditableTable({
60
76
  onCellEdit: handleCellEdit,
61
77
  onSubmitEdits: onSubmitEdits ? handleSubmitEdits : undefined,
62
78
  clearEdits,
63
- editMode: editModeConfig
79
+ editModeState,
80
+ onCellValidationError,
81
+ validationErrors,
82
+ clearCellValidationError
64
83
  };
65
84
  }
66
85
  //# sourceMappingURL=useEditableTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEditableTable.js","names":["useCallback","useState","useEditableTable","editMode","onCellValueChanged","onSubmitEdits","isActive","setActive","cellEdits","setCellEdits","handleCellEdit","cellId","info","newValue","oldValue","prev","_","rest","clearEdits","handleSubmitEdits","edits","Object","values","editModeConfig","type","onCellEdit","undefined"],"sources":["useEditableTable.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 ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport { useCallback, useState } from \"react\";\nimport type { ObjectTableProps } from \"../ObjectTableApi.js\";\nimport type { CellEditInfo, EditableConfig, EditMode } from \"../utils/types.js\";\n\nexport interface UseEditableTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n editMode?: \"always\" | \"manual\";\n\n onCellValueChanged?: ObjectTableProps<\n Q,\n RDPs,\n FunctionColumns\n >[\"onCellValueChanged\"];\n\n onSubmitEdits?: ObjectTableProps<\n Q,\n RDPs,\n FunctionColumns\n >[\"onSubmitEdits\"];\n}\n\nexport function useEditableTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n editMode = \"manual\",\n onCellValueChanged,\n onSubmitEdits,\n}: UseEditableTableProps<Q, RDPs, FunctionColumns>): EditableConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n> {\n const [isActive, setActive] = useState(editMode === \"always\");\n const [cellEdits, setCellEdits] = useState<\n Record<\n string,\n CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >\n >\n >(\n {},\n );\n\n const handleCellEdit = useCallback(\n (\n cellId: string,\n info: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n // If value is changed back to original, remove it from edits\n if (info.newValue === info.oldValue) {\n setCellEdits(prev => {\n const { [cellId]: _, ...rest } = prev;\n return rest;\n });\n } else {\n setCellEdits(prev => ({\n ...prev,\n [cellId]: info,\n }));\n }\n\n onCellValueChanged?.(info);\n },\n [onCellValueChanged],\n );\n\n const clearEdits = useCallback(() => {\n setCellEdits({});\n }, []);\n\n const handleSubmitEdits = useCallback(async () => {\n const edits = Object.values(cellEdits);\n return onSubmitEdits ? onSubmitEdits(edits) : false;\n }, [cellEdits, onSubmitEdits]);\n\n const editModeConfig: EditMode = editMode === \"always\"\n ? { type: \"always\", isActive: true }\n : { type: \"manual\", isActive, setActive };\n\n return {\n cellEdits,\n onCellEdit: handleCellEdit,\n onS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AK,CAAC,GAAG,KAAK;EACrD,CAAC,EAAE,CAACZ,SAAS,EAAEH,aAAa,CAAC,CAAC;EAE9B,MAAMkB,cAAwB,GAAGpB,QAAQ,KAAK,QAAQ,GAClD;IAAEqB,IAAI,EAAE,QAAQ;IAAElB,QAAQ,EAAE;EAAK,CAAC,GAClC;IAAEkB,IAAI,EAAE,QAAQ;IAAElB,QAAQ;IAAEC;EAAU,CAAC;EAE3C,OAAO;IACLC,SAAS;IACTiB,UAAU,EAAEf,cAAc;IAC1BL,aAAa,EAAEA,aAAa,GAAGc,iBAAiB,GAAGO,SAAS;IAC5DR,UAAU;IACVf,QAAQ,EAAEoB;EACZ,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"useEditableTable.js","names":["useCallback","useState","useEditableTable","editMode","onCellValueChanged","onSubmitEdits","isActive","setActive","cellEdits","setCellEdits","validationErrors","setValidationErrors","Map","clearCellValidationError","cellId","prev","newErrors","delete","handleCellEdit","info","newValue","oldValue","_","rest","clearEdits","handleSubmitEdits","edits","Object","values","onCellValidationError","error","set","editModeState","type","onCellEdit","undefined"],"sources":["useEditableTable.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 ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport { useCallback, useState } from \"react\";\nimport type { ObjectTableProps } from \"../ObjectTableApi.js\";\nimport type {\n CellEditInfo,\n EditableConfig,\n EditModeState,\n} from \"../utils/types.js\";\n\nexport interface UseEditableTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n editMode?: \"always\" | \"manual\";\n\n onCellValueChanged?: ObjectTableProps<\n Q,\n RDPs,\n FunctionColumns\n >[\"onCellValueChanged\"];\n\n onSubmitEdits?: ObjectTableProps<\n Q,\n RDPs,\n FunctionColumns\n >[\"onSubmitEdits\"];\n}\n\nexport function useEditableTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n editMode = \"manual\",\n onCellValueChanged,\n onSubmitEdits,\n}: UseEditableTableProps<Q, RDPs, FunctionColumns>): EditableConfig<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n> {\n const [isActive, setActive] = useState<boolean>(\n editMode === \"always\",\n );\n const [cellEdits, setCellEdits] = useState<\n Record<\n string,\n CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >\n >\n >(\n {},\n );\n const [validationErrors, setValidationErrors] = useState<\n Map<string, string>\n >(\n new Map(),\n );\n\n const clearCellValidationError = useCallback((cellId: string) => {\n setValidationErrors(prev => {\n const newErrors = new Map(prev);\n newErrors.delete(cellId);\n return newErrors;\n });\n }, []);\n\n const handleCellEdit = useCallback(\n (\n cellId: string,\n info: CellEditInfo<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n // If value is changed back to original, remove it from edits\n if (info.newValue === info.oldValue) {\n setCellEdits(prev => {\n const { [cellId]: _, ...rest } = prev;\n return rest;\n });\n } else {\n setCellEdits(prev => ({\n ...prev,\n [cellId]: info,\n }));\n }\n\n onCellValueChanged?.(info);\n },\n [onCellValueChanged],\n );\n\n const clearEdits = useCallback(() => {\n setCellEdits({});\n setValidationErrors(new Map());\n }, []);\n\n const handleSubmitEdits = useCallback(async () => {\n const edits = Object.values(cellEdits);\n return onSubmitEdits ? onSubmitEdits(edits) : false;\n }, [cellEdits, onSubmitEdits]);\n\n const onCellValidationError = useCallback(\n (cellId: string, error: string) => {\n setValidationErrors(prev => {\n const newErrors = new Map(prev);\n newErrors.set(cellId, error);\n return newErrors;\n });\n },\n [],\n );\n\n const editModeState: EditModeState = editMode === \"always\"\n ? { type: \"always\", isActive: true }\n : { type: \"manual\", isActive, setActive };\n\n return {\n cellEdits,\n onCellEdit: handleCellEdit,\n onSubmitEdits: onSubmitEdits ? handleSubmitEdits : undefined,\n clearEdits,\n editModeState,\n onCellValidationError,\n validationErrors,\n clearCellValidationError,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAkC7C,OAAO,SAASC,gBAAgBA,CAU9B;EACAC,QAAQ,GAAG,QAAQ;EACnBC,kBAAkB;EAClBC;AAC+C,CAAC,EAGhD;EACA,MAAM,CAACC,QAAQ,EAAEC,SAAS,CAAC,GAAGN,QAAQ,CACpCE,QAAQ,KAAK,QACf,CAAC;EACD,MAAM,CAACK,SAAS,EAAEC,YAAY,CAAC,GAAGR,QAAQ,CASxC,CAAC,CACH,CAAC;EACD,MAAM,CAACS,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGV,QAAQ,CAGtD,IAAIW,GAAG,CAAC,CACV,CAAC;EAED,MAAMC,wBAAwB,GAAGb,WAAW,CAAEc,MAAc,IAAK;IAC/DH,mBAAmB,CAACI,IAAI,IAAI;MAC1B,MAAMC,SAAS,GAAG,IAAIJ,GAAG,CAACG,IAAI,CAAC;MAC/BC,SAAS,CAACC,MAAM,CAACH,MAAM,CAAC;MACxB,OAAOE,SAAS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C;EAED,MAAMgB,aAA4B,GAAG7B,QAAQ,KAAK,QAAQ,GACtD;IAAE8B,IAAI,EAAE,QAAQ;IAAE3B,QAAQ,EAAE;EAAK,CAAC,GAClC;IAAE2B,IAAI,EAAE,QAAQ;IAAE3B,QAAQ;IAAEC;EAAU,CAAC;EAE3C,OAAO;IACLC,SAAS;IACT0B,UAAU,EAAEhB,cAAc;IAC1Bb,aAAa,EAAEA,aAAa,GAAGoB,iBAAiB,GAAGU,SAAS;IAC5DX,UAAU;IACVQ,aAAa;IACbH,qBAAqB;IACrBnB,gBAAgB;IAChBG;EACF,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["types.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 { RowData } from \"@tanstack/react-table\";\n\nexport interface ColumnOption {\n id: string;\n name: string;\n canSort: boolean;\n}\n\nexport interface CellIdentifier {\n rowId: string;\n columnId: string;\n}\n\nexport interface CellEditInfo<\n TData extends RowData = unknown,\n CellValue = unknown,\n> extends CellIdentifier {\n newValue: CellValue;\n oldValue: CellValue;\n originalRowData: TData;\n}\n\nexport type EditMode =\n | { type: \"always\"; isActive: true }\n | { type: \"manual\"; isActive: boolean; setActive: (value: boolean) => void };\n\nexport interface EditableConfig<\n TData extends RowData = unknown,\n CellValue = unknown,\n> {\n cellEdits: Record<string, CellEditInfo<TData, CellValue>>;\n onCellEdit: (\n cellId: string,\n info: CellEditInfo<TData, CellValue>,\n ) => void;\n onSubmitEdits?: () => Promise<boolean>;\n clearEdits: () => void;\n editMode: EditMode;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["types.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 { RowData } from \"@tanstack/react-table\";\n\nexport interface ColumnOption {\n id: string;\n name: string;\n canSort: boolean;\n}\n\nexport interface CellIdentifier {\n rowId: string;\n columnId: string;\n}\n\nexport interface CellEditInfo<\n TData extends RowData = unknown,\n CellValue = unknown,\n> extends CellIdentifier {\n newValue: CellValue | null;\n oldValue: CellValue | null;\n originalRowData: TData;\n}\n\nexport type EditModeState =\n | { type: \"always\"; isActive: true }\n | { type: \"manual\"; isActive: boolean; setActive: (value: boolean) => void };\n\nexport interface EditableConfig<\n TData extends RowData = unknown,\n CellValue = unknown,\n> {\n cellEdits: Record<string, CellEditInfo<TData, CellValue>>;\n onCellEdit: (\n cellId: string,\n info: CellEditInfo<TData, CellValue>,\n ) => void;\n onSubmitEdits?: () => Promise<boolean>;\n clearEdits: () => void;\n editModeState: EditModeState;\n onCellValidationError: (\n cellId: string,\n error: string,\n ) => void;\n validationErrors: Map<string, string>;\n clearCellValidationError: (cellId: string) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,25 @@
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
+ /**
18
+ * Exhaustive type checking helper.
19
+ * Use in default cases of switch statements to ensure all cases are handled.
20
+ * TypeScript will error if a case is missing.
21
+ */
22
+ export function assertUnreachable(value) {
23
+ throw new Error(`Unhandled value: ${String(value)}`);
24
+ }
25
+ //# sourceMappingURL=assertUnreachable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertUnreachable.js","names":["assertUnreachable","value","Error","String"],"sources":["assertUnreachable.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\n/**\n * Exhaustive type checking helper.\n * Use in default cases of switch statements to ensure all cases are handled.\n * TypeScript will error if a case is missing.\n */\nexport function assertUnreachable(value: never): never {\n throw new Error(`Unhandled value: ${String(value)}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAACC,KAAY,EAAS;EACrD,MAAM,IAAIC,KAAK,CAAC,oBAAoBC,MAAM,CAACF,KAAK,CAAC,EAAE,CAAC;AACtD","ignoreList":[]}
@@ -0,0 +1,25 @@
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 from "react";
18
+
19
+ /**
20
+ * TODO: Delete this once `React.memo` is typed to not lose generics to `unknown`
21
+ *
22
+ * Context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/37087
23
+ */
24
+ export const typedReactMemo = React.memo;
25
+ //# sourceMappingURL=typedMemo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedMemo.js","names":["React","typedReactMemo","memo"],"sources":["typedMemo.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 React from \"react\";\n\n/**\n * TODO: Delete this once `React.memo` is typed to not lose generics to `unknown`\n *\n * Context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/37087\n */\nexport const typedReactMemo: <T>(component: T) => T = React.memo;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAsC,GAAGD,KAAK,CAACE,IAAI","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import type { ActionDefinition } from "@osdk/api";
2
+ import React from "react";
3
+ import type { ActionFormProps } from "./ActionFormApi.js";
4
+ export declare const ActionForm: <Q extends ActionDefinition<unknown>>(props: ActionFormProps<Q>) => React.ReactElement;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,wBAAwB,WAAY;AAGlD,OAAO,WAAgD,OAAQ;AAE/D,cAAc,uBAAkC,oBAAqB;AAQrE,OAAO,cAAMA,aAAa,UAAU,2BAClCC,OAAO,gBAAgB,OACpB,MAAM","names":["ActionForm: <Q extends ActionDefinition<unknown>>(\n props: ActionFormProps<Q>,\n) => React.ReactElement","props: ActionFormProps<Q>"],"sources":["../../../src/action-form/ActionForm.tsx"],"version":3,"file":"ActionForm.d.ts"}
@@ -1,43 +1,34 @@
1
- import type { ActionDefinition, ActionEditResponse, ActionReturnTypeForOptions, ActionValidationResponse } from "@osdk/api";
2
- import type { ActionValidationError, ApplyActionOptions } from "@osdk/client";
3
- import type { ActionParameters, FieldKey, FieldValueType, FormFieldDefinition } from "./FormFieldApi.js";
1
+ import type { ActionDefinition, ActionEditResponse, ActionValidationResponse } from "@osdk/api";
2
+ import type { ActionValidationError } from "@osdk/client";
3
+ import type { ActionParameters, FieldKey, FieldValueType, FormFieldDefinition, RendererFieldDefinition } from "./FormFieldApi.js";
4
4
  /**
5
- * Props for the ActionForm component
5
+ * Props for the ActionForm component.
6
+ *
7
+ * A discriminated union ensures that controlled mode (formState provided)
8
+ * always requires onFormStateChange, and uncontrolled mode makes `onFormStateChange` optional
6
9
  */
7
- export interface ActionFormProps<Q extends ActionDefinition<unknown>> {
10
+ export type ActionFormProps<Q extends ActionDefinition<unknown>> = (ActionFormConfigProps<Q> & {
11
+ formState: FormState<Q>
12
+ onFormStateChange: (updater: (prevState: FormState<Q>) => FormState<Q>) => void
13
+ }) | (ActionFormConfigProps<Q> & {
14
+ formState?: undefined
15
+ onFormStateChange?: (updater: (prevState: FormState<Q>) => FormState<Q>) => void
16
+ });
17
+ interface ActionFormConfigProps<Q extends ActionDefinition<unknown>> extends Pick<BaseFormProps, "formTitle" | "isSubmitDisabled"> {
8
18
  actionDefinition: Q;
9
19
  /**
10
- * If not supplied, defaults to actionDef.displayName
20
+ * If not supplied, field definitions are constructed from `ActionParameters`.
11
21
  */
12
- formTitle?: string;
13
- /**
14
- * If not supplied, this will be constructed from ActionParameters
15
- */
16
- formFieldDefinition?: Array<FormFieldDefinition<Q>>;
17
- /**
18
- * Called when a field value changed.
19
- * Required when a field is in controlled mode, i.e. value is provided via formFieldDefinition.
20
- *
21
- * @param fieldKey The key of the changed field
22
- * @param value the updated value of the field
23
- */
24
- onFieldValueChanged?: <K extends FieldKey<Q>>(fieldKey: K, value: FieldValueType<Q, K>) => void;
25
- /**
26
- * Override to disable submit button
27
- * If not provided, button is disabled when form is submitting or has validation errors
28
- *
29
- * @default false
30
- */
31
- isSubmitDisabled?: boolean;
22
+ formFieldDefinitions?: ReadonlyArray<FormFieldDefinition<Q>>;
32
23
  /**
33
24
  * If supplied, this will override the default submit action
34
- * By default, the action's applyAction will be called with $validateOnly: false
25
+ * By default, the action's applyAction will be called
35
26
  *
36
27
  * @param formState all field values when onSubmit is called
37
- * @param applyAction the function to execute the action. Call it with $validateOnly: true options to run validation mode onSubmit.
28
+ * @param applyAction the function to execute the action
38
29
  * @returns a promise of the submission response
39
30
  */
40
- onSubmit?: <OP extends ApplyActionOptions>(formState: FormState<Q>, applyAction: (args: ActionParameters<Q>, options?: OP) => Promise<ActionReturnTypeForOptions<OP>>) => Promise<ActionReturnTypeForOptions<OP>> | void;
31
+ onSubmit?: (formState: FormState<Q>, applyAction: (args: ActionParameters<Q>) => Promise<ActionEditResponse | undefined>) => Promise<unknown> | void;
41
32
  /**
42
33
  * Called when the validation response is returned from a validateOnly submission
43
34
  *
@@ -49,7 +40,7 @@ export interface ActionFormProps<Q extends ActionDefinition<unknown>> {
49
40
  *
50
41
  * @param results the submission response
51
42
  */
52
- onSuccess?: (results: ActionEditResponse) => void;
43
+ onSuccess?: (results: ActionEditResponse | undefined) => void;
53
44
  /**
54
45
  * Called when there is an error in form submission
55
46
  *
@@ -60,7 +51,7 @@ export interface ActionFormProps<Q extends ActionDefinition<unknown>> {
60
51
  /**
61
52
  * Form values mapping parameter names to their values
62
53
  */
63
- export type FormState<Q extends ActionDefinition<unknown>> = { [K in FieldKey<Q>] : FieldValueType<Q, K> };
54
+ export type FormState<Q extends ActionDefinition<unknown>> = { [K in FieldKey<Q>]? : FieldValueType<Q, K> };
64
55
  /**
65
56
  * Form error discriminated union
66
57
  */
@@ -69,8 +60,33 @@ export type FormError = {
69
60
  error: ActionValidationError
70
61
  } | {
71
62
  type: "submission"
72
- error: Error
63
+ error: unknown
73
64
  } | {
74
65
  type: "unknown"
75
66
  error: unknown
76
67
  };
68
+ /**
69
+ * Props for the `BaseForm` component, which renders a form without
70
+ * OSDK data fetching.
71
+ *
72
+ * Uses a discriminated union so that controlled mode (`formState` provided)
73
+ * always requires `onFieldValueChange`, and uncontrolled mode omits both.
74
+ * `onSubmit` receives the current form state so callers can access values
75
+ * even in uncontrolled mode.
76
+ */
77
+ export type BaseFormProps = BaseFormCommonProps & ({
78
+ formState: Record<string, unknown>
79
+ onFieldValueChange: (fieldKey: string, value: unknown) => void
80
+ } | {
81
+ formState?: undefined
82
+ onFieldValueChange?: (fieldKey: string, value: unknown) => void
83
+ });
84
+ interface BaseFormCommonProps {
85
+ formTitle?: string;
86
+ fieldDefinitions: ReadonlyArray<RendererFieldDefinition>;
87
+ onSubmit: (formState: Record<string, unknown>) => void;
88
+ isSubmitDisabled?: boolean;
89
+ isPending?: boolean;
90
+ isLoading?: boolean;
91
+ }
92
+ export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,kBACA,oBACA,4BACA,gCACK,WAAY;AACnB,cAAc,uBAAuB,0BAA0B,cAAe;AAC9E,cACE,kBACA,UACA,gBACA,2BACK,mBAAoB;;;;AAK3B,iBAAiB,gBAAgB,UAAU,2BAA2B;CACpE,kBAAkB;;;;CAKlB;;;;CAKA,sBAAsB,MAAM,oBAAoB;;;;;;;;CAShD,uBAAuB,UAAU,SAAS,IACxCA,UAAU,GACVC,OAAO,eAAe,GAAG;;;;;;;CAS3B;;;;;;;;;CAUA,YAAY,WAAW,oBACrBC,WAAW,UAAU,IACrBC,cACEC,MAAM,iBAAiB,IACvBC,UAAU,OACP,QAAQ,2BAA2B,SACrC,QAAQ,2BAA2B;;;;;;CAOxC,wBAAwBC,SAAS;;;;;;CAOjC,aAAaC,SAAS;;;;;;CAOtB,WAAWC,OAAO;AACnB;;;;AAKD,YAAY,UAAU,UAAU,gCAC7B,KAAK,SAAS,MAAK,eAAe,GAAG;;;;AAMxC,YAAY,YACR;CAAE,MAAM;CAAc,OAAO;AAAuB,IACpD;CAAE,MAAM;CAAc,OAAO;AAAO,IACpC;CAAE,MAAM;CAAW;AAAgB","names":["fieldKey: K","value: FieldValueType<Q, K>","formState: FormState<Q>","applyAction: (\n args: ActionParameters<Q>,\n options?: OP,\n ) => Promise<ActionReturnTypeForOptions<OP>>","args: ActionParameters<Q>","options?: OP","results: ActionValidationResponse","results: ActionEditResponse","error: FormError"],"sources":["../../../src/action-form/ActionFormApi.ts"],"version":3,"file":"ActionFormApi.d.ts"}
1
+ {"mappings":"AAgBA,cACE,kBACA,oBACA,gCACK,WAAY;AACnB,cAAc,6BAA6B,cAAe;AAC1D,cACE,kBACA,UACA,gBACA,qBACA,+BACK,mBAAoB;;;;;;;AAQ3B,YAAY,gBAAgB,UAAU,8BACjC,sBAAsB,KAAK;CAC5B,WAAW,UAAU;CACrB,oBACEA,UAAUC,WAAW,UAAU,OAAO,UAAU;AAEnD,MACE,sBAAsB,KAAK;CAC5B;CACA,qBACED,UAAUC,WAAW,UAAU,OAAO,UAAU;AAEnD;UAEO,sBAAsB,UAAU,mCAChC,KAAK,eAAe,cAAc,oBAC5C;CACE,kBAAkB;;;;CAKlB,uBAAuB,cAAc,oBAAoB;;;;;;;;;CAUzD,YACEC,WAAW,UAAU,IACrBC,cACEC,MAAM,iBAAiB,OACpB,QAAQ,oCACV;;;;;;CAOL,wBAAwBC,SAAS;;;;;;CAOjC,aAAaC,SAAS;;;;;;CAOtB,WAAWC,OAAO;AACnB;;;;AAKD,YAAY,UAAU,UAAU,gCAC7B,KAAK,SAAS,OAAM,eAAe,GAAG;;;;AAMzC,YAAY,YACR;CAAE,MAAM;CAAc,OAAO;AAAuB,IACpD;CAAE,MAAM;CAAc;AAAgB,IACtC;CAAE,MAAM;CAAW;AAAgB;;;;;;;;;;AAWvC,YAAY,gBACR,uBAEE;CACA,WAAW;CACX,qBAAqBC,kBAAkBC;AACxC,IACC;CACA;CACA,sBAAsBD,kBAAkBC;AACzC;UAGK,oBAAoB;CAC5B;CACA,kBAAkB,cAAc;CAChC,WAAWC,WAAW;CACtB;CACA;CACA;AACD","names":["updater: (prevState: FormState<Q>) => FormState<Q>","prevState: FormState<Q>","formState: FormState<Q>","applyAction: (\n args: ActionParameters<Q>,\n ) => Promise<ActionEditResponse | undefined>","args: ActionParameters<Q>","results: ActionValidationResponse","results: ActionEditResponse | undefined","error: FormError","fieldKey: string","value: unknown","formState: Record<string, unknown>"],"sources":["../../../src/action-form/ActionFormApi.ts"],"version":3,"file":"ActionFormApi.d.ts"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { BaseFormProps } from "./ActionFormApi.js";
3
+ export declare const BaseForm: React.FC<BaseFormProps>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,OAAO,WAA2C,OAAQ;AAE1D,cAAc,qBAAqB,oBAAqB;AAIxD,OAAO,cAAMA,UAAU,MAAM,GAAG","names":["BaseForm: React.FC<BaseFormProps>"],"sources":["../../../src/action-form/BaseForm.tsx"],"version":3,"file":"BaseForm.d.ts"}
@@ -1,13 +1,11 @@
1
- import type { ActionDefinition, CompileTimeMetadata, ObjectSet, ObjectTypeDefinition } from "@osdk/api";
1
+ import type { ActionDefinition, ActionMetadata, ActionParam, CompileTimeMetadata, DataValueClientToWire, ObjectSet, ObjectTypeDefinition } from "@osdk/api";
2
2
  import type React from "react";
3
3
  /**
4
4
  * A form field definition specifies configuration for a single field
5
5
  */
6
6
  export interface FormFieldDefinition<
7
7
  Q extends ActionDefinition<unknown>,
8
- K extends FieldKey<Q> = FieldKey<Q>,
9
- V extends FieldValueType<Q, K> = FieldValueType<Q, K>,
10
- C extends ValidFormFieldForPropertyType<V> = ValidFormFieldForPropertyType<V>
8
+ K extends FieldKey<Q> = FieldKey<Q>
11
9
  > {
12
10
  /**
13
11
  * The field's unique key
@@ -19,18 +17,13 @@ export interface FormFieldDefinition<
19
17
  */
20
18
  label?: string;
21
19
  /**
22
- * Current value of the field
23
- * If provided, the field operates in controlled mode
24
- */
25
- value?: V;
26
- /**
27
20
  * Default value of the field
28
21
  */
29
- defaultValue?: V;
22
+ defaultValue?: FieldValueType<Q, K>;
30
23
  /**
31
24
  * The form field component type to render
32
25
  */
33
- fieldComponent: C;
26
+ fieldComponent: ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>;
34
27
  /**
35
28
  * Whether the field is required
36
29
  */
@@ -67,12 +60,12 @@ export interface FormFieldDefinition<
67
60
  * @param value the current field value
68
61
  * @returns a boolean promise indicating whether the value is valid
69
62
  */
70
- validate?: (value: V) => Promise<boolean>;
63
+ validate?: (value: FieldValueType<Q, K>) => Promise<boolean>;
71
64
  /**
72
65
  * The component props for the form field
73
66
  * Excludes runtime props (key, onChange) which are managed by ActionForm
74
67
  */
75
- fieldComponentProps?: Omit<FormFieldPropsByType[C], "key" | "onChange">;
68
+ fieldComponentProps?: Omit<FormFieldPropsByType[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>], "key" | "onChange">;
76
69
  }
77
70
  type ValidationError = {
78
71
  type: ValidationRule
@@ -161,6 +154,7 @@ export interface TextAreaFieldProps extends BaseFormFieldProps<string>, Pick<Rea
161
154
  }
162
155
  export interface TextInputFieldProps extends BaseFormFieldProps<string>, Pick<React.InputHTMLAttributes<HTMLInputElement>, "minLength" | "maxLength"> {
163
156
  fieldComponent: "TEXT_INPUT";
157
+ placeholder?: string;
164
158
  }
165
159
  /**
166
160
  * Number input field props
@@ -202,15 +196,18 @@ export interface CustomFieldProps<V> extends BaseFormFieldProps<V> {
202
196
  customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;
203
197
  }
204
198
  export interface BaseFormFieldProps<V> {
205
- fieldComponent: FieldComponent;
206
199
  /**
207
- * Called when the field value changed.
200
+ * The value of the form field
201
+ */
202
+ value: V;
203
+ /**
204
+ * Called when the field value changes.
208
205
  *
209
- * ActionForm internally wraps this to pass the key to onFieldValueChanged:
206
+ * ActionForm internally wraps this to pass the key to `onFieldValueChange`:
210
207
  * ```
211
208
  * <DropdownField
212
209
  * {...fieldDef}
213
- * onChange={(value) => onFieldValueChanged(fieldDef.key, value)}
210
+ * onChange={(value) => onFieldValueChange(fieldDef.key, value)}
214
211
  * />
215
212
  * ```
216
213
  *
@@ -225,8 +222,17 @@ export type FieldKey<Q extends ActionDefinition<unknown>> = keyof ActionParamete
225
222
  export type ActionParameters<Q extends ActionDefinition<unknown>> = CompileTimeMetadata<Q>["parameters"];
226
223
  /**
227
224
  * Extracts the value type for a specific parameter
225
+ *
226
+ * TODO: Re-use `BaseType`
228
227
  */
229
228
  export type FieldValueType<
229
+ Q extends ActionDefinition<unknown>,
230
+ K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>
231
+ > = ActionParameters<Q>[K]["type"] extends ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T> : ActionParameters<Q>[K]["type"] extends ActionMetadata.DataType.ObjectSet<infer T> ? ActionParam.ObjectSetType<T> : ActionParameters<Q>[K]["type"] extends ActionMetadata.DataType.Struct<infer T> ? ActionParam.StructType<T> : ActionParameters<Q>[K]["type"] extends keyof DataValueClientToWire ? DataValueClientToWire[ActionParameters<Q>[K]["type"]] : never;
232
+ /**
233
+ * Extracts the parameter type descriptor for a specific action parameter.
234
+ */
235
+ export type FieldDescriptorType<
230
236
  Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,
231
237
  K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>
232
238
  > = ActionParameters<Q>[K]["type"];
@@ -235,7 +241,41 @@ export type FieldValueType<
235
241
  */
236
242
  export type FieldComponent = "DATETIME_PICKER" | "DROPDOWN" | "FILE_PICKER" | "NUMBER_INPUT" | "RADIO_BUTTONS" | "OBJECT_SET" | "TEXT_AREA" | "TEXT_INPUT" | "CUSTOM";
237
243
  /**
244
+ * Describes the data type of a form field, independent of OSDK.
245
+ * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.
246
+ */
247
+ export type FieldType = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType" | "geoshape" | "geohash" | {
248
+ type: "object"
249
+ object: string
250
+ } | {
251
+ type: "objectSet"
252
+ objectSet: string
253
+ } | {
254
+ type: "interface"
255
+ interface: string
256
+ } | {
257
+ type: "struct"
258
+ struct: Record<string, string>
259
+ };
260
+ /**
261
+ * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.
262
+ * Contains only the information needed to render a single field — no generics,
263
+ * no compile-time parameter constraints.
264
+ */
265
+ export interface RendererFieldDefinition {
266
+ fieldKey: string;
267
+ fieldComponent: FieldComponent;
268
+ fieldType?: FieldType;
269
+ label?: string;
270
+ defaultValue?: unknown;
271
+ isRequired?: boolean;
272
+ placeholder?: string;
273
+ helperText?: string;
274
+ helperTextPlacement?: "bottom" | "tooltip";
275
+ fieldComponentProps?: Record<string, unknown>;
276
+ }
277
+ /**
238
278
  * Gets valid form field types for a given property type
239
279
  */
240
- export type ValidFormFieldForPropertyType<P extends FieldValueType> = P extends "objectSet" ? "OBJECT_SET" : P extends "object" ? "DROPDOWN" : P extends "mediaReference" | "attachment" ? "FILE_PICKER" : P extends "boolean" ? "RADIO_BUTTONS" | "DROPDOWN" : P extends "string" ? "TEXT_INPUT" | "TEXT_AREA" : P extends "datetime" | "timestamp" ? "DATETIME_PICKER" : P extends "double" | "integer" | "long" | "float" | "short" | "byte" | "decimal" ? "NUMBER_INPUT" : never;
280
+ export type ValidFormFieldForPropertyType<P extends FieldDescriptorType> = P extends "objectSet" ? "OBJECT_SET" : P extends "object" ? "DROPDOWN" : P extends "mediaReference" | "attachment" ? "FILE_PICKER" : P extends "boolean" ? "RADIO_BUTTONS" | "DROPDOWN" : P extends "string" ? "TEXT_INPUT" | "TEXT_AREA" : P extends "datetime" | "timestamp" ? "DATETIME_PICKER" : P extends "double" | "integer" | "long" | "float" | "short" | "byte" | "decimal" ? "NUMBER_INPUT" : never;
241
281
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,kBACA,qBACA,WACA,4BACK,WAAY;AACnB,YAAY,WAAW,OAAQ;;;;AAK/B,iBAAiB;CACf,UAAU;CACV,UAAU,SAAS,KAAK,SAAS;CACjC,UAAU,eAAe,GAAG,KAAK,eAAe,GAAG;CACnD,UAAU,8BAA8B,KAAK,8BAA8B;EAC3E;;;;CAIA,UAAU;;;;;CAMV;;;;;CAMA,QAAQ;;;;CAKR,eAAe;;;;CAKf,gBAAgB;;;;CAKhB;;;;CAKA;;;;;CAMA;;;;;;CAOA,sBAAsB,WAAW;;;;CAKjC;;;;;;;CAQA,qBAAqBA,OAAO;;;;;;;CAQ5B,YAAYC,OAAO,MAAM;;;;;CAMzB,sBAAsB,KAAK,qBAAqB,IAAI,QAAQ;AAC7D;KAEI,kBAAkB;CAAE,MAAM;CAAgB;AAAe;KAEzD,iBACD,aACA,QACA,QACA,cACA,cACA,YACA;;;;AAKJ,iBAAiB,qBAAqB;CACpC,iBAAiB;CACjB,UAAU;CACV,aAAa;CACb,cAAc;CACd,YAAY,oBAAoB;CAChC,eAAe;CACf,WAAW;CACX,YAAY;CACZ,QAAQ;AACT;;;;AAKD,iBAAiB,iCAAiC,mBAAmB,MAAM;CACzE,gBAAgB;;;;;C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,iBACA,kBACA,eACA,cACA,eACA;;;;AAKJ,YAAY,8BAA8B,UAAU,kBAAkB,UACpE,cAAc,eACZ,UAAU,WAAW,aACrB,UAAU,mBAAmB,eAAe,gBAC5C,UAAU,YAAY,kBAAkB,aACxC,UAAU,WAAW,eAAe,cACpC,UAAU,aAAa,cAAc,oBACrC,UACE,WACA,YACA,SACA,UACA,UACA,SACA,YAAY","names":["error: ValidationError","value: V","date: Date","props: BaseFormFieldProps<V>","value?: V"],"sources":["../../../src/action-form/FormFieldApi.ts"],"version":3,"file":"FormFieldApi.d.ts"}
1
+ {"mappings":"AAgBA,cACE,kBACA,gBACA,aACA,qBACA,uBACA,WACA,4BACK,WAAY;AACnB,YAAY,WAAW,OAAQ;;;;AAK/B,iBAAiB;CACf,UAAU;CACV,UAAU,SAAS,KAAK,SAAS;EACjC;;;;CAIA,UAAU;;;;;CAMV;;;;CAKA,eAAe,eAAe,GAAG;;;;CAKjC,gBAAgB,8BAA8B,oBAAoB,GAAG;;;;CAKrE;;;;CAKA;;;;;CAMA;;;;;;CAOA,sBAAsB,WAAW;;;;CAKjC;;;;;;;CAQA,qBAAqBA,OAAO;;;;;;;CAQ5B,YAAYC,OAAO,eAAe,GAAG,OAAO;;;;;CAM5C,sBAAsB,KACpB,qBACE,8BAA8B,oBAAoB,GAAG,MAEvD,QAAQ;AAEX;KAEI,kBAAkB;CAAE,MAAM;CAAgB;AAAe;KAEzD,iBACD,aACA,QACA,QACA,cACA,cACA,YACA;;;;AAKJ,iBAAiB,qBAAqB;CACpC,iBAAiB;CACjB,UAAU;CACV,aAAa;CACb,cAAc;CACd,YAAY,oBAAoB;CAChC,eAAe;CACf,WAAW;CACX,YAAY;CACZ,QAAQ;AACT;;;;AAKD,iBAAiB,iCAAiC,mBAAmB,MAAM;CACzE,gBAAgB;;;;;CAMhB,MAAM;;;;;CAMN,MAAM;;;;CAKN;;;;CAKA,cAAcC,MAAM;AACrB;;;;AAKD,iBAAiB;CAAmB;CAAG,0BAA0B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BACvB,eAAe,SAAS,aAAa,KAAK,YAAY,WAAW,KACjE,iBAAiB,GAAG,GAAG,sBAAsB,wBAC3C,sBAAsB,iBAAiB,GAAG,GAAG;;;;AAMnD,YAAY;CACV,UAAU,4BAA4B;CACtC,gBAAgB,iBAAiB,WAAW,iBAAiB;IAC3D,iBAAiB,GAAG,GAAG;;;;AAK3B,YAAY,iBACR,oBACA,aACA,gBACA,iBACA,kBACA,eACA,cACA,eACA;;;;;AAMJ,YAAY,YACR,YACA,WACA,YACA,SACA,WACA,aACA,cACA,eACA,YACA,mBACA,eACA,aACA,YACA;CAAE,MAAM;CAAU;AAAgB,IAClC;CAAE,MAAM;CAAa;AAAmB,IACxC;CAAE,MAAM;CAAa;AAAmB,IACxC;CAAE,MAAM;CAAU,QAAQ;AAAwB;;;;;;AAOtD,iBAAiB,wBAAwB;CACvC;CACA,gBAAgB;CAChB,YAAY;CACZ;CACA;CACA;CACA;CACA;CACA,sBAAsB,WAAW;CACjC,sBAAsB;AACvB;;;;AAKD,YAAY,8BAA8B,UAAU,uBAClD,UAAU,cAAc,eACpB,UAAU,WAAW,aACrB,UAAU,mBAAmB,eAAe,gBAC5C,UAAU,YAAY,kBAAkB,aACxC,UAAU,WAAW,eAAe,cACpC,UAAU,aAAa,cAAc,oBACrC,UACE,WACA,YACA,SACA,UACA,UACA,SACA,YAAY","names":["error: ValidationError","value: FieldValueType<Q, K>","date: Date","props: BaseFormFieldProps<V>","value?: V"],"sources":["../../../src/action-form/FormFieldApi.ts"],"version":3,"file":"FormFieldApi.d.ts"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { Control } from "react-hook-form";
3
+ import type { RendererFieldDefinition } from "../FormFieldApi.js";
4
+ export interface FieldBridgeProps {
5
+ fieldDef: RendererFieldDefinition;
6
+ control: Control<Record<string, unknown>>;
7
+ onExternalChange?: (fieldKey: string, value: unknown) => void;
8
+ }
9
+ export declare const FieldBridge: React.FC<FieldBridgeProps>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,OAAO,WAAkC,OAAQ;AACjD,cAAc,eAAe,iBAAkB;AAE/C,cAAc,+BAA+B,oBAAqB;AAGlE,iBAAiB,iBAAiB;CAChC,UAAU;CACV,SAAS,QAAQ;CACjB,oBAAoBA,kBAAkBC;AACvC;AACD,OAAO,cAAMC,aAAa,MAAM,GAAG","names":["fieldKey: string","value: unknown","FieldBridge: React.FC<FieldBridgeProps>"],"sources":["../../../../src/action-form/fields/FieldBridge.tsx"],"version":3,"file":"FieldBridge.d.ts"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { RendererFieldDefinition } from "../FormFieldApi.js";
3
+ export interface FormFieldRendererProps {
4
+ fieldDefinition: RendererFieldDefinition;
5
+ value: unknown;
6
+ onFieldValueChange: (value: unknown) => void;
7
+ }
8
+ export declare const FormFieldRenderer: React.FC<FormFieldRendererProps>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,OAAO,WAAqB,OAAQ;AACpC,cAAc,+BAA+B,oBAAqB;AAGlE,iBAAiB,uBAAuB;CACtC,iBAAiB;CACjB;CACA,qBAAqBA;AACtB;AAED,OAAO,cAAMC,mBAAmB,MAAM,GAAG","names":["value: unknown","FormFieldRenderer: React.FC<FormFieldRendererProps>"],"sources":["../../../../src/action-form/fields/FormFieldRenderer.tsx"],"version":3,"file":"FormFieldRenderer.d.ts"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { TextInputFieldProps } from "../FormFieldApi.js";
3
+ export declare function TextInputField({ value, onChange, placeholder, minLength, maxLength }: TextInputFieldProps): React.ReactElement;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,OAAO,WAA4B,OAAQ;AAC3C,cAAc,2BAA2B,oBAAqB;AAE9D,OAAO,iBAAS,eAAe,EAC7B,OACA,UACA,aACA,WACA,WACoB,EAAnB,sBAAsB,MAAM","names":[],"sources":["../../../../src/action-form/fields/TextInputField.tsx"],"version":3,"file":"TextInputField.d.ts"}
@@ -0,0 +1,10 @@
1
+ import type { FieldType } from "../FormFieldApi.js";
2
+ /**
3
+ * Coerces a raw form field value to match the expected type for the given
4
+ * field type. Returns `undefined` when coercion fails
5
+ * (e.g. non-numeric string for a number field).
6
+ *
7
+ * Complex types (object, objectSet, struct, interface) are passed through
8
+ * unchanged since they cannot be meaningfully coerced.
9
+ */
10
+ export declare function coerceFieldValue(parameterType: FieldType | undefined, rawValue: unknown): unknown;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,iBAAiB,oBAAqB;;;;;;;;;AAUpD,OAAO,iBAAS,iBACdA,eAAe,uBACfC","names":["parameterType: FieldType | undefined","rawValue: unknown"],"sources":["../../../../src/action-form/utils/coerceFieldValue.ts"],"version":3,"file":"coerceFieldValue.d.ts"}
@@ -0,0 +1,6 @@
1
+ import type { ActionMetadata } from "@osdk/api";
2
+ import type { FieldComponent } from "../FormFieldApi.js";
3
+ /**
4
+ * Maps an ActionMetadata parameter type to the default FieldComponent.
5
+ */
6
+ export declare function getDefaultFieldComponent(paramType: ActionMetadata.Parameter["type"]): FieldComponent;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,sBAAsB,WAAY;AAEhD,cAAc,sBAAsB,oBAAqB;;;;AAKzD,OAAO,iBAAS,yBACdA,WAAW,eAAe,UAAU,UACnC","names":["paramType: ActionMetadata.Parameter[\"type\"]"],"sources":["../../../../src/action-form/utils/getDefaultFieldComponent.ts"],"version":3,"file":"getDefaultFieldComponent.d.ts"}
@@ -0,0 +1,6 @@
1
+ import type { ActionDefinition, ActionMetadata } from "@osdk/api";
2
+ import type { FormFieldDefinition } from "../FormFieldApi.js";
3
+ /**
4
+ * Derives default field definitions from fetched ActionMetadata.
5
+ */
6
+ export declare function getDefaultFieldDefinitions<Q extends ActionDefinition<unknown>>(metadata: ActionMetadata): ReadonlyArray<FormFieldDefinition<Q>>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,kBAAkB,sBAAsB,WAAY;AAClE,cAIE,2BAEK,oBAAqB;;;;AAM5B,OAAO,iBAAS,2BACd,UAAU,2BACVA,UAAU,iBAAiB,cAAc,oBAAoB","names":["metadata: ActionMetadata"],"sources":["../../../../src/action-form/utils/getDefaultFieldDefinitions.ts"],"version":3,"file":"getDefaultFieldDefinitions.d.ts"}
@@ -0,0 +1,31 @@
1
+ import { Tooltip as BaseUITooltip, type TooltipPopupProps, type TooltipPositionerProps, type TooltipProviderProps, type TooltipRootProps, type TooltipTriggerProps } from "@base-ui/react/tooltip";
2
+ import React from "react";
3
+ export interface TooltipProps extends Omit<TooltipRootProps, "className"> {}
4
+ declare function TooltipRoot({ children,...rest }: TooltipProps): React.ReactElement;
5
+ interface TooltipProviderComponentProps extends Omit<TooltipProviderProps, "className"> {
6
+ className?: string;
7
+ }
8
+ declare function TooltipProvider({ children,...rest }: TooltipProviderComponentProps): React.ReactElement;
9
+ interface TooltipTriggerComponentProps extends Omit<TooltipTriggerProps, "className"> {
10
+ className?: string;
11
+ }
12
+ declare function TooltipTrigger({ className, children,...rest }: TooltipTriggerComponentProps): React.ReactElement;
13
+ interface TooltipPositionerComponentProps extends Omit<TooltipPositionerProps, "className"> {
14
+ className?: string;
15
+ }
16
+ declare function TooltipPositioner({ className, children, sideOffset,...rest }: TooltipPositionerComponentProps): React.ReactElement;
17
+ interface TooltipPopupComponentProps extends Omit<TooltipPopupProps, "className"> {
18
+ className?: string;
19
+ }
20
+ declare function TooltipPopup({ className, children,...rest }: TooltipPopupComponentProps): React.ReactElement;
21
+ export declare function TooltipArrow(): React.ReactElement;
22
+ export declare const Tooltip: {
23
+ Root: typeof TooltipRoot
24
+ Provider: typeof TooltipProvider
25
+ Trigger: typeof TooltipTrigger
26
+ Portal: typeof BaseUITooltip.Portal
27
+ Positioner: typeof TooltipPositioner
28
+ Popup: typeof TooltipPopup
29
+ Arrow: typeof TooltipArrow
30
+ };
31
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,SACE,WAAW,oBACN,wBACA,6BACA,2BACA,uBACA,2BACA,wBAAyB;AAEhC,OAAO,WAAW,OAAQ;AAG1B,iBAAiB,qBAAqB,KAAK,kBAAkB,aAAa,CAAE;AAE5E,iBAAS,YAAY,EACnB,SACA,GAAG,MACU,EAAZ,eAAe,MAAM;UAQd,sCACA,KAAK,sBAAsB,aACrC;CACE;AACD;AAED,iBAAS,gBAAgB,EACvB,SACA,GAAG,MAC2B,EAA7B,gCAAgC,MAAM;UAU/B,qCACA,KAAK,qBAAqB,aACpC;CACE;AACD;AAED,iBAAS,eAAe,EACtB,WACA,SACA,GAAG,MAC0B,EAA5B,+BAA+B,MAAM;UAW9B,wCACA,KAAK,wBAAwB,aACvC;CACE;AACD;AAED,iBAAS,kBAAkB,EACzB,WACA,UACA,WACA,GAAG,MAC6B,EAA/B,kCAAkC,MAAM;UAYjC,mCACA,KAAK,mBAAmB,aAClC;CACE;AACD;AAED,iBAAS,aAAa,EACpB,WACA,SACA,GAAG,MACwB,EAA1B,6BAA6B,MAAM;AAWtC,OAAO,iBAAS,gBAAgB,MAAM;AAuBtC,OAAO,cAAMA,SAAS;CACpB,aAAa;CACb,iBAAiB;CACjB,gBAAgB;CAChB,eAAe,cAAc;CAC7B,mBAAmB;CACnB,cAAc;CACd,cAAc;AACf","names":["Tooltip: {\n Root: typeof TooltipRoot;\n Provider: typeof TooltipProvider;\n Trigger: typeof TooltipTrigger;\n Portal: typeof BaseUITooltip.Portal;\n Positioner: typeof TooltipPositioner;\n Popup: typeof TooltipPopup;\n Arrow: typeof TooltipArrow;\n}"],"sources":["../../../../src/base-components/tooltip/Tooltip.tsx"],"version":3,"file":"Tooltip.d.ts"}
@@ -0,0 +1 @@
1
+ export { Tooltip, TooltipArrow, type TooltipProps } from "./Tooltip.js";
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,SAAS,SAAS,mBAAmB,oBAAoB","names":[],"sources":["../../../../src/base-components/tooltip/index.ts"],"version":3,"file":"index.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAkBA,OAAO,WAAW,OAAQ;AAC1B,cAAc,2BAA2B,wBAAyB;AAKlE,OAAO,iBAAS,eAAe,GAC7BA,OAAO,oBAAoB,KAC1B,MAAM","names":["props: BaseFilterListProps<D>"],"sources":["../../../../src/filter-list/base/BaseFilterList.tsx"],"version":3,"file":"BaseFilterList.d.ts"}
1
+ {"mappings":"AAkBA,OAAO,WAA4B,OAAQ;AAC3C,cAAc,2BAA2B,wBAAyB;AAMlE,OAAO,iBAAS,eAAe,GAC7BA,OAAO,oBAAoB,KAC1B,MAAM","names":["props: BaseFilterListProps<D>"],"sources":["../../../../src/filter-list/base/BaseFilterList.tsx"],"version":3,"file":"BaseFilterList.d.ts"}
@@ -2,3 +2,10 @@ import React from "react";
2
2
  export declare function IncludeIcon(): React.ReactElement;
3
3
  export declare function ExcludeIcon(): React.ReactElement;
4
4
  export declare function RemoveIcon(): React.ReactElement;
5
+ export declare function SearchIcon(): React.ReactElement;
6
+ export declare function OverflowMenuIcon(): React.ReactElement;
7
+ export declare function ChevronDownIcon(): React.ReactElement;
8
+ export declare function CollapseIcon(): React.ReactElement;
9
+ export declare function ExpandIcon(): React.ReactElement;
10
+ export declare function ResetIcon(): React.ReactElement;
11
+ export declare function CheckIcon(): React.ReactElement;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,OAAO,WAAW,OAAQ;AAE1B,OAAO,iBAAS,eAAe,MAAM;AAgBrC,OAAO,iBAAS,eAAe,MAAM;AAiBrC,OAAO,iBAAS,cAAc,MAAM","names":[],"sources":["../../../../src/filter-list/base/FilterIcons.tsx"],"version":3,"file":"FilterIcons.d.ts"}
1
+ {"mappings":"AA0BA,OAAO,WAAW,OAAQ;AAE1B,OAAO,iBAAS,eAAe,MAAM;AAgBrC,OAAO,iBAAS,eAAe,MAAM;AAiBrC,OAAO,iBAAS,cAAc,MAAM;AAIpC,OAAO,iBAAS,cAAc,MAAM;AAIpC,OAAO,iBAAS,oBAAoB,MAAM;AAI1C,OAAO,iBAAS,mBAAmB,MAAM;AAIzC,OAAO,iBAAS,gBAAgB,MAAM;AAItC,OAAO,iBAAS,cAAc,MAAM;AAIpC,OAAO,iBAAS,aAAa,MAAM;AAInC,OAAO,iBAAS,aAAa,MAAM","names":[],"sources":["../../../../src/filter-list/base/FilterIcons.tsx"],"version":3,"file":"FilterIcons.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAkBA,OAAO,cAAoB,iBAA8B,OAAQ;UAGvD,sBAAsB;CAC9B;CACA,YAAY;CACZ;CACA,qBAAqBA;CACrB;CACA;CACA;CACA;AACD;AAED,iBAAS,sBAAsB,EAC7B,OACA,WACA,WACA,mBACA,iBACA,SACA,uBACA,mBACsB,EAArB,wBAAwB,MAAM;AA+DjC,OAAO,cAAMC,kBAAkB,MAAM,2BAC5B","names":["collapsed: boolean","FilterListHeader: React.MemoExoticComponent<\n typeof FilterListHeaderInner\n>"],"sources":["../../../../src/filter-list/base/FilterListHeader.tsx"],"version":3,"file":"FilterListHeader.d.ts"}
1
+ {"mappings":"AAiBA,OAAO,cAAoB,iBAA8B,OAAQ;UAIvD,sBAAsB;CAC9B;CACA,YAAY;CACZ;CACA,qBAAqBA;CACrB;CACA;CACA;CACA;AACD;AAED,iBAAS,sBAAsB,EAC7B,OACA,WACA,WACA,mBACA,iBACA,SACA,uBACA,mBACsB,EAArB,wBAAwB,MAAM;AAqDjC,OAAO,cAAMC,kBAAkB,MAAM,2BAC5B","names":["collapsed: boolean","FilterListHeader: React.MemoExoticComponent<\n typeof FilterListHeaderInner\n>"],"sources":["../../../../src/filter-list/base/FilterListHeader.tsx"],"version":3,"file":"FilterListHeader.d.ts"}