react-science 23.1.0 → 24.0.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 (342) 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/index.d.ts +1 -0
  82. package/lib/components/form/components/input/index.d.ts.map +1 -1
  83. package/lib/components/form/components/input/input.js +1 -1
  84. package/lib/components/form/components/input/input.js.map +1 -1
  85. package/lib/components/form/components/input/numeric_input.js +1 -1
  86. package/lib/components/form/components/input/numeric_input.js.map +1 -1
  87. package/lib/components/form/components/input/radio_group.js +1 -1
  88. package/lib/components/form/components/input/radio_group.js.map +1 -1
  89. package/lib/components/form/components/input/select.js +1 -1
  90. package/lib/components/form/components/input/select.js.map +1 -1
  91. package/lib/components/form/components/input/switch.js +1 -1
  92. package/lib/components/form/components/input/switch.js.map +1 -1
  93. package/lib/components/form/components/input/textarea.js +1 -1
  94. package/lib/components/form/components/input/textarea.js.map +1 -1
  95. package/lib/components/form/components/input_groups/form.js +2 -2
  96. package/lib/components/form/components/input_groups/form.js.map +1 -1
  97. package/lib/components/form/components/input_groups/form_context.d.ts +1 -1
  98. package/lib/components/form/components/input_groups/form_context.js +3 -3
  99. package/lib/components/form/components/input_groups/form_context.js.map +1 -1
  100. package/lib/components/form/components/layout/form.d.ts +1 -1
  101. package/lib/components/form/components/layout/form.d.ts.map +1 -1
  102. package/lib/components/form/components/layout/form.js +1 -4
  103. package/lib/components/form/components/layout/form.js.map +1 -1
  104. package/lib/components/form/utils/validators.d.ts +14 -8
  105. package/lib/components/form/utils/validators.d.ts.map +1 -1
  106. package/lib/components/form/utils/validators.js +11 -11
  107. package/lib/components/form/utils/validators.js.map +1 -1
  108. package/lib/components/fullscreen/fullscreen_context.d.ts +1 -1
  109. package/lib/components/fullscreen/fullscreen_context.js +3 -3
  110. package/lib/components/fullscreen/fullscreen_context.js.map +1 -1
  111. package/lib/components/fullscreen/fullscreen_context.provider.d.ts +1 -3
  112. package/lib/components/fullscreen/fullscreen_context.provider.d.ts.map +1 -1
  113. package/lib/components/fullscreen/fullscreen_context.provider.js +3 -3
  114. package/lib/components/fullscreen/fullscreen_context.provider.js.map +1 -1
  115. package/lib/components/hooks/useDoubleClick.js +8 -8
  116. package/lib/components/hooks/useDoubleClick.js.map +1 -1
  117. package/lib/components/hooks/useOnClickOutside.js +2 -2
  118. package/lib/components/hooks/useOnClickOutside.js.map +1 -1
  119. package/lib/components/hooks/useOnOff.d.ts +1 -1
  120. package/lib/components/hooks/useOnOff.d.ts.map +1 -1
  121. package/lib/components/hooks/useOnOff.js +5 -5
  122. package/lib/components/hooks/useOnOff.js.map +1 -1
  123. package/lib/components/hooks/useSelect.d.ts.map +1 -1
  124. package/lib/components/hooks/useSelect.js +4 -3
  125. package/lib/components/hooks/useSelect.js.map +1 -1
  126. package/lib/components/hooks/useToggle.d.ts +1 -1
  127. package/lib/components/hooks/useToggle.d.ts.map +1 -1
  128. package/lib/components/hooks/useToggle.js +2 -2
  129. package/lib/components/hooks/useToggle.js.map +1 -1
  130. package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
  131. package/lib/components/info-panel/InfoPanel.js +10 -13
  132. package/lib/components/info-panel/InfoPanel.js.map +1 -1
  133. package/lib/components/input/radio-button-group/RadioButtonGroup.d.ts.map +1 -1
  134. package/lib/components/input/radio-button-group/RadioButtonGroup.js +3 -2
  135. package/lib/components/input/radio-button-group/RadioButtonGroup.js.map +1 -1
  136. package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
  137. package/lib/components/logger/FifoLoggerDialog.js +3 -1
  138. package/lib/components/logger/FifoLoggerDialog.js.map +1 -1
  139. package/lib/components/logger/FifoLoggerProvider.d.ts.map +1 -1
  140. package/lib/components/logger/FifoLoggerProvider.js +2 -2
  141. package/lib/components/logger/FifoLoggerProvider.js.map +1 -1
  142. package/lib/components/logger/loggerContext.d.ts +1 -1
  143. package/lib/components/logger/loggerContext.js +1 -1
  144. package/lib/components/logger/useFifoLogger.d.ts.map +1 -1
  145. package/lib/components/logger/useFifoLogger.js +7 -5
  146. package/lib/components/logger/useFifoLogger.js.map +1 -1
  147. package/lib/components/root-layout/root_layout.d.ts.map +1 -1
  148. package/lib/components/root-layout/root_layout.js +5 -3
  149. package/lib/components/root-layout/root_layout.js.map +1 -1
  150. package/lib/components/root-layout/root_layout_context.d.ts +1 -1
  151. package/lib/components/root-layout/root_layout_context.js +3 -3
  152. package/lib/components/root-layout/root_layout_context.js.map +1 -1
  153. package/lib/components/root-layout/root_layout_context.provider.js +2 -2
  154. package/lib/components/root-layout/root_layout_context.provider.js.map +1 -1
  155. package/lib/components/selected-total/SelectedTotal.js +1 -1
  156. package/lib/components/selected-total/SelectedTotal.js.map +1 -1
  157. package/lib/components/split_pane/split_pane.d.ts.map +1 -1
  158. package/lib/components/split_pane/split_pane.js +14 -18
  159. package/lib/components/split_pane/split_pane.js.map +1 -1
  160. package/lib/components/split_pane/split_pane_helpers.js +1 -1
  161. package/lib/components/split_pane/split_pane_helpers.js.map +1 -1
  162. package/lib/components/split_pane/use_split_pane_size.d.ts.map +1 -1
  163. package/lib/components/split_pane/use_split_pane_size.js +4 -3
  164. package/lib/components/split_pane/use_split_pane_size.js.map +1 -1
  165. package/lib/components/table/default_table_cell.d.ts.map +1 -1
  166. package/lib/components/table/default_table_cell.js +6 -14
  167. package/lib/components/table/default_table_cell.js.map +1 -1
  168. package/lib/components/table/flash_row/flashed_row_context.d.ts +1 -1
  169. package/lib/components/table/flash_row/flashed_row_context.js +3 -3
  170. package/lib/components/table/flash_row/flashed_row_context.js.map +1 -1
  171. package/lib/components/table/flash_row/flashed_row_provider.d.ts.map +1 -1
  172. package/lib/components/table/flash_row/flashed_row_provider.js +5 -4
  173. package/lib/components/table/flash_row/flashed_row_provider.js.map +1 -1
  174. package/lib/components/table/flash_row/use_flash_row_effect.d.ts.map +1 -1
  175. package/lib/components/table/flash_row/use_flash_row_effect.js +6 -5
  176. package/lib/components/table/flash_row/use_flash_row_effect.js.map +1 -1
  177. package/lib/components/table/preview_table.js +2 -2
  178. package/lib/components/table/preview_table.js.map +1 -1
  179. package/lib/components/table/preview_table_context.d.ts +2 -2
  180. package/lib/components/table/preview_table_context.js +6 -6
  181. package/lib/components/table/preview_table_context.js.map +1 -1
  182. package/lib/components/table/reorder_rows/draggable_row_context.d.ts +4 -6
  183. package/lib/components/table/reorder_rows/draggable_row_context.d.ts.map +1 -1
  184. package/lib/components/table/reorder_rows/draggable_row_context.js +3 -3
  185. package/lib/components/table/reorder_rows/draggable_row_context.js.map +1 -1
  186. package/lib/components/table/reorder_rows/draggable_row_tr.d.ts.map +1 -1
  187. package/lib/components/table/reorder_rows/draggable_row_tr.js +4 -3
  188. package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
  189. package/lib/components/table/reorder_rows/item_order_context.d.ts +2 -2
  190. package/lib/components/table/reorder_rows/item_order_context.d.ts.map +1 -1
  191. package/lib/components/table/reorder_rows/item_order_context.js +3 -3
  192. package/lib/components/table/reorder_rows/item_order_context.js.map +1 -1
  193. package/lib/components/table/reorder_rows/item_order_provider.d.ts.map +1 -1
  194. package/lib/components/table/reorder_rows/item_order_provider.js +2 -2
  195. package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -1
  196. package/lib/components/table/reorder_rows/use_drop_monitor.d.ts +2 -2
  197. package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
  198. package/lib/components/table/reorder_rows/use_drop_monitor.js +4 -4
  199. package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
  200. package/lib/components/table/table_body.d.ts.map +1 -1
  201. package/lib/components/table/table_body.js +10 -6
  202. package/lib/components/table/table_body.js.map +1 -1
  203. package/lib/components/table/table_features.js +7 -7
  204. package/lib/components/table/table_features.js.map +1 -1
  205. package/lib/components/table/table_header_cell.d.ts +1 -1
  206. package/lib/components/table/table_header_cell.d.ts.map +1 -1
  207. package/lib/components/table/table_root.d.ts +2 -2
  208. package/lib/components/table/table_root.d.ts.map +1 -1
  209. package/lib/components/table/table_root.js +12 -12
  210. package/lib/components/table/table_root.js.map +1 -1
  211. package/lib/components/table/table_utils.d.ts +1 -1
  212. package/lib/components/table/table_utils.d.ts.map +1 -1
  213. package/lib/components/table/table_utils.js.map +1 -1
  214. package/lib/components/table/use_table_columns.d.ts +2 -2
  215. package/lib/components/table/use_table_columns.d.ts.map +1 -1
  216. package/lib/components/table/use_table_columns.js +4 -4
  217. package/lib/components/table/use_table_columns.js.map +1 -1
  218. package/lib/components/table/use_table_scroll.d.ts.map +1 -1
  219. package/lib/components/table/use_table_scroll.js +13 -15
  220. package/lib/components/table/use_table_scroll.js.map +1 -1
  221. package/lib/components/toolbar/OverflowButton.js +5 -5
  222. package/lib/components/toolbar/OverflowButton.js.map +1 -1
  223. package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
  224. package/lib/components/toolbar/Toolbar.js +5 -8
  225. package/lib/components/toolbar/Toolbar.js.map +1 -1
  226. package/lib/components/toolbar/TooltipHelpContent.d.ts.map +1 -1
  227. package/lib/components/toolbar/TooltipHelpContent.js +5 -2
  228. package/lib/components/toolbar/TooltipHelpContent.js.map +1 -1
  229. package/lib/components/toolbar/toolbarContext.d.ts +3 -3
  230. package/lib/components/toolbar/toolbarContext.d.ts.map +1 -1
  231. package/lib/components/toolbar/toolbarContext.js +4 -4
  232. package/lib/components/toolbar/toolbarContext.js.map +1 -1
  233. package/lib/components/toolbar/useCheckOverflow.d.ts.map +1 -1
  234. package/lib/components/toolbar/useCheckOverflow.js +1 -0
  235. package/lib/components/toolbar/useCheckOverflow.js.map +1 -1
  236. package/lib/components/utils/debounce.d.ts +1 -1
  237. package/lib/components/utils/debounce.d.ts.map +1 -1
  238. package/lib/components/utils/debounce.js +3 -3
  239. package/lib/components/utils/debounce.js.map +1 -1
  240. package/lib/components/utils/forward_all_props_except.d.ts +2 -0
  241. package/lib/components/utils/forward_all_props_except.d.ts.map +1 -0
  242. package/lib/components/utils/{shouldForwardPropExcept.js → forward_all_props_except.js} +2 -2
  243. package/lib/components/utils/forward_all_props_except.js.map +1 -0
  244. package/lib/components/utils/svg.d.ts.map +1 -1
  245. package/lib/components/utils/svg.js +12 -6
  246. package/lib/components/utils/svg.js.map +1 -1
  247. package/lib/components/utils/svg_path_builder.d.ts +8 -8
  248. package/lib/components/utils/svg_path_builder.d.ts.map +1 -1
  249. package/lib/components/utils/svg_path_builder.js +16 -14
  250. package/lib/components/utils/svg_path_builder.js.map +1 -1
  251. package/lib/components/utils/throttle.d.ts +1 -1
  252. package/lib/components/utils/throttle.d.ts.map +1 -1
  253. package/lib/components/utils/throttle.js +10 -9
  254. package/lib/components/utils/throttle.js.map +1 -1
  255. package/package.json +47 -47
  256. package/src/components/accordion/accordion_context.ts +3 -3
  257. package/src/components/accordion/accordion_context_provider.tsx +3 -7
  258. package/src/components/accordion/accordion_hooks.ts +3 -3
  259. package/src/components/button/Button.tsx +11 -2
  260. package/src/components/color-picker/react-color/ColorPicker.tsx +36 -30
  261. package/src/components/color-picker/react-color/common/Alpha.tsx +5 -7
  262. package/src/components/color-picker/react-color/common/CheckBoard.tsx +2 -4
  263. package/src/components/color-picker/react-color/common/EditableInput.tsx +35 -29
  264. package/src/components/color-picker/react-color/common/Hue.tsx +5 -7
  265. package/src/components/color-picker/react-color/common/Saturation.tsx +7 -9
  266. package/src/components/color-picker/react-color/common/Swatch.tsx +18 -9
  267. package/src/components/color-picker/react-color/common/interaction.tsx +12 -13
  268. package/src/components/color-picker/react-color/common/useOnChange.tsx +2 -2
  269. package/src/components/color-picker/react-color/helpers/alpha.ts +6 -5
  270. package/src/components/color-picker/react-color/helpers/color.ts +16 -13
  271. package/src/components/color-picker/react-color/helpers/hue.ts +16 -25
  272. package/src/components/color-picker/react-color/helpers/saturation.ts +5 -3
  273. package/src/components/color-picker/react-color/sketch/SketchFields.tsx +8 -8
  274. package/src/components/color-picker/react-color/sketch/SketchPresetColors.tsx +9 -9
  275. package/src/components/dialog/ConfirmDialog.tsx +2 -2
  276. package/src/components/draggable/draggable.tsx +20 -18
  277. package/src/components/form/components/field_groups/svg_text_style.schema.ts +1 -1
  278. package/src/components/form/components/field_groups/svg_text_style.tsx +17 -15
  279. package/src/components/form/components/input/checkbox.tsx +3 -3
  280. package/src/components/form/components/input/color_picker.tsx +1 -1
  281. package/src/components/form/components/input/draggable_numeric_input.tsx +1 -1
  282. package/src/components/form/components/input/index.ts +1 -0
  283. package/src/components/form/components/input/input.tsx +1 -1
  284. package/src/components/form/components/input/numeric_input.tsx +1 -1
  285. package/src/components/form/components/input/radio_group.tsx +1 -1
  286. package/src/components/form/components/input/select.tsx +1 -1
  287. package/src/components/form/components/input/switch.tsx +1 -1
  288. package/src/components/form/components/input/textarea.tsx +1 -1
  289. package/src/components/form/components/input_groups/form.tsx +3 -3
  290. package/src/components/form/components/input_groups/form_context.ts +3 -3
  291. package/src/components/form/components/layout/form.tsx +4 -6
  292. package/src/components/form/utils/validators.ts +29 -23
  293. package/src/components/fullscreen/fullscreen_context.provider.tsx +4 -9
  294. package/src/components/fullscreen/fullscreen_context.ts +3 -3
  295. package/src/components/hooks/useDoubleClick.ts +8 -8
  296. package/src/components/hooks/useOnClickOutside.ts +2 -2
  297. package/src/components/hooks/useOnOff.ts +5 -5
  298. package/src/components/hooks/useSelect.tsx +5 -3
  299. package/src/components/hooks/useToggle.ts +2 -2
  300. package/src/components/info-panel/InfoPanel.tsx +12 -16
  301. package/src/components/input/radio-button-group/RadioButtonGroup.tsx +5 -2
  302. package/src/components/logger/FifoLoggerDialog.tsx +1 -0
  303. package/src/components/logger/FifoLoggerProvider.tsx +2 -4
  304. package/src/components/logger/loggerContext.ts +1 -1
  305. package/src/components/logger/useFifoLogger.ts +7 -5
  306. package/src/components/root-layout/root_layout.tsx +6 -3
  307. package/src/components/root-layout/root_layout_context.provider.tsx +3 -3
  308. package/src/components/root-layout/root_layout_context.ts +3 -3
  309. package/src/components/selected-total/SelectedTotal.tsx +1 -1
  310. package/src/components/split_pane/split_pane.tsx +17 -20
  311. package/src/components/split_pane/split_pane_helpers.ts +1 -1
  312. package/src/components/split_pane/use_split_pane_size.tsx +4 -3
  313. package/src/components/table/default_table_cell.tsx +10 -11
  314. package/src/components/table/flash_row/flashed_row_context.ts +3 -3
  315. package/src/components/table/flash_row/flashed_row_provider.tsx +8 -6
  316. package/src/components/table/flash_row/use_flash_row_effect.ts +7 -5
  317. package/src/components/table/preview_table.tsx +3 -3
  318. package/src/components/table/preview_table_context.ts +6 -6
  319. package/src/components/table/reorder_rows/draggable_row_context.ts +6 -10
  320. package/src/components/table/reorder_rows/draggable_row_tr.tsx +11 -6
  321. package/src/components/table/reorder_rows/item_order_context.ts +4 -4
  322. package/src/components/table/reorder_rows/item_order_provider.tsx +2 -6
  323. package/src/components/table/reorder_rows/use_drop_monitor.ts +4 -4
  324. package/src/components/table/table_body.tsx +19 -5
  325. package/src/components/table/table_features.ts +12 -12
  326. package/src/components/table/table_root.tsx +20 -18
  327. package/src/components/table/table_utils.ts +4 -5
  328. package/src/components/table/use_table_columns.ts +7 -7
  329. package/src/components/table/use_table_scroll.ts +18 -21
  330. package/src/components/toolbar/OverflowButton.tsx +5 -5
  331. package/src/components/toolbar/Toolbar.tsx +8 -20
  332. package/src/components/toolbar/TooltipHelpContent.tsx +10 -5
  333. package/src/components/toolbar/toolbarContext.ts +5 -7
  334. package/src/components/toolbar/useCheckOverflow.tsx +1 -0
  335. package/src/components/utils/debounce.ts +5 -5
  336. package/src/components/utils/{shouldForwardPropExcept.ts → forward_all_props_except.ts} +1 -1
  337. package/src/components/utils/svg.ts +5 -2
  338. package/src/components/utils/svg_path_builder.ts +22 -19
  339. package/src/components/utils/throttle.ts +13 -11
  340. package/lib/components/utils/shouldForwardPropExcept.d.ts +0 -2
  341. package/lib/components/utils/shouldForwardPropExcept.d.ts.map +0 -1
  342. package/lib/components/utils/shouldForwardPropExcept.js.map +0 -1
@@ -12,7 +12,7 @@ import type {
12
12
  import { useEffect, useMemo, useRef } from 'react';
13
13
  import { match } from 'ts-pattern';
14
14
 
15
- import { shouldForwardPropExcept } from '../utils/shouldForwardPropExcept.js';
15
+ import { forwardAllPropsExcept } from '../utils/forward_all_props_except.ts';
16
16
 
17
17
  import { FlashedRowProvider } from './flash_row/flashed_row_provider.js';
18
18
  import type { PreviewTablePropsContextValue } from './preview_table_context.js';
@@ -27,7 +27,7 @@ import { ScrollContainer } from './table_scroll_container.js';
27
27
  import type {
28
28
  GetTdProps,
29
29
  Scroller,
30
- TableColumnDef,
30
+ TableColumnDefinition,
31
31
  TableRowPreviewRenderer,
32
32
  TableRowTrRenderer,
33
33
  VirtualScroller,
@@ -35,7 +35,7 @@ import type {
35
35
  import { useTableColumns } from './use_table_columns.js';
36
36
 
37
37
  const CustomHTMLTable = styled(HTMLTable, {
38
- shouldForwardProp: shouldForwardPropExcept([
38
+ shouldForwardProp: forwardAllPropsExcept([
39
39
  'striped',
40
40
  'stickyHeader',
41
41
  'noHeader',
@@ -83,7 +83,7 @@ interface TableBaseProps<TData extends RowData> {
83
83
  * Tanstack table definition of columns in the table.
84
84
  */
85
85
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- columns: Array<TableColumnDef<TData, any>>;
86
+ columns: Array<TableColumnDefinition<TData, any>>;
87
87
  /**
88
88
  * Show borders between each cell and row of the table.
89
89
  */
@@ -327,7 +327,7 @@ export function Table<TData extends RowData>(props: TableProps<TData>) {
327
327
  virtualScrollElementRef
328
328
  : // When not virtualized, ScrollContainer does not render a container, only its children,
329
329
  // And the scrollable element is provided by the user or by default, the <table> element.
330
- // eslint-disable-next-line unicorn/consistent-destructuring
330
+
331
331
  props.scrollableElementRef || tableRef
332
332
  }
333
333
  scrollToRowRef={scrollToRowRef}
@@ -380,19 +380,21 @@ function useCheckProps<TData extends RowData>(
380
380
  ) {
381
381
  const { onRowOrderChanged, getRowId } = props;
382
382
  useEffect(() => {
383
- if (onRowOrderChanged) {
384
- if (!getRowId) {
385
- // eslint-disable-next-line no-console
386
- console.warn(
387
- 'When reordering rows is enabled via the `onRowOrderChanged` prop, the `getRowId` prop must be provided to identify each row unambiguously.',
388
- );
389
- }
390
- if (headers.some((header) => header.column.getCanSort())) {
391
- // eslint-disable-next-line no-console
392
- console.warn(
393
- 'When reordering rows is enabled via the `onRowOrderChanged` prop, none of the columns should be sortable as data order will be overriden by internal sorting.',
394
- );
395
- }
383
+ if (!onRowOrderChanged) {
384
+ return;
385
+ }
386
+
387
+ if (!getRowId) {
388
+ // eslint-disable-next-line no-console
389
+ console.warn(
390
+ 'When reordering rows is enabled via the `onRowOrderChanged` prop, the `getRowId` prop must be provided to identify each row unambiguously.',
391
+ );
392
+ }
393
+ if (headers.some((header) => header.column.getCanSort())) {
394
+ // eslint-disable-next-line no-console
395
+ console.warn(
396
+ 'When reordering rows is enabled via the `onRowOrderChanged` prop, none of the columns should be sortable as data order will be overriden by internal sorting.',
397
+ );
396
398
  }
397
399
  }, [onRowOrderChanged, getRowId, headers]);
398
400
  }
@@ -5,11 +5,10 @@ import type { CSSProperties, ReactNode, TdHTMLAttributes } from 'react';
5
5
 
6
6
  import type { ReactScienceTableFeatures } from './table_features.js';
7
7
 
8
- export type TableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<
9
- ReactScienceTableFeatures,
10
- TData,
11
- TValue
12
- >;
8
+ export type TableColumnDefinition<
9
+ TData extends RowData,
10
+ TValue = unknown,
11
+ > = ColumnDef<ReactScienceTableFeatures, TData, TValue>;
13
12
 
14
13
  type TableTdProps = TdHTMLAttributes<HTMLTableCellElement>;
15
14
 
@@ -2,17 +2,17 @@ import type { RowData } from '@tanstack/react-table';
2
2
  import { useMemo } from 'react';
3
3
 
4
4
  import { defaultTableCell } from './default_table_cell.js';
5
- import type { TableColumnDef } from './table_utils.js';
5
+ import type { TableColumnDefinition } from './table_utils.js';
6
6
 
7
7
  export function useTableColumns<TData extends RowData, TValue>(
8
- columnDefs: Array<TableColumnDef<TData, TValue>>,
8
+ columnDefs: Array<TableColumnDefinition<TData, TValue>>,
9
9
  ) {
10
- return useMemo<Array<TableColumnDef<TData, TValue>>>(() => {
11
- return columnDefs.map((columnDef) => {
10
+ return useMemo<Array<TableColumnDefinition<TData, TValue>>>(() => {
11
+ return columnDefs.map((columnDefinition) => {
12
12
  return {
13
- ...columnDef,
14
- cell: columnDef.cell ?? defaultTableCell,
15
- enableSorting: columnDef.enableSorting ?? false,
13
+ ...columnDefinition,
14
+ cell: columnDefinition.cell ?? defaultTableCell,
15
+ enableSorting: columnDefinition.enableSorting ?? false,
16
16
  };
17
17
  });
18
18
  }, [columnDefs]);
@@ -59,27 +59,24 @@ export function useTableScroll<TData extends RowData>(options: {
59
59
  }
60
60
  },
61
61
  };
62
- } else {
63
- return {
64
- scrollIntoView(
65
- id: string,
66
- options?: TableVirtualScrollIntoViewOptions,
67
- ) {
68
- const element = scrollRef.current?.querySelector(
69
- selector`tr[data-row-id="${id}"]`,
70
- );
71
- if (!element) {
72
- // eslint-disable-next-line no-console
73
- console.warn(
74
- `Could not scroll to row with ID ${id}, the row does not exist`,
75
- );
76
- }
77
- element?.scrollIntoView(options);
78
- if (options?.flashRow && options.behavior !== 'smooth') {
79
- setFlashedRow(id);
80
- }
81
- },
82
- };
83
62
  }
63
+
64
+ return {
65
+ scrollIntoView(id: string, options?: TableVirtualScrollIntoViewOptions) {
66
+ const element = scrollRef.current?.querySelector(
67
+ selector`tr[data-row-id="${id}"]`,
68
+ );
69
+ if (!element) {
70
+ // eslint-disable-next-line no-console
71
+ console.warn(
72
+ `Could not scroll to row with ID ${id}, the row does not exist`,
73
+ );
74
+ }
75
+ element?.scrollIntoView(options);
76
+ if (options?.flashRow && options.behavior !== 'smooth') {
77
+ setFlashedRow(id);
78
+ }
79
+ },
80
+ };
84
81
  }, [virtualizeRows, scrollRef, table, virtualizer, setFlashedRow]);
85
82
  }
@@ -20,10 +20,10 @@ export interface OverButtonProps extends BaseOverButtonProps {
20
20
 
21
21
  function getPlacement(
22
22
  placement: Placement,
23
- vertical?: boolean,
23
+ isVertical?: boolean,
24
24
  ): PopoverNextProps['placement'] {
25
25
  const isEndPlacement = placement === 'end';
26
- return vertical
26
+ return isVertical
27
27
  ? `${isEndPlacement ? 'top' : 'bottom'}-start`
28
28
  : `${isEndPlacement ? 'left' : 'right'}-start`;
29
29
  }
@@ -78,7 +78,7 @@ export function OverflowButton(props: OverButtonProps) {
78
78
  );
79
79
  }
80
80
 
81
- function getOverflowShadow(placement: Placement, vertical?: boolean) {
81
+ function getOverflowShadow(placement: Placement, isVertical?: boolean) {
82
82
  const color = 'rgba(0, 0, 0, 0.15)';
83
83
  const offset = 8;
84
84
  const blur = 8;
@@ -86,8 +86,8 @@ function getOverflowShadow(placement: Placement, vertical?: boolean) {
86
86
 
87
87
  const sign = placement === 'start' ? 1 : -1;
88
88
 
89
- const x = vertical ? 0 : offset * sign;
90
- const y = vertical ? offset * sign : 0;
89
+ const x = isVertical ? 0 : offset * sign;
90
+ const y = isVertical ? offset * sign : 0;
91
91
 
92
92
  return `${x}px ${y}px ${blur}px -${spread}px ${color}`;
93
93
  }
@@ -13,7 +13,7 @@ import {
13
13
  } from '@blueprintjs/core';
14
14
  import type { StyledComponent } from '@emotion/styled';
15
15
  import styled from '@emotion/styled';
16
- import type { MouseEvent, ReactNode } from 'react';
16
+ import type { MouseEvent } from 'react';
17
17
  import { useLayoutEffect, useMemo, useRef } from 'react';
18
18
 
19
19
  import type { ButtonProps } from '../button/index.js';
@@ -22,8 +22,7 @@ import { normalizeIcon } from '../icon.js';
22
22
 
23
23
  import type { BaseOverButtonProps, Placement } from './OverflowButton.tsx';
24
24
  import { OverflowButton } from './OverflowButton.tsx';
25
- import type { ToolbarContext } from './toolbarContext.js';
26
- import { toolbarContext, useToolbarContext } from './toolbarContext.js';
25
+ import { ToolbarContext, useToolbarContext } from './toolbarContext.js';
27
26
  import { useCheckOverflow } from './useCheckOverflow.tsx';
28
27
 
29
28
  export type Overflow = 'wrap' | 'collapse';
@@ -163,8 +162,8 @@ export function Toolbar(props: ToolbarProps) {
163
162
  }
164
163
  ref.current.style.width = 'initial';
165
164
  const divRect = ref.current.getBoundingClientRect();
166
- const lastElemRect = lastElement.getBoundingClientRect();
167
- const width = `${lastElemRect.right - divRect.left}px`;
165
+ const lastElementRect = lastElement.getBoundingClientRect();
166
+ const width = `${lastElementRect.right - divRect.left}px`;
168
167
  if (ref.current.style.width !== width) {
169
168
  ref.current.style.width = width;
170
169
  }
@@ -182,7 +181,7 @@ export function Toolbar(props: ToolbarProps) {
182
181
 
183
182
  if (overflow === 'wrap') {
184
183
  return (
185
- <ToolbarProvider value={contextValue}>
184
+ <ToolbarContext value={contextValue}>
186
185
  <ButtonGroup
187
186
  role="toolbar"
188
187
  aria-label={ariaLabel}
@@ -197,12 +196,12 @@ export function Toolbar(props: ToolbarProps) {
197
196
  >
198
197
  {children}
199
198
  </ButtonGroup>
200
- </ToolbarProvider>
199
+ </ToolbarContext>
201
200
  );
202
201
  }
203
202
 
204
203
  return (
205
- <ToolbarProvider value={contextValue}>
204
+ <ToolbarContext value={contextValue}>
206
205
  <Container vertical={vertical} placement={placement}>
207
206
  <ButtonGroup
208
207
  role="toolbar"
@@ -234,7 +233,7 @@ export function Toolbar(props: ToolbarProps) {
234
233
  </OverflowButton>
235
234
  )}
236
235
  </Container>
237
- </ToolbarProvider>
236
+ </ToolbarContext>
238
237
  );
239
238
  }
240
239
 
@@ -351,14 +350,3 @@ Toolbar.PopoverItem = function ToolbarPopoverItem(
351
350
  />
352
351
  );
353
352
  };
354
-
355
- function ToolbarProvider(props: {
356
- value: ToolbarContext;
357
- children: ReactNode;
358
- }) {
359
- return (
360
- <toolbarContext.Provider value={props.value}>
361
- {props.children}
362
- </toolbarContext.Provider>
363
- );
364
- }
@@ -1,4 +1,5 @@
1
1
  import styled from '@emotion/styled';
2
+ import type { Mandatory } from '@zakodium/utils';
2
3
  import type { CSSProperties } from 'react';
3
4
 
4
5
  const shortcutBoxSize = 1.5;
@@ -81,14 +82,18 @@ export interface TooltipItem {
81
82
  style?: CSSProperties;
82
83
  }
83
84
 
85
+ const defaultShortCuts: Mandatory<TooltipItem['shortcuts']> = [];
86
+ const defaultSubTitles: Mandatory<TooltipItem['subTitles']> = [];
87
+ const defaultStyle: Mandatory<TooltipItem['style']> = {};
88
+
84
89
  export function TooltipHelpContent(props: TooltipItem) {
85
90
  const {
86
91
  title,
87
- shortcuts = [],
88
- subTitles = [],
92
+ shortcuts = defaultShortCuts,
93
+ subTitles = defaultSubTitles,
89
94
  description = '',
90
95
  link,
91
- style = {},
96
+ style = defaultStyle,
92
97
  } = props;
93
98
 
94
99
  return (
@@ -135,8 +140,8 @@ function ShortCuts({ shortcuts }: { shortcuts: string[] }) {
135
140
  >
136
141
  {shortcuts.map((shortcut, index) => {
137
142
  return (
138
- // eslint-disable-next-line react/no-array-index-key
139
- <ShortcutItem key={`${index}`}>
143
+ // eslint-disable-next-line @eslint-react/no-array-index-key
144
+ <ShortcutItem key={index}>
140
145
  <span>{shortcut}</span>
141
146
  </ShortcutItem>
142
147
  );
@@ -1,23 +1,21 @@
1
1
  import type { Intent } from '@blueprintjs/core';
2
- import { createContext, useContext } from 'react';
2
+ import { createContext, use } from 'react';
3
3
 
4
4
  import type { PopoverInteractionType } from './Toolbar.js';
5
5
 
6
- export interface ToolbarContext {
6
+ export interface ToolbarContextValue {
7
7
  intent?: Intent;
8
8
  vertical?: boolean;
9
9
  disabled?: boolean;
10
10
  popoverInteractionKind?: PopoverInteractionType;
11
11
  }
12
12
 
13
- export const toolbarContext = createContext<ToolbarContext | null>(null);
13
+ export const ToolbarContext = createContext<ToolbarContextValue | null>(null);
14
14
 
15
15
  export function useToolbarContext() {
16
- const ctx = useContext(toolbarContext);
16
+ const ctx = use(ToolbarContext);
17
17
  if (!ctx) {
18
- throw new Error(
19
- 'useToolbarContext must be used within a ToolbarContextProvider',
20
- );
18
+ throw new Error('useToolbarContext must be used within a ToolbarContext');
21
19
  }
22
20
  return ctx;
23
21
  }
@@ -26,6 +26,7 @@ export function useCheckOverflow(options: UseCheckOverflowOptions) {
26
26
  } else {
27
27
  isOverflow = container.scrollWidth > container.clientWidth;
28
28
  }
29
+ // eslint-disable-next-line @eslint-react/set-state-in-effect
29
30
  setIsOverflow(isOverflow);
30
31
  };
31
32
 
@@ -1,16 +1,16 @@
1
- export function debounce<T extends (...args: any[]) => any>(
2
- func: T,
1
+ export function debounce<T extends (...arguments_: any[]) => any>(
2
+ function_: T,
3
3
  wait: number,
4
- ): (...args: Parameters<T>) => void {
4
+ ): (...arguments_: Parameters<T>) => void {
5
5
  let timeout: ReturnType<typeof setTimeout> | null;
6
6
 
7
- return (...args: Parameters<T>) => {
7
+ return (...arguments_: Parameters<T>) => {
8
8
  if (timeout) {
9
9
  clearTimeout(timeout);
10
10
  }
11
11
 
12
12
  timeout = setTimeout(() => {
13
- func.apply({}, args);
13
+ function_.apply({}, arguments_);
14
14
  }, wait);
15
15
  };
16
16
  }
@@ -1,4 +1,4 @@
1
- export function shouldForwardPropExcept(properties: string[]) {
1
+ export function forwardAllPropsExcept(properties: string[]) {
2
2
  const propsSet = new Set(properties);
3
3
  return (property: string) => {
4
4
  return !propsSet.has(property);
@@ -42,7 +42,9 @@ export function exportSVG(
42
42
  options: ExportSVGOptions = {},
43
43
  ): string {
44
44
  const {
45
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
45
46
  removeFromSelector,
47
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
46
48
  addBackground = false,
47
49
  backgroundColor = 'white',
48
50
  customMutations,
@@ -60,8 +62,6 @@ export function exportSVG(
60
62
 
61
63
  if (addBackground) {
62
64
  const background = document.createElementNS(
63
- // XML namespaces are immutable. This false-positive is fixed in eslint-plugin-unicorn v66.
64
- // eslint-disable-next-line unicorn/prefer-https
65
65
  'http://www.w3.org/2000/svg',
66
66
  'rect',
67
67
  );
@@ -89,7 +89,9 @@ export async function exportSVGAsPNG(
89
89
  options: ExportSVGOptions = {},
90
90
  ): Promise<Blob> {
91
91
  const {
92
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
92
93
  removeFromSelector,
94
+ // eslint-disable-next-line unicorn/no-non-function-verb-prefix
93
95
  addBackground = false,
94
96
  backgroundColor = 'white',
95
97
  customMutations,
@@ -104,6 +106,7 @@ export async function exportSVGAsPNG(
104
106
 
105
107
  const img = new Image();
106
108
  img.src = URL.createObjectURL(svgBlob);
109
+ // eslint-disable-next-line unicorn/prefer-await
107
110
  await img.decode().finally(() => URL.revokeObjectURL(img.src));
108
111
 
109
112
  const canvas = new OffscreenCanvas(img.naturalWidth, img.naturalHeight);
@@ -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
 
@@ -17,7 +19,23 @@ const DEFAULT_CLAMP_VALUE = 1e5;
17
19
  * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d
18
20
  */
19
21
  export class SVGPathBuilder {
22
+ /**
23
+ * Merge many path builders into a new single one.
24
+ *
25
+ * @param builders
26
+ */
27
+ static concat(...builders: SVGPathBuilder[]): SVGPathBuilder {
28
+ const builder = new SVGPathBuilder();
29
+
30
+ builder.#buffer = builder.#buffer.concat(
31
+ builders.flatMap((path) => path.getBufferSlice()),
32
+ );
33
+
34
+ return builder;
35
+ }
36
+
20
37
  #buffer: string[] = [];
38
+
21
39
  clampValue: number | null;
22
40
 
23
41
  /**
@@ -51,10 +69,10 @@ export class SVGPathBuilder {
51
69
  /**
52
70
  * Get a shallow copy of internal the buffer.
53
71
  *
54
- * @param sliceArgs
72
+ * @param sliceArguments
55
73
  */
56
- getBufferSlice(...sliceArgs: [start?: number, end?: number]) {
57
- return this.#buffer.slice(...sliceArgs);
74
+ getBufferSlice(...sliceArguments: [start?: number, end?: number]) {
75
+ return this.#buffer.slice(...sliceArguments);
58
76
  }
59
77
 
60
78
  /**
@@ -107,19 +125,4 @@ export class SVGPathBuilder {
107
125
  toString(separator = DEFAULT_SEPARATOR): string {
108
126
  return this.#buffer.join(separator);
109
127
  }
110
-
111
- /**
112
- * Merge many path builders into a new single one.
113
- *
114
- * @param builders
115
- */
116
- static concat(...builders: SVGPathBuilder[]): SVGPathBuilder {
117
- const builder = new SVGPathBuilder();
118
-
119
- builder.#buffer = builder.#buffer.concat(
120
- builders.flatMap((path) => path.getBufferSlice()),
121
- );
122
-
123
- return builder;
124
- }
125
128
  }
@@ -1,18 +1,20 @@
1
- export function throttle<T extends (...args: any[]) => void>(
2
- func: T,
1
+ export function throttle<T extends (...arguments_: any[]) => void>(
2
+ function_: T,
3
3
  limit: number,
4
4
  ): T {
5
- let inThrottle: boolean;
5
+ let isInThrottle: boolean;
6
6
 
7
- const fun = (...args: any[]) => {
8
- if (!inThrottle) {
9
- func.apply({}, args);
10
- inThrottle = true;
11
-
12
- setTimeout(() => {
13
- inThrottle = false;
14
- }, limit);
7
+ const fun = (...arguments_: any[]) => {
8
+ if (isInThrottle) {
9
+ return;
15
10
  }
11
+
12
+ function_.apply({}, arguments_);
13
+ isInThrottle = true;
14
+
15
+ setTimeout(() => {
16
+ isInThrottle = false;
17
+ }, limit);
16
18
  };
17
19
 
18
20
  return fun as T;
@@ -1,2 +0,0 @@
1
- export declare function shouldForwardPropExcept(properties: string[]): (property: string) => boolean;
2
- //# sourceMappingURL=shouldForwardPropExcept.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shouldForwardPropExcept.d.ts","sourceRoot":"","sources":["../../../src/components/utils/shouldForwardPropExcept.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,IAElD,UAAU,MAAM,aAGzB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shouldForwardPropExcept.js","sourceRoot":"","sources":["../../../src/components/utils/shouldForwardPropExcept.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB,CAAC,UAAoB;IAC1D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,CAAC,QAAgB,EAAE,EAAE;QAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC"}