react-science 23.1.1 → 24.0.1

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 (340) hide show
  1. package/lib/components/accordion/accordion_context.d.ts +1 -1
  2. package/lib/components/accordion/accordion_context.js +3 -3
  3. package/lib/components/accordion/accordion_context.js.map +1 -1
  4. package/lib/components/accordion/accordion_context_provider.d.ts.map +1 -1
  5. package/lib/components/accordion/accordion_context_provider.js +3 -3
  6. package/lib/components/accordion/accordion_context_provider.js.map +1 -1
  7. package/lib/components/accordion/accordion_hooks.js +3 -3
  8. package/lib/components/accordion/accordion_hooks.js.map +1 -1
  9. package/lib/components/button/Button.d.ts.map +1 -1
  10. package/lib/components/button/Button.js +3 -2
  11. package/lib/components/button/Button.js.map +1 -1
  12. package/lib/components/color-picker/react-color/ColorPicker.d.ts +2 -2
  13. package/lib/components/color-picker/react-color/ColorPicker.d.ts.map +1 -1
  14. package/lib/components/color-picker/react-color/ColorPicker.js +25 -22
  15. package/lib/components/color-picker/react-color/ColorPicker.js.map +1 -1
  16. package/lib/components/color-picker/react-color/common/Alpha.d.ts +1 -2
  17. package/lib/components/color-picker/react-color/common/Alpha.d.ts.map +1 -1
  18. package/lib/components/color-picker/react-color/common/Alpha.js +5 -6
  19. package/lib/components/color-picker/react-color/common/Alpha.js.map +1 -1
  20. package/lib/components/color-picker/react-color/common/CheckBoard.d.ts +1 -2
  21. package/lib/components/color-picker/react-color/common/CheckBoard.d.ts.map +1 -1
  22. package/lib/components/color-picker/react-color/common/CheckBoard.js +2 -3
  23. package/lib/components/color-picker/react-color/common/CheckBoard.js.map +1 -1
  24. package/lib/components/color-picker/react-color/common/EditableInput.d.ts.map +1 -1
  25. package/lib/components/color-picker/react-color/common/EditableInput.js +30 -26
  26. package/lib/components/color-picker/react-color/common/EditableInput.js.map +1 -1
  27. package/lib/components/color-picker/react-color/common/Hue.d.ts +1 -2
  28. package/lib/components/color-picker/react-color/common/Hue.d.ts.map +1 -1
  29. package/lib/components/color-picker/react-color/common/Hue.js +5 -6
  30. package/lib/components/color-picker/react-color/common/Hue.js.map +1 -1
  31. package/lib/components/color-picker/react-color/common/Saturation.d.ts +1 -2
  32. package/lib/components/color-picker/react-color/common/Saturation.d.ts.map +1 -1
  33. package/lib/components/color-picker/react-color/common/Saturation.js +6 -7
  34. package/lib/components/color-picker/react-color/common/Saturation.js.map +1 -1
  35. package/lib/components/color-picker/react-color/common/Swatch.d.ts.map +1 -1
  36. package/lib/components/color-picker/react-color/common/Swatch.js +10 -11
  37. package/lib/components/color-picker/react-color/common/Swatch.js.map +1 -1
  38. package/lib/components/color-picker/react-color/common/interaction.d.ts +1 -1
  39. package/lib/components/color-picker/react-color/common/interaction.d.ts.map +1 -1
  40. package/lib/components/color-picker/react-color/common/interaction.js +9 -9
  41. package/lib/components/color-picker/react-color/common/interaction.js.map +1 -1
  42. package/lib/components/color-picker/react-color/common/useOnChange.js +2 -2
  43. package/lib/components/color-picker/react-color/common/useOnChange.js.map +1 -1
  44. package/lib/components/color-picker/react-color/helpers/alpha.d.ts +1 -1
  45. package/lib/components/color-picker/react-color/helpers/alpha.d.ts.map +1 -1
  46. package/lib/components/color-picker/react-color/helpers/alpha.js +4 -5
  47. package/lib/components/color-picker/react-color/helpers/alpha.js.map +1 -1
  48. package/lib/components/color-picker/react-color/helpers/color.d.ts.map +1 -1
  49. package/lib/components/color-picker/react-color/helpers/color.js +15 -13
  50. package/lib/components/color-picker/react-color/helpers/color.js.map +1 -1
  51. package/lib/components/color-picker/react-color/helpers/hue.d.ts +1 -1
  52. package/lib/components/color-picker/react-color/helpers/hue.d.ts.map +1 -1
  53. package/lib/components/color-picker/react-color/helpers/hue.js +14 -23
  54. package/lib/components/color-picker/react-color/helpers/hue.js.map +1 -1
  55. package/lib/components/color-picker/react-color/helpers/saturation.d.ts +1 -1
  56. package/lib/components/color-picker/react-color/helpers/saturation.d.ts.map +1 -1
  57. package/lib/components/color-picker/react-color/helpers/saturation.js +3 -3
  58. package/lib/components/color-picker/react-color/helpers/saturation.js.map +1 -1
  59. package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts +1 -1
  60. package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts.map +1 -1
  61. package/lib/components/color-picker/react-color/sketch/SketchFields.js +6 -6
  62. package/lib/components/color-picker/react-color/sketch/SketchFields.js.map +1 -1
  63. package/lib/components/color-picker/react-color/sketch/SketchPresetColors.js +8 -8
  64. package/lib/components/color-picker/react-color/sketch/SketchPresetColors.js.map +1 -1
  65. package/lib/components/dialog/ConfirmDialog.js +2 -2
  66. package/lib/components/dialog/ConfirmDialog.js.map +1 -1
  67. package/lib/components/draggable/draggable.d.ts.map +1 -1
  68. package/lib/components/draggable/draggable.js +10 -9
  69. package/lib/components/draggable/draggable.js.map +1 -1
  70. package/lib/components/form/components/field_groups/svg_text_style.d.ts.map +1 -1
  71. package/lib/components/form/components/field_groups/svg_text_style.js +8 -8
  72. package/lib/components/form/components/field_groups/svg_text_style.js.map +1 -1
  73. package/lib/components/form/components/field_groups/svg_text_style.schema.js +1 -1
  74. package/lib/components/form/components/field_groups/svg_text_style.schema.js.map +1 -1
  75. package/lib/components/form/components/input/checkbox.js +3 -3
  76. package/lib/components/form/components/input/checkbox.js.map +1 -1
  77. package/lib/components/form/components/input/color_picker.js +1 -1
  78. package/lib/components/form/components/input/color_picker.js.map +1 -1
  79. package/lib/components/form/components/input/draggable_numeric_input.js +1 -1
  80. package/lib/components/form/components/input/draggable_numeric_input.js.map +1 -1
  81. package/lib/components/form/components/input/input.js +1 -1
  82. package/lib/components/form/components/input/input.js.map +1 -1
  83. package/lib/components/form/components/input/numeric_input.js +1 -1
  84. package/lib/components/form/components/input/numeric_input.js.map +1 -1
  85. package/lib/components/form/components/input/radio_group.js +1 -1
  86. package/lib/components/form/components/input/radio_group.js.map +1 -1
  87. package/lib/components/form/components/input/select.js +1 -1
  88. package/lib/components/form/components/input/select.js.map +1 -1
  89. package/lib/components/form/components/input/switch.js +1 -1
  90. package/lib/components/form/components/input/switch.js.map +1 -1
  91. package/lib/components/form/components/input/textarea.js +1 -1
  92. package/lib/components/form/components/input/textarea.js.map +1 -1
  93. package/lib/components/form/components/input_groups/form.js +2 -2
  94. package/lib/components/form/components/input_groups/form.js.map +1 -1
  95. package/lib/components/form/components/input_groups/form_context.d.ts +1 -1
  96. package/lib/components/form/components/input_groups/form_context.js +3 -3
  97. package/lib/components/form/components/input_groups/form_context.js.map +1 -1
  98. package/lib/components/form/components/layout/form.d.ts +1 -1
  99. package/lib/components/form/components/layout/form.d.ts.map +1 -1
  100. package/lib/components/form/components/layout/form.js +1 -4
  101. package/lib/components/form/components/layout/form.js.map +1 -1
  102. package/lib/components/form/utils/validators.d.ts +14 -8
  103. package/lib/components/form/utils/validators.d.ts.map +1 -1
  104. package/lib/components/form/utils/validators.js +11 -11
  105. package/lib/components/form/utils/validators.js.map +1 -1
  106. package/lib/components/fullscreen/fullscreen_context.d.ts +1 -1
  107. package/lib/components/fullscreen/fullscreen_context.js +3 -3
  108. package/lib/components/fullscreen/fullscreen_context.js.map +1 -1
  109. package/lib/components/fullscreen/fullscreen_context.provider.d.ts +1 -3
  110. package/lib/components/fullscreen/fullscreen_context.provider.d.ts.map +1 -1
  111. package/lib/components/fullscreen/fullscreen_context.provider.js +3 -3
  112. package/lib/components/fullscreen/fullscreen_context.provider.js.map +1 -1
  113. package/lib/components/hooks/useDoubleClick.js +8 -8
  114. package/lib/components/hooks/useDoubleClick.js.map +1 -1
  115. package/lib/components/hooks/useOnClickOutside.js +2 -2
  116. package/lib/components/hooks/useOnClickOutside.js.map +1 -1
  117. package/lib/components/hooks/useOnOff.d.ts +1 -1
  118. package/lib/components/hooks/useOnOff.d.ts.map +1 -1
  119. package/lib/components/hooks/useOnOff.js +5 -5
  120. package/lib/components/hooks/useOnOff.js.map +1 -1
  121. package/lib/components/hooks/useSelect.d.ts.map +1 -1
  122. package/lib/components/hooks/useSelect.js +4 -3
  123. package/lib/components/hooks/useSelect.js.map +1 -1
  124. package/lib/components/hooks/useToggle.d.ts +1 -1
  125. package/lib/components/hooks/useToggle.d.ts.map +1 -1
  126. package/lib/components/hooks/useToggle.js +2 -2
  127. package/lib/components/hooks/useToggle.js.map +1 -1
  128. package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
  129. package/lib/components/info-panel/InfoPanel.js +10 -13
  130. package/lib/components/info-panel/InfoPanel.js.map +1 -1
  131. package/lib/components/input/radio-button-group/RadioButtonGroup.d.ts.map +1 -1
  132. package/lib/components/input/radio-button-group/RadioButtonGroup.js +3 -2
  133. package/lib/components/input/radio-button-group/RadioButtonGroup.js.map +1 -1
  134. package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
  135. package/lib/components/logger/FifoLoggerDialog.js +3 -1
  136. package/lib/components/logger/FifoLoggerDialog.js.map +1 -1
  137. package/lib/components/logger/FifoLoggerProvider.d.ts.map +1 -1
  138. package/lib/components/logger/FifoLoggerProvider.js +2 -2
  139. package/lib/components/logger/FifoLoggerProvider.js.map +1 -1
  140. package/lib/components/logger/loggerContext.d.ts +1 -1
  141. package/lib/components/logger/loggerContext.js +1 -1
  142. package/lib/components/logger/useFifoLogger.d.ts.map +1 -1
  143. package/lib/components/logger/useFifoLogger.js +7 -5
  144. package/lib/components/logger/useFifoLogger.js.map +1 -1
  145. package/lib/components/root-layout/root_layout.d.ts.map +1 -1
  146. package/lib/components/root-layout/root_layout.js +5 -3
  147. package/lib/components/root-layout/root_layout.js.map +1 -1
  148. package/lib/components/root-layout/root_layout_context.d.ts +1 -1
  149. package/lib/components/root-layout/root_layout_context.js +3 -3
  150. package/lib/components/root-layout/root_layout_context.js.map +1 -1
  151. package/lib/components/root-layout/root_layout_context.provider.js +2 -2
  152. package/lib/components/root-layout/root_layout_context.provider.js.map +1 -1
  153. package/lib/components/selected-total/SelectedTotal.js +1 -1
  154. package/lib/components/selected-total/SelectedTotal.js.map +1 -1
  155. package/lib/components/split_pane/split_pane.d.ts.map +1 -1
  156. package/lib/components/split_pane/split_pane.js +14 -18
  157. package/lib/components/split_pane/split_pane.js.map +1 -1
  158. package/lib/components/split_pane/split_pane_helpers.d.ts.map +1 -1
  159. package/lib/components/split_pane/split_pane_helpers.js +5 -1
  160. package/lib/components/split_pane/split_pane_helpers.js.map +1 -1
  161. package/lib/components/split_pane/use_split_pane_size.d.ts.map +1 -1
  162. package/lib/components/split_pane/use_split_pane_size.js +4 -3
  163. package/lib/components/split_pane/use_split_pane_size.js.map +1 -1
  164. package/lib/components/table/default_table_cell.d.ts.map +1 -1
  165. package/lib/components/table/default_table_cell.js +6 -14
  166. package/lib/components/table/default_table_cell.js.map +1 -1
  167. package/lib/components/table/flash_row/flashed_row_context.d.ts +1 -1
  168. package/lib/components/table/flash_row/flashed_row_context.js +3 -3
  169. package/lib/components/table/flash_row/flashed_row_context.js.map +1 -1
  170. package/lib/components/table/flash_row/flashed_row_provider.d.ts.map +1 -1
  171. package/lib/components/table/flash_row/flashed_row_provider.js +5 -4
  172. package/lib/components/table/flash_row/flashed_row_provider.js.map +1 -1
  173. package/lib/components/table/flash_row/use_flash_row_effect.d.ts.map +1 -1
  174. package/lib/components/table/flash_row/use_flash_row_effect.js +6 -5
  175. package/lib/components/table/flash_row/use_flash_row_effect.js.map +1 -1
  176. package/lib/components/table/preview_table.js +2 -2
  177. package/lib/components/table/preview_table.js.map +1 -1
  178. package/lib/components/table/preview_table_context.d.ts +2 -2
  179. package/lib/components/table/preview_table_context.js +6 -6
  180. package/lib/components/table/preview_table_context.js.map +1 -1
  181. package/lib/components/table/reorder_rows/draggable_row_context.d.ts +4 -6
  182. package/lib/components/table/reorder_rows/draggable_row_context.d.ts.map +1 -1
  183. package/lib/components/table/reorder_rows/draggable_row_context.js +3 -3
  184. package/lib/components/table/reorder_rows/draggable_row_context.js.map +1 -1
  185. package/lib/components/table/reorder_rows/draggable_row_tr.d.ts.map +1 -1
  186. package/lib/components/table/reorder_rows/draggable_row_tr.js +4 -3
  187. package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
  188. package/lib/components/table/reorder_rows/item_order_context.d.ts +2 -2
  189. package/lib/components/table/reorder_rows/item_order_context.d.ts.map +1 -1
  190. package/lib/components/table/reorder_rows/item_order_context.js +3 -3
  191. package/lib/components/table/reorder_rows/item_order_context.js.map +1 -1
  192. package/lib/components/table/reorder_rows/item_order_provider.d.ts.map +1 -1
  193. package/lib/components/table/reorder_rows/item_order_provider.js +2 -2
  194. package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -1
  195. package/lib/components/table/reorder_rows/use_drop_monitor.d.ts +2 -2
  196. package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
  197. package/lib/components/table/reorder_rows/use_drop_monitor.js +4 -4
  198. package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
  199. package/lib/components/table/table_body.d.ts.map +1 -1
  200. package/lib/components/table/table_body.js +10 -6
  201. package/lib/components/table/table_body.js.map +1 -1
  202. package/lib/components/table/table_features.js +7 -7
  203. package/lib/components/table/table_features.js.map +1 -1
  204. package/lib/components/table/table_header_cell.d.ts +1 -1
  205. package/lib/components/table/table_header_cell.d.ts.map +1 -1
  206. package/lib/components/table/table_root.d.ts +2 -2
  207. package/lib/components/table/table_root.d.ts.map +1 -1
  208. package/lib/components/table/table_root.js +12 -12
  209. package/lib/components/table/table_root.js.map +1 -1
  210. package/lib/components/table/table_utils.d.ts +1 -1
  211. package/lib/components/table/table_utils.d.ts.map +1 -1
  212. package/lib/components/table/table_utils.js.map +1 -1
  213. package/lib/components/table/use_table_columns.d.ts +2 -2
  214. package/lib/components/table/use_table_columns.d.ts.map +1 -1
  215. package/lib/components/table/use_table_columns.js +4 -4
  216. package/lib/components/table/use_table_columns.js.map +1 -1
  217. package/lib/components/table/use_table_scroll.d.ts.map +1 -1
  218. package/lib/components/table/use_table_scroll.js +13 -15
  219. package/lib/components/table/use_table_scroll.js.map +1 -1
  220. package/lib/components/toolbar/OverflowButton.js +5 -5
  221. package/lib/components/toolbar/OverflowButton.js.map +1 -1
  222. package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
  223. package/lib/components/toolbar/Toolbar.js +5 -8
  224. package/lib/components/toolbar/Toolbar.js.map +1 -1
  225. package/lib/components/toolbar/TooltipHelpContent.d.ts.map +1 -1
  226. package/lib/components/toolbar/TooltipHelpContent.js +5 -2
  227. package/lib/components/toolbar/TooltipHelpContent.js.map +1 -1
  228. package/lib/components/toolbar/toolbarContext.d.ts +3 -3
  229. package/lib/components/toolbar/toolbarContext.d.ts.map +1 -1
  230. package/lib/components/toolbar/toolbarContext.js +4 -4
  231. package/lib/components/toolbar/toolbarContext.js.map +1 -1
  232. package/lib/components/toolbar/useCheckOverflow.d.ts.map +1 -1
  233. package/lib/components/toolbar/useCheckOverflow.js +1 -0
  234. package/lib/components/toolbar/useCheckOverflow.js.map +1 -1
  235. package/lib/components/utils/debounce.d.ts +1 -1
  236. package/lib/components/utils/debounce.d.ts.map +1 -1
  237. package/lib/components/utils/debounce.js +3 -3
  238. package/lib/components/utils/debounce.js.map +1 -1
  239. package/lib/components/utils/forward_all_props_except.d.ts +2 -0
  240. package/lib/components/utils/forward_all_props_except.d.ts.map +1 -0
  241. package/lib/components/utils/{shouldForwardPropExcept.js → forward_all_props_except.js} +2 -2
  242. package/lib/components/utils/forward_all_props_except.js.map +1 -0
  243. package/lib/components/utils/svg.d.ts.map +1 -1
  244. package/lib/components/utils/svg.js +12 -6
  245. package/lib/components/utils/svg.js.map +1 -1
  246. package/lib/components/utils/svg_path_builder.d.ts +8 -8
  247. package/lib/components/utils/svg_path_builder.d.ts.map +1 -1
  248. package/lib/components/utils/svg_path_builder.js +16 -14
  249. package/lib/components/utils/svg_path_builder.js.map +1 -1
  250. package/lib/components/utils/throttle.d.ts +1 -1
  251. package/lib/components/utils/throttle.d.ts.map +1 -1
  252. package/lib/components/utils/throttle.js +10 -9
  253. package/lib/components/utils/throttle.js.map +1 -1
  254. package/package.json +47 -47
  255. package/src/components/accordion/accordion_context.ts +3 -3
  256. package/src/components/accordion/accordion_context_provider.tsx +3 -7
  257. package/src/components/accordion/accordion_hooks.ts +3 -3
  258. package/src/components/button/Button.tsx +11 -2
  259. package/src/components/color-picker/react-color/ColorPicker.tsx +36 -30
  260. package/src/components/color-picker/react-color/common/Alpha.tsx +5 -7
  261. package/src/components/color-picker/react-color/common/CheckBoard.tsx +2 -4
  262. package/src/components/color-picker/react-color/common/EditableInput.tsx +35 -29
  263. package/src/components/color-picker/react-color/common/Hue.tsx +5 -7
  264. package/src/components/color-picker/react-color/common/Saturation.tsx +7 -9
  265. package/src/components/color-picker/react-color/common/Swatch.tsx +18 -9
  266. package/src/components/color-picker/react-color/common/interaction.tsx +12 -13
  267. package/src/components/color-picker/react-color/common/useOnChange.tsx +2 -2
  268. package/src/components/color-picker/react-color/helpers/alpha.ts +6 -5
  269. package/src/components/color-picker/react-color/helpers/color.ts +16 -13
  270. package/src/components/color-picker/react-color/helpers/hue.ts +16 -25
  271. package/src/components/color-picker/react-color/helpers/saturation.ts +5 -3
  272. package/src/components/color-picker/react-color/sketch/SketchFields.tsx +8 -8
  273. package/src/components/color-picker/react-color/sketch/SketchPresetColors.tsx +9 -9
  274. package/src/components/dialog/ConfirmDialog.tsx +2 -2
  275. package/src/components/draggable/draggable.tsx +20 -18
  276. package/src/components/form/components/field_groups/svg_text_style.schema.ts +1 -1
  277. package/src/components/form/components/field_groups/svg_text_style.tsx +17 -15
  278. package/src/components/form/components/input/checkbox.tsx +3 -3
  279. package/src/components/form/components/input/color_picker.tsx +1 -1
  280. package/src/components/form/components/input/draggable_numeric_input.tsx +1 -1
  281. package/src/components/form/components/input/input.tsx +1 -1
  282. package/src/components/form/components/input/numeric_input.tsx +1 -1
  283. package/src/components/form/components/input/radio_group.tsx +1 -1
  284. package/src/components/form/components/input/select.tsx +1 -1
  285. package/src/components/form/components/input/switch.tsx +1 -1
  286. package/src/components/form/components/input/textarea.tsx +1 -1
  287. package/src/components/form/components/input_groups/form.tsx +3 -3
  288. package/src/components/form/components/input_groups/form_context.ts +3 -3
  289. package/src/components/form/components/layout/form.tsx +4 -6
  290. package/src/components/form/utils/validators.ts +29 -23
  291. package/src/components/fullscreen/fullscreen_context.provider.tsx +4 -9
  292. package/src/components/fullscreen/fullscreen_context.ts +3 -3
  293. package/src/components/hooks/useDoubleClick.ts +8 -8
  294. package/src/components/hooks/useOnClickOutside.ts +2 -2
  295. package/src/components/hooks/useOnOff.ts +5 -5
  296. package/src/components/hooks/useSelect.tsx +5 -3
  297. package/src/components/hooks/useToggle.ts +2 -2
  298. package/src/components/info-panel/InfoPanel.tsx +12 -16
  299. package/src/components/input/radio-button-group/RadioButtonGroup.tsx +5 -2
  300. package/src/components/logger/FifoLoggerDialog.tsx +1 -0
  301. package/src/components/logger/FifoLoggerProvider.tsx +2 -4
  302. package/src/components/logger/loggerContext.ts +1 -1
  303. package/src/components/logger/useFifoLogger.ts +7 -5
  304. package/src/components/root-layout/root_layout.tsx +6 -3
  305. package/src/components/root-layout/root_layout_context.provider.tsx +3 -3
  306. package/src/components/root-layout/root_layout_context.ts +3 -3
  307. package/src/components/selected-total/SelectedTotal.tsx +1 -1
  308. package/src/components/split_pane/split_pane.tsx +17 -20
  309. package/src/components/split_pane/split_pane_helpers.ts +7 -2
  310. package/src/components/split_pane/use_split_pane_size.tsx +4 -3
  311. package/src/components/table/default_table_cell.tsx +10 -11
  312. package/src/components/table/flash_row/flashed_row_context.ts +3 -3
  313. package/src/components/table/flash_row/flashed_row_provider.tsx +8 -6
  314. package/src/components/table/flash_row/use_flash_row_effect.ts +7 -5
  315. package/src/components/table/preview_table.tsx +3 -3
  316. package/src/components/table/preview_table_context.ts +6 -6
  317. package/src/components/table/reorder_rows/draggable_row_context.ts +6 -10
  318. package/src/components/table/reorder_rows/draggable_row_tr.tsx +11 -6
  319. package/src/components/table/reorder_rows/item_order_context.ts +4 -4
  320. package/src/components/table/reorder_rows/item_order_provider.tsx +2 -6
  321. package/src/components/table/reorder_rows/use_drop_monitor.ts +4 -4
  322. package/src/components/table/table_body.tsx +19 -5
  323. package/src/components/table/table_features.ts +12 -12
  324. package/src/components/table/table_root.tsx +20 -18
  325. package/src/components/table/table_utils.ts +4 -5
  326. package/src/components/table/use_table_columns.ts +7 -7
  327. package/src/components/table/use_table_scroll.ts +18 -21
  328. package/src/components/toolbar/OverflowButton.tsx +5 -5
  329. package/src/components/toolbar/Toolbar.tsx +8 -20
  330. package/src/components/toolbar/TooltipHelpContent.tsx +10 -5
  331. package/src/components/toolbar/toolbarContext.ts +5 -7
  332. package/src/components/toolbar/useCheckOverflow.tsx +1 -0
  333. package/src/components/utils/debounce.ts +5 -5
  334. package/src/components/utils/{shouldForwardPropExcept.ts → forward_all_props_except.ts} +1 -1
  335. package/src/components/utils/svg.ts +5 -2
  336. package/src/components/utils/svg_path_builder.ts +22 -19
  337. package/src/components/utils/throttle.ts +13 -11
  338. package/lib/components/utils/shouldForwardPropExcept.d.ts +0 -2
  339. package/lib/components/utils/shouldForwardPropExcept.d.ts.map +0 -1
  340. package/lib/components/utils/shouldForwardPropExcept.js.map +0 -1
@@ -8,7 +8,11 @@ import { assert } from '@zakodium/utils';
8
8
  * @return The outerHTML of the SVG element.
9
9
  */
10
10
  export function exportSVG(base, options = {}) {
11
- const { removeFromSelector, addBackground = false, backgroundColor = 'white', customMutations, } = options;
11
+ const {
12
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
13
+ removeFromSelector,
14
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
15
+ addBackground = false, backgroundColor = 'white', customMutations, } = options;
12
16
  const svg = base.cloneNode(true);
13
17
  // cleanup svg
14
18
  if (removeFromSelector) {
@@ -18,10 +22,7 @@ export function exportSVG(base, options = {}) {
18
22
  }
19
23
  }
20
24
  if (addBackground) {
21
- const background = document.createElementNS(
22
- // XML namespaces are immutable. This false-positive is fixed in eslint-plugin-unicorn v66.
23
- // eslint-disable-next-line unicorn/prefer-https
24
- 'http://www.w3.org/2000/svg', 'rect');
25
+ const background = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
25
26
  background.setAttribute('x', '0');
26
27
  background.setAttribute('y', '0');
27
28
  background.setAttribute('width', '100%');
@@ -39,7 +40,11 @@ export function exportSVG(base, options = {}) {
39
40
  * @param options
40
41
  */
41
42
  export async function exportSVGAsPNG(base, options = {}) {
42
- const { removeFromSelector, addBackground = false, backgroundColor = 'white', customMutations, } = options;
43
+ const {
44
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
45
+ removeFromSelector,
46
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
47
+ addBackground = false, backgroundColor = 'white', customMutations, } = options;
43
48
  const svg = exportSVG(base, {
44
49
  removeFromSelector,
45
50
  addBackground: false,
@@ -48,6 +53,7 @@ export async function exportSVGAsPNG(base, options = {}) {
48
53
  const svgBlob = new Blob([svg], { type: 'image/svg+xml' });
49
54
  const img = new Image();
50
55
  img.src = URL.createObjectURL(svgBlob);
56
+ // eslint-disable-next-line unicorn/prefer-await
51
57
  await img.decode().finally(() => URL.revokeObjectURL(img.src));
52
58
  const canvas = new OffscreenCanvas(img.naturalWidth, img.naturalHeight);
53
59
  const ctx = canvas.getContext('2d');
@@ -1 +1 @@
1
- {"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/components/utils/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA+BzC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAmB,EACnB,UAA4B,EAAE;IAE9B,MAAM,EACJ,kBAAkB,EAClB,aAAa,GAAG,KAAK,EACrB,eAAe,GAAG,OAAO,EACzB,eAAe,GAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAkB,CAAC;IAElD,cAAc;IACd,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,kBAAkB,CA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G,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,gDAAgD;IAChD,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEZ,IAAI,aAAa,EAAE,CAAC;QAClB,GAAG,CAAC,SAAS,GAAG,eAAe,CAAC;QAChC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEzB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9D,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -14,6 +14,12 @@
14
14
  */
15
15
  export declare class SVGPathBuilder {
16
16
  #private;
17
+ /**
18
+ * Merge many path builders into a new single one.
19
+ *
20
+ * @param builders
21
+ */
22
+ static concat(...builders: SVGPathBuilder[]): SVGPathBuilder;
17
23
  clampValue: number | null;
18
24
  /**
19
25
  * @param clampValue - All `x` and `y` values passed to moveTo and lineTo commands
@@ -26,9 +32,9 @@ export declare class SVGPathBuilder {
26
32
  /**
27
33
  * Get a shallow copy of internal the buffer.
28
34
  *
29
- * @param sliceArgs
35
+ * @param sliceArguments
30
36
  */
31
- getBufferSlice(...sliceArgs: [start?: number, end?: number]): string[];
37
+ getBufferSlice(...sliceArguments: [start?: number, end?: number]): string[];
32
38
  /**
33
39
  * Absolute move to
34
40
  *
@@ -57,11 +63,5 @@ export declare class SVGPathBuilder {
57
63
  * @param separator - default value is debug friendly (new-line + two spaces).
58
64
  */
59
65
  toString(separator?: string): string;
60
- /**
61
- * Merge many path builders into a new single one.
62
- *
63
- * @param builders
64
- */
65
- static concat(...builders: SVGPathBuilder[]): SVGPathBuilder;
66
66
  }
67
67
  //# sourceMappingURL=svg_path_builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"svg_path_builder.d.ts","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;;IAEzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;;;OAMG;gBACS,UAAU,GAAE,MAAM,GAAG,IAA0B;IAqB3D;;;;OAIG;IACH,cAAc,CAAC,GAAG,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAI3D;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;OAIG;IACH,SAAS,IAAI,IAAI;IAOjB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,SAAoB,GAAG,MAAM;IAI/C;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,EAAE,cAAc,EAAE,GAAG,cAAc;CAS7D"}
1
+ {"version":3,"file":"svg_path_builder.d.ts","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;;IACzB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,EAAE,cAAc,EAAE,GAAG,cAAc;IAY5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;;;OAMG;gBACS,UAAU,GAAE,MAAM,GAAG,IAA0B;IAqB3D;;;;OAIG;IACH,cAAc,CAAC,GAAG,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAIhE;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;OAIG;IACH,SAAS,IAAI,IAAI;IAOjB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,SAAoB,GAAG,MAAM;CAGhD"}
@@ -1,4 +1,6 @@
1
- /** Better dom readability */
1
+ /**
2
+ * Better dom readability.
3
+ */
2
4
  const DEFAULT_SEPARATOR = '\n ';
3
5
  const DEFAULT_CLAMP_VALUE = 1e5;
4
6
  /**
@@ -16,6 +18,16 @@ const DEFAULT_CLAMP_VALUE = 1e5;
16
18
  * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d
17
19
  */
18
20
  export class SVGPathBuilder {
21
+ /**
22
+ * Merge many path builders into a new single one.
23
+ *
24
+ * @param builders
25
+ */
26
+ static concat(...builders) {
27
+ const builder = new SVGPathBuilder();
28
+ builder.#buffer = builder.#buffer.concat(builders.flatMap((path) => path.getBufferSlice()));
29
+ return builder;
30
+ }
19
31
  #buffer = [];
20
32
  clampValue;
21
33
  /**
@@ -49,10 +61,10 @@ export class SVGPathBuilder {
49
61
  /**
50
62
  * Get a shallow copy of internal the buffer.
51
63
  *
52
- * @param sliceArgs
64
+ * @param sliceArguments
53
65
  */
54
- getBufferSlice(...sliceArgs) {
55
- return this.#buffer.slice(...sliceArgs);
66
+ getBufferSlice(...sliceArguments) {
67
+ return this.#buffer.slice(...sliceArguments);
56
68
  }
57
69
  /**
58
70
  * Absolute move to
@@ -99,15 +111,5 @@ export class SVGPathBuilder {
99
111
  toString(separator = DEFAULT_SEPARATOR) {
100
112
  return this.#buffer.join(separator);
101
113
  }
102
- /**
103
- * Merge many path builders into a new single one.
104
- *
105
- * @param builders
106
- */
107
- static concat(...builders) {
108
- const builder = new SVGPathBuilder();
109
- builder.#buffer = builder.#buffer.concat(builders.flatMap((path) => path.getBufferSlice()));
110
- return builder;
111
- }
112
114
  }
113
115
  //# sourceMappingURL=svg_path_builder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"svg_path_builder.js","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAAc;IACzB,OAAO,GAAa,EAAE,CAAC;IACvB,UAAU,CAAgB;IAE1B;;;;;;OAMG;IACH,YAAY,aAA4B,mBAAmB;QACzD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAa;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAC3B,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QAC9B,IAAI,KAAK,GAAG,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,CAAC;QAC5B,IAAI,KAAK,GAAG,EAAE;YAAE,OAAO,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,GAAG,SAAyC;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,KA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H,MAAM,CAAC,CAAS,EAAE,CAAS;QACzB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,CAAS,EAAE,CAAS;QACzB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,SAAS;QACP,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,SAAS,GAAG,iBAAiB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- export declare function throttle<T extends (...args: any[]) => void>(func: T, limit: number): T;
1
+ export declare function throttle<T extends (...arguments_: any[]) => void>(function_: T, limit: number): T;
2
2
  //# sourceMappingURL=throttle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EACzD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,MAAM,GACZ,CAAC,CAeH"}
1
+ {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,UAAU,EAAE,GAAG,EAAE,KAAK,IAAI,EAC/D,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,MAAM,GACZ,CAAC,CAiBH"}
@@ -1,13 +1,14 @@
1
- export function throttle(func, limit) {
2
- let inThrottle;
3
- const fun = (...args) => {
4
- if (!inThrottle) {
5
- func.apply({}, args);
6
- inThrottle = true;
7
- setTimeout(() => {
8
- inThrottle = false;
9
- }, limit);
1
+ export function throttle(function_, limit) {
2
+ let isInThrottle;
3
+ const fun = (...arguments_) => {
4
+ if (isInThrottle) {
5
+ return;
10
6
  }
7
+ function_.apply({}, arguments_);
8
+ isInThrottle = true;
9
+ setTimeout(() => {
10
+ isInThrottle = false;
11
+ }, limit);
11
12
  };
12
13
  return fun;
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CACtB,IAAO,EACP,KAAa;IAEb,IAAI,UAAmB,CAAC;IAExB,MAAM,GAAG,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE;QAC7B,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YACrB,UAAU,GAAG,IAAI,CAAC;YAElB,UAAU,CAAC,GAAG,EAAE;gBACd,UAAU,GAAG,KAAK,CAAC;YACrB,CAAC,EAAE,KAAK,CAAC,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,GAAQ,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CACtB,SAAY,EACZ,KAAa;IAEb,IAAI,YAAqB,CAAC;IAE1B,MAAM,GAAG,GAAG,CAAC,GAAG,UAAiB,EAAE,EAAE;QACnC,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAChC,YAAY,GAAG,IAAI,CAAC;QAEpB,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC;IAEF,OAAO,GAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-science",
3
- "version": "23.1.1",
3
+ "version": "24.0.1",
4
4
  "description": "React components to build scientific applications UI",
5
5
  "type": "module",
6
6
  "exports": {
@@ -23,7 +23,7 @@
23
23
  "createData": "npm run prepack && node scripts/createData",
24
24
  "dev": "echo Use npm run dev-app or npm run storybook && exit 1",
25
25
  "dev-app": "vite --open /pages/demo.html",
26
- "eslint": "eslint . --cache --max-warnings=45",
26
+ "eslint": "eslint . --cache --max-warnings=51",
27
27
  "eslint-fix": "npm run eslint -- --fix",
28
28
  "playwright": "npm run playwright-ct -- --project chromium && npm run playwright-e2e -- --project chromium",
29
29
  "playwright-ct": "playwright test -c playwright-ct.config.mts",
@@ -48,87 +48,87 @@
48
48
  },
49
49
  "homepage": "https://github.com/zakodium-oss/react-science#readme",
50
50
  "peerDependencies": {
51
- "@blueprintjs/core": "^6.16.0",
52
- "@blueprintjs/icons": "^6.11.0",
53
- "@blueprintjs/select": "^6.3.0",
51
+ "@blueprintjs/core": "^6.20.0",
52
+ "@blueprintjs/icons": "^6.14.1",
53
+ "@blueprintjs/select": "^6.3.6",
54
54
  "fifo-logger": "^2.0.1",
55
- "react": "^18.3.1 || ^19.2.7",
56
- "react-dom": "^18.3.1 || ^19.2.7"
55
+ "react": "^19.3.0",
56
+ "react-dom": "^19.3.0"
57
57
  },
58
58
  "dependencies": {
59
59
  "@emotion/styled": "^11.14.1",
60
60
  "@radix-ui/react-use-controllable-state": "^1.2.6",
61
- "@tanstack/react-form": "^1.33.4",
61
+ "@tanstack/react-form": "^1.33.5",
62
62
  "@tanstack/react-store": "^0.11.1",
63
- "@tanstack/react-table": "^9.1.2",
64
- "@tanstack/react-virtual": "^3.14.9",
65
- "@zakodium/pdnd-esm": "^1.1.0",
63
+ "@tanstack/react-table": "^9.2.4",
64
+ "@tanstack/react-virtual": "^3.14.13",
65
+ "@zakodium/pdnd-esm": "^1.1.2",
66
66
  "@zakodium/utils": "^0.5.1",
67
67
  "d3-scale-chromatic": "^3.1.0",
68
68
  "react-d3-utils": "^3.1.2",
69
- "react-dropzone": "^20.1.0",
69
+ "react-dropzone": "^20.1.2",
70
70
  "react-full-screen": "^1.1.1",
71
71
  "react-icons": "^5.7.0",
72
72
  "react-inspector": "^9.0.0",
73
73
  "tinycolor2": "^1.6.0",
74
74
  "ts-pattern": "^5.9.0",
75
- "zod": "^4.4.3"
75
+ "zod": "^4.6.5"
76
76
  },
77
77
  "devDependencies": {
78
- "@blueprintjs/core": "6.16.0",
79
- "@blueprintjs/icons": "6.11.0",
80
- "@blueprintjs/select": "6.3.0",
78
+ "@blueprintjs/core": "6.20.0",
79
+ "@blueprintjs/icons": "6.14.1",
80
+ "@blueprintjs/select": "6.3.6",
81
81
  "@floating-ui/react": "^0.27.20",
82
- "@playwright/experimental-ct-react": "^1.62.1",
83
- "@playwright/test": "^1.62.1",
84
- "@storybook/addon-docs": "^10.5.7",
85
- "@storybook/react-vite": "^10.5.7",
86
- "@tanstack/react-query": "^5.101.4",
82
+ "@playwright/experimental-ct-react": "1.62.1",
83
+ "@playwright/test": "1.62.1",
84
+ "@storybook/addon-docs": "^10.6.0",
85
+ "@storybook/react-vite": "^10.6.0",
86
+ "@tanstack/react-query": "^5.103.2",
87
87
  "@types/babel__core": "^7.20.5",
88
88
  "@types/d3-scale-chromatic": "^3.1.0",
89
- "@types/node": "^26.2.0",
90
- "@types/react": "^18.3.31",
91
- "@types/react-dom": "^18.3.7",
89
+ "@types/node": "^26.6.2",
90
+ "@types/react": "^19.3.0",
91
+ "@types/react-dom": "^19.3.0",
92
92
  "@types/tinycolor2": "^1.4.6",
93
- "@vitejs/plugin-react": "^6.0.5",
94
- "@vitest/coverage-v8": "^4.1.10",
93
+ "@vitejs/plugin-react": "^6.1.1",
94
+ "@vitest/coverage-v8": "^5.0.1",
95
95
  "@zakodium/tsconfig": "^1.0.5",
96
96
  "biologic-converter": "^1.0.0",
97
- "cheminfo-font": "^1.27.0",
98
- "cheminfo-types": "^1.15.0",
97
+ "cheminfo-font": "^1.28.0",
98
+ "cheminfo-types": "^1.16.0",
99
99
  "cross-env": "^10.1.0",
100
- "eslint": "^9.39.5",
101
- "eslint-config-zakodium": "^20.1.0",
102
- "eslint-plugin-storybook": "^10.5.7",
100
+ "eslint": "^10.11.0",
101
+ "eslint-config-zakodium": "^21.0.0",
102
+ "eslint-plugin-storybook": "^10.6.0",
103
103
  "fifo-logger": "2.0.1",
104
104
  "filelist-utils": "^1.11.3",
105
- "immer": "^11.1.16",
106
- "jcampconverter": "^12.5.3",
107
- "ml-gsd": "^14.2.2",
108
- "ml-peak-shape-generator": "^5.5.0",
105
+ "immer": "^11.1.18",
106
+ "jcampconverter": "^12.5.7",
107
+ "ml-gsd": "^14.3.0",
108
+ "ml-peak-shape-generator": "^5.6.0",
109
109
  "ml-signal-processing": "^2.2.2",
110
- "ml-spectra-processing": "^14.33.0",
111
- "ms-spectrum": "^3.12.0",
110
+ "ml-spectra-processing": "^14.35.1",
111
+ "ms-spectrum": "^3.12.1",
112
112
  "netcdfjs": "^4.0.0",
113
113
  "postcss-styled-syntax": "^0.7.2",
114
- "prettier": "^3.9.6",
115
- "react": "18.3.1",
116
- "react-dom": "18.3.1",
117
- "react-error-boundary": "^6.1.2",
114
+ "prettier": "^3.9.9",
115
+ "react": "19.3.0",
116
+ "react-dom": "19.3.0",
117
+ "react-error-boundary": "^6.1.6",
118
118
  "react-kbs": "^3.1.0",
119
119
  "react-ocl": "^8.7.2",
120
120
  "react-plot": "^3.1.2",
121
121
  "rimraf": "^6.1.3",
122
- "spc-parser": "^2.1.0",
123
- "storybook": "^10.5.7",
124
- "stylelint": "^17.14.1",
122
+ "spc-parser": "^2.1.1",
123
+ "storybook": "^10.6.0",
124
+ "stylelint": "^17.15.0",
125
125
  "stylelint-config-standard": "^40.0.0",
126
126
  "typescript": "^6.0.3",
127
- "vite": "^8.2.1",
128
- "vitest": "^4.1.10",
127
+ "vite": "^8.3.0",
128
+ "vitest": "^5.0.1",
129
129
  "wdf-parser": "^1.0.0"
130
130
  },
131
131
  "volta": {
132
- "node": "24.19.0"
132
+ "node": "24.21.0"
133
133
  }
134
134
  }
@@ -1,4 +1,4 @@
1
- import { createContext, useContext, useEffect, useMemo } from 'react';
1
+ import { createContext, use, useEffect, useMemo } from 'react';
2
2
 
3
3
  import type {
4
4
  AccordionItemContextValue,
@@ -17,7 +17,7 @@ export type AccordionContextValue = [
17
17
  change: (id: string, isOpen: boolean) => void;
18
18
  },
19
19
  ];
20
- export const accordionContext = createContext<AccordionContextValue | null>(
20
+ export const AccordionContext = createContext<AccordionContextValue | null>(
21
21
  null,
22
22
  );
23
23
 
@@ -25,7 +25,7 @@ export function useAccordionItemContext(
25
25
  id: string,
26
26
  setIsOpen: AccordionItemSetIsOpen,
27
27
  ): AccordionItemContextValue {
28
- const context = useContext(accordionContext);
28
+ const context = use(AccordionContext);
29
29
 
30
30
  if (!context) {
31
31
  throw new Error('AccordionContext was not found');
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
3
3
  import { useMemo, useRef } from 'react';
4
4
 
5
5
  import type { AccordionContextValue } from './accordion_context.js';
6
- import { accordionContext } from './accordion_context.js';
6
+ import { AccordionContext } from './accordion_context.js';
7
7
  import type { AccordionItemSetIsOpen } from './accordion_context_utils.js';
8
8
  import { getAccordionRegister } from './accordion_context_utils.js';
9
9
 
@@ -27,7 +27,7 @@ export function AccordionProvider(props: AccordionProviderProps) {
27
27
  },
28
28
  closeAllExcept: (id: string) => {
29
29
  assert(registerRef.current);
30
- for (const [key, item] of registerRef.current.entries()) {
30
+ for (const [key, item] of registerRef.current) {
31
31
  if (key === id) {
32
32
  item.setIsOpen(true);
33
33
  } else {
@@ -70,9 +70,5 @@ export function AccordionProvider(props: AccordionProviderProps) {
70
70
  ];
71
71
  }, [unmountChildren, utils]);
72
72
 
73
- return (
74
- <accordionContext.Provider value={contextValue}>
75
- {children}
76
- </accordionContext.Provider>
77
- );
73
+ return <AccordionContext value={contextValue}>{children}</AccordionContext>;
78
74
  }
@@ -1,6 +1,6 @@
1
- import { useContext, useMemo } from 'react';
1
+ import { use, useMemo } from 'react';
2
2
 
3
- import { accordionContext } from './accordion_context.js';
3
+ import { AccordionContext } from './accordion_context.js';
4
4
 
5
5
  export interface AccordionControls<T extends string = string> {
6
6
  open: (id: T) => void;
@@ -12,7 +12,7 @@ export interface AccordionControls<T extends string = string> {
12
12
  export function useAccordionControls<
13
13
  T extends string = string,
14
14
  >(): AccordionControls<T> {
15
- const context = useContext(accordionContext);
15
+ const context = use(AccordionContext);
16
16
 
17
17
  if (!context) {
18
18
  throw new Error('AccordionContext was not found');
@@ -12,6 +12,7 @@ import {
12
12
  Tooltip,
13
13
  } from '@blueprintjs/core';
14
14
  import styled from '@emotion/styled';
15
+ import type { Mandatory } from '@zakodium/utils';
15
16
  import type { ReactNode } from 'react';
16
17
 
17
18
  type BlueprintProps = {
@@ -77,8 +78,16 @@ const TooltipButton = styled(BlueprintButton, {
77
78
  ${(props) => buttonStyles(props)}
78
79
  `;
79
80
 
81
+ const defaultTooltipProps: Mandatory<ButtonProps['tooltipProps']> = {};
82
+
80
83
  export function Button(props: ButtonProps) {
81
- const { tooltipProps = {}, children, tag, tagProps, ...buttonProps } = props;
84
+ const {
85
+ tooltipProps = defaultTooltipProps,
86
+ children,
87
+ tag,
88
+ tagProps,
89
+ ...buttonProps
90
+ } = props;
82
91
  const {
83
92
  fill,
84
93
  content = '',
@@ -103,7 +112,7 @@ export function Button(props: ButtonProps) {
103
112
  isIconButton={!children && !buttonProps.text}
104
113
  isTagButton={Boolean(tag)}
105
114
  >
106
- {tag && (
115
+ {Boolean(tag) && (
107
116
  <ButtonTag round intent="success" {...tagProps}>
108
117
  {tag}
109
118
  </ButtonTag>
@@ -43,12 +43,12 @@ export interface ColorPickerProps {
43
43
  className?: string;
44
44
  presetColors?: string[];
45
45
  color?:
46
- | {
47
- hex: string;
48
- }
49
46
  | RGB
50
47
  | HSL
51
- | HSV;
48
+ | HSV
49
+ | {
50
+ hex: string;
51
+ };
52
52
  disableAlpha?: boolean;
53
53
  onChange?: (props: ChangeCallbackProps, event?: Event) => void;
54
54
  onChangeComplete?: (props: ChangeCallbackProps, event?: Event) => void;
@@ -76,7 +76,7 @@ const styles: Record<
76
76
  Record<
77
77
  'picker' | 'color' | 'activeColor' | 'alphaContainer',
78
78
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
- (...args: any) => CSSProperties
79
+ (...arguments_: any) => CSSProperties
80
80
  > = {
81
81
  picker: (width: number | string) => ({
82
82
  width: typeof width === 'string' ? width : `${width}px`,
@@ -93,9 +93,9 @@ const styles: Record<
93
93
  padding: '4px 0',
94
94
  flex: '1',
95
95
  },
96
- color: (disableAlpha: boolean) => ({
96
+ color: (isAlphaDisabled: boolean) => ({
97
97
  width: '24px',
98
- height: disableAlpha ? '10px' : '24px',
98
+ height: isAlphaDisabled ? '10px' : '24px',
99
99
  position: 'relative',
100
100
  marginTop: '4px',
101
101
  marginLeft: '4px',
@@ -128,12 +128,12 @@ const styles: Record<
128
128
  borderRadius: '2px',
129
129
  boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)',
130
130
  },
131
- alphaContainer: (disableAlpha: boolean) => ({
131
+ alphaContainer: (isAlphaDisabled: boolean) => ({
132
132
  position: 'relative',
133
133
  height: '10px',
134
134
  marginTop: '4px',
135
135
  overflow: 'hidden',
136
- ...(disableAlpha && { display: 'none' }),
136
+ ...(isAlphaDisabled && { display: 'none' }),
137
137
  }),
138
138
  alphaElement: {
139
139
  borderRadius: '2px',
@@ -141,6 +141,8 @@ const styles: Record<
141
141
  },
142
142
  };
143
143
 
144
+ const defaultStyle: CSSProperties = {};
145
+
144
146
  export function ColorPicker(props: ColorPickerProps) {
145
147
  const {
146
148
  width = 200,
@@ -152,12 +154,12 @@ export function ColorPicker(props: ColorPickerProps) {
152
154
  color = defaultColor,
153
155
  onChangeComplete,
154
156
  onBlur,
155
- style = {},
157
+ style = defaultStyle,
156
158
  } = props;
157
159
 
158
160
  const debounceRef = useRef(
159
- debounce((fn: any, data: ChangeCallbackProps, event: Event) => {
160
- fn(data, event);
161
+ debounce((function_: any, data: ChangeCallbackProps, event: Event) => {
162
+ function_(data, event);
161
163
  }, 100),
162
164
  );
163
165
 
@@ -172,18 +174,20 @@ export function ColorPicker(props: ColorPickerProps) {
172
174
  const handleChange = useCallback<SketchFieldsProps['onChange']>(
173
175
  (data, event) => {
174
176
  const isValidColor = colorHelper.simpleCheckForValidColor(data);
175
- if (isValidColor) {
176
- const colors = colorHelper.toState(
177
- data,
178
- ('h' in data && data.h) || state.oldHue,
179
- );
180
- setState(colors);
181
- if (onChangeComplete) {
182
- debounceRef.current(onChangeComplete, colors, event);
183
- }
184
- if (onChange) {
185
- onChange(colors, event);
186
- }
177
+ if (!isValidColor) {
178
+ return;
179
+ }
180
+
181
+ const colors = colorHelper.toState(
182
+ data,
183
+ ('h' in data && data.h) || state.oldHue,
184
+ );
185
+ setState(colors);
186
+ if (onChangeComplete) {
187
+ debounceRef.current(onChangeComplete, colors, event);
188
+ }
189
+ if (onChange) {
190
+ onChange(colors, event);
187
191
  }
188
192
  },
189
193
  [debounceRef, onChange, onChangeComplete, state.oldHue],
@@ -192,11 +196,13 @@ export function ColorPicker(props: ColorPickerProps) {
192
196
  const handleSwatchHover = useCallback(
193
197
  (data: any, event: any) => {
194
198
  const isValidColor = colorHelper.simpleCheckForValidColor(data);
195
- if (isValidColor) {
196
- const colors = colorHelper.toState(data, data.h || state.oldHue);
197
- if (onSwatchHover) {
198
- onSwatchHover(colors, event);
199
- }
199
+ if (!isValidColor) {
200
+ return;
201
+ }
202
+
203
+ const colors = colorHelper.toState(data, data.h || state.oldHue);
204
+ if (onSwatchHover) {
205
+ onSwatchHover(colors, event);
200
206
  }
201
207
  },
202
208
  [onSwatchHover, state.oldHue],
@@ -249,7 +255,7 @@ export function ColorPicker(props: ColorPickerProps) {
249
255
  />
250
256
  <SketchPresetColors
251
257
  colors={presetColors}
252
- onClick={(data, e) => handleChange(data, e)}
258
+ onClick={(data, event) => handleChange(data, event)}
253
259
  onSwatchHover={handleSwatchHover}
254
260
  />
255
261
  </div>
@@ -75,19 +75,19 @@ const styles = {
75
75
  },
76
76
  };
77
77
 
78
- const Alpha = (props) => {
78
+ export default function Alpha(props) {
79
79
  const containerRef = useRef();
80
80
  const handleChange = useCallback(
81
- (e) => {
81
+ (event) => {
82
82
  const change = alpha.calculateChange(
83
- e,
83
+ event,
84
84
  props.hsl,
85
85
  props.direction,
86
86
  props.a,
87
87
  containerRef.current,
88
88
  );
89
89
  if (change && typeof props.onChange === 'function') {
90
- props.onChange(change, e);
90
+ props.onChange(change, event);
91
91
  }
92
92
  },
93
93
  [props],
@@ -119,6 +119,4 @@ const Alpha = (props) => {
119
119
  </div>
120
120
  </div>
121
121
  );
122
- };
123
-
124
- export default Alpha;
122
+ }
@@ -34,7 +34,7 @@ const styles = {
34
34
  },
35
35
  };
36
36
 
37
- const CheckBoard = (props) => {
37
+ export default function CheckBoard(props) {
38
38
  const { children } = props;
39
39
 
40
40
  if (!isValidElement(children)) {
@@ -45,6 +45,4 @@ const CheckBoard = (props) => {
45
45
  ...children.props,
46
46
  style: { ...children.props.style, ...styles.grid(props) },
47
47
  });
48
- };
49
-
50
- export default CheckBoard;
48
+ }