@osdk/react-components 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +11 -0
  3. package/build/browser/action-form/ActionForm.js +19 -11
  4. package/build/browser/action-form/ActionForm.js.map +1 -1
  5. package/build/browser/action-form/ActionFormApi.js.map +1 -1
  6. package/build/browser/action-form/BaseForm.js +19 -13
  7. package/build/browser/action-form/BaseForm.js.map +1 -1
  8. package/build/browser/action-form/BaseForm.module.css +7 -7
  9. package/build/browser/action-form/FormField.js +5 -2
  10. package/build/browser/action-form/FormField.js.map +1 -1
  11. package/build/browser/action-form/FormField.module.css +6 -1
  12. package/build/browser/action-form/FormField.module.css.js +1 -0
  13. package/build/browser/action-form/FormFieldApi.js +7 -1
  14. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  15. package/build/browser/action-form/FormHeader.module.css +2 -2
  16. package/build/browser/action-form/fields/DateCalendar.js +41 -3
  17. package/build/browser/action-form/fields/DateCalendar.js.map +1 -1
  18. package/build/browser/action-form/fields/DateCalendar.module.css +59 -10
  19. package/build/browser/action-form/fields/DateCalendar.module.css.js +5 -1
  20. package/build/browser/action-form/fields/DateRangeCalendar.js +8 -5
  21. package/build/browser/action-form/fields/DateRangeCalendar.js.map +1 -1
  22. package/build/browser/action-form/fields/DateRangeInputField.js +76 -61
  23. package/build/browser/action-form/fields/DateRangeInputField.js.map +1 -1
  24. package/build/browser/action-form/fields/DateRangeInputField.module.css +0 -15
  25. package/build/browser/action-form/fields/DateRangeInputField.module.css.js +1 -2
  26. package/build/browser/action-form/fields/DatetimePickerField.js +74 -40
  27. package/build/browser/action-form/fields/DatetimePickerField.js.map +1 -1
  28. package/build/browser/action-form/fields/DatetimePickerField.module.css +2 -9
  29. package/build/browser/action-form/fields/FieldBridge.js +1 -1
  30. package/build/browser/action-form/fields/FieldBridge.js.map +1 -1
  31. package/build/browser/action-form/fields/FilePickerField.js +47 -39
  32. package/build/browser/action-form/fields/FilePickerField.js.map +1 -1
  33. package/build/browser/action-form/fields/FilePickerField.module.css +43 -31
  34. package/build/browser/action-form/fields/FilePickerField.module.css.js +2 -2
  35. package/build/browser/action-form/fields/FormFieldRenderer.js +9 -0
  36. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  37. package/build/browser/action-form/fields/RadioButtonsField.module.css +3 -3
  38. package/build/browser/action-form/fields/SwitchField.js +34 -0
  39. package/build/browser/action-form/fields/SwitchField.js.map +1 -0
  40. package/build/browser/action-form/fields/TimePicker.js +165 -26
  41. package/build/browser/action-form/fields/TimePicker.js.map +1 -1
  42. package/build/browser/action-form/fields/TimePicker.module.css +27 -2
  43. package/build/browser/action-form/fields/TimePicker.module.css.js +3 -1
  44. package/build/browser/action-form/fields/calendarShared.js +5 -0
  45. package/build/browser/action-form/fields/calendarShared.js.map +1 -1
  46. package/build/browser/action-form/fields/useDateEditState.js +3 -4
  47. package/build/browser/action-form/fields/useDateEditState.js.map +1 -1
  48. package/build/browser/base-components/action-button/ActionButton.js +2 -1
  49. package/build/browser/base-components/action-button/ActionButton.js.map +1 -1
  50. package/build/browser/base-components/action-button/ActionButton.module.css +19 -0
  51. package/build/browser/base-components/action-button/ActionButton.module.css.js +2 -1
  52. package/build/browser/base-components/combobox/Combobox.module.css +31 -3
  53. package/build/browser/base-components/select/Select.module.css +18 -0
  54. package/build/browser/base-components/switch/Switch.module.css +18 -6
  55. package/build/browser/filter-list/base/inputs/ListogramInput.js +34 -6
  56. package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
  57. package/build/browser/filter-list/base/inputs/ListogramInput.module.css +11 -5
  58. package/build/browser/filter-list/base/inputs/ListogramInput.module.css.js +1 -1
  59. package/build/browser/filter-list/base/inputs/MultiSelectInput.js +20 -12
  60. package/build/browser/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
  61. package/build/browser/filter-list/base/inputs/NoValueLabel.js +36 -0
  62. package/build/browser/filter-list/base/inputs/NoValueLabel.js.map +1 -0
  63. package/build/browser/filter-list/base/inputs/NoValueLabel.module.css +20 -0
  64. package/build/browser/filter-list/base/inputs/NoValueLabel.module.css.js +6 -0
  65. package/build/browser/filter-list/base/inputs/NullValueWrapper.js +4 -3
  66. package/build/browser/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
  67. package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css +10 -7
  68. package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css.js +1 -1
  69. package/build/browser/filter-list/base/inputs/SingleSelectInput.js +13 -8
  70. package/build/browser/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
  71. package/build/browser/filter-list/base/inputs/TextTagsInput.js +6 -2
  72. package/build/browser/filter-list/base/inputs/TextTagsInput.js.map +1 -1
  73. package/build/browser/filter-list/hooks/useFilterListState.js +7 -6
  74. package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
  75. package/build/browser/filter-list/hooks/useStableMapEntries.js +35 -0
  76. package/build/browser/filter-list/hooks/useStableMapEntries.js.map +1 -0
  77. package/build/browser/filter-list/utils/filterValues.js +13 -0
  78. package/build/browser/filter-list/utils/filterValues.js.map +1 -1
  79. package/build/browser/object-table/DefaultCellRenderer.js +12 -2
  80. package/build/browser/object-table/DefaultCellRenderer.js.map +1 -1
  81. package/build/browser/object-table/EditableCell.js +14 -4
  82. package/build/browser/object-table/EditableCell.js.map +1 -1
  83. package/build/browser/object-table/EditableCell.module.css +4 -0
  84. package/build/browser/object-table/EditableCell.module.css.js +1 -0
  85. package/build/browser/object-table/ObjectTable.js +3 -1
  86. package/build/browser/object-table/ObjectTable.js.map +1 -1
  87. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  88. package/build/browser/object-table/Table.js +8 -4
  89. package/build/browser/object-table/Table.js.map +1 -1
  90. package/build/browser/object-table/TableBody.js +4 -2
  91. package/build/browser/object-table/TableBody.js.map +1 -1
  92. package/build/browser/object-table/TableRow.js +12 -4
  93. package/build/browser/object-table/TableRow.js.map +1 -1
  94. package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
  95. package/build/browser/object-table/utils/editableUtils.js +39 -0
  96. package/build/browser/object-table/utils/editableUtils.js.map +1 -0
  97. package/build/browser/object-table/utils/shouldShowEditableCell.js +1 -1
  98. package/build/browser/object-table/utils/shouldShowEditableCell.js.map +1 -1
  99. package/build/browser/object-table/utils/types.js.map +1 -1
  100. package/build/browser/styles.css +331 -130
  101. package/build/browser/tokens/component-tokens/button.css +15 -0
  102. package/build/browser/tokens/component-tokens/combobox.css +9 -0
  103. package/build/browser/tokens/component-tokens/datetime-picker.css +2 -2
  104. package/build/browser/tokens/component-tokens/file-picker.css +0 -10
  105. package/build/browser/tokens/component-tokens/filter-list.css +9 -6
  106. package/build/browser/tokens/component-tokens/form-section.css +1 -1
  107. package/build/browser/tokens/component-tokens/form.css +9 -5
  108. package/build/browser/tokens/component-tokens/table.css +3 -5
  109. package/build/browser/tokens.css +1 -0
  110. package/build/browser/util/UserAgent.js +1 -1
  111. package/build/cjs/{DateCalendar-2W4QHEEI.css → DateCalendar-G7RC2FCG.css} +105 -8
  112. package/build/cjs/DateCalendar-G7RC2FCG.css.map +1 -0
  113. package/build/cjs/DateCalendar-RX7HP2XP.cjs +26 -0
  114. package/build/cjs/{DateCalendar-QGSYBWJB.cjs.map → DateCalendar-RX7HP2XP.cjs.map} +1 -1
  115. package/build/cjs/{DateRangeCalendar-M63S2LLG.css → DateRangeCalendar-JBVYJDBJ.css} +105 -8
  116. package/build/cjs/DateRangeCalendar-JBVYJDBJ.css.map +1 -0
  117. package/build/cjs/DateRangeCalendar-OHT4IUWQ.cjs +54 -0
  118. package/build/cjs/DateRangeCalendar-OHT4IUWQ.cjs.map +1 -0
  119. package/build/cjs/{chunk-T7I6O43T.cjs → chunk-6SPXSFPI.cjs} +237 -85
  120. package/build/cjs/chunk-6SPXSFPI.cjs.map +1 -0
  121. package/build/cjs/{chunk-SZXVBDSA.cjs → chunk-6UDBHYSO.cjs} +3 -3
  122. package/build/cjs/{chunk-SZXVBDSA.cjs.map → chunk-6UDBHYSO.cjs.map} +1 -1
  123. package/build/cjs/{chunk-YBDS5WQP.cjs → chunk-7H6WXQ35.cjs} +4 -4
  124. package/build/cjs/{chunk-YBDS5WQP.cjs.map → chunk-7H6WXQ35.cjs.map} +1 -1
  125. package/build/cjs/{chunk-VVJFMOZI.cjs → chunk-I3OSD6CF.cjs} +19 -45
  126. package/build/cjs/chunk-I3OSD6CF.cjs.map +1 -0
  127. package/build/cjs/chunk-MD4KDE44.cjs +41 -0
  128. package/build/cjs/chunk-MD4KDE44.cjs.map +1 -0
  129. package/build/cjs/{chunk-YPXTSEE7.cjs → chunk-MLFMSZJQ.cjs} +85 -38
  130. package/build/cjs/chunk-MLFMSZJQ.cjs.map +1 -0
  131. package/build/cjs/chunk-MQYOHGPY.cjs +52 -0
  132. package/build/cjs/chunk-MQYOHGPY.cjs.map +1 -0
  133. package/build/cjs/{chunk-BJDCC446.cjs → chunk-PTTCWNZZ.cjs} +417 -364
  134. package/build/cjs/chunk-PTTCWNZZ.cjs.map +1 -0
  135. package/build/cjs/{chunk-B2GRQRWU.cjs → chunk-TOJSJN3L.cjs} +44 -8
  136. package/build/cjs/chunk-TOJSJN3L.cjs.map +1 -0
  137. package/build/cjs/{chunk-JLESWL47.cjs → chunk-V7XWTJV7.cjs} +4 -2
  138. package/build/cjs/chunk-V7XWTJV7.cjs.map +1 -0
  139. package/build/cjs/{chunk-L5LPFCXT.cjs → chunk-W2IASYE4.cjs} +163 -125
  140. package/build/cjs/chunk-W2IASYE4.cjs.map +1 -0
  141. package/build/cjs/chunk-X337DNCW.cjs +45 -0
  142. package/build/cjs/chunk-X337DNCW.cjs.map +1 -0
  143. package/build/cjs/{chunk-SB2VTP67.cjs → chunk-Z7VHLTKD.cjs} +2 -64
  144. package/build/cjs/chunk-Z7VHLTKD.cjs.map +1 -0
  145. package/build/cjs/public/experimental/action-form.cjs +11 -9
  146. package/build/cjs/public/experimental/action-form.css +223 -68
  147. package/build/cjs/public/experimental/action-form.css.map +1 -1
  148. package/build/cjs/public/experimental/action-form.d.cts +83 -74
  149. package/build/cjs/public/experimental/filter-list.cjs +9 -8
  150. package/build/cjs/public/experimental/filter-list.css +38 -19
  151. package/build/cjs/public/experimental/filter-list.css.map +1 -1
  152. package/build/cjs/public/experimental/object-table.cjs +14 -12
  153. package/build/cjs/public/experimental/object-table.css +152 -59
  154. package/build/cjs/public/experimental/object-table.css.map +1 -1
  155. package/build/cjs/public/experimental/object-table.d.cts +39 -20
  156. package/build/cjs/public/experimental/pdf-viewer.cjs +24 -24
  157. package/build/cjs/public/experimental.cjs +46 -44
  158. package/build/cjs/public/experimental.css +242 -139
  159. package/build/cjs/public/experimental.css.map +1 -1
  160. package/build/cjs/public/primitives.cjs +8 -7
  161. package/build/cjs/public/primitives.css +15 -0
  162. package/build/cjs/public/primitives.css.map +1 -1
  163. package/build/cjs/public/primitives.d.cts +1 -0
  164. package/build/esm/action-form/ActionForm.js +19 -11
  165. package/build/esm/action-form/ActionForm.js.map +1 -1
  166. package/build/esm/action-form/ActionFormApi.js.map +1 -1
  167. package/build/esm/action-form/BaseForm.js +19 -13
  168. package/build/esm/action-form/BaseForm.js.map +1 -1
  169. package/build/esm/action-form/BaseForm.module.css +7 -7
  170. package/build/esm/action-form/FormField.js +5 -2
  171. package/build/esm/action-form/FormField.js.map +1 -1
  172. package/build/esm/action-form/FormField.module.css +6 -1
  173. package/build/esm/action-form/FormFieldApi.js +7 -1
  174. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  175. package/build/esm/action-form/FormHeader.module.css +2 -2
  176. package/build/esm/action-form/fields/DateCalendar.js +41 -3
  177. package/build/esm/action-form/fields/DateCalendar.js.map +1 -1
  178. package/build/esm/action-form/fields/DateCalendar.module.css +59 -10
  179. package/build/esm/action-form/fields/DateRangeCalendar.js +8 -5
  180. package/build/esm/action-form/fields/DateRangeCalendar.js.map +1 -1
  181. package/build/esm/action-form/fields/DateRangeInputField.js +76 -61
  182. package/build/esm/action-form/fields/DateRangeInputField.js.map +1 -1
  183. package/build/esm/action-form/fields/DateRangeInputField.module.css +0 -15
  184. package/build/esm/action-form/fields/DatetimePickerField.js +74 -40
  185. package/build/esm/action-form/fields/DatetimePickerField.js.map +1 -1
  186. package/build/esm/action-form/fields/DatetimePickerField.module.css +2 -9
  187. package/build/esm/action-form/fields/FieldBridge.js +1 -1
  188. package/build/esm/action-form/fields/FieldBridge.js.map +1 -1
  189. package/build/esm/action-form/fields/FilePickerField.js +47 -39
  190. package/build/esm/action-form/fields/FilePickerField.js.map +1 -1
  191. package/build/esm/action-form/fields/FilePickerField.module.css +43 -31
  192. package/build/esm/action-form/fields/FormFieldRenderer.js +9 -0
  193. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  194. package/build/esm/action-form/fields/RadioButtonsField.module.css +3 -3
  195. package/build/esm/action-form/fields/SwitchField.js +34 -0
  196. package/build/esm/action-form/fields/SwitchField.js.map +1 -0
  197. package/build/esm/action-form/fields/TimePicker.js +165 -26
  198. package/build/esm/action-form/fields/TimePicker.js.map +1 -1
  199. package/build/esm/action-form/fields/TimePicker.module.css +27 -2
  200. package/build/esm/action-form/fields/calendarShared.js +5 -0
  201. package/build/esm/action-form/fields/calendarShared.js.map +1 -1
  202. package/build/esm/action-form/fields/useDateEditState.js +3 -4
  203. package/build/esm/action-form/fields/useDateEditState.js.map +1 -1
  204. package/build/esm/base-components/action-button/ActionButton.js +2 -1
  205. package/build/esm/base-components/action-button/ActionButton.js.map +1 -1
  206. package/build/esm/base-components/action-button/ActionButton.module.css +19 -0
  207. package/build/esm/base-components/combobox/Combobox.module.css +31 -3
  208. package/build/esm/base-components/select/Select.module.css +18 -0
  209. package/build/esm/base-components/switch/Switch.module.css +18 -6
  210. package/build/esm/filter-list/base/inputs/ListogramInput.js +34 -6
  211. package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
  212. package/build/esm/filter-list/base/inputs/ListogramInput.module.css +11 -5
  213. package/build/esm/filter-list/base/inputs/MultiSelectInput.js +20 -12
  214. package/build/esm/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
  215. package/build/esm/filter-list/base/inputs/NoValueLabel.js +36 -0
  216. package/build/esm/filter-list/base/inputs/NoValueLabel.js.map +1 -0
  217. package/build/esm/filter-list/base/inputs/NoValueLabel.module.css +20 -0
  218. package/build/esm/filter-list/base/inputs/NullValueWrapper.js +4 -3
  219. package/build/esm/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
  220. package/build/esm/filter-list/base/inputs/NullValueWrapper.module.css +10 -7
  221. package/build/esm/filter-list/base/inputs/SingleSelectInput.js +13 -8
  222. package/build/esm/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
  223. package/build/esm/filter-list/base/inputs/TextTagsInput.js +6 -2
  224. package/build/esm/filter-list/base/inputs/TextTagsInput.js.map +1 -1
  225. package/build/esm/filter-list/hooks/useFilterListState.js +7 -6
  226. package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
  227. package/build/esm/filter-list/hooks/useStableMapEntries.js +35 -0
  228. package/build/esm/filter-list/hooks/useStableMapEntries.js.map +1 -0
  229. package/build/esm/filter-list/utils/filterValues.js +13 -0
  230. package/build/esm/filter-list/utils/filterValues.js.map +1 -1
  231. package/build/esm/object-table/DefaultCellRenderer.js +12 -2
  232. package/build/esm/object-table/DefaultCellRenderer.js.map +1 -1
  233. package/build/esm/object-table/EditableCell.js +14 -4
  234. package/build/esm/object-table/EditableCell.js.map +1 -1
  235. package/build/esm/object-table/EditableCell.module.css +4 -0
  236. package/build/esm/object-table/ObjectTable.js +3 -1
  237. package/build/esm/object-table/ObjectTable.js.map +1 -1
  238. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  239. package/build/esm/object-table/Table.js +8 -4
  240. package/build/esm/object-table/Table.js.map +1 -1
  241. package/build/esm/object-table/TableBody.js +4 -2
  242. package/build/esm/object-table/TableBody.js.map +1 -1
  243. package/build/esm/object-table/TableRow.js +12 -4
  244. package/build/esm/object-table/TableRow.js.map +1 -1
  245. package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
  246. package/build/esm/object-table/utils/editableUtils.js +39 -0
  247. package/build/esm/object-table/utils/editableUtils.js.map +1 -0
  248. package/build/esm/object-table/utils/shouldShowEditableCell.js +1 -1
  249. package/build/esm/object-table/utils/shouldShowEditableCell.js.map +1 -1
  250. package/build/esm/object-table/utils/types.js.map +1 -1
  251. package/build/esm/tokens/component-tokens/button.css +15 -0
  252. package/build/esm/tokens/component-tokens/combobox.css +9 -0
  253. package/build/esm/tokens/component-tokens/datetime-picker.css +2 -2
  254. package/build/esm/tokens/component-tokens/file-picker.css +0 -10
  255. package/build/esm/tokens/component-tokens/filter-list.css +9 -6
  256. package/build/esm/tokens/component-tokens/form-section.css +1 -1
  257. package/build/esm/tokens/component-tokens/form.css +9 -5
  258. package/build/esm/tokens/component-tokens/table.css +3 -5
  259. package/build/esm/tokens.css +1 -0
  260. package/build/esm/util/UserAgent.js +1 -1
  261. package/build/types/action-form/ActionFormApi.d.ts +8 -8
  262. package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
  263. package/build/types/action-form/BaseForm.d.ts.map +1 -1
  264. package/build/types/action-form/FormFieldApi.d.ts +29 -22
  265. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  266. package/build/types/action-form/fields/DateCalendar.d.ts +6 -1
  267. package/build/types/action-form/fields/DateCalendar.d.ts.map +1 -1
  268. package/build/types/action-form/fields/DateRangeCalendar.d.ts.map +1 -1
  269. package/build/types/action-form/fields/DateRangeInputField.d.ts.map +1 -1
  270. package/build/types/action-form/fields/DatetimePickerField.d.ts.map +1 -1
  271. package/build/types/action-form/fields/FieldBridge.d.ts.map +1 -1
  272. package/build/types/action-form/fields/FilePickerField.d.ts.map +1 -1
  273. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  274. package/build/types/action-form/fields/SwitchField.d.ts +7 -0
  275. package/build/types/action-form/fields/SwitchField.d.ts.map +1 -0
  276. package/build/types/action-form/fields/TimePicker.d.ts +4 -5
  277. package/build/types/action-form/fields/TimePicker.d.ts.map +1 -1
  278. package/build/types/action-form/fields/useDateEditState.d.ts +2 -2
  279. package/build/types/base-components/action-button/ActionButton.d.ts +1 -0
  280. package/build/types/base-components/action-button/ActionButton.d.ts.map +1 -1
  281. package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -1
  282. package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts.map +1 -1
  283. package/build/types/filter-list/base/inputs/NoValueLabel.d.ts +15 -0
  284. package/build/types/filter-list/base/inputs/NoValueLabel.d.ts.map +1 -0
  285. package/build/types/filter-list/base/inputs/NullValueWrapper.d.ts.map +1 -1
  286. package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts.map +1 -1
  287. package/build/types/filter-list/base/inputs/TextTagsInput.d.ts.map +1 -1
  288. package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -1
  289. package/build/types/filter-list/hooks/useStableMapEntries.d.ts +9 -0
  290. package/build/types/filter-list/hooks/useStableMapEntries.d.ts.map +1 -0
  291. package/build/types/filter-list/utils/filterValues.d.ts +7 -0
  292. package/build/types/filter-list/utils/filterValues.d.ts.map +1 -1
  293. package/build/types/object-table/DefaultCellRenderer.d.ts.map +1 -1
  294. package/build/types/object-table/EditableCell.d.ts +1 -1
  295. package/build/types/object-table/EditableCell.d.ts.map +1 -1
  296. package/build/types/object-table/ObjectTableApi.d.ts +26 -7
  297. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  298. package/build/types/object-table/Table.d.ts +9 -2
  299. package/build/types/object-table/Table.d.ts.map +1 -1
  300. package/build/types/object-table/TableBody.d.ts +2 -1
  301. package/build/types/object-table/TableBody.d.ts.map +1 -1
  302. package/build/types/object-table/TableRow.d.ts +2 -1
  303. package/build/types/object-table/TableRow.d.ts.map +1 -1
  304. package/build/types/object-table/utils/editableUtils.d.ts +16 -0
  305. package/build/types/object-table/utils/editableUtils.d.ts.map +1 -0
  306. package/build/types/object-table/utils/shouldShowEditableCell.d.ts +2 -1
  307. package/build/types/object-table/utils/shouldShowEditableCell.d.ts.map +1 -1
  308. package/build/types/object-table/utils/types.d.ts +4 -11
  309. package/build/types/object-table/utils/types.d.ts.map +1 -1
  310. package/docs/ActionForm.md +176 -0
  311. package/docs/CSSVariables.md +31 -30
  312. package/docs/ObjectTable.md +141 -16
  313. package/package.json +6 -5
  314. package/build/cjs/DateCalendar-2W4QHEEI.css.map +0 -1
  315. package/build/cjs/DateCalendar-QGSYBWJB.cjs +0 -24
  316. package/build/cjs/DateRangeCalendar-JHO2BF3Z.cjs +0 -48
  317. package/build/cjs/DateRangeCalendar-JHO2BF3Z.cjs.map +0 -1
  318. package/build/cjs/DateRangeCalendar-M63S2LLG.css.map +0 -1
  319. package/build/cjs/chunk-B2GRQRWU.cjs.map +0 -1
  320. package/build/cjs/chunk-BJDCC446.cjs.map +0 -1
  321. package/build/cjs/chunk-JLESWL47.cjs.map +0 -1
  322. package/build/cjs/chunk-L5LPFCXT.cjs.map +0 -1
  323. package/build/cjs/chunk-SB2VTP67.cjs.map +0 -1
  324. package/build/cjs/chunk-T7I6O43T.cjs.map +0 -1
  325. package/build/cjs/chunk-UCTQICPR.cjs +0 -10
  326. package/build/cjs/chunk-UCTQICPR.cjs.map +0 -1
  327. package/build/cjs/chunk-VVJFMOZI.cjs.map +0 -1
  328. package/build/cjs/chunk-YPXTSEE7.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldApi.js","names":["EMPTY_RANGE"],"sources":["FormFieldApi.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\nexport type PortalContainer =\n | HTMLElement\n | ShadowRoot\n | null\n | React.RefObject<HTMLElement | ShadowRoot | null>;\n\n/**\n * A form field definition specifies configuration for a single field\n */\nexport interface FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n */\n label: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field.\n * Accepts plain text or rich content (e.g. JSX with links or formatting).\n * Rendered as a tooltip icon next to the label by default, or below the\n * label when helperTextPlacement is \"bottom\".\n */\n helperText?: React.ReactNode;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n isDisabled?: boolean;\n\n /**\n * A callback to customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (value: FieldValueType<Q, K>) => Promise<string | undefined>;\n\n /**\n * The component props for the form field.\n * Excludes runtime props (value, onChange) which are managed by ActionForm.\n */\n fieldComponentProps: Omit<\n FormFieldPropsByType[\n ValidFormFieldForPropertyType<\n FieldDescriptorType<Q, K>\n >\n ],\n FormManagedProps<\n ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>\n >\n >;\n}\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangeInputFieldProps;\n DATETIME_PICKER: DatetimePickerFieldProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SELECT: ObjectSelectFieldProps<ObjectTypeDefinition>;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n}\n\n/**\n * Datetime picker field props.\n *\n * When `formatDate` is omitted, ISO-like format is used (YYYY-MM-DD / YYYY-MM-DD HH:mm).\n */\nexport interface DatetimePickerFieldProps extends BaseFormFieldProps<Date> {\n /**\n * The earliest date the user can select.\n * If provided, this will be added to the field validation.\n */\n min?: Date;\n\n /**\n * The latest date the user can select.\n * If provided, this will be added to the field validation.\n */\n max?: Date;\n\n /**\n * Whether to show time picker.\n */\n showTime?: boolean;\n\n /**\n * Whether to close the popover after selecting a date.\n * @default true when `showTime` is false, false when `showTime` is true\n */\n closeOnSelection?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Formats a Date for display in the input field when not editing.\n * When typing, the input shows the parsable format (YYYY-MM-DD or YYYY-MM-DD HH:mm).\n * Provide a matching `parseDate` if using a custom format.\n */\n formatDate?: (date: Date) => string;\n\n /**\n * Parses a user-typed string back into a Date.\n * Must be the inverse of `formatDate` — if `formatDate(d)` produces string `s`,\n * then `parseDate(s)` must return an equivalent Date.\n * When omitted, defaults to parsing \"YYYY-MM-DD\" (date-only) or \"YYYY-MM-DD HH:mm\" (with time).\n */\n parseDate?: (text: string) => Date | undefined;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the date picker portal. Use this when rendering\n * inside modal dialogs so popovers stay in the dialog's stacking and focus\n * context instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n}\n\n/**\n * A date range represented as a start/end tuple.\n * Either element may be `null` when the range is partially selected.\n */\nexport type DateRange = readonly [Date | null, Date | null];\n\n/** Default empty range — both bounds are null. */\nexport const EMPTY_RANGE: DateRange = [null, null];\n\n/**\n * Date range input field props.\n *\n * Renders two text inputs (start / end) with a shared calendar popover\n * that supports range selection.\n */\nexport interface DateRangeInputFieldProps\n extends BaseFormFieldProps<DateRange>\n{\n /** The earliest selectable date. */\n min?: Date;\n\n /** The latest selectable date. */\n max?: Date;\n\n /** Whether to show time pickers for both dates. */\n showTime?: boolean;\n\n /** Placeholder text for the start date input. */\n placeholderStart?: string;\n\n /** Placeholder text for the end date input. */\n placeholderEnd?: string;\n\n /** Whether to allow start and end on the same day. @default true */\n allowSingleDayRange?: boolean;\n\n /** Formats a Date for display. Defaults to \"YYYY-MM-DD\". */\n formatDate?: (date: Date) => string;\n\n /** Parses a user-typed string back into a Date. */\n parseDate?: (text: string) => Date | undefined;\n\n /**\n * Element that receives the date range picker portal. Use this when rendering\n * inside modal dialogs so popovers stay in the dialog's stacking and focus\n * context instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the dropdown portal. Use this when rendering inside\n * modal dialogs so popups stay in the dialog's stacking and focus context\n * instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n\n /**\n * Controlled search input value. Must be provided together with `onQueryChange`.\n */\n query?: string;\n\n /**\n * Callback when the search input value changes.\n * Can be used standalone as an event listener or together with `query`\n * for fully controlled search state.\n */\n onQueryChange?: (query: string) => void;\n\n /**\n * When true, disables the combobox's built-in client-side filtering.\n * Use when items are already filtered server-side (e.g. via `onQueryChange`).\n *\n * @default false\n */\n disableClientSideFiltering?: boolean;\n\n /**\n * Status message rendered below the search input and above the item list\n * inside the popup. Use for loading/error/empty messages.\n */\n popupStatus?: React.ReactNode;\n\n /**\n * A React node to render after the item list.\n * Use for infinite scroll sentinels, \"load more\" buttons, etc.\n */\n trailingItem?: React.ReactNode;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n\n /**\n * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\n}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n\n /**\n * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\n}\n\n/**\n * Object select field props for selecting object instances from the ontology.\n * Used for action parameters that accept a single object or multiple objects.\n *\n * Extends DropdownFieldProps with props that ObjectSelectField\n * manages internally (items, search, filtering) omitted from the public surface.\n */\nexport interface ObjectSelectFieldProps<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> extends\n Omit<\n DropdownFieldProps<Osdk.Instance<Q>>,\n | \"items\"\n | \"itemToStringLabel\"\n | \"itemToKey\"\n | \"isItemEqual\"\n | \"isSearchable\"\n | \"query\"\n | \"onQueryChange\"\n | \"disableClientSideFiltering\"\n | \"renderItemList\"\n >\n{\n /**\n * The object type definition to search within.\n */\n objectType: Q;\n}\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n *\n * TODO: Re-use `BaseType`\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATE_RANGE_INPUT\"\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"OBJECT_SELECT\"\n | \"OBJECT_SET\"\n | \"RADIO_BUTTONS\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\"\n : \"onChange\";\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label: string;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: Omit<FormFieldPropsByType[K], FormManagedProps<K>>;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n P extends { type: \"objectSet\" } ? \"OBJECT_SET\"\n : P extends { type: \"object\" } ? \"OBJECT_SELECT\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;;AAuFA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;;AA2DA;AACA;AACA;AACA;;AAGA;AACA,OAAO,MAAMA,WAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;;AAoCA;AACA;AACA;;AAwHA;AACA;AACA;;AAqCA;AACA;AACA;;AAyBA;AACA;AACA;;AAoBA;AACA;AACA;;AAMA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuBA;AACA;AACA;;AAkDA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;;AAMA;AACA;AACA;;AAcA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldApi.js","names":["EMPTY_RANGE"],"sources":["FormFieldApi.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\nexport type PortalContainer =\n | HTMLElement\n | ShadowRoot\n | null\n | React.RefObject<HTMLElement | ShadowRoot | null>;\n\n/**\n * A form field definition specifies configuration for a single field.\n * Implemented as a distributed mapped type so `fieldComponent` narrows\n * `fieldComponentProps` to the matching component prop type.\n */\nexport type FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> = K extends unknown ? {\n // Distribute over each field key so a field's key, value type, and allowed\n // components stay correlated when K is the default union of all keys.\n [C in ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]: {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n */\n label: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field.\n * Accepts plain text or rich content (e.g. JSX with links or formatting).\n * Rendered as a tooltip icon next to the label by default, or below the\n * label when helperTextPlacement is \"bottom\".\n */\n helperText?: React.ReactNode;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n isDisabled?: boolean;\n\n /**\n * A callback to customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (\n value: FieldValueType<Q, K>,\n ) => Promise<string | undefined>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: C;\n\n /**\n * The component props for the form field.\n * Excludes runtime props (value, onChange) which are managed by ActionForm.\n */\n fieldComponentProps: Omit<\n FormFieldPropsByType[C],\n FormManagedProps<C>\n >;\n };\n }[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]\n : never;\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangeInputFieldProps;\n DATETIME_PICKER: DatetimePickerFieldProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SELECT: ObjectSelectFieldProps<ObjectTypeDefinition>;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n SWITCH: SwitchFieldProps;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n}\n\n/**\n * Datetime picker field props.\n *\n * When `formatDate` is omitted, ISO-like format is used (YYYY-MM-DD / YYYY-MM-DD HH:mm).\n */\nexport interface DatetimePickerFieldProps extends BaseFormFieldProps<Date> {\n /**\n * The earliest date the user can select.\n * If provided, this will be added to the field validation.\n */\n min?: Date;\n\n /**\n * The latest date the user can select.\n * If provided, this will be added to the field validation.\n */\n max?: Date;\n\n /**\n * Whether to show time picker.\n */\n showTime?: boolean;\n\n /**\n * Whether to close the popover after selecting a date.\n * @default true when `showTime` is false, false when `showTime` is true\n */\n closeOnSelection?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Formats a Date for display in the input field when not editing.\n * When typing, the input shows the parsable format (YYYY-MM-DD or YYYY-MM-DD HH:mm).\n * Provide a matching `parseDate` if using a custom format.\n */\n formatDate?: (date: Date) => string;\n\n /**\n * Parses a user-typed string back into a Date.\n * Must be the inverse of `formatDate` — if `formatDate(d)` produces string `s`,\n * then `parseDate(s)` must return an equivalent Date.\n * When omitted, defaults to parsing \"YYYY-MM-DD\" (date-only) or \"YYYY-MM-DD HH:mm\" (with time).\n */\n parseDate?: (text: string) => Date | undefined;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the date picker portal. Use this when rendering\n * inside modal dialogs so popovers stay in the dialog's stacking and focus\n * context instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n}\n\n/**\n * A date range represented as a start/end tuple.\n * Either element may be `null` when the range is partially selected.\n */\nexport type DateRange = readonly [Date | null, Date | null];\n\n/** Default empty range — both bounds are null. */\nexport const EMPTY_RANGE: DateRange = [null, null];\n\n/**\n * Date range input field props.\n *\n * Renders two text inputs (start / end) with a shared calendar popover\n * that supports range selection.\n */\nexport interface DateRangeInputFieldProps\n extends BaseFormFieldProps<DateRange>\n{\n /** The earliest selectable date. */\n min?: Date;\n\n /** The latest selectable date. */\n max?: Date;\n\n /** Whether to show time pickers for both dates. */\n showTime?: boolean;\n\n /** Placeholder text for the start date input. */\n placeholderStart?: string;\n\n /** Placeholder text for the end date input. */\n placeholderEnd?: string;\n\n /** Whether to allow start and end on the same day. @default true */\n allowSingleDayRange?: boolean;\n\n /** Formats a Date for display. Defaults to \"YYYY-MM-DD\". */\n formatDate?: (date: Date) => string;\n\n /** Parses a user-typed string back into a Date. */\n parseDate?: (text: string) => Date | undefined;\n\n /**\n * Element that receives the date range picker portal. Use this when rendering\n * inside modal dialogs so popovers stay in the dialog's stacking and focus\n * context instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the dropdown portal. Use this when rendering inside\n * modal dialogs so popups stay in the dialog's stacking and focus context\n * instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n\n /**\n * Controlled search input value. Must be provided together with `onQueryChange`.\n */\n query?: string;\n\n /**\n * Callback when the search input value changes.\n * Can be used standalone as an event listener or together with `query`\n * for fully controlled search state.\n */\n onQueryChange?: (query: string) => void;\n\n /**\n * When true, disables the combobox's built-in client-side filtering.\n * Use when items are already filtered server-side (e.g. via `onQueryChange`).\n *\n * @default false\n */\n disableClientSideFiltering?: boolean;\n\n /**\n * Status message rendered below the search input and above the item list\n * inside the popup. Use for loading/error/empty messages.\n */\n popupStatus?: React.ReactNode;\n\n /**\n * A React node to render after the item list.\n * Use for infinite scroll sentinels, \"load more\" buttons, etc.\n */\n trailingItem?: React.ReactNode;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n\n /**\n * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\n}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n\n /**\n * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Switch field props for boolean values.\n */\nexport type SwitchFieldProps = BaseFormFieldProps<boolean>;\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\n}\n\n/**\n * Object select field props for selecting object instances from the ontology.\n * Used for action parameters that accept a single object or multiple objects.\n *\n * Extends DropdownFieldProps with props that ObjectSelectField\n * manages internally (items, search, filtering) omitted from the public surface.\n */\nexport interface ObjectSelectFieldProps<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> extends\n Omit<\n DropdownFieldProps<Osdk.Instance<Q>>,\n | \"items\"\n | \"itemToStringLabel\"\n | \"itemToKey\"\n | \"isItemEqual\"\n | \"isSearchable\"\n | \"query\"\n | \"onQueryChange\"\n | \"disableClientSideFiltering\"\n | \"renderItemList\"\n >\n{\n /**\n * The object type definition to search within.\n */\n objectType: Q;\n}\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n *\n * TODO: Re-use `BaseType`\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATE_RANGE_INPUT\"\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"OBJECT_SELECT\"\n | \"OBJECT_SET\"\n | \"RADIO_BUTTONS\"\n | \"SWITCH\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\"\n : \"onChange\";\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label: string;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: Omit<FormFieldPropsByType[K], FormManagedProps<K>>;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n | \"CUSTOM\"\n | (P extends { type: \"objectSet\" } ? \"OBJECT_SET\"\n : P extends { type: \"object\" } ? \"OBJECT_SELECT\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\" | \"SWITCH\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;;AAwFA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;;AA2DA;AACA;AACA;AACA;;AAGA;AACA,OAAO,MAAMA,WAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;;AAoCA;AACA;AACA;;AAwHA;AACA;AACA;;AAqCA;AACA;AACA;;AAyBA;AACA;AACA;;AAoBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuBA;AACA;AACA;;AAkDA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;;AAMA;AACA;AACA;;AAeA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA","ignoreList":[]}
@@ -17,8 +17,8 @@
17
17
  .osdkFormHeader {
18
18
  margin: 0;
19
19
  padding-block: var(--osdk-form-header-block-padding);
20
- padding-inline: var(--osdk-form-header-inline-padding);
21
- border-bottom: var(--osdk-surface-border-width) solid
20
+ padding-inline: var(--osdk-form-content-padding-inline);
21
+ border-block-end: var(--osdk-surface-border-width) solid
22
22
  var(--osdk-form-header-border-color);
23
23
  font-size: var(--osdk-form-header-font-size);
24
24
  font-weight: var(--osdk-form-header-font-weight);
@@ -16,8 +16,10 @@
16
16
 
17
17
  import { ChevronLeft, ChevronRight } from "@blueprintjs/icons";
18
18
  import classnames from "classnames";
19
- import React, { useMemo } from "react";
19
+ import React, { useCallback, useMemo } from "react";
20
20
  import { DayPicker } from "react-day-picker";
21
+ import { ActionButton } from "../../base-components/action-button/ActionButton.js";
22
+ import { isDateInRange } from "../../shared/dateUtils.js";
21
23
  import { buildDisabledMatchers, DEFAULT_FROM_YEAR, DEFAULT_TO_YEAR } from "./calendarShared.js";
22
24
  import styles from "./DateCalendar.module.css";
23
25
  export const CLASS_NAMES = {
@@ -63,22 +65,51 @@ export const CALENDAR_COMPONENTS = {
63
65
  export default function DateCalendar({
64
66
  dateSelected,
65
67
  onSelect,
68
+ onClear,
69
+ month,
70
+ onMonthChange,
66
71
  min,
67
72
  max,
68
- footer
73
+ footer,
74
+ todayButtonText = "Today",
75
+ clearButtonText = "Clear"
69
76
  }) {
70
77
  const disabled = useMemo(() => buildDisabledMatchers(min, max), [min, max]);
71
78
  const fromYear = min != null ? min.getFullYear() : DEFAULT_FROM_YEAR;
72
79
  const toYear = max != null ? max.getFullYear() : DEFAULT_TO_YEAR;
80
+ const today = getLocalToday();
81
+ const isTodaySelectable = isDateInRange(today, min, max);
82
+ const handleTodayClick = useCallback(() => {
83
+ if (!isTodaySelectable) {
84
+ return;
85
+ }
86
+ onSelect(getLocalToday());
87
+ }, [isTodaySelectable, onSelect]);
88
+ const calendarFooter = /*#__PURE__*/React.createElement(React.Fragment, null, footer != null && /*#__PURE__*/React.createElement("div", {
89
+ className: styles.calendarTimeFooter
90
+ }, footer), /*#__PURE__*/React.createElement("div", {
91
+ className: styles.calendarActionBar
92
+ }, /*#__PURE__*/React.createElement(ActionButton, {
93
+ type: "button",
94
+ appearance: "minimal",
95
+ disabled: !isTodaySelectable,
96
+ onClick: handleTodayClick
97
+ }, todayButtonText), onClear != null && /*#__PURE__*/React.createElement(ActionButton, {
98
+ type: "button",
99
+ appearance: "minimal",
100
+ onClick: onClear
101
+ }, clearButtonText)));
73
102
  return /*#__PURE__*/React.createElement(DayPicker, {
74
103
  mode: "single",
75
104
  selected: dateSelected,
76
105
  onSelect: onSelect,
106
+ month: month,
107
+ onMonthChange: onMonthChange,
77
108
  disabled: disabled,
78
109
  defaultMonth: dateSelected,
79
110
  classNames: CLASS_NAMES,
80
111
  components: CALENDAR_COMPONENTS,
81
- footer: footer
112
+ footer: calendarFooter
82
113
  // Render month/year as dropdown selects + prev/next arrows,
83
114
  // so users can jump directly to any month/year without paging.
84
115
  ,
@@ -91,4 +122,11 @@ export default function DateCalendar({
91
122
  fixedWeeks: true
92
123
  });
93
124
  }
125
+ function getLocalToday() {
126
+ const today = new Date();
127
+ // Date-only picker actions should match calendar-day selection, which emits
128
+ // local midnight rather than the current wall-clock time.
129
+ today.setHours(0, 0, 0, 0);
130
+ return today;
131
+ }
94
132
  //# sourceMappingURL=DateCalendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateCalendar.js","names":["ChevronLeft","ChevronRight","classnames","React","useMemo","DayPicker","buildDisabledMatchers","DEFAULT_FROM_YEAR","DEFAULT_TO_YEAR","styles","CLASS_NAMES","root","calendar","months","calendarMonths","table","calendarMonthGrid","head_cell","calendarWeekday","cell","calendarDay","day","calendarDayButton","day_selected","calendarSelected","day_today","calendarToday","day_outside","calendarOutside","day_disabled","calendarDisabled","day_hidden","calendarHidden","nav","calendarNav","nav_button_previous","calendarNavButton","calendarNavPrev","nav_button_next","calendarNavNext","caption","calendarMonthCaption","caption_label","calendarVhidden","caption_dropdowns","calendarCaptionDropdowns","dropdown","calendarDropdown","dropdown_month","dropdown_year","nav_icon","calendarChevron","vhidden","tfoot","calendarFooter","NAV_ICON_SIZE","IconLeft","createElement","size","IconRight","CALENDAR_COMPONENTS","DateCalendar","dateSelected","onSelect","min","max","footer","disabled","fromYear","getFullYear","toYear","mode","selected","defaultMonth","classNames","components","captionLayout","showOutsideDays","fixedWeeks"],"sources":["DateCalendar.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 { ChevronLeft, ChevronRight } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React, { useMemo } from \"react\";\nimport type { ClassNames } from \"react-day-picker\";\nimport { DayPicker } from \"react-day-picker\";\nimport {\n buildDisabledMatchers,\n DEFAULT_FROM_YEAR,\n DEFAULT_TO_YEAR,\n} from \"./calendarShared.js\";\nimport styles from \"./DateCalendar.module.css\";\n\nexport const CLASS_NAMES: ClassNames = {\n root: styles.calendar,\n months: styles.calendarMonths,\n table: styles.calendarMonthGrid,\n head_cell: styles.calendarWeekday,\n cell: styles.calendarDay,\n day: styles.calendarDayButton,\n day_selected: styles.calendarSelected,\n day_today: styles.calendarToday,\n day_outside: styles.calendarOutside,\n day_disabled: styles.calendarDisabled,\n day_hidden: styles.calendarHidden,\n nav: styles.calendarNav,\n nav_button_previous: classnames(\n styles.calendarNavButton,\n styles.calendarNavPrev,\n ),\n nav_button_next: classnames(styles.calendarNavButton, styles.calendarNavNext),\n caption: styles.calendarMonthCaption,\n caption_label: styles.calendarVhidden,\n caption_dropdowns: styles.calendarCaptionDropdowns,\n dropdown: styles.calendarDropdown,\n dropdown_month: styles.calendarDropdown,\n dropdown_year: styles.calendarDropdown,\n nav_icon: styles.calendarChevron,\n vhidden: styles.calendarVhidden,\n tfoot: styles.calendarFooter,\n};\n\nconst NAV_ICON_SIZE = 12;\n\nfunction IconLeft(): React.ReactElement {\n return <ChevronLeft size={NAV_ICON_SIZE} />;\n}\n\nfunction IconRight(): React.ReactElement {\n return <ChevronRight size={NAV_ICON_SIZE} />;\n}\n\nexport const CALENDAR_COMPONENTS: {\n IconLeft: () => React.ReactElement;\n IconRight: () => React.ReactElement;\n} = { IconLeft, IconRight };\n\nexport interface DateCalendarProps {\n dateSelected: Date | undefined;\n onSelect: (date: Date | undefined) => void;\n min?: Date;\n max?: Date;\n footer?: React.ReactNode;\n}\n\nexport default function DateCalendar({\n dateSelected,\n onSelect,\n min,\n max,\n footer,\n}: DateCalendarProps): React.ReactElement {\n const disabled = useMemo(() => buildDisabledMatchers(min, max), [min, max]);\n\n const fromYear = min != null ? min.getFullYear() : DEFAULT_FROM_YEAR;\n const toYear = max != null ? max.getFullYear() : DEFAULT_TO_YEAR;\n\n return (\n <DayPicker\n mode=\"single\"\n selected={dateSelected}\n onSelect={onSelect}\n disabled={disabled}\n defaultMonth={dateSelected}\n classNames={CLASS_NAMES}\n components={CALENDAR_COMPONENTS}\n footer={footer}\n // Render month/year as dropdown selects + prev/next arrows,\n // so users can jump directly to any month/year without paging.\n captionLayout=\"dropdown-buttons\"\n fromYear={fromYear}\n toYear={toYear}\n showOutsideDays={true}\n // Always render 6 rows so the calendar height doesn't jump between months.\n fixedWeeks={true}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,YAAY,QAAQ,oBAAoB;AAC9D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,eAAe,QACV,qBAAqB;AAC5B,OAAOC,MAAM,MAAM,2BAA2B;AAE9C,OAAO,MAAMC,WAAuB,GAAG;EACrCC,IAAI,EAAEF,MAAM,CAACG,QAAQ;EACrBC,MAAM,EAAEJ,MAAM,CAACK,cAAc;EAC7BC,KAAK,EAAEN,MAAM,CAACO,iBAAiB;EAC/BC,SAAS,EAAER,MAAM,CAACS,eAAe;EACjCC,IAAI,EAAEV,MAAM,CAACW,WAAW;EACxBC,GAAG,EAAEZ,MAAM,CAACa,iBAAiB;EAC7BC,YAAY,EAAEd,MAAM,CAACe,gBAAgB;EACrCC,SAAS,EAAEhB,MAAM,CAACiB,aAAa;EAC/BC,WAAW,EAAElB,MAAM,CAACmB,eAAe;EACnCC,YAAY,EAAEpB,MAAM,CAACqB,gBAAgB;EACrCC,UAAU,EAAEtB,MAAM,CAACuB,cAAc;EACjCC,GAAG,EAAExB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AI,IAAI,GAAGA,GAAG,CAACK,WAAW,CAAC,CAAC,GAAG9D,iBAAiB;EACpE,MAAM+D,MAAM,GAAGL,GAAG,IAAI,IAAI,GAAGA,GAAG,CAACI,WAAW,CAAC,CAAC,GAAG7D,eAAe;EAEhE,oBACEL,KAAA,CAAAsD,aAAA,CAACpD,SAAS;IACRkE,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAEV,YAAa;IACvBC,QAAQ,EAAEA,QAAS;IACnBI,QAAQ,EAAEA,QAAS;IACnBM,YAAY,EAAEX,YAAa;IAC3BY,UAAU,EAAEhE,WAAY;IACxBiE,UAAU,EAAEf,mBAAoB;IAChCM,MAAM,EAAEA;IACR;IACA;IAAA;IACAU,aAAa,EAAC,kBAAkB;IAChCR,QAAQ,EAAEA,QAAS;IACnBE,MAAM,EAAEA,MAAO;IACfO,eAAe,EAAE;IACjB;IAAA;IACAC,UAAU,EAAE;EAAK,CAClB,CAAC;AAEN","ignoreList":[]}
1
+ {"version":3,"file":"DateCalendar.js","names":["ChevronLeft","ChevronRight","classnames","React","useCallback","useMemo","DayPicker","ActionButton","isDateInRange","buildDisabledMatchers","DEFAULT_FROM_YEAR","DEFAULT_TO_YEAR","styles","CLASS_NAMES","root","calendar","months","calendarMonths","table","calendarMonthGrid","head_cell","calendarWeekday","cell","calendarDay","day","calendarDayButton","day_selected","calendarSelected","day_today","calendarToday","day_outside","calendarOutside","day_disabled","calendarDisabled","day_hidden","calendarHidden","nav","calendarNav","nav_button_previous","calendarNavButton","calendarNavPrev","nav_button_next","calendarNavNext","caption","calendarMonthCaption","caption_label","calendarVhidden","caption_dropdowns","calendarCaptionDropdowns","dropdown","calendarDropdown","dropdown_month","dropdown_year","nav_icon","calendarChevron","vhidden","tfoot","calendarFooter","NAV_ICON_SIZE","IconLeft","createElement","size","IconRight","CALENDAR_COMPONENTS","DateCalendar","dateSelected","onSelect","onClear","month","onMonthChange","min","max","footer","todayButtonText","clearButtonText","disabled","fromYear","getFullYear","toYear","today","getLocalToday","isTodaySelectable","handleTodayClick","Fragment","className","calendarTimeFooter","calendarActionBar","type","appearance","onClick","mode","selected","defaultMonth","classNames","components","captionLayout","showOutsideDays","fixedWeeks","Date","setHours"],"sources":["DateCalendar.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 { ChevronLeft, ChevronRight } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React, { useCallback, useMemo } from \"react\";\nimport type { ClassNames } from \"react-day-picker\";\nimport { DayPicker } from \"react-day-picker\";\nimport { ActionButton } from \"../../base-components/action-button/ActionButton.js\";\nimport { isDateInRange } from \"../../shared/dateUtils.js\";\nimport {\n buildDisabledMatchers,\n DEFAULT_FROM_YEAR,\n DEFAULT_TO_YEAR,\n} from \"./calendarShared.js\";\nimport styles from \"./DateCalendar.module.css\";\n\nexport const CLASS_NAMES: ClassNames = {\n root: styles.calendar,\n months: styles.calendarMonths,\n table: styles.calendarMonthGrid,\n head_cell: styles.calendarWeekday,\n cell: styles.calendarDay,\n day: styles.calendarDayButton,\n day_selected: styles.calendarSelected,\n day_today: styles.calendarToday,\n day_outside: styles.calendarOutside,\n day_disabled: styles.calendarDisabled,\n day_hidden: styles.calendarHidden,\n nav: styles.calendarNav,\n nav_button_previous: classnames(\n styles.calendarNavButton,\n styles.calendarNavPrev,\n ),\n nav_button_next: classnames(styles.calendarNavButton, styles.calendarNavNext),\n caption: styles.calendarMonthCaption,\n caption_label: styles.calendarVhidden,\n caption_dropdowns: styles.calendarCaptionDropdowns,\n dropdown: styles.calendarDropdown,\n dropdown_month: styles.calendarDropdown,\n dropdown_year: styles.calendarDropdown,\n nav_icon: styles.calendarChevron,\n vhidden: styles.calendarVhidden,\n tfoot: styles.calendarFooter,\n};\n\nconst NAV_ICON_SIZE = 12;\n\nfunction IconLeft(): React.ReactElement {\n return <ChevronLeft size={NAV_ICON_SIZE} />;\n}\n\nfunction IconRight(): React.ReactElement {\n return <ChevronRight size={NAV_ICON_SIZE} />;\n}\n\nexport const CALENDAR_COMPONENTS: {\n IconLeft: () => React.ReactElement;\n IconRight: () => React.ReactElement;\n} = { IconLeft, IconRight };\n\nexport interface DateCalendarProps {\n dateSelected: Date | undefined;\n onSelect: (date: Date | undefined) => void;\n onClear?: () => void;\n month?: Date;\n onMonthChange?: (month: Date) => void;\n min?: Date;\n max?: Date;\n footer?: React.ReactNode;\n todayButtonText?: string;\n clearButtonText?: string;\n}\n\nexport default function DateCalendar({\n dateSelected,\n onSelect,\n onClear,\n month,\n onMonthChange,\n min,\n max,\n footer,\n todayButtonText = \"Today\",\n clearButtonText = \"Clear\",\n}: DateCalendarProps): React.ReactElement {\n const disabled = useMemo(() => buildDisabledMatchers(min, max), [min, max]);\n\n const fromYear = min != null ? min.getFullYear() : DEFAULT_FROM_YEAR;\n const toYear = max != null ? max.getFullYear() : DEFAULT_TO_YEAR;\n const today = getLocalToday();\n const isTodaySelectable = isDateInRange(today, min, max);\n const handleTodayClick = useCallback(() => {\n if (!isTodaySelectable) {\n return;\n }\n onSelect(getLocalToday());\n }, [isTodaySelectable, onSelect]);\n\n const calendarFooter = (\n <>\n {footer != null && (\n <div className={styles.calendarTimeFooter}>{footer}</div>\n )}\n <div className={styles.calendarActionBar}>\n <ActionButton\n type=\"button\"\n appearance=\"minimal\"\n disabled={!isTodaySelectable}\n onClick={handleTodayClick}\n >\n {todayButtonText}\n </ActionButton>\n {onClear != null && (\n <ActionButton\n type=\"button\"\n appearance=\"minimal\"\n onClick={onClear}\n >\n {clearButtonText}\n </ActionButton>\n )}\n </div>\n </>\n );\n\n return (\n <DayPicker\n mode=\"single\"\n selected={dateSelected}\n onSelect={onSelect}\n month={month}\n onMonthChange={onMonthChange}\n disabled={disabled}\n defaultMonth={dateSelected}\n classNames={CLASS_NAMES}\n components={CALENDAR_COMPONENTS}\n footer={calendarFooter}\n // Render month/year as dropdown selects + prev/next arrows,\n // so users can jump directly to any month/year without paging.\n captionLayout=\"dropdown-buttons\"\n fromYear={fromYear}\n toYear={toYear}\n showOutsideDays={true}\n // Always render 6 rows so the calendar height doesn't jump between months.\n fixedWeeks={true}\n />\n );\n}\n\nfunction getLocalToday(): Date {\n const today = new Date();\n // Date-only picker actions should match calendar-day selection, which emits\n // local midnight rather than the current wall-clock time.\n today.setHours(0, 0, 0, 0);\n return today;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,YAAY,QAAQ,oBAAoB;AAC9D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAEnD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,YAAY,QAAQ,qDAAqD;AAClF,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,eAAe,QACV,qBAAqB;AAC5B,OAAOC,MAAM,MAAM,2BAA2B;AAE9C,OAAO,MAAMC,WAAuB,GAAG;EACrCC,IAAI,EAAEF,MAAM,CAACG,QAAQ;EACrBC,MAAM,EAAEJ,MAAM,CAACK,cAAc;EAC7BC,KAAK,EAAEN,MAAM,CAACO,iBAAiB;EAC/BC,SAAS,EAAER,MAAM,CAACS,eAAe;EACjCC,IAAI,EAAEV,MAAM,CAACW,WAAW;EACxBC,GAAG,EAAEZ,MAAM,CAACa,iBAAiB;EAC7BC,YAAY,EAAEd,MAAM,CAACe,gBAAgB;EACrCC,SAAS,EAAEhB,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,CAACrD,YAAY;IACXgF,IAAI,EAAC,QAAQ;IACbC,UAAU,EAAC,SAAS;IACpBC,OAAO,EAAEtB;EAAQ,GAEhBO,eACW,CAEb,CACL,CACH;EAED,oBACEvE,KAAA,CAAAyD,aAAA,CAACtD,SAAS;IACRoF,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAE1B,YAAa;IACvBC,QAAQ,EAAEA,QAAS;IACnBE,KAAK,EAAEA,KAAM;IACbC,aAAa,EAAEA,aAAc;IAC7BM,QAAQ,EAAEA,QAAS;IACnBiB,YAAY,EAAE3B,YAAa;IAC3B4B,UAAU,EAAEhF,WAAY;IACxBiF,UAAU,EAAE/B,mBAAoB;IAChCS,MAAM,EAAEf;IACR;IACA;IAAA;IACAsC,aAAa,EAAC,kBAAkB;IAChCnB,QAAQ,EAAEA,QAAS;IACnBE,MAAM,EAAEA,MAAO;IACfkB,eAAe,EAAE;IACjB;IAAA;IACAC,UAAU,EAAE;EAAK,CAClB,CAAC;AAEN;AAEA,SAASjB,aAAaA,CAAA,EAAS;EAC7B,MAAMD,KAAK,GAAG,IAAImB,IAAI,CAAC,CAAC;EACxB;EACA;EACAnB,KAAK,CAACoB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EAC1B,OAAOpB,KAAK;AACd","ignoreList":[]}
@@ -28,6 +28,7 @@
28
28
  }
29
29
 
30
30
  .calendarDay {
31
+ position: relative;
31
32
  padding: var(--osdk-datetime-calendar-gap);
32
33
  text-align: center;
33
34
  }
@@ -112,18 +113,46 @@
112
113
  }
113
114
  }
114
115
 
116
+ /* Day buttons are inset by cell padding; paint the range on the table cell too
117
+ so the range spans horizontal gaps while staying the same height as a day. */
118
+ .calendarDay:has(.calendarRangeStart)::before,
119
+ .calendarDay:has(.calendarRangeMiddle)::before,
120
+ .calendarDay:has(.calendarRangeEnd)::before {
121
+ content: "";
122
+ position: absolute;
123
+ inset-block: var(--osdk-datetime-calendar-gap);
124
+ background: var(--osdk-datetime-calendar-range-middle-bg);
125
+ pointer-events: none;
126
+ }
127
+
128
+ .calendarDay:has(.calendarRangeStart)::before {
129
+ inset-inline-start: 50%;
130
+ inset-inline-end: 0;
131
+ }
115
132
 
116
- /* Range-middle needs .calendarDayButton prefix to match specificity of
117
- .calendarDayButton.calendarSelected (rdp applies both to range-middle days). */
133
+ .calendarDay:has(.calendarRangeMiddle)::before {
134
+ inset-inline: 0;
135
+ }
136
+
137
+ .calendarDay:has(.calendarRangeEnd)::before {
138
+ inset-inline-start: 0;
139
+ inset-inline-end: 50%;
140
+ }
141
+
142
+ .calendarDay:has(.calendarRangeStart.calendarRangeEnd)::before {
143
+ content: none;
144
+ }
145
+
146
+ /* The table cell owns the translucent range fill. Keeping the middle button
147
+ transparent avoids alpha-stacking the same token over itself. */
118
148
  .calendarDayButton.calendarRangeMiddle {
119
- background: var(--osdk-datetime-calendar-range-middle-bg);
149
+ background: transparent;
120
150
  color: var(--osdk-datetime-calendar-day-color);
121
151
  border-radius: 0;
122
152
 
123
153
  &:hover {
124
- background: var(--osdk-datetime-calendar-range-middle-bg);
154
+ background: transparent;
125
155
  color: var(--osdk-datetime-calendar-day-hover-color);
126
- filter: brightness(0.95);
127
156
  }
128
157
 
129
158
  &:active {
@@ -131,6 +160,14 @@
131
160
  }
132
161
  }
133
162
 
163
+ .calendarRangeFooter {
164
+ display: grid;
165
+ grid-template-columns: repeat(2, minmax(0, 1fr));
166
+ column-gap: var(--osdk-datetime-calendar-months-gap);
167
+ justify-items: center;
168
+ padding-block-start: var(--osdk-time-picker-padding-top);
169
+ }
170
+
134
171
  .calendarHidden {
135
172
  visibility: hidden;
136
173
  }
@@ -213,6 +250,9 @@
213
250
 
214
251
  /* Month/year selects — borderless, matching caption text weight */
215
252
  .calendarDropdown {
253
+ /* Native selects otherwise reserve room for the longest option, which makes
254
+ the month caret drift away from short month names like "May". */
255
+ field-sizing: content;
216
256
  font-family: var(--osdk-datetime-calendar-font-family);
217
257
  font-size: var(--osdk-datetime-calendar-caption-font-size);
218
258
  font-weight: var(--osdk-datetime-calendar-caption-font-weight);
@@ -230,10 +270,19 @@
230
270
  }
231
271
 
232
272
 
233
- /* Footer — content rendered inside DayPicker's <tfoot> (constrained by the table). */
234
- .calendarFooter {
235
- padding-top: var(--osdk-time-picker-padding-top);
236
- margin-top: var(--osdk-time-picker-margin-top);
237
- border-top: var(--osdk-time-picker-border-top);
273
+ .calendarTimeFooter {
274
+ display: flex;
275
+ justify-content: center;
276
+ padding-block-start: var(--osdk-time-picker-padding-top);
238
277
  }
239
278
 
279
+ .calendarActionBar {
280
+ display: flex;
281
+ justify-content: space-between;
282
+ gap: var(--osdk-surface-spacing);
283
+ padding-block-start: var(--osdk-time-picker-padding-top);
284
+ padding-inline: var(--osdk-datetime-popover-padding);
285
+ margin-block-start: var(--osdk-time-picker-margin-top);
286
+ margin-inline: calc(var(--osdk-datetime-popover-padding) * -1);
287
+ border-block-start: var(--osdk-time-picker-border-top);
288
+ }
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import classnames from "classnames";
17
18
  import React, { useMemo } from "react";
18
19
  import { DayPicker } from "react-day-picker";
19
20
  import { buildDisabledMatchers, DEFAULT_FROM_YEAR, DEFAULT_TO_YEAR } from "./calendarShared.js";
@@ -21,9 +22,9 @@ import { CALENDAR_COMPONENTS, CLASS_NAMES as BASE_CLASS_NAMES } from "./DateCale
21
22
  import styles from "./DateCalendar.module.css";
22
23
  const CLASS_NAMES = {
23
24
  ...BASE_CLASS_NAMES,
24
- day_range_start: styles.calendarRangeEndpoint,
25
+ day_range_start: classnames(styles.calendarRangeEndpoint, styles.calendarRangeStart),
25
26
  day_range_middle: styles.calendarRangeMiddle,
26
- day_range_end: styles.calendarRangeEndpoint
27
+ day_range_end: classnames(styles.calendarRangeEndpoint, styles.calendarRangeEnd)
27
28
  };
28
29
  export default function DateRangeCalendar({
29
30
  selected,
@@ -35,7 +36,10 @@ export default function DateRangeCalendar({
35
36
  const disabled = useMemo(() => buildDisabledMatchers(min, max), [min, max]);
36
37
  const fromYear = min != null ? min.getFullYear() : DEFAULT_FROM_YEAR;
37
38
  const toYear = max != null ? max.getFullYear() : DEFAULT_TO_YEAR;
38
- return /*#__PURE__*/React.createElement(DayPicker, {
39
+ const calendarFooter = footer == null ? undefined : /*#__PURE__*/React.createElement("div", {
40
+ className: styles.calendarRangeFooter
41
+ }, footer);
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DayPicker, {
39
43
  mode: "range",
40
44
  selected: selected,
41
45
  onSelect: onSelect,
@@ -43,12 +47,11 @@ export default function DateRangeCalendar({
43
47
  defaultMonth: selected?.from,
44
48
  classNames: CLASS_NAMES,
45
49
  components: CALENDAR_COMPONENTS,
46
- footer: footer,
47
50
  captionLayout: "dropdown-buttons",
48
51
  fromYear: fromYear,
49
52
  toYear: toYear,
50
53
  numberOfMonths: 2,
51
54
  pagedNavigation: true
52
- });
55
+ }), calendarFooter);
53
56
  }
54
57
  //# sourceMappingURL=DateRangeCalendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeCalendar.js","names":["React","useMemo","DayPicker","buildDisabledMatchers","DEFAULT_FROM_YEAR","DEFAULT_TO_YEAR","CALENDAR_COMPONENTS","CLASS_NAMES","BASE_CLASS_NAMES","styles","day_range_start","calendarRangeEndpoint","day_range_middle","calendarRangeMiddle","day_range_end","DateRangeCalendar","selected","onSelect","min","max","footer","disabled","fromYear","getFullYear","toYear","createElement","mode","defaultMonth","from","classNames","components","captionLayout","numberOfMonths","pagedNavigation"],"sources":["DateRangeCalendar.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, { useMemo } from \"react\";\nimport type {\n ClassNames,\n DateRange as RdpDateRange,\n SelectRangeEventHandler,\n} from \"react-day-picker\";\nimport { DayPicker } from \"react-day-picker\";\nimport {\n buildDisabledMatchers,\n DEFAULT_FROM_YEAR,\n DEFAULT_TO_YEAR,\n} from \"./calendarShared.js\";\nimport {\n CALENDAR_COMPONENTS,\n CLASS_NAMES as BASE_CLASS_NAMES,\n} from \"./DateCalendar.js\";\nimport styles from \"./DateCalendar.module.css\";\n\nconst CLASS_NAMES: ClassNames = {\n ...BASE_CLASS_NAMES,\n day_range_start: styles.calendarRangeEndpoint,\n day_range_middle: styles.calendarRangeMiddle,\n day_range_end: styles.calendarRangeEndpoint,\n};\n\nexport interface DateRangeCalendarProps {\n selected: RdpDateRange | undefined;\n onSelect: SelectRangeEventHandler;\n min?: Date;\n max?: Date;\n footer?: React.ReactNode;\n}\n\nexport default function DateRangeCalendar({\n selected,\n onSelect,\n min,\n max,\n footer,\n}: DateRangeCalendarProps): React.ReactElement {\n const disabled = useMemo(() => buildDisabledMatchers(min, max), [min, max]);\n\n const fromYear = min != null ? min.getFullYear() : DEFAULT_FROM_YEAR;\n const toYear = max != null ? max.getFullYear() : DEFAULT_TO_YEAR;\n\n return (\n <DayPicker\n mode=\"range\"\n selected={selected}\n onSelect={onSelect}\n disabled={disabled}\n defaultMonth={selected?.from}\n classNames={CLASS_NAMES}\n components={CALENDAR_COMPONENTS}\n footer={footer}\n captionLayout=\"dropdown-buttons\"\n fromYear={fromYear}\n toYear={toYear}\n numberOfMonths={2}\n pagedNavigation={true}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAMtC,SAASC,SAAS,QA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ignoreList":[]}
1
+ {"version":3,"file":"DateRangeCalendar.js","names":["classnames","React","useMemo","DayPicker","buildDisabledMatchers","DEFAULT_FROM_YEAR","DEFAULT_TO_YEAR","CALENDAR_COMPONENTS","CLASS_NAMES","BASE_CLASS_NAMES","styles","day_range_start","calendarRangeEndpoint","calendarRangeStart","day_range_middle","calendarRangeMiddle","day_range_end","calendarRangeEnd","DateRangeCalendar","selected","onSelect","min","max","footer","disabled","fromYear","getFullYear","toYear","calendarFooter","undefined","createElement","className","calendarRangeFooter","Fragment","mode","defaultMonth","from","classNames","components","captionLayout","numberOfMonths","pagedNavigation"],"sources":["DateRangeCalendar.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 classnames from \"classnames\";\nimport React, { useMemo } from \"react\";\nimport type {\n ClassNames,\n DateRange as RdpDateRange,\n SelectRangeEventHandler,\n} from \"react-day-picker\";\nimport { DayPicker } from \"react-day-picker\";\nimport {\n buildDisabledMatchers,\n DEFAULT_FROM_YEAR,\n DEFAULT_TO_YEAR,\n} from \"./calendarShared.js\";\nimport {\n CALENDAR_COMPONENTS,\n CLASS_NAMES as BASE_CLASS_NAMES,\n} from \"./DateCalendar.js\";\nimport styles from \"./DateCalendar.module.css\";\n\nconst CLASS_NAMES: ClassNames = {\n ...BASE_CLASS_NAMES,\n day_range_start: classnames(\n styles.calendarRangeEndpoint,\n styles.calendarRangeStart,\n ),\n day_range_middle: styles.calendarRangeMiddle,\n day_range_end: classnames(\n styles.calendarRangeEndpoint,\n styles.calendarRangeEnd,\n ),\n};\n\nexport interface DateRangeCalendarProps {\n selected: RdpDateRange | undefined;\n onSelect: SelectRangeEventHandler;\n min?: Date;\n max?: Date;\n footer?: React.ReactNode;\n}\n\nexport default function DateRangeCalendar({\n selected,\n onSelect,\n min,\n max,\n footer,\n}: DateRangeCalendarProps): React.ReactElement {\n const disabled = useMemo(() => buildDisabledMatchers(min, max), [min, max]);\n\n const fromYear = min != null ? min.getFullYear() : DEFAULT_FROM_YEAR;\n const toYear = max != null ? max.getFullYear() : DEFAULT_TO_YEAR;\n const calendarFooter = footer == null\n ? undefined\n : <div className={styles.calendarRangeFooter}>{footer}</div>;\n\n return (\n <>\n <DayPicker\n mode=\"range\"\n selected={selected}\n onSelect={onSelect}\n disabled={disabled}\n defaultMonth={selected?.from}\n classNames={CLASS_NAMES}\n components={CALENDAR_COMPONENTS}\n captionLayout=\"dropdown-buttons\"\n fromYear={fromYear}\n toYear={toYear}\n numberOfMonths={2}\n pagedNavigation={true}\n />\n {calendarFooter}\n </>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAMtC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,eAAe,QACV,qBAAqB;AAC5B,SACEC,mBAAmB,EACnBC,WAAW,IAAIC,gBAAgB,QAC1B,mBAAmB;AAC1B,OAAOC,MAAM,MAAM,2BAA2B;AAE9C,MAAMF,WAAuB,GAAG;EAC9B,GAAGC,gBAAgB;EACnBE,eAAe,EAAEX,UAAU,CACzBU,MAAM,CAACE,qBAAqB,EAC5BF,MAAM,CAACG,kBACT,CAAC;EACDC,gBAAgB,EAAEJ,MAAM,CAACK,mBAAmB;EAC5CC,aAAa,EAAEhB,UAAU,CACvBU,MAAM,CAACE,qBAAqB,EAC5BF,MA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