@osdk/react-components 0.2.0-beta.24 → 0.2.0-beta.26

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 (175) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +38 -0
  3. package/build/browser/action-form/ActionForm.js +15 -11
  4. package/build/browser/action-form/ActionForm.js.map +1 -1
  5. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  6. package/build/browser/action-form/fields/{TextInputField.module.css → BaseInput.module.css} +2 -2
  7. package/build/browser/action-form/fields/BaseInput.module.css.js +6 -0
  8. package/build/browser/action-form/fields/CustomField.js +30 -0
  9. package/build/browser/action-form/fields/CustomField.js.map +1 -0
  10. package/build/browser/action-form/fields/FormFieldRenderer.js +26 -16
  11. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  12. package/build/browser/action-form/fields/RadioButtonsField.js +57 -0
  13. package/build/browser/action-form/fields/RadioButtonsField.js.map +1 -0
  14. package/build/browser/action-form/fields/RadioButtonsField.module.css +83 -0
  15. package/build/browser/action-form/fields/RadioButtonsField.module.css.js +10 -0
  16. package/build/browser/action-form/fields/TextAreaField.js +50 -0
  17. package/build/browser/action-form/fields/TextAreaField.js.map +1 -0
  18. package/build/browser/action-form/fields/TextInputField.js +3 -3
  19. package/build/browser/action-form/fields/TextInputField.js.map +1 -1
  20. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +97 -10
  21. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  22. package/build/browser/base-components/dialog/Dialog.js +4 -2
  23. package/build/browser/base-components/dialog/Dialog.js.map +1 -1
  24. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  25. package/build/browser/object-table/hooks/useFunctionColumnsData.js +57 -192
  26. package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  27. package/build/browser/pdf-viewer/PdfViewer.js +49 -8
  28. package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
  29. package/build/browser/pdf-viewer/PdfViewerContext.js +108 -0
  30. package/build/browser/pdf-viewer/PdfViewerContext.js.map +1 -0
  31. package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js +85 -18
  32. package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -1
  33. package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css +18 -0
  34. package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css.js +1 -0
  35. package/build/browser/pdf-viewer/components/PdfViewerContent.js +15 -3
  36. package/build/browser/pdf-viewer/components/PdfViewerContent.js.map +1 -1
  37. package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +1 -1
  38. package/build/browser/pdf-viewer/components/PdfViewerSidebar.module.css +1 -1
  39. package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.module.css +1 -1
  40. package/build/browser/pdf-viewer/components/PdfViewerToolbar.js +29 -2
  41. package/build/browser/pdf-viewer/components/PdfViewerToolbar.js.map +1 -1
  42. package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css +5 -0
  43. package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css.js +1 -0
  44. package/build/browser/pdf-viewer/constants.js +2 -1
  45. package/build/browser/pdf-viewer/constants.js.map +1 -1
  46. package/build/browser/pdf-viewer/hooks/usePdfAnnotationsByPage.js +30 -0
  47. package/build/browser/pdf-viewer/hooks/usePdfAnnotationsByPage.js.map +1 -0
  48. package/build/browser/pdf-viewer/hooks/usePdfFormFields.js +341 -0
  49. package/build/browser/pdf-viewer/hooks/usePdfFormFields.js.map +1 -0
  50. package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js +227 -0
  51. package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -0
  52. package/build/browser/pdf-viewer/hooks/usePdfViewer.js +16 -10
  53. package/build/browser/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
  54. package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
  55. package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
  56. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
  57. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
  58. package/build/browser/pdf-viewer/hooks/usePdfViewerState.js +3 -3
  59. package/build/browser/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
  60. package/build/browser/pdf-viewer/types.js.map +1 -1
  61. package/build/browser/public/experimental.js +5 -0
  62. package/build/browser/public/experimental.js.map +1 -1
  63. package/build/browser/styles.css +144 -35
  64. package/build/cjs/{chunk-GT6IV6LV.cjs → chunk-MRRRZN44.cjs} +6 -4
  65. package/build/cjs/chunk-MRRRZN44.cjs.map +1 -0
  66. package/build/cjs/public/experimental.cjs +1981 -1314
  67. package/build/cjs/public/experimental.cjs.map +1 -1
  68. package/build/cjs/public/experimental.css +82 -5
  69. package/build/cjs/public/experimental.css.map +1 -1
  70. package/build/cjs/public/experimental.d.cts +267 -26
  71. package/build/cjs/public/primitives.cjs +5 -5
  72. package/build/cjs/public/primitives.d.cts +3 -2
  73. package/build/esm/action-form/ActionForm.js +15 -11
  74. package/build/esm/action-form/ActionForm.js.map +1 -1
  75. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  76. package/build/esm/action-form/fields/{TextInputField.module.css → BaseInput.module.css} +2 -2
  77. package/build/esm/action-form/fields/CustomField.js +30 -0
  78. package/build/esm/action-form/fields/CustomField.js.map +1 -0
  79. package/build/esm/action-form/fields/FormFieldRenderer.js +26 -16
  80. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  81. package/build/esm/action-form/fields/RadioButtonsField.js +57 -0
  82. package/build/esm/action-form/fields/RadioButtonsField.js.map +1 -0
  83. package/build/esm/action-form/fields/RadioButtonsField.module.css +83 -0
  84. package/build/esm/action-form/fields/TextAreaField.js +50 -0
  85. package/build/esm/action-form/fields/TextAreaField.js.map +1 -0
  86. package/build/esm/action-form/fields/TextInputField.js +3 -3
  87. package/build/esm/action-form/fields/TextInputField.js.map +1 -1
  88. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +97 -10
  89. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  90. package/build/esm/base-components/dialog/Dialog.js +4 -2
  91. package/build/esm/base-components/dialog/Dialog.js.map +1 -1
  92. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  93. package/build/esm/object-table/hooks/useFunctionColumnsData.js +57 -192
  94. package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  95. package/build/esm/pdf-viewer/PdfViewer.js +49 -8
  96. package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
  97. package/build/esm/pdf-viewer/PdfViewerContext.js +108 -0
  98. package/build/esm/pdf-viewer/PdfViewerContext.js.map +1 -0
  99. package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js +85 -18
  100. package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -1
  101. package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.module.css +18 -0
  102. package/build/esm/pdf-viewer/components/PdfViewerContent.js +15 -3
  103. package/build/esm/pdf-viewer/components/PdfViewerContent.js.map +1 -1
  104. package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +1 -1
  105. package/build/esm/pdf-viewer/components/PdfViewerSidebar.module.css +1 -1
  106. package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.module.css +1 -1
  107. package/build/esm/pdf-viewer/components/PdfViewerToolbar.js +29 -2
  108. package/build/esm/pdf-viewer/components/PdfViewerToolbar.js.map +1 -1
  109. package/build/esm/pdf-viewer/components/PdfViewerToolbar.module.css +5 -0
  110. package/build/esm/pdf-viewer/constants.js +2 -1
  111. package/build/esm/pdf-viewer/constants.js.map +1 -1
  112. package/build/esm/pdf-viewer/hooks/usePdfAnnotationsByPage.js +30 -0
  113. package/build/esm/pdf-viewer/hooks/usePdfAnnotationsByPage.js.map +1 -0
  114. package/build/esm/pdf-viewer/hooks/usePdfFormFields.js +341 -0
  115. package/build/esm/pdf-viewer/hooks/usePdfFormFields.js.map +1 -0
  116. package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js +227 -0
  117. package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -0
  118. package/build/esm/pdf-viewer/hooks/usePdfViewer.js +16 -10
  119. package/build/esm/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
  120. package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
  121. package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
  122. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
  123. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
  124. package/build/esm/pdf-viewer/hooks/usePdfViewerState.js +3 -3
  125. package/build/esm/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
  126. package/build/esm/pdf-viewer/types.js.map +1 -1
  127. package/build/esm/public/experimental.js +5 -0
  128. package/build/esm/public/experimental.js.map +1 -1
  129. package/build/types/action-form/FormFieldApi.d.ts +11 -5
  130. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  131. package/build/types/action-form/fields/CustomField.d.ts +9 -0
  132. package/build/types/action-form/fields/CustomField.d.ts.map +1 -0
  133. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  134. package/build/types/action-form/fields/RadioButtonsField.d.ts +3 -0
  135. package/build/types/action-form/fields/RadioButtonsField.d.ts.map +1 -0
  136. package/build/types/action-form/fields/TextAreaField.d.ts +3 -0
  137. package/build/types/action-form/fields/TextAreaField.d.ts.map +1 -0
  138. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +7 -4
  139. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -1
  140. package/build/types/base-components/dialog/Dialog.d.ts +3 -2
  141. package/build/types/base-components/dialog/Dialog.d.ts.map +1 -1
  142. package/build/types/object-table/ObjectTableApi.d.ts +4 -3
  143. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  144. package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -1
  145. package/build/types/pdf-viewer/PdfViewer.d.ts +2 -2
  146. package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
  147. package/build/types/pdf-viewer/PdfViewerContext.d.ts +64 -0
  148. package/build/types/pdf-viewer/PdfViewerContext.d.ts.map +1 -0
  149. package/build/types/pdf-viewer/components/PdfViewerAnnotationLayer.d.ts.map +1 -1
  150. package/build/types/pdf-viewer/components/PdfViewerContent.d.ts +8 -4
  151. package/build/types/pdf-viewer/components/PdfViewerContent.d.ts.map +1 -1
  152. package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts +6 -1
  153. package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts.map +1 -1
  154. package/build/types/pdf-viewer/constants.d.ts +1 -1
  155. package/build/types/pdf-viewer/constants.d.ts.map +1 -1
  156. package/build/types/pdf-viewer/hooks/usePdfAnnotationsByPage.d.ts +5 -0
  157. package/build/types/pdf-viewer/hooks/usePdfAnnotationsByPage.d.ts.map +1 -0
  158. package/build/types/pdf-viewer/hooks/usePdfFormFields.d.ts +24 -0
  159. package/build/types/pdf-viewer/hooks/usePdfFormFields.d.ts.map +1 -0
  160. package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts +36 -0
  161. package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts.map +1 -0
  162. package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts.map +1 -1
  163. package/build/types/pdf-viewer/types.d.ts +137 -13
  164. package/build/types/pdf-viewer/types.d.ts.map +1 -1
  165. package/build/types/public/experimental.d.ts +6 -1
  166. package/build/types/public/experimental.d.ts.map +1 -1
  167. package/package.json +6 -6
  168. package/build/browser/action-form/fields/TextInputField.module.css.js +0 -6
  169. package/build/browser/action-form/utils/getDefaultFieldComponent.js +0 -56
  170. package/build/browser/action-form/utils/getDefaultFieldComponent.js.map +0 -1
  171. package/build/cjs/chunk-GT6IV6LV.cjs.map +0 -1
  172. package/build/esm/action-form/utils/getDefaultFieldComponent.js +0 -56
  173. package/build/esm/action-form/utils/getDefaultFieldComponent.js.map +0 -1
  174. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts +0 -6
  175. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- .osdkTextInput {
17
+ .osdkBaseInput {
18
18
  display: block;
19
19
  width: 100%;
20
20
  min-height: var(--osdk-input-min-height);
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React, { memo } from "react";
18
+ /**
19
+ * Renders a user-provided custom field. Delegates all rendering to the
20
+ * `customRenderer` callback, passing through the standard form field props
21
+ * (value, onChange, id) so the custom implementation can participate in
22
+ * form state management.
23
+ */
24
+ export const CustomField = /*#__PURE__*/memo(function ({
25
+ customRenderer: CustomRenderer,
26
+ ...baseProps
27
+ }) {
28
+ return /*#__PURE__*/React.createElement(CustomRenderer, baseProps);
29
+ });
30
+ //# sourceMappingURL=CustomField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomField.js","names":["React","memo","CustomField","customRenderer","CustomRenderer","baseProps","createElement"],"sources":["CustomField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport type { CustomFieldProps } from \"../FormFieldApi.js\";\n\n/**\n * Renders a user-provided custom field. Delegates all rendering to the\n * `customRenderer` callback, passing through the standard form field props\n * (value, onChange, id) so the custom implementation can participate in\n * form state management.\n */\nexport const CustomField: React.FC<CustomFieldProps<unknown>> = memo(\n function CustomFieldFn({ customRenderer: CustomRenderer, ...baseProps }) {\n return <CustomRenderer {...baseProps} />;\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAGnC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAgD,gBAAGD,IAAI,CAClE,UAAuB;EAAEE,cAAc,EAAEC,cAAc;EAAE,GAAGC;AAAU,CAAC,EAAE;EACvE,oBAAOL,KAAA,CAAAM,aAAA,CAACF,cAAc,EAAKC,SAAY,CAAC;AAC1C,CACF,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  /*
3
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -17,10 +17,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
17
17
 
18
18
  import React, { memo } from "react";
19
19
  import { FormField } from "../FormField.js";
20
+ import { CustomField } from "./CustomField.js";
20
21
  import { DatetimePickerField } from "./DatetimePickerField.js";
21
22
  import { DropdownField } from "./DropdownField.js";
23
+ import { RadioButtonsField } from "./RadioButtonsField.js";
24
+ import { TextAreaField } from "./TextAreaField.js";
22
25
  import { TextInputField } from "./TextInputField.js";
23
- const EMPTY_ITEMS = [];
24
26
  export const FormFieldRenderer = /*#__PURE__*/memo(function ({
25
27
  fieldDefinition,
26
28
  value,
@@ -42,28 +44,26 @@ export const FormFieldRenderer = /*#__PURE__*/memo(function ({
42
44
  function renderFieldComponent(fieldDefinition, value, onChange) {
43
45
  switch (fieldDefinition.fieldComponent) {
44
46
  case "TEXT_INPUT":
45
- // TODO: Render a <textarea> for TEXT_AREA instead of falling through
47
+ return /*#__PURE__*/React.createElement(TextInputField, _extends({
48
+ id: fieldDefinition.fieldKey,
49
+ value: value != null ? String(value) : "",
50
+ onChange: onChange,
51
+ placeholder: fieldDefinition.placeholder
52
+ }, fieldDefinition.fieldComponentProps));
46
53
  case "TEXT_AREA":
47
- return /*#__PURE__*/React.createElement(TextInputField, {
48
- id: fieldDefinition.fieldKey
49
- // TODO: Use coerceFieldValue
50
- ,
54
+ return /*#__PURE__*/React.createElement(TextAreaField, _extends({
55
+ id: fieldDefinition.fieldKey,
51
56
  value: value != null ? String(value) : "",
52
57
  onChange: onChange,
53
58
  placeholder: fieldDefinition.placeholder
54
- });
59
+ }, fieldDefinition.fieldComponentProps));
55
60
  case "DROPDOWN":
56
61
  {
57
- const {
58
- items = EMPTY_ITEMS,
59
- ...dropdownProps
60
- } = fieldDefinition.fieldComponentProps ?? {};
61
62
  return /*#__PURE__*/React.createElement(DropdownField, _extends({
62
63
  value: value,
63
64
  onChange: onChange,
64
- items: items,
65
65
  placeholder: fieldDefinition.placeholder
66
- }, dropdownProps));
66
+ }, fieldDefinition.fieldComponentProps));
67
67
  }
68
68
  case "DATETIME_PICKER":
69
69
  return /*#__PURE__*/React.createElement(DatetimePickerField, _extends({
@@ -74,11 +74,21 @@ function renderFieldComponent(fieldDefinition, value, onChange) {
74
74
  value: value instanceof Date ? value : null,
75
75
  onChange: onChange
76
76
  }, fieldDefinition.fieldComponentProps));
77
- case "NUMBER_INPUT":
78
77
  case "RADIO_BUTTONS":
78
+ return /*#__PURE__*/React.createElement(RadioButtonsField, _extends({
79
+ id: fieldDefinition.fieldKey,
80
+ value: value,
81
+ onChange: onChange
82
+ }, fieldDefinition.fieldComponentProps));
83
+ case "CUSTOM":
84
+ return /*#__PURE__*/React.createElement(CustomField, _extends({
85
+ id: fieldDefinition.fieldKey,
86
+ value: value,
87
+ onChange: onChange
88
+ }, fieldDefinition.fieldComponentProps));
89
+ case "NUMBER_INPUT":
79
90
  case "FILE_PICKER":
80
91
  case "OBJECT_SET":
81
- case "CUSTOM":
82
92
  return /*#__PURE__*/React.createElement("div", null, "Unsupported field type: ", fieldDefinition.fieldComponent);
83
93
  default:
84
94
  return assertUnreachableFieldComponent(fieldDefinition);
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldRenderer.js","names":["React","memo","FormField","DatetimePickerField","DropdownField","TextInputField","EMPTY_ITEMS","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","undefined","renderFieldComponent","onChange","fieldComponent","id","String","placeholder","items","dropdownProps","fieldComponentProps","_extends","Date","assertUnreachableFieldComponent","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport { FormField } from \"../FormField.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\nimport { DatetimePickerField } from \"./DatetimePickerField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nconst EMPTY_ITEMS: unknown[] = [];\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperTextPlacement !== \"tooltip\" ? helperText : undefined}\n >\n {renderFieldComponent(fieldDefinition, value, onFieldValueChange)}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"TEXT_INPUT\":\n // TODO: Render a <textarea> for TEXT_AREA instead of falling through\n case \"TEXT_AREA\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n // TODO: Use coerceFieldValue\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n />\n );\n case \"DROPDOWN\": {\n const { items = EMPTY_ITEMS, ...dropdownProps } =\n fieldDefinition.fieldComponentProps ?? {};\n return (\n <DropdownField\n value={value}\n onChange={onChange}\n items={items}\n placeholder={fieldDefinition.placeholder}\n {...dropdownProps}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatetimePickerField\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"NUMBER_INPUT\":\n case \"RADIO_BUTTONS\":\n case \"FILE_PICKER\":\n case \"OBJECT_SET\":\n case \"CUSTOM\":\n return <div>Unsupported field type: {fieldDefinition.fieldComponent}\n </div>;\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: ${String(value)}`);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAMC,WAAsB,GAAG,EAAE;AAQjC,OAAO,MAAMC,iBAAmD,gBAAGN,IAAI,CACrE,UAA6B;EAC3BO,eAAe;EACfC,KAAK;EACLC;AACsB,CAAC,EAAsB;EAC7C,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAoB,CAAC,GAC1DN,eAAe;EAEjB,oBACER,KAAA,CAAAe,aAAA,CAACb,SAAS;IACRS,KAAK,EAAEA,KAAM;IACbC,UAAU,EAAEA,UAAW;IACvBI,QAAQ,EAAER,eAAe,CAACQ,QAAS;IACnCH,UAAU,EAAEC,mBAAmB,KAAK,SAAS,GAAGD,UAAU,GAAGI;EAAU,GAEtEC,oBAAoB,CAACV,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A,cAAK,0BAAwB,EAACP,eAAe,CAACY,cAChD,CAAC;IACR;MACE,OAAOS,+BAA+B,CAACrB,eAAe,CAAC;EAC3D;AACF;AAEA,SAASqB,+BAA+BA,CAACpB,KAAY,EAAS;EAC5D,MAAM,IAAIqB,KAAK,CAAC,8BAA8BR,MAAM,CAACb,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldRenderer.js","names":["React","memo","FormField","CustomField","DatetimePickerField","DropdownField","RadioButtonsField","TextAreaField","TextInputField","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","undefined","renderFieldComponent","onChange","fieldComponent","_extends","id","String","placeholder","fieldComponentProps","Date","assertUnreachableFieldComponent","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport { FormField } from \"../FormField.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\nimport { CustomField } from \"./CustomField.js\";\nimport { DatetimePickerField } from \"./DatetimePickerField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { RadioButtonsField } from \"./RadioButtonsField.js\";\nimport { TextAreaField } from \"./TextAreaField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperTextPlacement !== \"tooltip\" ? helperText : undefined}\n >\n {renderFieldComponent(fieldDefinition, value, onFieldValueChange)}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"TEXT_INPUT\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"TEXT_AREA\":\n return (\n <TextAreaField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"DROPDOWN\": {\n return (\n <DropdownField\n value={value}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatetimePickerField\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"RADIO_BUTTONS\":\n return (\n <RadioButtonsField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"CUSTOM\":\n return (\n <CustomField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"NUMBER_INPUT\":\n case \"FILE_PICKER\":\n case \"OBJECT_SET\":\n return <div>Unsupported field type: {fieldDefinition.fieldComponent}\n </div>;\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: ${String(value)}`);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AAQpD,OAAO,MAAMC,iBAAmD,gBAAGR,IAAI,CACrE,UAA6B;EAC3BS,eAAe;EACfC,KAAK;EACLC;AACsB,CAAC,EAAsB;EAC7C,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAoB,CAAC,GAC1DN,eAAe;EAEjB,oBACEV,KAAA,CAAAiB,aAAA,CAACf,SAAS;IACRW,KAAK,EAAEA,KAAM;IACbC,UAAU,EAAEA,UAAW;IACvBI,QAAQ,EAAER,eAAe,CAACQ,QAAS;IACnCH,UAAU,EAAEC,mBAAmB,KAAK,SAAS,GAAGD,UAAU,GAAGI;EAAU,GAEtEC,oBAAoB,CAACV,eAAe,EAAEC,KAAK,EAAEC,kBAAkB,CACvD,CAAC;AAEhB,CACF,CAAC;AAED,SAASQ,oBAAoBA,CAC3BV,eAAwC,EACxCC,KAAc,EACdU,QAAkC,EACd;EACpB,QAAQX,eAAe,CAACY,cAAc;IACpC,KAAK,YAAY;MACf,oBACEtB,KAAA,CAAAiB,aAAA,CAACT,cAAc,EAAAe,QAAA;QACbC,EAAE,EAAEd,eAAe,CAACQ,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CAACiB,mBAAmB,CACxC,CAAC;IAEN,KAAK,QAAQ;MACX,oBACE3B,KAAA,CAAAiB,aAAA,CAACd,WAAW,EAAAoB,QAAA;QACVC,EAAE,EAAEd,eAAe,CAACQ,QAAS;QAC7BP,KAAK,EAAEA,KAAM;QACbU,QAAQ,EAAEA;MAAS,GACfX,eAAe,CAACiB,mBAAmB,CACxC,CAAC;IAEN,KAAK,cAAc;IACnB,KAAK,aAAa;IAClB,KAAK,YAAY;MACf,oBAAO3B,KAAA,CAAAiB,aAAA,cAAK,0BAAwB,EAACP,eAAe,CAACY,cAChD,CAAC;IACR;MACE,OAAOO,+BAA+B,CAACnB,eAAe,CAAC;EAC3D;AACF;AAEA,SAASmB,+BAA+BA,CAAClB,KAAY,EAAS;EAC5D,MAAM,IAAImB,KAAK,CAAC,8BAA8BL,MAAM,CAACd,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
@@ -0,0 +1,57 @@
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 { Radio } from "@base-ui/react/radio";
18
+ import { RadioGroup } from "@base-ui/react/radio-group";
19
+ import React, { memo, useCallback, useMemo } from "react";
20
+ import { typedReactMemo } from "../../shared/typedMemo.js";
21
+ import styles from "./RadioButtonsField.module.css";
22
+ export const RadioButtonsField = typedReactMemo(function ({
23
+ id,
24
+ value,
25
+ onChange,
26
+ options
27
+ }) {
28
+ const selectedLabel = useMemo(() => value != null ? options.find(opt => opt.value === value)?.label : undefined, [options, value]);
29
+ const handleValueChange = useCallback(nextLabel => {
30
+ const match = options.find(opt => opt.label === nextLabel);
31
+ onChange?.(match?.value ?? null);
32
+ }, [options, onChange]);
33
+ return /*#__PURE__*/React.createElement(RadioGroup, {
34
+ id: id,
35
+ className: styles.osdkRadioGroup,
36
+ value: selectedLabel,
37
+ onValueChange: handleValueChange
38
+ }, options.map(option => /*#__PURE__*/React.createElement(RadioItem, {
39
+ key: option.label,
40
+ option: option
41
+ })));
42
+ });
43
+ const RadioItem = /*#__PURE__*/memo(function ({
44
+ option
45
+ }) {
46
+ return /*#__PURE__*/React.createElement("label", {
47
+ className: styles.osdkRadioItem
48
+ }, /*#__PURE__*/React.createElement(Radio.Root, {
49
+ value: option.label,
50
+ className: styles.osdkRadioRoot
51
+ }, /*#__PURE__*/React.createElement(Radio.Indicator, {
52
+ className: styles.osdkRadioIndicator
53
+ })), /*#__PURE__*/React.createElement("span", {
54
+ className: styles.osdkRadioLabel
55
+ }, option.label));
56
+ });
57
+ //# sourceMappingURL=RadioButtonsField.js.map
@@ -0,0 +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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KAAA,CAAAmB,aAAA,CAACrB,KAAK,CAACgC,SAAS;IAACV,SAAS,EAAEf,MAAM,CAAC0B;EAAmB,CAAE,CAC9C,CAAC,eACb/B,KAAA,CAAAmB,aAAA;IAAMC,SAAS,EAAEf,MAAM,CAAC2B;EAAe,GAAER,MAAM,CAACV,KAAY,CACvD,CAAC;AAEZ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,83 @@
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
+ .osdkRadioGroup {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: var(--osdk-radio-gap);
21
+ }
22
+
23
+ .osdkRadioItem {
24
+ display: flex;
25
+ align-items: center;
26
+ gap: var(--osdk-radio-item-gap);
27
+ }
28
+
29
+ .osdkRadioRoot {
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ width: var(--osdk-radio-size);
34
+ height: var(--osdk-radio-size);
35
+ border-radius: 50%;
36
+ border: var(--osdk-radio-border);
37
+ cursor: pointer;
38
+ flex-shrink: 0;
39
+
40
+ &[data-unchecked] {
41
+ background-color: var(--osdk-radio-bg);
42
+
43
+ &:hover {
44
+ background-color: var(--osdk-radio-bg-hover);
45
+ }
46
+ }
47
+
48
+ &[data-checked] {
49
+ background-color: var(--osdk-radio-bg-checked);
50
+
51
+ &:hover {
52
+ background-color: var(--osdk-radio-bg-checked-hover);
53
+ }
54
+
55
+ &:active {
56
+ background-color: var(--osdk-radio-bg-checked-active);
57
+ }
58
+ }
59
+
60
+ &:focus-visible {
61
+ outline: var(--osdk-focus-outline);
62
+ outline-offset: calc(-1 * var(--osdk-focus-visible-outline-offset));
63
+ }
64
+ }
65
+
66
+ .osdkRadioIndicator {
67
+ width: var(--osdk-radio-indicator-size);
68
+ height: var(--osdk-radio-indicator-size);
69
+ border-radius: 50%;
70
+ background-color: var(--osdk-radio-indicator-color);
71
+
72
+ &[data-unchecked] {
73
+ display: none;
74
+ }
75
+ }
76
+
77
+ .osdkRadioLabel {
78
+ font-family: var(--osdk-typography-font-family);
79
+ font-size: var(--osdk-typography-font-size-default);
80
+ line-height: var(--osdk-typography-line-height-default);
81
+ color: var(--osdk-typography-color-default);
82
+ cursor: pointer;
83
+ }
@@ -0,0 +1,50 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ /*
3
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ import { Input } from "@base-ui/react/input";
19
+ import React, { useCallback } from "react";
20
+ import styles from "./BaseInput.module.css";
21
+ const TEXTAREA_STYLE = {
22
+ resize: "vertical"
23
+ };
24
+ export function TextAreaField({
25
+ id,
26
+ value,
27
+ onChange,
28
+ placeholder,
29
+ rows,
30
+ wrap,
31
+ minLength,
32
+ maxLength
33
+ }) {
34
+ const renderTextarea = useCallback(props => /*#__PURE__*/React.createElement("textarea", _extends({}, props, {
35
+ rows: rows,
36
+ wrap: wrap,
37
+ style: TEXTAREA_STYLE
38
+ })), [rows, wrap]);
39
+ return /*#__PURE__*/React.createElement(Input, {
40
+ id: id,
41
+ className: styles.osdkBaseInput,
42
+ value: value ?? "",
43
+ onValueChange: onChange,
44
+ placeholder: placeholder,
45
+ minLength: minLength,
46
+ maxLength: maxLength,
47
+ render: renderTextarea
48
+ });
49
+ }
50
+ //# sourceMappingURL=TextAreaField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAreaField.js","names":["Input","React","useCallback","styles","TEXTAREA_STYLE","resize","TextAreaField","id","value","onChange","placeholder","rows","wrap","minLength","maxLength","renderTextarea","props","createElement","_extends","style","className","osdkBaseInput","onValueChange","render"],"sources":["TextAreaField.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 { Input } from \"@base-ui/react/input\";\nimport React, { useCallback } from \"react\";\nimport type { TextAreaFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./BaseInput.module.css\";\n\nconst TEXTAREA_STYLE: React.CSSProperties = { resize: \"vertical\" };\n\nexport function TextAreaField({\n id,\n value,\n onChange,\n placeholder,\n rows,\n wrap,\n minLength,\n maxLength,\n}: TextAreaFieldProps): React.ReactElement {\n const renderTextarea = useCallback(\n (props: React.ComponentPropsWithRef<\"textarea\">) => (\n <textarea {...props} rows={rows} wrap={wrap} style={TEXTAREA_STYLE} />\n ),\n [rows, wrap],\n );\n\n return (\n <Input\n id={id}\n className={styles.osdkBaseInput}\n value={value ?? \"\"}\n onValueChange={onChange}\n placeholder={placeholder}\n minLength={minLength}\n maxLength={maxLength}\n render={renderTextarea}\n />\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,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAE1C,OAAOC,MAAM,MAAM,wBAAwB;AAE3C,MAAMC,cAAmC,GAAG;EAAEC,MAAM,EAAE;AAAW,CAAC;AAElE,OAAO,SAASC,aAAaA,CAAC;EAC5BC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,IAAI;EACJC,IAAI;EACJC,SAAS;EACTC;AACkB,CAAC,EAAsB;EACzC,MAAMC,cAAc,GAAGb,WAAW,CAC/Bc,KAA8C,iBAC7Cf,KAAA,CAAAgB,aAAA,aAAAC,QAAA,KAAcF,KAAK;IAAEL,IAAI,EAAEA,IAAK;IAACC,IAAI,EAAEA,IAAK;IAACO,KAAK,EAAEf;EAAe,EAAE,CACtE,EACD,CAACO,IAAI,EAAEC,IAAI,CACb,CAAC;EAED,oBACEX,KAAA,CAAAgB,aAAA,CAACjB,KAAK;IACJO,EAAE,EAAEA,EAAG;IACPa,SAAS,EAAEjB,MAAM,CAACkB,aAAc;IAChCb,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBc,aAAa,EAAEb,QAAS;IACxBC,WAAW,EAAEA,WAAY;IACzBG,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA,SAAU;IACrBS,MAAM,EAAER;EAAe,CACxB,CAAC;AAEN","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { Input } from "@base-ui/react/input";
18
18
  import React from "react";
19
- import styles from "./TextInputField.module.css";
19
+ import styles from "./BaseInput.module.css";
20
20
  export function TextInputField({
21
21
  id,
22
22
  value,
@@ -27,7 +27,7 @@ export function TextInputField({
27
27
  }) {
28
28
  return /*#__PURE__*/React.createElement(Input, {
29
29
  id: id,
30
- className: styles.osdkTextInput,
30
+ className: styles.osdkBaseInput,
31
31
  type: "text",
32
32
  value: value ?? "",
33
33
  onValueChange: onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"TextInputField.js","names":["Input","React","styles","TextInputField","id","value","onChange","placeholder","minLength","maxLength","createElement","className","osdkTextInput","type","onValueChange"],"sources":["TextInputField.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Input } from \"@base-ui/react/input\";\nimport React from \"react\";\nimport type { TextInputFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./TextInputField.module.css\";\n\nexport function TextInputField({\n id,\n value,\n onChange,\n placeholder,\n minLength,\n maxLength,\n}: TextInputFieldProps & { id?: string }): React.ReactElement {\n return (\n <Input\n id={id}\n className={styles.osdkTextInput}\n type=\"text\"\n value={value ?? \"\"}\n onValueChange={onChange}\n placeholder={placeholder}\n minLength={minLength}\n maxLength={maxLength}\n />\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,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,MAAM,MAAM,6BAA6B;AAEhD,OAAO,SAASC,cAAcA,CAAC;EAC7BC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,SAAS;EACTC;AACqC,CAAC,EAAsB;EAC5D,oBACER,KAAA,CAAAS,aAAA,CAACV,KAAK;IACJI,EAAE,EAAEA,EAAG;IACPO,SAAS,EAAET,MAAM,CAACU,aAAc;IAChCC,IAAI,EAAC,MAAM;IACXR,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBS,aAAa,EAAER,QAAS;IACxBC,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN","ignoreList":[]}
1
+ {"version":3,"file":"TextInputField.js","names":["Input","React","styles","TextInputField","id","value","onChange","placeholder","minLength","maxLength","createElement","className","osdkBaseInput","type","onValueChange"],"sources":["TextInputField.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 { Input } from \"@base-ui/react/input\";\nimport React from \"react\";\nimport type { TextInputFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./BaseInput.module.css\";\n\nexport function TextInputField({\n id,\n value,\n onChange,\n placeholder,\n minLength,\n maxLength,\n}: TextInputFieldProps & { id?: string }): React.ReactElement {\n return (\n <Input\n id={id}\n className={styles.osdkBaseInput}\n type=\"text\"\n value={value ?? \"\"}\n onValueChange={onChange}\n placeholder={placeholder}\n minLength={minLength}\n maxLength={maxLength}\n />\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,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,MAAM,MAAM,wBAAwB;AAE3C,OAAO,SAASC,cAAcA,CAAC;EAC7BC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,SAAS;EACTC;AACqC,CAAC,EAAsB;EAC5D,oBACER,KAAA,CAAAS,aAAA,CAACV,KAAK;IACJI,EAAE,EAAEA,EAAG;IACPO,SAAS,EAAET,MAAM,CAACU,aAAc;IAChCC,IAAI,EAAC,MAAM;IACXR,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBS,aAAa,EAAER,QAAS;IACxBC,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN","ignoreList":[]}
@@ -14,20 +14,107 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { getDefaultFieldComponent } from "./getDefaultFieldComponent.js";
18
-
17
+ import { assertUnreachable } from "../../shared/assertUnreachable.js";
19
18
  /**
20
- * Derives default field definitions from fetched ActionMetadata.
19
+ * Derives default field definitions from ActionMetadata.
20
+ *
21
+ * Each parameter type maps to a concrete RendererFieldDefinition with the
22
+ * correct fieldComponent and default fieldComponentProps.
21
23
  */
22
24
  export function getDefaultFieldDefinitions(metadata) {
23
- return Object.entries(metadata.parameters).map(([key, param]) => ({
24
- // Object.entries erases key types; assertion bridges runtime string to FieldKey<Q>
25
+ return Object.entries(metadata.parameters).map(([key, param]) => buildFieldDefinition(key, param));
26
+ }
27
+ const EMPTY_ITEMS = [];
28
+
29
+ /**
30
+ * Maps a single action parameter to its default RendererFieldDefinition.
31
+ *
32
+ * Switches on the parameter's data type to select both the field component
33
+ * and its required default props.
34
+ */
35
+ function buildFieldDefinition(key, param) {
36
+ const base = {
25
37
  fieldKey: key,
26
38
  label: key,
27
- // getDefaultFieldComponent returns FieldComponent (full union); TS can't verify
28
- // it matches ValidFormFieldForPropertyType for a deferred generic Q
29
- fieldComponent: getDefaultFieldComponent(param.type),
30
- isRequired: !param.nullable
31
- }));
39
+ isRequired: !param.nullable,
40
+ fieldType: param.type
41
+ };
42
+ const paramType = param.type;
43
+ if (typeof paramType === "object") {
44
+ switch (paramType.type) {
45
+ case "objectSet":
46
+ return {
47
+ ...base,
48
+ fieldComponent: "OBJECT_SET",
49
+ fieldComponentProps: {}
50
+ };
51
+ case "object":
52
+ case "interface":
53
+ // TODO: provide correct items
54
+ return {
55
+ ...base,
56
+ fieldComponent: "DROPDOWN",
57
+ fieldComponentProps: {
58
+ items: EMPTY_ITEMS
59
+ }
60
+ };
61
+ case "struct":
62
+ return {
63
+ ...base,
64
+ fieldComponent: "TEXT_INPUT",
65
+ fieldComponentProps: {}
66
+ };
67
+ }
68
+ }
69
+ switch (paramType) {
70
+ case "string":
71
+ case "marking":
72
+ case "geohash":
73
+ case "geoshape":
74
+ case "objectType":
75
+ return {
76
+ ...base,
77
+ fieldComponent: "TEXT_INPUT",
78
+ fieldComponentProps: {}
79
+ };
80
+ case "boolean":
81
+ return {
82
+ ...base,
83
+ fieldComponent: "RADIO_BUTTONS",
84
+ fieldComponentProps: {
85
+ options: [{
86
+ label: "True",
87
+ value: true
88
+ }, {
89
+ label: "False",
90
+ value: false
91
+ }]
92
+ }
93
+ };
94
+ case "integer":
95
+ case "double":
96
+ case "long":
97
+ return {
98
+ ...base,
99
+ fieldComponent: "NUMBER_INPUT",
100
+ fieldComponentProps: {}
101
+ };
102
+ case "datetime":
103
+ case "timestamp":
104
+ return {
105
+ ...base,
106
+ fieldComponent: "DATETIME_PICKER",
107
+ fieldComponentProps: {}
108
+ };
109
+ case "attachment":
110
+ case "mediaReference":
111
+ return {
112
+ ...base,
113
+ fieldComponent: "FILE_PICKER",
114
+ fieldComponentProps: {}
115
+ };
116
+ default:
117
+ return assertUnreachable(paramType);
118
+ }
32
119
  }
33
120
  //# sourceMappingURL=getDefaultFieldDefinitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultFieldDefinitions.js","names":["getDefaultFieldComponent","getDefaultFieldDefinitions","metadata","Object","entries","parameters","map","key","param","fieldKey","label","fieldComponent","type","isRequired","nullable"],"sources":["getDefaultFieldDefinitions.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 { ActionDefinition, ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameters,\n FieldDescriptorType,\n FieldKey,\n FormFieldDefinition,\n ValidFormFieldForPropertyType,\n} from \"../FormFieldApi.js\";\nimport { getDefaultFieldComponent } from \"./getDefaultFieldComponent.js\";\n\n/**\n * Derives default field definitions from fetched ActionMetadata.\n */\nexport function getDefaultFieldDefinitions<\n Q extends ActionDefinition<unknown>,\n>(metadata: ActionMetadata): ReadonlyArray<FormFieldDefinition<Q>> {\n return Object.entries(metadata.parameters).map(([key, param]) => ({\n // Object.entries erases key types; assertion bridges runtime string to FieldKey<Q>\n fieldKey: key as FieldKey<Q>,\n label: key,\n // getDefaultFieldComponent returns FieldComponent (full union); TS can't verify\n // it matches ValidFormFieldForPropertyType for a deferred generic Q\n fieldComponent: getDefaultFieldComponent(\n param.type,\n ) as ValidFormFieldForPropertyType<\n FieldDescriptorType<Q, keyof ActionParameters<Q>>\n >,\n isRequired: !param.nullable,\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,wBAAwB,QAAQ,+BAA+B;;AAExE;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAExCC,QAAwB,EAAyC;EACjE,OAAOC,MAAM,CAACC,OAAO,CAACF,QAAQ,CAACG,UAAU,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,MAAM;IAChE;IACAC,QAAQ,EAAEF,GAAkB;IAC5BG,KAAK,EAAEH,GAAG;IACV;IACA;IACAI,cAAc,EAAEX,wBAAwB,CACtCQ,KAAK,CAACI,IACR,CAEC;IACDC,UAAU,EAAE,CAACL,KAAK,CAACM;EACrB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"getDefaultFieldDefinitions.js","names":["assertUnreachable","getDefaultFieldDefinitions","metadata","Object","entries","parameters","map","key","param","buildFieldDefinition","EMPTY_ITEMS","base","fieldKey","label","isRequired","nullable","fieldType","type","paramType","fieldComponent","fieldComponentProps","items","options","value"],"sources":["getDefaultFieldDefinitions.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 { ActionMetadata } from \"@osdk/api\";\nimport { assertUnreachable } from \"../../shared/assertUnreachable.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\n\n/**\n * Derives default field definitions from ActionMetadata.\n *\n * Each parameter type maps to a concrete RendererFieldDefinition with the\n * correct fieldComponent and default fieldComponentProps.\n */\nexport function getDefaultFieldDefinitions(\n metadata: ActionMetadata,\n): ReadonlyArray<RendererFieldDefinition> {\n return Object.entries(metadata.parameters).map(\n ([key, param]) => buildFieldDefinition(key, param),\n );\n}\n\nconst EMPTY_ITEMS: unknown[] = [];\n\n/**\n * Maps a single action parameter to its default RendererFieldDefinition.\n *\n * Switches on the parameter's data type to select both the field component\n * and its required default props.\n */\nfunction buildFieldDefinition(\n key: string,\n param: ActionMetadata.Parameter,\n): RendererFieldDefinition {\n const base = {\n fieldKey: key,\n label: key,\n isRequired: !param.nullable,\n fieldType: param.type,\n };\n\n const paramType = param.type;\n\n if (typeof paramType === \"object\") {\n switch (paramType.type) {\n case \"objectSet\":\n return {\n ...base,\n fieldComponent: \"OBJECT_SET\",\n fieldComponentProps: {},\n };\n case \"object\":\n case \"interface\":\n // TODO: provide correct items\n return {\n ...base,\n fieldComponent: \"DROPDOWN\",\n fieldComponentProps: { items: EMPTY_ITEMS },\n };\n case \"struct\":\n return {\n ...base,\n fieldComponent: \"TEXT_INPUT\",\n fieldComponentProps: {},\n };\n }\n }\n\n switch (paramType) {\n case \"string\":\n case \"marking\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectType\":\n return {\n ...base,\n fieldComponent: \"TEXT_INPUT\",\n fieldComponentProps: {},\n };\n case \"boolean\":\n return {\n ...base,\n fieldComponent: \"RADIO_BUTTONS\",\n fieldComponentProps: {\n options: [{ label: \"True\", value: true }, {\n label: \"False\",\n value: false,\n }],\n },\n };\n case \"integer\":\n case \"double\":\n case \"long\":\n return {\n ...base,\n fieldComponent: \"NUMBER_INPUT\",\n fieldComponentProps: {},\n };\n case \"datetime\":\n case \"timestamp\":\n return {\n ...base,\n fieldComponent: \"DATETIME_PICKER\",\n fieldComponentProps: {},\n };\n case \"attachment\":\n case \"mediaReference\":\n return {\n ...base,\n fieldComponent: \"FILE_PICKER\",\n fieldComponentProps: {},\n };\n default:\n return assertUnreachable(paramType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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GP,IAAI;QACPQ,cAAc,EAAE,YAAY;QAC5BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,SAAS;MACZ,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,eAAe;QAC/BC,mBAAmB,EAAE;UACnBE,OAAO,EAAE,CAAC;YAAET,KAAK,EAAE,MAAM;YAAEU,KAAK,EAAE;UAAK,CAAC,EAAE;YACxCV,KAAK,EAAE,OAAO;YACdU,KAAK,EAAE;UACT,CAAC;QACH;MACF,CAAC;IACH,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAO;QACL,GAAGZ,IAAI;QACPQ,cAAc,EAAE,cAAc;QAC9BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,UAAU;IACf,KAAK,WAAW;MACd,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,iBAAiB;QACjCC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,YAAY;IACjB,KAAK,gBAAgB;MACnB,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,aAAa;QAC7BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH;MACE,OAAOpB,iBAAiB,CAACkB,SAAS,CAAC;EACvC;AACF","ignoreList":[]}
@@ -25,11 +25,13 @@ export function Dialog({
25
25
  title,
26
26
  children,
27
27
  footer,
28
- className
28
+ className,
29
+ disablePointerDismissal
29
30
  }) {
30
31
  return /*#__PURE__*/React.createElement(BaseUIDialog.Root, {
31
32
  open: isOpen,
32
- onOpenChange: onOpenChange
33
+ onOpenChange: onOpenChange,
34
+ disablePointerDismissal: disablePointerDismissal
33
35
  }, /*#__PURE__*/React.createElement(BaseUIDialog.Portal, null, /*#__PURE__*/React.createElement(BaseUIDialog.Backdrop, {
34
36
  className: styles.backdrop
35
37
  }), /*#__PURE__*/React.createElement(BaseUIDialog.Popup, {
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","names":["Dialog","BaseUIDialog","Cross","classnames","React","styles","isOpen","onOpenChange","title","children","footer","className","createElement","Root","open","Portal","Backdrop","backdrop","Popup","popup","header","Title","Close","closeButton","closeIcon","body"],"sources":["Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dialog as BaseUIDialog } from \"@base-ui/react/dialog\";\nimport { Cross } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Dialog.module.css\";\n\nexport interface DialogProps {\n isOpen: boolean;\n onOpenChange: () => void;\n title: React.ReactNode;\n children: React.ReactNode;\n footer?: React.ReactNode;\n className?: string;\n}\n\nexport function Dialog({\n isOpen,\n onOpenChange,\n title,\n children,\n footer,\n className,\n}: DialogProps): React.ReactElement {\n return (\n <BaseUIDialog.Root open={isOpen} onOpenChange={onOpenChange}>\n <BaseUIDialog.Portal>\n <BaseUIDialog.Backdrop className={styles.backdrop} />\n <BaseUIDialog.Popup\n className={classnames(\n styles.popup,\n className,\n )}\n >\n <div className={styles.header}>\n <BaseUIDialog.Title className={styles.title}>\n {title}\n </BaseUIDialog.Title>\n <BaseUIDialog.Close\n className={styles.closeButton}\n aria-label=\"Close dialog\"\n >\n <Cross className={styles.closeIcon} />\n </BaseUIDialog.Close>\n </div>\n <div className={styles.body}>{children}</div>\n {footer != null && <div className={styles.footer}>{footer}</div>}\n </BaseUIDialog.Popup>\n </BaseUIDialog.Portal>\n </BaseUIDialog.Root>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;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AI,IAAI,iBAAIN,KAAA,CAAAQ,aAAA;IAAKD,SAAS,EAAEN,MAAM,CAACK;EAAO,GAAEA,MAAY,CAC7C,CACD,CACJ,CAAC;AAExB","ignoreList":[]}
1
+ {"version":3,"file":"Dialog.js","names":["Dialog","BaseUIDialog","Cross","classnames","React","styles","isOpen","onOpenChange","title","children","footer","className","disablePointerDismissal","createElement","Root","open","Portal","Backdrop","backdrop","Popup","popup","header","Title","Close","closeButton","closeIcon","body"],"sources":["Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dialog as BaseUIDialog } from \"@base-ui/react/dialog\";\nimport { Cross } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Dialog.module.css\";\n\nexport interface DialogProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n title: React.ReactNode;\n children: React.ReactNode;\n footer?: React.ReactNode;\n className?: string;\n disablePointerDismissal?: boolean;\n}\n\nexport function Dialog({\n isOpen,\n onOpenChange,\n title,\n children,\n footer,\n className,\n disablePointerDismissal,\n}: DialogProps): React.ReactElement {\n return (\n <BaseUIDialog.Root\n open={isOpen}\n onOpenChange={onOpenChange}\n disablePointerDismissal={disablePointerDismissal}\n >\n <BaseUIDialog.Portal>\n <BaseUIDialog.Backdrop className={styles.backdrop} />\n <BaseUIDialog.Popup\n className={classnames(\n styles.popup,\n className,\n )}\n >\n <div className={styles.header}>\n <BaseUIDialog.Title className={styles.title}>\n {title}\n </BaseUIDialog.Title>\n <BaseUIDialog.Close\n className={styles.closeButton}\n aria-label=\"Close dialog\"\n >\n <Cross className={styles.closeIcon} />\n </BaseUIDialog.Close>\n </div>\n <div className={styles.body}>{children}</div>\n {footer != null && <div className={styles.footer}>{footer}</div>}\n </BaseUIDialog.Popup>\n </BaseUIDialog.Portal>\n </BaseUIDialog.Root>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,IAAIC,YAAY,QAAQ,uBAAuB;AAC9D,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,qBAAqB;AAYxC,OAAO,SAASL,MAAMA,CAAC;EACrBM,MAAM;EACNC,YAAY;EACZC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC;AACW,CAAC,EAAsB;EAClC,oBACER,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACa,IAAI;IAChBC,IAAI,EAAET,MAAO;IACbC,YAAY,EAAEA,YAAa;IAC3BK,uBAAuB,EAAEA;EAAwB,gBAEjDR,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACe,MAAM,qBAClBZ,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACgB,QAAQ;IAACN,SAAS,EAAEN,MAAM,CAACa;EAAS,CAAE,CAAC,eACrDd,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACkB,KAAK;IACjBR,SAAS,EAAER,UAAU,CACnBE,MAAM,CAACe,KAAK,EACZT,SACF;EAAE,gBAEFP,KAAA,CAAAS,aAAA;IAAKF,SAAS,EAAEN,MAAM,CAACgB;EAAO,gBAC5BjB,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACqB,KAAK;IAACX,SAAS,EAAEN,MAAM,CAACG;EAAM,GACzCA,KACiB,CAAC,eACrBJ,KAAA,CAAAS,aAAA,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