@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
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ import { Switch } from "../../base-components/switch/Switch.js";
19
+ export const SwitchField = /*#__PURE__*/React.memo(function ({
20
+ id,
21
+ label,
22
+ value,
23
+ onChange,
24
+ error
25
+ }) {
26
+ return /*#__PURE__*/React.createElement(Switch, {
27
+ id: id,
28
+ checked: value ?? false,
29
+ onCheckedChange: onChange,
30
+ "aria-invalid": error != null || undefined,
31
+ "aria-label": label
32
+ });
33
+ });
34
+ //# sourceMappingURL=SwitchField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchField.js","names":["React","Switch","SwitchField","memo","id","label","value","onChange","error","createElement","checked","onCheckedChange","undefined"],"sources":["SwitchField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { Switch } from \"../../base-components/switch/Switch.js\";\nimport type { SwitchFieldProps } from \"../FormFieldApi.js\";\n\ninterface InternalSwitchFieldProps extends SwitchFieldProps {\n label?: string;\n}\n\nexport const SwitchField: React.NamedExoticComponent<InternalSwitchFieldProps> =\n React\n .memo(function SwitchFieldFn({\n id,\n label,\n value,\n onChange,\n error,\n }: InternalSwitchFieldProps): React.ReactElement {\n return (\n <Switch\n id={id}\n checked={value ?? false}\n onCheckedChange={onChange}\n aria-invalid={error != null || undefined}\n aria-label={label}\n />\n );\n });\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,wCAAwC;AAO/D,OAAO,MAAMC,WAAiE,gBAC5EF,KAAK,CACFG,IAAI,CAAC,UAAuB;EAC3BC,EAAE;EACFC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC;AACwB,CAAC,EAAsB;EAC/C,oBACER,KAAA,CAAAS,aAAA,CAACR,MAAM;IACLG,EAAE,EAAEA,EAAG;IACPM,OAAO,EAAEJ,KAAK,IAAI,KAAM;IACxBK,eAAe,EAAEJ,QAAS;IAC1B,gBAAcC,KAAK,IAAI,IAAI,IAAII,SAAU;IACzC,cAAYP;EAAM,CACnB,CAAC;AAEN,CAAC,CAAC","ignoreList":[]}
@@ -15,39 +15,178 @@
15
15
  */
16
16
 
17
17
  import { Input } from "@base-ui/react/input";
18
- import React, { useCallback, useRef, useState } from "react";
18
+ import React, { useCallback, useMemo, useState } from "react";
19
19
  import styles from "./TimePicker.module.css.js";
20
- export function TimePicker({
20
+ const NUMERIC_INPUT_PATTERN = "[0-9]*";
21
+ const SEGMENT_LIMITS = {
22
+ hours: {
23
+ min: 0,
24
+ max: 23
25
+ },
26
+ minutes: {
27
+ min: 0,
28
+ max: 59
29
+ }
30
+ };
31
+ export const TimePicker = /*#__PURE__*/React.memo(function ({
21
32
  value,
22
33
  onChange,
23
34
  label = "Time"
24
35
  }) {
25
- const [localValue, setLocalValue] = useState(value);
26
- const isFocusedRef = useRef(false);
36
+ const valueTimestamp = value?.getTime() ?? null;
37
+ // Keep typed text locally so users can enter temporarily invalid values
38
+ // like "99" or "" without immediately mutating/clamping the parent Date.
39
+ const [internalSegments, setInternalSegments] = useState(() => createInternalSegments(valueTimestamp, segmentsFromTimestamp(valueTimestamp)));
40
+ const valueSegments = useMemo(() => segmentsFromTimestamp(valueTimestamp), [valueTimestamp]);
27
41
 
28
- // Sync from prop when not focused (parent changed the value externally)
29
- const prevValueRef = useRef(value);
30
- if (prevValueRef.current !== value) {
31
- prevValueRef.current = value;
32
- if (!isFocusedRef.current) {
33
- setLocalValue(value);
42
+ // Track which external value this internal text was derived from. If the
43
+ // parent commits a different Date, ignore stale internal text and render
44
+ // from the new value instead.
45
+ const activeSegments = internalSegments.valueTimestamp === valueTimestamp ? internalSegments : createInternalSegments(valueTimestamp, valueSegments);
46
+ const hourText = activeSegments.hours;
47
+ const minuteText = activeSegments.minutes;
48
+ const hourInvalid = isSegmentInvalid(hourText, "hours");
49
+ const minuteInvalid = isSegmentInvalid(minuteText, "minutes");
50
+ const emitChange = useCallback((hours, minutes) => {
51
+ const nextDate = value != null ? new Date(value.getTime()) : new Date();
52
+ nextDate.setHours(hours, minutes, 0, 0);
53
+ onChange?.(nextDate);
54
+ }, [onChange, value]);
55
+ const handleSegmentChange = useCallback((segment, nextText) => {
56
+ setInternalSegments({
57
+ valueTimestamp,
58
+ ...replaceSegmentText({
59
+ hours: hourText,
60
+ minutes: minuteText
61
+ }, {
62
+ segment,
63
+ nextText
64
+ })
65
+ });
66
+ }, [hourText, minuteText, valueTimestamp]);
67
+ const handleSegmentBlur = useCallback((segment, text) => {
68
+ const parsedSegment = parseNumber(text);
69
+ if (parsedSegment == null) {
70
+ // Non-numeric text cannot be converted into a valid time segment, so
71
+ // restore the displayed value instead of emitting an arbitrary Date.
72
+ setInternalSegments(createInternalSegments(valueTimestamp, valueSegments));
73
+ return;
34
74
  }
35
- }
36
- const handleFocus = useCallback(() => {
37
- isFocusedRef.current = true;
38
- }, []);
39
- const handleBlur = useCallback(() => {
40
- isFocusedRef.current = false;
41
- onChange(localValue);
42
- }, [onChange, localValue]);
43
- return /*#__PURE__*/React.createElement(Input, {
44
- type: "time",
45
- value: localValue,
46
- onValueChange: setLocalValue,
47
- onFocus: handleFocus,
48
- onBlur: handleBlur,
49
- className: styles.osdkTimePickerInput,
75
+ const clampedSegment = clampSegment(parsedSegment, segment);
76
+ const nextSegments = replaceSegmentText({
77
+ hours: hourText,
78
+ minutes: minuteText
79
+ }, {
80
+ segment,
81
+ nextText: formatSegment(clampedSegment, segment)
82
+ });
83
+ // Only the blurred segment should commit. If the other segment is
84
+ // currently invalid, preserve the committed value for that segment.
85
+ const nextHours = parseSegment(nextSegments.hours, "hours") ?? Number(valueSegments.hours);
86
+ const nextMinutes = parseSegment(nextSegments.minutes, "minutes") ?? Number(valueSegments.minutes);
87
+ setInternalSegments({
88
+ valueTimestamp,
89
+ hours: formatSegment(nextHours, "hours"),
90
+ minutes: formatSegment(nextMinutes, "minutes")
91
+ });
92
+ const currentHours = Number(valueSegments.hours);
93
+ const currentMinutes = Number(valueSegments.minutes);
94
+ if (nextHours !== currentHours || nextMinutes !== currentMinutes) {
95
+ emitChange(nextHours, nextMinutes);
96
+ }
97
+ }, [emitChange, hourText, minuteText, valueTimestamp, valueSegments]);
98
+ const handleHourChange = useCallback(nextText => handleSegmentChange("hours", nextText), [handleSegmentChange]);
99
+ const handleMinuteChange = useCallback(nextText => handleSegmentChange("minutes", nextText), [handleSegmentChange]);
100
+ const handleHourBlur = useCallback(() => handleSegmentBlur("hours", hourText), [handleSegmentBlur, hourText]);
101
+ const handleMinuteBlur = useCallback(() => handleSegmentBlur("minutes", minuteText), [handleSegmentBlur, minuteText]);
102
+ return /*#__PURE__*/React.createElement("div", {
103
+ className: styles.osdkTimePickerRoot,
104
+ role: "group",
50
105
  "aria-label": label
51
- });
106
+ }, /*#__PURE__*/React.createElement(Input, {
107
+ type: "text",
108
+ inputMode: "numeric",
109
+ pattern: NUMERIC_INPUT_PATTERN,
110
+ value: hourText,
111
+ onValueChange: handleHourChange,
112
+ onBlur: handleHourBlur,
113
+ className: styles.osdkTimePickerInput,
114
+ "aria-label": `${label} hours`,
115
+ "aria-invalid": hourInvalid || undefined
116
+ }), /*#__PURE__*/React.createElement("span", {
117
+ className: styles.osdkTimePickerSeparator,
118
+ "aria-hidden": "true"
119
+ }, ":"), /*#__PURE__*/React.createElement(Input, {
120
+ type: "text",
121
+ inputMode: "numeric",
122
+ pattern: NUMERIC_INPUT_PATTERN,
123
+ value: minuteText,
124
+ onValueChange: handleMinuteChange,
125
+ onBlur: handleMinuteBlur,
126
+ className: styles.osdkTimePickerInput,
127
+ "aria-label": `${label} minutes`,
128
+ "aria-invalid": minuteInvalid || undefined
129
+ }));
130
+ });
131
+ function createInternalSegments(valueTimestamp, segments) {
132
+ return {
133
+ valueTimestamp,
134
+ ...segments
135
+ };
136
+ }
137
+ function replaceSegmentText(segments, {
138
+ segment,
139
+ nextText
140
+ }) {
141
+ return {
142
+ ...segments,
143
+ [segment]: nextText
144
+ };
145
+ }
146
+ function segmentsFromTimestamp(valueTimestamp) {
147
+ if (valueTimestamp == null) {
148
+ return {
149
+ hours: formatSegment(0, "hours"),
150
+ minutes: formatSegment(0, "minutes")
151
+ };
152
+ }
153
+ const value = new Date(valueTimestamp);
154
+ return {
155
+ hours: formatSegment(value.getHours(), "hours"),
156
+ minutes: formatSegment(value.getMinutes(), "minutes")
157
+ };
158
+ }
159
+ function formatSegment(value, segment) {
160
+ // Hours stay compact while minutes stay two digits so the HH:mm control
161
+ // remains easy to scan.
162
+ return segment === "hours" ? String(value) : String(value).padStart(2, "0");
163
+ }
164
+ function parseNumber(text) {
165
+ if (!/^\d{1,2}$/.test(text)) {
166
+ return undefined;
167
+ }
168
+ const parsed = Number(text);
169
+ return Number.isNaN(parsed) ? undefined : parsed;
170
+ }
171
+ function parseSegment(text, segment) {
172
+ const parsed = parseNumber(text);
173
+ if (parsed == null) {
174
+ return undefined;
175
+ }
176
+ const {
177
+ min,
178
+ max
179
+ } = SEGMENT_LIMITS[segment];
180
+ return parsed >= min && parsed <= max ? parsed : undefined;
181
+ }
182
+ function isSegmentInvalid(text, segment) {
183
+ return parseSegment(text, segment) == null;
184
+ }
185
+ function clampSegment(value, segment) {
186
+ const {
187
+ min,
188
+ max
189
+ } = SEGMENT_LIMITS[segment];
190
+ return Math.min(Math.max(value, min), max);
52
191
  }
53
192
  //# sourceMappingURL=TimePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","names":["Input","React","useCallback","useRef","useState","styles","TimePicker","value","onChange","label","localValue","setLocalValue","isFocusedRef","prevValueRef","current","handleFocus","handleBlur","createElement","type","onValueChange","onFocus","onBlur","className","osdkTimePickerInput"],"sources":["TimePicker.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Input } from \"@base-ui/react/input\";\nimport React, { useCallback, useRef, useState } from \"react\";\nimport styles from \"./TimePicker.module.css\";\n\ninterface TimePickerProps {\n value: string;\n onChange: (timeString: string) => void;\n label?: string;\n}\n\nexport function TimePicker({\n value,\n onChange,\n label = \"Time\",\n}: TimePickerProps): React.ReactElement {\n const [localValue, setLocalValue] = useState(value);\n const isFocusedRef = useRef(false);\n\n // Sync from prop when not focused (parent changed the value externally)\n const prevValueRef = useRef(value);\n if (prevValueRef.current !== value) {\n prevValueRef.current = value;\n if (!isFocusedRef.current) {\n setLocalValue(value);\n }\n }\n\n const handleFocus = useCallback(() => {\n isFocusedRef.current = true;\n }, []);\n\n const handleBlur = useCallback(() => {\n isFocusedRef.current = false;\n onChange(localValue);\n }, [onChange, localValue]);\n\n return (\n <Input\n type=\"time\"\n value={localValue}\n onValueChange={setLocalValue}\n onFocus={handleFocus}\n onBlur={handleBlur}\n className={styles.osdkTimePickerInput}\n aria-label={label}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,OAAOC,KAAK,IAAIC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,MAAM,MAAM,yBAAyB;AAQ5C,OAAO,SAASC,UAAUA,CAAC;EACzBC,KAAK;EACLC,QAAQ;EACRC,KAAK,GAAG;AACO,CAAC,EAAsB;EACtC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGP,QAAQ,CAACG,KAAK,CAAC;EACnD,MAAMK,YAAY,GAAGT,MAAM,CAAC,KAAK,CAAC;;EAElC;EACA,MAAMU,YAAY,GAAGV,MAAM,CAACI,KAAK,CAAC;EAClC,IAAIM,YAAY,CAACC,OAAO,KAAKP,KAAK,EAAE;IAClCM,YAAY,CAACC,OAAO,GAAGP,KAAK;IAC5B,IAAI,CAACK,YAAY,CAACE,OAAO,EAAE;MACzBH,aAAa,CAACJ,KAAK,CAAC;IACtB;EACF;EAEA,MAAMQ,WAAW,GAAGb,WAAW,CAAC,MAAM;IACpCU,YAAY,CAACE,OAAO,GAAG,IAAI;EAC7B,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,UAAU,GAAGd,WAAW,CAAC,MAAM;IACnCU,YAAY,CAACE,OAAO,GAAG,KAAK;IAC5BN,QAAQ,CAACE,UAAU,CAAC;EACtB,CAAC,EAAE,CAACF,QAAQ,EAAEE,UAAU,CAAC,CAAC;EAE1B,oBACET,KAAA,CAAAgB,aAAA,CAACjB,KAAK;IACJkB,IAAI,EAAC,MAAM;IACXX,KAAK,EAAEG,UAAW;IAClBS,aAAa,EAAER,aAAc;IAC7BS,OAAO,EAAEL,WAAY;IACrBM,MAAM,EAAEL,UAAW;IACnBM,SAAS,EAAEjB,MAAM,CAACkB,mBAAoB;IACtC,cAAYd;EAAM,CACnB,CAAC;AAEN","ignoreList":[]}
1
+ {"version":3,"file":"TimePicker.js","names":["Input","React","useCallback","useMemo","useState","styles","NUMERIC_INPUT_PATTERN","SEGMENT_LIMITS","hours","min","max","minutes","TimePicker","memo","value","onChange","label","valueTimestamp","getTime","internalSegments","setInternalSegments","createInternalSegments","segmentsFromTimestamp","valueSegments","activeSegments","hourText","minuteText","hourInvalid","isSegmentInvalid","minuteInvalid","emitChange","nextDate","Date","setHours","handleSegmentChange","segment","nextText","replaceSegmentText","handleSegmentBlur","text","parsedSegment","parseNumber","clampedSegment","clampSegment","nextSegments","formatSegment","nextHours","parseSegment","Number","nextMinutes","currentHours","currentMinutes","handleHourChange","handleMinuteChange","handleHourBlur","handleMinuteBlur","createElement","className","osdkTimePickerRoot","role","type","inputMode","pattern","onValueChange","onBlur","osdkTimePickerInput","undefined","osdkTimePickerSeparator","segments","getHours","getMinutes","String","padStart","test","parsed","isNaN","Math"],"sources":["TimePicker.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Input } from \"@base-ui/react/input\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport styles from \"./TimePicker.module.css\";\n\nexport interface TimePickerProps {\n value: Date | null;\n onChange?: (newTime: Date) => void;\n label?: string;\n}\n\ntype TimeSegment = \"hours\" | \"minutes\";\ntype TimeSegments = Record<TimeSegment, string>;\n\ninterface InternalSegments extends TimeSegments {\n valueTimestamp: number | null;\n}\n\nconst NUMERIC_INPUT_PATTERN = \"[0-9]*\";\n\nconst SEGMENT_LIMITS: Record<TimeSegment, { min: number; max: number }> = {\n hours: { min: 0, max: 23 },\n minutes: { min: 0, max: 59 },\n} as const;\n\nexport const TimePicker: React.NamedExoticComponent<TimePickerProps> = React\n .memo(function TimePickerFn({\n value,\n onChange,\n label = \"Time\",\n }: TimePickerProps): React.ReactElement {\n const valueTimestamp = value?.getTime() ?? null;\n // Keep typed text locally so users can enter temporarily invalid values\n // like \"99\" or \"\" without immediately mutating/clamping the parent Date.\n const [internalSegments, setInternalSegments] = useState<InternalSegments>(\n () =>\n createInternalSegments(\n valueTimestamp,\n segmentsFromTimestamp(valueTimestamp),\n ),\n );\n const valueSegments = useMemo(\n () => segmentsFromTimestamp(valueTimestamp),\n [valueTimestamp],\n );\n\n // Track which external value this internal text was derived from. If the\n // parent commits a different Date, ignore stale internal text and render\n // from the new value instead.\n const activeSegments = internalSegments.valueTimestamp === valueTimestamp\n ? internalSegments\n : createInternalSegments(valueTimestamp, valueSegments);\n const hourText = activeSegments.hours;\n const minuteText = activeSegments.minutes;\n const hourInvalid = isSegmentInvalid(hourText, \"hours\");\n const minuteInvalid = isSegmentInvalid(minuteText, \"minutes\");\n\n const emitChange = useCallback(\n (hours: number, minutes: number) => {\n const nextDate = value != null ? new Date(value.getTime()) : new Date();\n nextDate.setHours(hours, minutes, 0, 0);\n onChange?.(nextDate);\n },\n [onChange, value],\n );\n\n const handleSegmentChange = useCallback(\n (segment: TimeSegment, nextText: string) => {\n setInternalSegments({\n valueTimestamp,\n ...replaceSegmentText(\n { hours: hourText, minutes: minuteText },\n { segment, nextText },\n ),\n });\n },\n [hourText, minuteText, valueTimestamp],\n );\n\n const handleSegmentBlur = useCallback(\n (segment: TimeSegment, text: string) => {\n const parsedSegment = parseNumber(text);\n if (parsedSegment == null) {\n // Non-numeric text cannot be converted into a valid time segment, so\n // restore the displayed value instead of emitting an arbitrary Date.\n setInternalSegments(\n createInternalSegments(valueTimestamp, valueSegments),\n );\n return;\n }\n\n const clampedSegment = clampSegment(parsedSegment, segment);\n const nextSegments = replaceSegmentText(\n { hours: hourText, minutes: minuteText },\n { segment, nextText: formatSegment(clampedSegment, segment) },\n );\n // Only the blurred segment should commit. If the other segment is\n // currently invalid, preserve the committed value for that segment.\n const nextHours = parseSegment(nextSegments.hours, \"hours\")\n ?? Number(valueSegments.hours);\n const nextMinutes = parseSegment(nextSegments.minutes, \"minutes\")\n ?? Number(valueSegments.minutes);\n\n setInternalSegments({\n valueTimestamp,\n hours: formatSegment(nextHours, \"hours\"),\n minutes: formatSegment(nextMinutes, \"minutes\"),\n });\n\n const currentHours = Number(valueSegments.hours);\n const currentMinutes = Number(valueSegments.minutes);\n if (nextHours !== currentHours || nextMinutes !== currentMinutes) {\n emitChange(nextHours, nextMinutes);\n }\n },\n [\n emitChange,\n hourText,\n minuteText,\n valueTimestamp,\n valueSegments,\n ],\n );\n\n const handleHourChange = useCallback(\n (nextText: string) => handleSegmentChange(\"hours\", nextText),\n [handleSegmentChange],\n );\n const handleMinuteChange = useCallback(\n (nextText: string) => handleSegmentChange(\"minutes\", nextText),\n [handleSegmentChange],\n );\n const handleHourBlur = useCallback(\n () => handleSegmentBlur(\"hours\", hourText),\n [handleSegmentBlur, hourText],\n );\n const handleMinuteBlur = useCallback(\n () => handleSegmentBlur(\"minutes\", minuteText),\n [handleSegmentBlur, minuteText],\n );\n\n return (\n <div\n className={styles.osdkTimePickerRoot}\n role=\"group\"\n aria-label={label}\n >\n <Input\n type=\"text\"\n inputMode=\"numeric\"\n pattern={NUMERIC_INPUT_PATTERN}\n value={hourText}\n onValueChange={handleHourChange}\n onBlur={handleHourBlur}\n className={styles.osdkTimePickerInput}\n aria-label={`${label} hours`}\n aria-invalid={hourInvalid || undefined}\n />\n <span className={styles.osdkTimePickerSeparator} aria-hidden=\"true\">\n :\n </span>\n <Input\n type=\"text\"\n inputMode=\"numeric\"\n pattern={NUMERIC_INPUT_PATTERN}\n value={minuteText}\n onValueChange={handleMinuteChange}\n onBlur={handleMinuteBlur}\n className={styles.osdkTimePickerInput}\n aria-label={`${label} minutes`}\n aria-invalid={minuteInvalid || undefined}\n />\n </div>\n );\n });\n\nfunction createInternalSegments(\n valueTimestamp: number | null,\n segments: TimeSegments,\n): InternalSegments {\n return { valueTimestamp, ...segments };\n}\n\nfunction replaceSegmentText(\n segments: TimeSegments,\n {\n segment,\n nextText,\n }: {\n segment: TimeSegment;\n nextText: string;\n },\n): TimeSegments {\n return {\n ...segments,\n [segment]: nextText,\n };\n}\n\nfunction segmentsFromTimestamp(valueTimestamp: number | null): TimeSegments {\n if (valueTimestamp == null) {\n return {\n hours: formatSegment(0, \"hours\"),\n minutes: formatSegment(0, \"minutes\"),\n };\n }\n const value = new Date(valueTimestamp);\n return {\n hours: formatSegment(value.getHours(), \"hours\"),\n minutes: formatSegment(value.getMinutes(), \"minutes\"),\n };\n}\n\nfunction formatSegment(value: number, segment: TimeSegment): string {\n // Hours stay compact while minutes stay two digits so the HH:mm control\n // remains easy to scan.\n return segment === \"hours\" ? String(value) : String(value).padStart(2, \"0\");\n}\n\nfunction parseNumber(text: string): number | undefined {\n if (!/^\\d{1,2}$/.test(text)) {\n return undefined;\n }\n const parsed = Number(text);\n return Number.isNaN(parsed) ? undefined : parsed;\n}\n\nfunction parseSegment(\n text: string,\n segment: TimeSegment,\n): number | undefined {\n const parsed = parseNumber(text);\n if (parsed == null) {\n return undefined;\n }\n const { min, max } = SEGMENT_LIMITS[segment];\n return parsed >= min && parsed <= max ? parsed : undefined;\n}\n\nfunction isSegmentInvalid(text: string, segment: TimeSegment): boolean {\n return parseSegment(text, segment) == null;\n}\n\nfunction clampSegment(value: number, segment: TimeSegment): number {\n const { min, max } = SEGMENT_LIMITS[segment];\n return Math.min(Math.max(value, min), max);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC7D,OAAOC,MAAM,MAAM,yBAAyB;AAe5C,MAAMC,qBAAqB,GAAG,QAAQ;AAEtC,MAAMC,cAAiE,GAAG;EACxEC,K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7B,KAAa,EAAEqB,OAAoB,EAAU;EACjE,MAAM;IAAE1B,GAAG;IAAEC;EAAI,CAAC,GAAGH,cAAc,CAAC4B,OAAO,CAAC;EAC5C,OAAOyC,IAAI,CAACnE,GAAG,CAACmE,IAAI,CAAClE,GAAG,CAACI,KAAK,EAAEL,GAAG,CAAC,EAAEC,GAAG,CAAC;AAC5C","ignoreList":[]}
@@ -1,9 +1,20 @@
1
- /* TimePicker — bare time input. Layout (spacing, borders) owned by the parent. */
1
+ /* TimePicker — HH:mm control. Outer layout is owned by the parent. */
2
+
3
+ .osdkTimePickerRoot {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: var(--osdk-surface-spacing);
7
+ }
2
8
 
3
9
  .osdkTimePickerInput {
4
- width: 100%;
10
+ width: calc(var(--osdk-surface-spacing) * 10);
5
11
  font-family: var(--osdk-time-picker-input-font-family);
6
12
  font-size: var(--osdk-time-picker-input-font-size);
13
+ line-height: var(
14
+ --osdk-input-line-height,
15
+ var(--osdk-typography-line-height-default)
16
+ );
17
+ text-align: center;
7
18
  padding: var(--osdk-time-picker-input-padding);
8
19
  border: var(--osdk-time-picker-input-border);
9
20
  border-radius: var(--osdk-time-picker-input-border-radius);
@@ -16,4 +27,18 @@
16
27
  outline: var(--osdk-time-picker-input-focus-outline);
17
28
  outline-offset: var(--osdk-time-picker-input-focus-offset);
18
29
  }
30
+
31
+ &[aria-invalid] {
32
+ border-color: var(--osdk-input-border-color-error);
33
+ }
34
+ }
35
+
36
+ .osdkTimePickerSeparator {
37
+ color: var(--osdk-typography-color-muted);
38
+ font-family: var(--osdk-time-picker-input-font-family);
39
+ font-size: var(--osdk-time-picker-input-font-size);
40
+ line-height: var(
41
+ --osdk-input-line-height,
42
+ var(--osdk-typography-line-height-default)
43
+ );
19
44
  }
@@ -1,6 +1,8 @@
1
1
  // CSS Module proxy for TimePicker.module.css
2
2
  const styles = {
3
- "osdkTimePickerInput": "TimePicker-module__osdkTimePickerInput___uUABQ7Pu"
3
+ "osdkTimePickerRoot": "TimePicker-module__osdkTimePickerRoot___i8UN3Nug",
4
+ "osdkTimePickerInput": "TimePicker-module__osdkTimePickerInput___uUABQ7Pu",
5
+ "osdkTimePickerSeparator": "TimePicker-module__osdkTimePickerSeparator___3cKcNBWE"
4
6
  };
5
7
 
6
8
  export default styles;
@@ -49,5 +49,10 @@ export function buildDisabledMatchers(min, max) {
49
49
  */
50
50
  export const stopPropagation = e => {
51
51
  e.stopPropagation();
52
+ // Base UI chains its trigger handler after this click handler. When focus or
53
+ // pointer-down already opened the popover, suppress that handler so the same
54
+ // click does not immediately toggle the popover closed again.
55
+ const preventBaseUIHandler = e.preventBaseUIHandler;
56
+ preventBaseUIHandler?.();
52
57
  };
53
58
  //# sourceMappingURL=calendarShared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendarShared.js","names":["DEFAULT_FROM_YEAR","Date","getFullYear","DEFAULT_TO_YEAR","buildDisabledMatchers","min","max","matchers","push","before","after","stopPropagation","e"],"sources":["calendarShared.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Shared constants and utilities for DateCalendar, DateRangeCalendar,\n * DatetimePickerField, and DateRangeInputField.\n */\n\nimport type React from \"react\";\nimport type { DateAfter, DateBefore, Matcher } from \"react-day-picker\";\n\n/** Fallback year range for the month/year dropdown when no min/max is provided. */\nexport const DEFAULT_FROM_YEAR: number = new Date().getFullYear() - 10;\nexport const DEFAULT_TO_YEAR: number = new Date().getFullYear() + 10;\n\n/**\n * Builds the `disabled` matcher array for react-day-picker from optional\n * min/max date constraints. Dates before min or after max are disabled.\n */\nexport function buildDisabledMatchers(\n min: Date | undefined,\n max: Date | undefined,\n): Matcher[] {\n const matchers: Matcher[] = [];\n if (min != null) {\n const before: DateBefore = { before: min };\n matchers.push(before);\n }\n if (max != null) {\n const after: DateAfter = { after: max };\n matchers.push(after);\n }\n return matchers;\n}\n\n/**\n * Stable click handler that stops event propagation. Used on date inputs\n * inside Popover.Trigger to prevent the trigger's click handler from\n * toggling the popover closed when the user clicks the already-open input.\n */\nexport const stopPropagation: (e: React.MouseEvent) => void = (e) => {\n e.stopPropagation();\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAKA;AACA,OAAO,MAAMA,iBAAyB,GAAG,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAG,EAAE;AACtE,OAAO,MAAMC,eAAuB,GAAG,IAAIF,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAG,EAAE;;AAEpE;AACA;AACA;AACA;AACA,OAAO,SAASE,qBAAqBA,CACnCC,GAAqB,EACrBC,GAAqB,EACV;EACX,MAAMC,QAAmB,GAAG,EAAE;EAC9B,IAAIF,GAAG,IAAI,IAAI,EAAE;IAEfE,QAAQ,CAACC,IAAI,CADc;MAAEC,MAAM,EAAEJ;IAAI,CACrB,CAAC;EACvB;EACA,IAAIC,GAAG,IAAI,IAAI,EAAE;IAEfC,QAAQ,CAACC,IAAI,CADY;MAAEE,KAAK,EAAEJ;IAAI,CACnB,CAAC;EACtB;EACA,OAAOC,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,eAA8C,GAAIC,CAAC,IAAK;EACnEA,CAAC,CAACD,eAAe,CAAC,CAAC;AACrB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"calendarShared.js","names":["DEFAULT_FROM_YEAR","Date","getFullYear","DEFAULT_TO_YEAR","buildDisabledMatchers","min","max","matchers","push","before","after","stopPropagation","e","preventBaseUIHandler"],"sources":["calendarShared.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Shared constants and utilities for DateCalendar, DateRangeCalendar,\n * DatetimePickerField, and DateRangeInputField.\n */\n\nimport type React from \"react\";\nimport type { DateAfter, DateBefore, Matcher } from \"react-day-picker\";\n\n/** Fallback year range for the month/year dropdown when no min/max is provided. */\nexport const DEFAULT_FROM_YEAR: number = new Date().getFullYear() - 10;\nexport const DEFAULT_TO_YEAR: number = new Date().getFullYear() + 10;\n\n/**\n * Builds the `disabled` matcher array for react-day-picker from optional\n * min/max date constraints. Dates before min or after max are disabled.\n */\nexport function buildDisabledMatchers(\n min: Date | undefined,\n max: Date | undefined,\n): Matcher[] {\n const matchers: Matcher[] = [];\n if (min != null) {\n const before: DateBefore = { before: min };\n matchers.push(before);\n }\n if (max != null) {\n const after: DateAfter = { after: max };\n matchers.push(after);\n }\n return matchers;\n}\n\n/**\n * Stable click handler that stops event propagation. Used on date inputs\n * inside Popover.Trigger to prevent the trigger's click handler from\n * toggling the popover closed when the user clicks the already-open input.\n */\nexport const stopPropagation: (e: React.MouseEvent) => void = (e) => {\n e.stopPropagation();\n // Base UI chains its trigger handler after this click handler. When focus or\n // pointer-down already opened the popover, suppress that handler so the same\n // click does not immediately toggle the popover closed again.\n const preventBaseUIHandler =\n (e as React.MouseEvent & { preventBaseUIHandler?: () => void })\n .preventBaseUIHandler;\n preventBaseUIHandler?.();\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAKA;AACA,OAAO,MAAMA,iBAAyB,GAAG,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAG,EAAE;AACtE,OAAO,MAAMC,eAAuB,GAAG,IAAIF,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAG,EAAE;;AAEpE;AACA;AACA;AACA;AACA,OAAO,SAASE,qBAAqBA,CACnCC,GAAqB,EACrBC,GAAqB,EACV;EACX,MAAMC,QAAmB,GAAG,EAAE;EAC9B,IAAIF,GAAG,IAAI,IAAI,EAAE;IAEfE,QAAQ,CAACC,IAAI,CADc;MAAEC,MAAM,EAAEJ;IAAI,CACrB,CAAC;EACvB;EACA,IAAIC,GAAG,IAAI,IAAI,EAAE;IAEfC,QAAQ,CAACC,IAAI,CADY;MAAEE,KAAK,EAAEJ;IAAI,CACnB,CAAC;EACtB;EACA,OAAOC,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,eAA8C,GAAIC,CAAC,IAAK;EACnEA,CAAC,CAACD,eAAe,CAAC,CAAC;EACnB;EACA;EACA;EACA,MAAME,oBAAoB,GACvBD,CAAC,CACCC,oBAAoB;EACzBA,oBAAoB,GAAG,CAAC;AAC1B,CAAC","ignoreList":[]}
@@ -45,10 +45,9 @@ export function useDateEditState({
45
45
  }
46
46
 
47
47
  // During editing the user needs parsable text they can modify and that
48
- // round-trips through parseFn (e.g. "2024-01-15"). When idle the input
49
- // shows a locale-friendly string that may not be parsable (e.g. "Jan 15, 2024")
50
- // but is more readable. displayedValue is the single source of truth
51
- // for the input's visible text.
48
+ // round-trips through parseFn (e.g. "2024-01-15"). When idle the input may
49
+ // show a different display string. displayedValue is the single source of
50
+ // truth for the input's visible text.
52
51
  const displayedValue = isEditing ? inputValue : value != null ? displayFormatFn(value) : "";
53
52
 
54
53
  // Parse the input once per render and derive all validation state from it.
@@ -1 +1 @@
1
- {"version":3,"file":"useDateEditState.js","names":["useCallback","useRef","useState","isDateInRange","useDateEditState","value","displayFormatFn","editFormatFn","parseFn","min","max","onChange","isEditing","setIsEditing","inputValue","setInputValue","prevValueTimeRef","getTime","currentValueTime","current","displayedValue","dateValue","undefined","inputError","validatedDate","setDateValue","date","startEditing","stopEditing","inputValueRef","validatedDateRef","commitAndStopEditing"],"sources":["useDateEditState.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useRef, useState } from \"react\";\nimport { isDateInRange } from \"../../shared/dateUtils.js\";\n\nexport interface UseDateEditStateConfig {\n /** The current committed date value (controlled by the parent). */\n value: Date | null;\n /**\n * Formats the date when the input is idle (not focused). Can be locale-friendly\n * like \"Jan 15, 2024\" — it doesn't need to be parsable since the user isn't typing.\n * When no custom formatDate prop is provided, this is the same as editFormatFn.\n */\n displayFormatFn: (date: Date) => string;\n /**\n * Formats the date when the user starts typing. Must produce a string that\n * parseFn can round-trip back to a Date (e.g. \"2024-01-15\" or \"2024-01-15 14:30\").\n */\n editFormatFn: (date: Date) => string;\n /** Parses user-typed text back into a Date. Returns undefined if invalid. */\n parseFn: (text: string) => Date | undefined;\n /** Earliest selectable date (inclusive). */\n min?: Date;\n /** Latest selectable date (inclusive). */\n max?: Date;\n /**\n * Called by `commitAndStopEditing` with the validated date, or null when the\n * field is cleared. Not called when the input is invalid (silent revert) or\n * when `stopEditing` is used directly (Escape/cancel).\n */\n onChange?: (date: Date | null) => void;\n}\n\nexport interface UseDateEditState {\n /** Whether the user is currently typing in the input. */\n isEditing: boolean;\n /** The value to show in the input: raw text when editing, formatted date otherwise. */\n displayedValue: string;\n /** Validation error for the current input text: null when valid or not editing. */\n inputError: \"invalid\" | \"out-of-range\" | null;\n /**\n * Live parse of inputValue — the Date if parsable, undefined if empty/invalid.\n * Re-derived every render from parseFn(inputValue).\n * Used for cross-input validation (e.g. DateRangeInputField's overlapping check).\n */\n dateValue: Date | undefined;\n /** Enter editing mode: sets isEditing=true and populates inputValue from the current value. */\n startEditing: () => void;\n /** Exit editing mode without committing (Escape/cancel). */\n stopEditing: () => void;\n /** Commit the current input via onChange, then exit editing mode (blur/Enter). */\n commitAndStopEditing: () => void;\n /** Update the raw input text (stable useState setter). */\n setInputValue: (value: string) => void;\n /**\n * Set inputValue from a Date using editFormatFn. Use this instead of calling\n * `setInputValue(editFormatFn(date))` manually — it removes the need for\n * callers to know which format function to apply.\n */\n setDateValue: (date: Date | null) => void;\n}\n\n/**\n * Manages the editing lifecycle for a single date text input.\n *\n * Handles the two-phase display pattern where the input shows a formatted\n * display value when idle and switches to an editable format when focused.\n */\nexport function useDateEditState({\n value,\n displayFormatFn,\n editFormatFn,\n parseFn,\n min,\n max,\n onChange,\n}: UseDateEditStateConfig): UseDateEditState {\n const [isEditing, setIsEditing] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n\n // Sync inputValue when external value changes (e.g. parent resets)\n const prevValueTimeRef = useRef<number | null>(value?.getTime() ?? null);\n const currentValueTime = value?.getTime() ?? null;\n if (prevValueTimeRef.current !== currentValueTime) {\n prevValueTimeRef.current = currentValueTime;\n if (!isEditing) {\n setInputValue(value != null ? editFormatFn(value) : \"\");\n }\n }\n\n // During editing the user needs parsable text they can modify and that\n // round-trips through parseFn (e.g. \"2024-01-15\"). When idle the input\n // shows a locale-friendly string that may not be parsable (e.g. \"Jan 15, 2024\")\n // but is more readable. displayedValue is the single source of truth\n // for the input's visible text.\n const displayedValue = isEditing\n ? inputValue\n : (value != null ? displayFormatFn(value) : \"\");\n\n // Parse the input once per render and derive all validation state from it.\n const dateValue = inputValue !== \"\" ? parseFn(inputValue) : undefined;\n\n const inputError: \"invalid\" | \"out-of-range\" | null = (() => {\n // Not editing: no validation feedback.\n // Empty input: the user cleared the field — that means null, not invalid.\n if (!isEditing || inputValue === \"\") return null;\n if (dateValue == null) return \"invalid\";\n if (!isDateInRange(dateValue, min, max)) return \"out-of-range\";\n return null;\n })();\n\n // The validated date ready for onChange, derived from dateValue + inputError.\n const validatedDate = (inputError == null && dateValue != null)\n ? dateValue\n : null;\n\n const setDateValue = useCallback(\n (date: Date | null) => {\n setInputValue(date != null ? editFormatFn(date) : \"\");\n },\n [editFormatFn],\n );\n\n const startEditing = useCallback(() => {\n setIsEditing(true);\n setDateValue(value);\n }, [value, setDateValue]);\n\n const stopEditing = useCallback(() => {\n setIsEditing(false);\n setDateValue(value);\n }, [value, setDateValue]);\n\n // Refs so commitAndStopEditing reads the latest derived values without\n // closing over inputValue/validatedDate (which change every keystroke).\n const inputValueRef = useRef(inputValue);\n inputValueRef.current = inputValue;\n const validatedDateRef = useRef(validatedDate);\n validatedDateRef.current = validatedDate;\n\n const commitAndStopEditing = useCallback(() => {\n if (inputValueRef.current === \"\") {\n onChange?.(null);\n } else if (validatedDateRef.current != null) {\n onChange?.(validatedDateRef.current);\n }\n setIsEditing(false);\n setDateValue(value);\n }, [onChange, setDateValue, value]);\n\n return {\n isEditing,\n displayedValue,\n inputError,\n dateValue,\n startEditing,\n stopEditing,\n commitAndStopEditing,\n setInputValue,\n setDateValue,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrD,SAASC,aAAa,QAAQ,2BAA2B;AA2DzD;AACA;AACA;AACA;AACA;AACA;AACA,OA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AAU;IACVF,SAAS;IACTM,YAAY;IACZC,WAAW;IACXG,oBAAoB;IACpBhB,aAAa;IACbU;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"useDateEditState.js","names":["useCallback","useRef","useState","isDateInRange","useDateEditState","value","displayFormatFn","editFormatFn","parseFn","min","max","onChange","isEditing","setIsEditing","inputValue","setInputValue","prevValueTimeRef","getTime","currentValueTime","current","displayedValue","dateValue","undefined","inputError","validatedDate","setDateValue","date","startEditing","stopEditing","inputValueRef","validatedDateRef","commitAndStopEditing"],"sources":["useDateEditState.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useRef, useState } from \"react\";\nimport { isDateInRange } from \"../../shared/dateUtils.js\";\n\nexport interface UseDateEditStateConfig {\n /** The current committed date value (controlled by the parent). */\n value: Date | null;\n /**\n * Formats the date when the input is idle (not focused). It doesn't need to\n * be parsable since the user isn't typing.\n * When no custom formatDate prop is provided, this is the same as editFormatFn.\n */\n displayFormatFn: (date: Date) => string;\n /**\n * Formats the date when the user starts typing. Must produce a string that\n * parseFn can round-trip back to a Date (e.g. \"2024-01-15\" or \"2024-01-15 14:30\").\n */\n editFormatFn: (date: Date) => string;\n /** Parses user-typed text back into a Date. Returns undefined if invalid. */\n parseFn: (text: string) => Date | undefined;\n /** Earliest selectable date (inclusive). */\n min?: Date;\n /** Latest selectable date (inclusive). */\n max?: Date;\n /**\n * Called by `commitAndStopEditing` with the validated date, or null when the\n * field is cleared. Not called when the input is invalid (silent revert) or\n * when `stopEditing` is used directly (Escape/cancel).\n */\n onChange?: (date: Date | null) => void;\n}\n\nexport interface UseDateEditState {\n /** Whether the user is currently typing in the input. */\n isEditing: boolean;\n /** The value to show in the input: raw text when editing, formatted date otherwise. */\n displayedValue: string;\n /** Validation error for the current input text: null when valid or not editing. */\n inputError: \"invalid\" | \"out-of-range\" | null;\n /**\n * Live parse of inputValue — the Date if parsable, undefined if empty/invalid.\n * Re-derived every render from parseFn(inputValue).\n * Used for cross-input validation (e.g. DateRangeInputField's overlapping check).\n */\n dateValue: Date | undefined;\n /** Enter editing mode: sets isEditing=true and populates inputValue from the current value. */\n startEditing: () => void;\n /** Exit editing mode without committing (Escape/cancel). */\n stopEditing: () => void;\n /** Commit the current input via onChange, then exit editing mode (blur/Enter). */\n commitAndStopEditing: () => void;\n /** Update the raw input text (stable useState setter). */\n setInputValue: (value: string) => void;\n /**\n * Set inputValue from a Date using editFormatFn. Use this instead of calling\n * `setInputValue(editFormatFn(date))` manually — it removes the need for\n * callers to know which format function to apply.\n */\n setDateValue: (date: Date | null) => void;\n}\n\n/**\n * Manages the editing lifecycle for a single date text input.\n *\n * Handles the two-phase display pattern where the input shows a formatted\n * display value when idle and switches to an editable format when focused.\n */\nexport function useDateEditState({\n value,\n displayFormatFn,\n editFormatFn,\n parseFn,\n min,\n max,\n onChange,\n}: UseDateEditStateConfig): UseDateEditState {\n const [isEditing, setIsEditing] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n\n // Sync inputValue when external value changes (e.g. parent resets)\n const prevValueTimeRef = useRef<number | null>(value?.getTime() ?? null);\n const currentValueTime = value?.getTime() ?? null;\n if (prevValueTimeRef.current !== currentValueTime) {\n prevValueTimeRef.current = currentValueTime;\n if (!isEditing) {\n setInputValue(value != null ? editFormatFn(value) : \"\");\n }\n }\n\n // During editing the user needs parsable text they can modify and that\n // round-trips through parseFn (e.g. \"2024-01-15\"). When idle the input may\n // show a different display string. displayedValue is the single source of\n // truth for the input's visible text.\n const displayedValue = isEditing\n ? inputValue\n : (value != null ? displayFormatFn(value) : \"\");\n\n // Parse the input once per render and derive all validation state from it.\n const dateValue = inputValue !== \"\" ? parseFn(inputValue) : undefined;\n\n const inputError: \"invalid\" | \"out-of-range\" | null = (() => {\n // Not editing: no validation feedback.\n // Empty input: the user cleared the field — that means null, not invalid.\n if (!isEditing || inputValue === \"\") return null;\n if (dateValue == null) return \"invalid\";\n if (!isDateInRange(dateValue, min, max)) return \"out-of-range\";\n return null;\n })();\n\n // The validated date ready for onChange, derived from dateValue + inputError.\n const validatedDate = (inputError == null && dateValue != null)\n ? dateValue\n : null;\n\n const setDateValue = useCallback(\n (date: Date | null) => {\n setInputValue(date != null ? editFormatFn(date) : \"\");\n },\n [editFormatFn],\n );\n\n const startEditing = useCallback(() => {\n setIsEditing(true);\n setDateValue(value);\n }, [value, setDateValue]);\n\n const stopEditing = useCallback(() => {\n setIsEditing(false);\n setDateValue(value);\n }, [value, setDateValue]);\n\n // Refs so commitAndStopEditing reads the latest derived values without\n // closing over inputValue/validatedDate (which change every keystroke).\n const inputValueRef = useRef(inputValue);\n inputValueRef.current = inputValue;\n const validatedDateRef = useRef(validatedDate);\n validatedDateRef.current = validatedDate;\n\n const commitAndStopEditing = useCallback(() => {\n if (inputValueRef.current === \"\") {\n onChange?.(null);\n } else if (validatedDateRef.current != null) {\n onChange?.(validatedDateRef.current);\n }\n setIsEditing(false);\n setDateValue(value);\n }, [onChange, setDateValue, value]);\n\n return {\n isEditing,\n displayedValue,\n inputError,\n dateValue,\n startEditing,\n stopEditing,\n commitAndStopEditing,\n setInputValue,\n setDateValue,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrD,SAASC,aAAa,QAAQ,2BAA2B;AA2DzD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAC;EA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C,WAAW;IACXG,oBAAoB;IACpBhB,aAAa;IACbU;EACF,CAAC;AACH","ignoreList":[]}
@@ -21,12 +21,13 @@ import React from "react";
21
21
  import styles from "./ActionButton.module.css.js";
22
22
  export const ActionButton = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ({
23
23
  variant = "secondary",
24
+ appearance = "default",
24
25
  className,
25
26
  ...rest
26
27
  }, ref) {
27
28
  return /*#__PURE__*/React.createElement(Button, _extends({
28
29
  ref: ref,
29
- className: classNames(styles.button, variant === "primary" ? styles.primaryButton : styles.secondaryButton, className)
30
+ className: classNames(styles.button, variant === "primary" ? styles.primaryButton : styles.secondaryButton, appearance === "minimal" && styles.minimalButton, className)
30
31
  }, rest));
31
32
  }));
32
33
  //# sourceMappingURL=ActionButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.js","names":["Button","classNames","React","styles","ActionButton","memo","forwardRef","variant","className","rest","ref","createElement","_extends","button","primaryButton","secondaryButton"],"sources":["ActionButton.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 { Button } from \"@base-ui/react/button\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./ActionButton.module.css\";\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>\n{\n variant?: \"primary\" | \"secondary\";\n}\n\nexport const ActionButton: React.MemoExoticComponent<\n React.ForwardRefExoticComponent<\n ButtonProps & React.RefAttributes<HTMLButtonElement>\n >\n> = React.memo(\n React.forwardRef<HTMLButtonElement, ButtonProps>(\n function ActionButton({ variant = \"secondary\", className, ...rest }, ref) {\n return (\n <Button\n ref={ref}\n className={classNames(\n styles.button,\n variant === \"primary\"\n ? styles.primaryButton\n : styles.secondaryButton,\n className,\n )}\n {...rest}\n />\n );\n },\n ),\n);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,2BAA2B;AAQ9C,OAAO,MAAMC,YAIZ,gBAAGF,KAAK,CAACG,IAAI,cACZH,KAAK,CAACI,UAAU,CACd,UAAsB;EAAEC,OAAO,GAAG,WAAW;EAAEC,SAAS;EAAE,GAAGC;AAAK,CAAC,EAAEC,GAAG,EAAE;EACxE,oBACER,KAAA,CAAAS,aAAA,CAACX,MAAM,EAAAY,QAAA;IACLF,GAAG,EAAEA,GAAI;IACTF,SAAS,EAAEP,UAAU,CACnBE,MAAM,CAACU,MAAM,EACbN,OAAO,KAAK,SAAS,GACjBJ,MAAM,CAACW,aAAa,GACpBX,MAAM,CAACY,eAAe,EAC1BP,SACF;EAAE,GACEC,IAAI,CACT,CAAC;AAEN,CACF,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ActionButton.js","names":["Button","classNames","React","styles","ActionButton","memo","forwardRef","variant","appearance","className","rest","ref","createElement","_extends","button","primaryButton","secondaryButton","minimalButton"],"sources":["ActionButton.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 { Button } from \"@base-ui/react/button\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./ActionButton.module.css\";\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>\n{\n variant?: \"primary\" | \"secondary\";\n appearance?: \"default\" | \"minimal\";\n}\n\nexport const ActionButton: React.MemoExoticComponent<\n React.ForwardRefExoticComponent<\n ButtonProps & React.RefAttributes<HTMLButtonElement>\n >\n> = React.memo(\n React.forwardRef<HTMLButtonElement, ButtonProps>(function ActionButton(\n { variant = \"secondary\", appearance = \"default\", className, ...rest },\n ref,\n ) {\n return (\n <Button\n ref={ref}\n className={classNames(\n styles.button,\n variant === \"primary\" ? styles.primaryButton : styles.secondaryButton,\n appearance === \"minimal\" && styles.minimalButton,\n className,\n )}\n {...rest}\n />\n );\n }),\n);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,2BAA2B;AAS9C,OAAO,MAAMC,YAIZ,gBAAGF,KAAK,CAACG,IAAI,cACZH,KAAK,CAACI,UAAU,CAAiC,UAC/C;EAAEC,OAAO,GAAG,WAAW;EAAEC,UAAU,GAAG,SAAS;EAAEC,SAAS;EAAE,GAAGC;AAAK,CAAC,EACrEC,GAAG,EACH;EACA,oBACET,KAAA,CAAAU,aAAA,CAACZ,MAAM,EAAAa,QAAA;IACLF,GAAG,EAAEA,GAAI;IACTF,SAAS,EAAER,UAAU,CACnBE,MAAM,CAACW,MAAM,EACbP,OAAO,KAAK,SAAS,GAAGJ,MAAM,CAACY,aAAa,GAAGZ,MAAM,CAACa,eAAe,EACrER,UAAU,KAAK,SAAS,IAAIL,MAAM,CAACc,aAAa,EAChDR,SACF;EAAE,GACEC,IAAI,CACT,CAAC;AAEN,CAAC,CACH,CAAC","ignoreList":[]}
@@ -62,3 +62,22 @@
62
62
  background-color: var(--osdk-button-primary-bg-active);
63
63
  }
64
64
  }
65
+
66
+ .minimalButton {
67
+ background-color: var(--osdk-button-minimal-bg);
68
+ border: var(--osdk-button-minimal-border);
69
+ box-shadow: var(--osdk-button-minimal-shadow);
70
+ color: var(--osdk-button-secondary-minimal-color);
71
+
72
+ &:hover:not(:disabled) {
73
+ background-color: var(--osdk-button-minimal-bg-hover);
74
+ }
75
+
76
+ &:active:not(:disabled) {
77
+ background-color: var(--osdk-button-minimal-bg-active);
78
+ }
79
+ }
80
+
81
+ .primaryButton.minimalButton {
82
+ color: var(--osdk-button-primary-minimal-color);
83
+ }
@@ -2,7 +2,8 @@
2
2
  const styles = {
3
3
  "button": "ActionButton-module__button___ml7q5klp",
4
4
  "secondaryButton": "ActionButton-module__secondaryButton___9ADrh8W1",
5
- "primaryButton": "ActionButton-module__primaryButton___26uDwmR6"
5
+ "primaryButton": "ActionButton-module__primaryButton___26uDwmR6",
6
+ "minimalButton": "ActionButton-module__minimalButton___GD-TV5sR"
6
7
  };
7
8
 
8
9
  export default styles;
@@ -91,6 +91,12 @@
91
91
  );
92
92
  }
93
93
 
94
+ /* Override global :focus rules (e.g. Blueprint) that add an outline on
95
+ mouse click. Only show the ring on keyboard focus (:focus-visible). */
96
+ &:focus:not(:focus-visible) {
97
+ outline: none;
98
+ }
99
+
94
100
  &:focus-visible {
95
101
  outline: var(
96
102
  --osdk-combobox-trigger-focus-width,
@@ -104,6 +110,10 @@
104
110
  );
105
111
  }
106
112
 
113
+ &[data-popup-open]:focus-visible {
114
+ outline: none;
115
+ }
116
+
107
117
  &[data-disabled] {
108
118
  cursor: not-allowed;
109
119
  opacity: var(--osdk-disabled-opacity, 0.5);
@@ -298,13 +308,20 @@
298
308
 
299
309
  .osdkComboboxPositioner {
300
310
  z-index: var(--osdk-combobox-z-index, var(--osdk-surface-z-index-3));
311
+ /* Base UI may focus popup containers so they can own roving keyboard
312
+ navigation. Keep visible focus on the trigger/input or highlighted option
313
+ instead of drawing a browser-default ring around this wrapper. */
314
+ outline: none;
301
315
  }
302
316
 
303
317
  .osdkComboboxPopup {
304
318
  display: flex;
305
319
  flex-direction: column;
306
320
  min-width: var(--anchor-width);
307
- max-height: var(--available-height);
321
+ max-height: min(
322
+ var(--osdk-combobox-popup-max-height),
323
+ var(--available-height)
324
+ );
308
325
  overflow-y: auto;
309
326
  padding: calc(
310
327
  var(--osdk-combobox-spacing, var(--osdk-surface-spacing)) * 1.5
@@ -321,6 +338,10 @@
321
338
  var(--osdk-surface-background-color-default-rest)
322
339
  );
323
340
  box-shadow: var(--osdk-combobox-popup-shadow, var(--osdk-surface-shadow-2));
341
+
342
+ &:focus {
343
+ outline: none;
344
+ }
324
345
  }
325
346
 
326
347
  /*
@@ -440,7 +461,7 @@
440
461
  );
441
462
  background-color: var(
442
463
  --osdk-combobox-chip-bg,
443
- var(--osdk-surface-background-color-default-hover)
464
+ var(--osdk-custom-color-gray-4)
444
465
  );
445
466
  font-family: var(
446
467
  --osdk-combobox-font-family,
@@ -532,6 +553,13 @@
532
553
  display: flex;
533
554
  flex-direction: column;
534
555
  overflow-y: auto;
556
+
557
+ /* Base UI moves focus into the list when the popup opens for keyboard
558
+ navigation. Highlighted options provide the visible affordance, so do not
559
+ draw a browser/default focus ring around the whole popup list. */
560
+ &:focus {
561
+ outline: none;
562
+ }
535
563
  }
536
564
 
537
565
  .osdkComboboxEmpty {
@@ -628,7 +656,7 @@
628
656
  );
629
657
  background-color: var(
630
658
  --osdk-combobox-chip-bg,
631
- var(--osdk-surface-background-color-default-hover)
659
+ var(--osdk-custom-color-gray-4)
632
660
  );
633
661
  font-size: var(
634
662
  --osdk-combobox-chip-font-size,