@react-spectrum/s2 1.3.0 → 1.4.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 (1030) hide show
  1. package/dist/exports/Accordion.cjs.map +1 -1
  2. package/dist/exports/Accordion.mjs.map +1 -1
  3. package/dist/exports/ActionMenu.cjs.map +1 -1
  4. package/dist/exports/ActionMenu.mjs.map +1 -1
  5. package/dist/exports/Card.cjs.map +1 -1
  6. package/dist/exports/Card.mjs.map +1 -1
  7. package/dist/exports/CardView.cjs.map +1 -1
  8. package/dist/exports/CardView.mjs.map +1 -1
  9. package/dist/exports/ColorArea.cjs.map +1 -1
  10. package/dist/exports/ColorArea.mjs.map +1 -1
  11. package/dist/exports/ColorField.cjs.map +1 -1
  12. package/dist/exports/ColorField.mjs.map +1 -1
  13. package/dist/exports/ColorSlider.cjs.map +1 -1
  14. package/dist/exports/ColorSlider.mjs.map +1 -1
  15. package/dist/exports/ColorSwatch.cjs.map +1 -1
  16. package/dist/exports/ColorSwatch.mjs.map +1 -1
  17. package/dist/exports/ColorSwatchPicker.cjs.map +1 -1
  18. package/dist/exports/ColorSwatchPicker.mjs.map +1 -1
  19. package/dist/exports/ColorWheel.cjs.map +1 -1
  20. package/dist/exports/ColorWheel.mjs.map +1 -1
  21. package/dist/exports/ContextualHelp.cjs.map +1 -1
  22. package/dist/exports/ContextualHelp.mjs.map +1 -1
  23. package/dist/exports/Disclosure.cjs.map +1 -1
  24. package/dist/exports/Disclosure.mjs.map +1 -1
  25. package/dist/exports/DragPreview.cjs +12 -0
  26. package/dist/exports/DragPreview.cjs.map +1 -0
  27. package/dist/exports/DragPreview.mjs +7 -0
  28. package/dist/exports/DragPreview.mjs.map +1 -0
  29. package/dist/exports/Icon.cjs.map +1 -1
  30. package/dist/exports/Icon.mjs.map +1 -1
  31. package/dist/exports/LabeledValue.cjs +13 -0
  32. package/dist/exports/LabeledValue.cjs.map +1 -0
  33. package/dist/exports/LabeledValue.mjs +7 -0
  34. package/dist/exports/LabeledValue.mjs.map +1 -0
  35. package/dist/exports/Menu.cjs.map +1 -1
  36. package/dist/exports/Menu.mjs.map +1 -1
  37. package/dist/exports/SegmentedControl.cjs.map +1 -1
  38. package/dist/exports/SegmentedControl.mjs.map +1 -1
  39. package/dist/exports/TableView.cjs +1 -0
  40. package/dist/exports/TableView.cjs.map +1 -1
  41. package/dist/exports/TableView.mjs +2 -2
  42. package/dist/exports/TableView.mjs.map +1 -1
  43. package/dist/exports/TreeView.cjs.map +1 -1
  44. package/dist/exports/TreeView.mjs.map +1 -1
  45. package/dist/exports/index.cjs +17 -0
  46. package/dist/exports/index.cjs.map +1 -1
  47. package/dist/exports/index.mjs +10 -2
  48. package/dist/exports/index.mjs.map +1 -1
  49. package/dist/exports/useAsyncList.cjs.map +1 -1
  50. package/dist/exports/useAsyncList.mjs.map +1 -1
  51. package/dist/exports/useDragAndDrop.cjs +21 -0
  52. package/dist/exports/useDragAndDrop.cjs.map +1 -0
  53. package/dist/exports/useDragAndDrop.mjs +11 -0
  54. package/dist/exports/useDragAndDrop.mjs.map +1 -0
  55. package/dist/private/Accordion.cjs +2 -2
  56. package/dist/private/Accordion.cjs.map +1 -1
  57. package/dist/private/Accordion.css +2 -2
  58. package/dist/private/Accordion.css.map +1 -1
  59. package/dist/private/Accordion.mjs +2 -2
  60. package/dist/private/Accordion.mjs.map +1 -1
  61. package/dist/private/ActionBar.cjs +61 -61
  62. package/dist/private/ActionBar.cjs.map +1 -1
  63. package/dist/private/ActionBar.css +58 -58
  64. package/dist/private/ActionBar.css.map +1 -1
  65. package/dist/private/ActionBar.mjs +61 -61
  66. package/dist/private/ActionBar.mjs.map +1 -1
  67. package/dist/private/ActionButton.cjs +350 -323
  68. package/dist/private/ActionButton.cjs.map +1 -1
  69. package/dist/private/ActionButton.css +203 -167
  70. package/dist/private/ActionButton.css.map +1 -1
  71. package/dist/private/ActionButton.mjs +351 -324
  72. package/dist/private/ActionButton.mjs.map +1 -1
  73. package/dist/private/ActionButtonGroup.cjs +15 -15
  74. package/dist/private/ActionButtonGroup.cjs.map +1 -1
  75. package/dist/private/ActionButtonGroup.css +9 -9
  76. package/dist/private/ActionButtonGroup.css.map +1 -1
  77. package/dist/private/ActionButtonGroup.mjs +15 -15
  78. package/dist/private/ActionButtonGroup.mjs.map +1 -1
  79. package/dist/private/ActionMenu.cjs.map +1 -1
  80. package/dist/private/ActionMenu.mjs.map +1 -1
  81. package/dist/private/Add.cjs +10 -10
  82. package/dist/private/Add.cjs.map +1 -1
  83. package/dist/private/Add.css +6 -6
  84. package/dist/private/Add.css.map +1 -1
  85. package/dist/private/Add.mjs +10 -10
  86. package/dist/private/Add.mjs.map +1 -1
  87. package/dist/private/AlertDialog.cjs +3 -3
  88. package/dist/private/AlertDialog.cjs.map +1 -1
  89. package/dist/private/AlertDialog.css +3 -3
  90. package/dist/private/AlertDialog.css.map +1 -1
  91. package/dist/private/AlertDialog.mjs +3 -3
  92. package/dist/private/AlertDialog.mjs.map +1 -1
  93. package/dist/private/Asterisk.cjs +6 -6
  94. package/dist/private/Asterisk.cjs.map +1 -1
  95. package/dist/private/Asterisk.css +4 -4
  96. package/dist/private/Asterisk.css.map +1 -1
  97. package/dist/private/Asterisk.mjs +6 -6
  98. package/dist/private/Asterisk.mjs.map +1 -1
  99. package/dist/private/Avatar.cjs +16 -16
  100. package/dist/private/Avatar.cjs.map +1 -1
  101. package/dist/private/Avatar.css +16 -16
  102. package/dist/private/Avatar.css.map +1 -1
  103. package/dist/private/Avatar.mjs +16 -16
  104. package/dist/private/Avatar.mjs.map +1 -1
  105. package/dist/private/AvatarGroup.cjs +120 -120
  106. package/dist/private/AvatarGroup.cjs.map +1 -1
  107. package/dist/private/AvatarGroup.css +31 -31
  108. package/dist/private/AvatarGroup.css.map +1 -1
  109. package/dist/private/AvatarGroup.mjs +120 -120
  110. package/dist/private/AvatarGroup.mjs.map +1 -1
  111. package/dist/private/Badge.cjs +197 -197
  112. package/dist/private/Badge.cjs.map +1 -1
  113. package/dist/private/Badge.css +125 -125
  114. package/dist/private/Badge.css.map +1 -1
  115. package/dist/private/Badge.mjs +197 -197
  116. package/dist/private/Badge.mjs.map +1 -1
  117. package/dist/private/Breadcrumbs.cjs +234 -234
  118. package/dist/private/Breadcrumbs.cjs.map +1 -1
  119. package/dist/private/Breadcrumbs.css +100 -100
  120. package/dist/private/Breadcrumbs.css.map +1 -1
  121. package/dist/private/Breadcrumbs.mjs +234 -234
  122. package/dist/private/Breadcrumbs.mjs.map +1 -1
  123. package/dist/private/Button.cjs +326 -335
  124. package/dist/private/Button.cjs.map +1 -1
  125. package/dist/private/Button.css +172 -180
  126. package/dist/private/Button.css.map +1 -1
  127. package/dist/private/Button.mjs +326 -335
  128. package/dist/private/Button.mjs.map +1 -1
  129. package/dist/private/ButtonGroup.cjs +20 -20
  130. package/dist/private/ButtonGroup.cjs.map +1 -1
  131. package/dist/private/ButtonGroup.css +15 -15
  132. package/dist/private/ButtonGroup.css.map +1 -1
  133. package/dist/private/ButtonGroup.mjs +20 -20
  134. package/dist/private/ButtonGroup.mjs.map +1 -1
  135. package/dist/private/Calendar.cjs +263 -312
  136. package/dist/private/Calendar.cjs.map +1 -1
  137. package/dist/private/Calendar.css +155 -167
  138. package/dist/private/Calendar.css.map +1 -1
  139. package/dist/private/Calendar.mjs +266 -315
  140. package/dist/private/Calendar.mjs.map +1 -1
  141. package/dist/private/Card.cjs +309 -309
  142. package/dist/private/Card.cjs.map +1 -1
  143. package/dist/private/Card.css +206 -206
  144. package/dist/private/Card.css.map +1 -1
  145. package/dist/private/Card.mjs +309 -309
  146. package/dist/private/Card.mjs.map +1 -1
  147. package/dist/private/CardView.cjs +17 -17
  148. package/dist/private/CardView.cjs.map +1 -1
  149. package/dist/private/CardView.css +17 -17
  150. package/dist/private/CardView.css.map +1 -1
  151. package/dist/private/CardView.mjs +17 -17
  152. package/dist/private/CardView.mjs.map +1 -1
  153. package/dist/private/CenterBaseline.cjs +5 -1
  154. package/dist/private/CenterBaseline.cjs.map +1 -1
  155. package/dist/private/CenterBaseline.css +2 -2
  156. package/dist/private/CenterBaseline.css.map +1 -1
  157. package/dist/private/CenterBaseline.mjs +5 -1
  158. package/dist/private/CenterBaseline.mjs.map +1 -1
  159. package/dist/private/Checkbox.cjs +268 -208
  160. package/dist/private/Checkbox.cjs.map +1 -1
  161. package/dist/private/Checkbox.css +170 -98
  162. package/dist/private/Checkbox.css.map +1 -1
  163. package/dist/private/Checkbox.mjs +269 -209
  164. package/dist/private/Checkbox.mjs.map +1 -1
  165. package/dist/private/CheckboxGroup.cjs +44 -43
  166. package/dist/private/CheckboxGroup.cjs.map +1 -1
  167. package/dist/private/CheckboxGroup.css +37 -37
  168. package/dist/private/CheckboxGroup.css.map +1 -1
  169. package/dist/private/CheckboxGroup.mjs +44 -43
  170. package/dist/private/CheckboxGroup.mjs.map +1 -1
  171. package/dist/private/Checkmark.cjs +12 -12
  172. package/dist/private/Checkmark.cjs.map +1 -1
  173. package/dist/private/Checkmark.css +8 -8
  174. package/dist/private/Checkmark.css.map +1 -1
  175. package/dist/private/Checkmark.mjs +12 -12
  176. package/dist/private/Checkmark.mjs.map +1 -1
  177. package/dist/private/Chevron.cjs +12 -12
  178. package/dist/private/Chevron.cjs.map +1 -1
  179. package/dist/private/Chevron.css +10 -10
  180. package/dist/private/Chevron.css.map +1 -1
  181. package/dist/private/Chevron.mjs +12 -12
  182. package/dist/private/Chevron.mjs.map +1 -1
  183. package/dist/private/ClearButton.cjs +30 -30
  184. package/dist/private/ClearButton.cjs.map +1 -1
  185. package/dist/private/ClearButton.css +30 -30
  186. package/dist/private/ClearButton.css.map +1 -1
  187. package/dist/private/ClearButton.mjs +30 -30
  188. package/dist/private/ClearButton.mjs.map +1 -1
  189. package/dist/private/CloseButton.cjs +52 -57
  190. package/dist/private/CloseButton.cjs.map +1 -1
  191. package/dist/private/CloseButton.css +47 -51
  192. package/dist/private/CloseButton.css.map +1 -1
  193. package/dist/private/CloseButton.mjs +52 -57
  194. package/dist/private/CloseButton.mjs.map +1 -1
  195. package/dist/private/ColorArea.cjs +16 -16
  196. package/dist/private/ColorArea.cjs.map +1 -1
  197. package/dist/private/ColorArea.css +16 -16
  198. package/dist/private/ColorArea.css.map +1 -1
  199. package/dist/private/ColorArea.mjs +16 -16
  200. package/dist/private/ColorArea.mjs.map +1 -1
  201. package/dist/private/ColorField.cjs +44 -33
  202. package/dist/private/ColorField.cjs.map +1 -1
  203. package/dist/private/ColorField.css +27 -27
  204. package/dist/private/ColorField.css.map +1 -1
  205. package/dist/private/ColorField.mjs +44 -33
  206. package/dist/private/ColorField.mjs.map +1 -1
  207. package/dist/private/ColorHandle.cjs +27 -27
  208. package/dist/private/ColorHandle.cjs.map +1 -1
  209. package/dist/private/ColorHandle.css +42 -42
  210. package/dist/private/ColorHandle.css.map +1 -1
  211. package/dist/private/ColorHandle.mjs +27 -27
  212. package/dist/private/ColorHandle.mjs.map +1 -1
  213. package/dist/private/ColorSlider.cjs +113 -109
  214. package/dist/private/ColorSlider.cjs.map +1 -1
  215. package/dist/private/ColorSlider.css +52 -52
  216. package/dist/private/ColorSlider.css.map +1 -1
  217. package/dist/private/ColorSlider.mjs +113 -109
  218. package/dist/private/ColorSlider.mjs.map +1 -1
  219. package/dist/private/ColorSwatch.cjs +29 -29
  220. package/dist/private/ColorSwatch.cjs.map +1 -1
  221. package/dist/private/ColorSwatch.css +29 -29
  222. package/dist/private/ColorSwatch.css.map +1 -1
  223. package/dist/private/ColorSwatch.mjs +29 -29
  224. package/dist/private/ColorSwatch.mjs.map +1 -1
  225. package/dist/private/ColorSwatchPicker.cjs +29 -29
  226. package/dist/private/ColorSwatchPicker.cjs.map +1 -1
  227. package/dist/private/ColorSwatchPicker.css +48 -48
  228. package/dist/private/ColorSwatchPicker.css.map +1 -1
  229. package/dist/private/ColorSwatchPicker.mjs +29 -29
  230. package/dist/private/ColorSwatchPicker.mjs.map +1 -1
  231. package/dist/private/ColorWheel.cjs +26 -26
  232. package/dist/private/ColorWheel.cjs.map +1 -1
  233. package/dist/private/ColorWheel.css +17 -17
  234. package/dist/private/ColorWheel.css.map +1 -1
  235. package/dist/private/ColorWheel.mjs +26 -26
  236. package/dist/private/ColorWheel.mjs.map +1 -1
  237. package/dist/private/ComboBox.cjs +384 -405
  238. package/dist/private/ComboBox.cjs.map +1 -1
  239. package/dist/private/ComboBox.css +192 -188
  240. package/dist/private/ComboBox.css.map +1 -1
  241. package/dist/private/ComboBox.mjs +385 -406
  242. package/dist/private/ComboBox.mjs.map +1 -1
  243. package/dist/private/Content.cjs +2 -1
  244. package/dist/private/Content.cjs.map +1 -1
  245. package/dist/private/Content.mjs +2 -1
  246. package/dist/private/Content.mjs.map +1 -1
  247. package/dist/private/ContextualHelp.cjs +5 -5
  248. package/dist/private/ContextualHelp.cjs.map +1 -1
  249. package/dist/private/ContextualHelp.css +50 -50
  250. package/dist/private/ContextualHelp.css.map +1 -1
  251. package/dist/private/ContextualHelp.mjs +5 -5
  252. package/dist/private/ContextualHelp.mjs.map +1 -1
  253. package/dist/private/CornerTriangle.cjs +76 -0
  254. package/dist/private/CornerTriangle.cjs.map +1 -0
  255. package/dist/private/CornerTriangle.css +26 -0
  256. package/dist/private/CornerTriangle.css.map +1 -0
  257. package/dist/private/CornerTriangle.mjs +71 -0
  258. package/dist/private/CornerTriangle.mjs.map +1 -0
  259. package/dist/private/Cross.cjs +14 -14
  260. package/dist/private/Cross.cjs.map +1 -1
  261. package/dist/private/Cross.css +10 -10
  262. package/dist/private/Cross.css.map +1 -1
  263. package/dist/private/Cross.mjs +14 -14
  264. package/dist/private/Cross.mjs.map +1 -1
  265. package/dist/private/CustomDialog.cjs +27 -26
  266. package/dist/private/CustomDialog.cjs.map +1 -1
  267. package/dist/private/CustomDialog.css +25 -25
  268. package/dist/private/CustomDialog.css.map +1 -1
  269. package/dist/private/CustomDialog.mjs +27 -26
  270. package/dist/private/CustomDialog.mjs.map +1 -1
  271. package/dist/private/Dash.cjs +10 -10
  272. package/dist/private/Dash.cjs.map +1 -1
  273. package/dist/private/Dash.css +6 -6
  274. package/dist/private/Dash.css.map +1 -1
  275. package/dist/private/Dash.mjs +10 -10
  276. package/dist/private/Dash.mjs.map +1 -1
  277. package/dist/private/DateField.cjs +73 -73
  278. package/dist/private/DateField.cjs.map +1 -1
  279. package/dist/private/DateField.css +77 -77
  280. package/dist/private/DateField.css.map +1 -1
  281. package/dist/private/DateField.mjs +73 -73
  282. package/dist/private/DateField.mjs.map +1 -1
  283. package/dist/private/DatePicker.cjs +172 -172
  284. package/dist/private/DatePicker.cjs.map +1 -1
  285. package/dist/private/DatePicker.css +128 -128
  286. package/dist/private/DatePicker.css.map +1 -1
  287. package/dist/private/DatePicker.mjs +172 -172
  288. package/dist/private/DatePicker.mjs.map +1 -1
  289. package/dist/private/DateRangePicker.cjs +55 -55
  290. package/dist/private/DateRangePicker.cjs.map +1 -1
  291. package/dist/private/DateRangePicker.css +59 -59
  292. package/dist/private/DateRangePicker.css.map +1 -1
  293. package/dist/private/DateRangePicker.mjs +55 -55
  294. package/dist/private/DateRangePicker.mjs.map +1 -1
  295. package/dist/private/Dialog.cjs +21 -18
  296. package/dist/private/Dialog.cjs.map +1 -1
  297. package/dist/private/Dialog.css +70 -70
  298. package/dist/private/Dialog.css.map +1 -1
  299. package/dist/private/Dialog.mjs +21 -18
  300. package/dist/private/Dialog.mjs.map +1 -1
  301. package/dist/private/DialogContainer.cjs.map +1 -1
  302. package/dist/private/DialogContainer.mjs.map +1 -1
  303. package/dist/private/DialogTrigger.cjs.map +1 -1
  304. package/dist/private/DialogTrigger.mjs.map +1 -1
  305. package/dist/private/Disclosure.cjs +119 -119
  306. package/dist/private/Disclosure.cjs.map +1 -1
  307. package/dist/private/Disclosure.css +112 -112
  308. package/dist/private/Disclosure.css.map +1 -1
  309. package/dist/private/Disclosure.mjs +119 -119
  310. package/dist/private/Disclosure.mjs.map +1 -1
  311. package/dist/private/Divider.cjs +25 -25
  312. package/dist/private/Divider.cjs.map +1 -1
  313. package/dist/private/Divider.css +25 -25
  314. package/dist/private/Divider.css.map +1 -1
  315. package/dist/private/Divider.mjs +25 -25
  316. package/dist/private/Divider.mjs.map +1 -1
  317. package/dist/private/DragHandle.cjs +76 -0
  318. package/dist/private/DragHandle.cjs.map +1 -0
  319. package/dist/private/DragHandle.css +26 -0
  320. package/dist/private/DragHandle.css.map +1 -0
  321. package/dist/private/DragHandle.mjs +71 -0
  322. package/dist/private/DragHandle.mjs.map +1 -0
  323. package/dist/private/DragPreview.cjs +297 -0
  324. package/dist/private/DragPreview.cjs.map +1 -0
  325. package/dist/private/DragPreview.css +459 -0
  326. package/dist/private/DragPreview.css.map +1 -0
  327. package/dist/private/DragPreview.mjs +288 -0
  328. package/dist/private/DragPreview.mjs.map +1 -0
  329. package/dist/private/DropZone.cjs +61 -61
  330. package/dist/private/DropZone.cjs.map +1 -1
  331. package/dist/private/DropZone.css +57 -57
  332. package/dist/private/DropZone.css.map +1 -1
  333. package/dist/private/DropZone.mjs +61 -61
  334. package/dist/private/DropZone.mjs.map +1 -1
  335. package/dist/private/Field.cjs +421 -372
  336. package/dist/private/Field.cjs.map +1 -1
  337. package/dist/private/Field.css +206 -154
  338. package/dist/private/Field.css.map +1 -1
  339. package/dist/private/Field.mjs +422 -373
  340. package/dist/private/Field.mjs.map +1 -1
  341. package/dist/private/Fonts.cjs.map +1 -1
  342. package/dist/private/Fonts.mjs.map +1 -1
  343. package/dist/private/Form.cjs +9 -9
  344. package/dist/private/Form.cjs.map +1 -1
  345. package/dist/private/Form.css +9 -9
  346. package/dist/private/Form.css.map +1 -1
  347. package/dist/private/Form.mjs +9 -9
  348. package/dist/private/Form.mjs.map +1 -1
  349. package/dist/private/FullscreenDialog.cjs +7 -6
  350. package/dist/private/FullscreenDialog.cjs.map +1 -1
  351. package/dist/private/FullscreenDialog.css +78 -78
  352. package/dist/private/FullscreenDialog.css.map +1 -1
  353. package/dist/private/FullscreenDialog.mjs +7 -6
  354. package/dist/private/FullscreenDialog.mjs.map +1 -1
  355. package/dist/private/IllustratedMessage.cjs +228 -228
  356. package/dist/private/IllustratedMessage.cjs.map +1 -1
  357. package/dist/private/IllustratedMessage.css +72 -72
  358. package/dist/private/IllustratedMessage.css.map +1 -1
  359. package/dist/private/IllustratedMessage.mjs +228 -228
  360. package/dist/private/IllustratedMessage.mjs.map +1 -1
  361. package/dist/private/Image.cjs +16 -16
  362. package/dist/private/Image.cjs.map +1 -1
  363. package/dist/private/Image.css +14 -14
  364. package/dist/private/Image.css.map +1 -1
  365. package/dist/private/Image.mjs +16 -16
  366. package/dist/private/Image.mjs.map +1 -1
  367. package/dist/private/ImageCoordinator.cjs.map +1 -1
  368. package/dist/private/ImageCoordinator.mjs.map +1 -1
  369. package/dist/private/InlineAlert.cjs +100 -100
  370. package/dist/private/InlineAlert.cjs.map +1 -1
  371. package/dist/private/InlineAlert.css +76 -76
  372. package/dist/private/InlineAlert.css.map +1 -1
  373. package/dist/private/InlineAlert.mjs +100 -100
  374. package/dist/private/InlineAlert.mjs.map +1 -1
  375. package/dist/private/LabeledValue.cjs +359 -0
  376. package/dist/private/LabeledValue.cjs.map +1 -0
  377. package/dist/private/LabeledValue.css +285 -0
  378. package/dist/private/LabeledValue.css.map +1 -0
  379. package/dist/private/LabeledValue.mjs +353 -0
  380. package/dist/private/LabeledValue.mjs.map +1 -0
  381. package/dist/private/Link.cjs +49 -49
  382. package/dist/private/Link.cjs.map +1 -1
  383. package/dist/private/Link.css +41 -41
  384. package/dist/private/Link.css.map +1 -1
  385. package/dist/private/Link.mjs +49 -49
  386. package/dist/private/Link.mjs.map +1 -1
  387. package/dist/private/LinkOut.cjs +8 -8
  388. package/dist/private/LinkOut.cjs.map +1 -1
  389. package/dist/private/LinkOut.css +8 -8
  390. package/dist/private/LinkOut.css.map +1 -1
  391. package/dist/private/LinkOut.mjs +8 -8
  392. package/dist/private/LinkOut.mjs.map +1 -1
  393. package/dist/private/ListView.cjs +422 -489
  394. package/dist/private/ListView.cjs.map +1 -1
  395. package/dist/private/ListView.css +276 -348
  396. package/dist/private/ListView.css.map +1 -1
  397. package/dist/private/ListView.mjs +422 -488
  398. package/dist/private/ListView.mjs.map +1 -1
  399. package/dist/private/Menu.cjs +489 -471
  400. package/dist/private/Menu.cjs.map +1 -1
  401. package/dist/private/Menu.css +205 -205
  402. package/dist/private/Menu.css.map +1 -1
  403. package/dist/private/Menu.mjs +489 -471
  404. package/dist/private/Menu.mjs.map +1 -1
  405. package/dist/private/Meter.cjs +153 -153
  406. package/dist/private/Meter.cjs.map +1 -1
  407. package/dist/private/Meter.css +91 -91
  408. package/dist/private/Meter.css.map +1 -1
  409. package/dist/private/Meter.mjs +153 -153
  410. package/dist/private/Meter.mjs.map +1 -1
  411. package/dist/private/Modal.cjs +78 -66
  412. package/dist/private/Modal.cjs.map +1 -1
  413. package/dist/private/Modal.css +83 -53
  414. package/dist/private/Modal.css.map +1 -1
  415. package/dist/private/Modal.mjs +78 -66
  416. package/dist/private/Modal.mjs.map +1 -1
  417. package/dist/private/NotificationBadge.cjs +56 -56
  418. package/dist/private/NotificationBadge.cjs.map +1 -1
  419. package/dist/private/NotificationBadge.css +49 -49
  420. package/dist/private/NotificationBadge.css.map +1 -1
  421. package/dist/private/NotificationBadge.mjs +56 -56
  422. package/dist/private/NotificationBadge.mjs.map +1 -1
  423. package/dist/private/NumberField.cjs +115 -114
  424. package/dist/private/NumberField.cjs.map +1 -1
  425. package/dist/private/NumberField.css +99 -99
  426. package/dist/private/NumberField.css.map +1 -1
  427. package/dist/private/NumberField.mjs +115 -114
  428. package/dist/private/NumberField.mjs.map +1 -1
  429. package/dist/private/Picker.cjs +277 -277
  430. package/dist/private/Picker.cjs.map +1 -1
  431. package/dist/private/Picker.css +173 -173
  432. package/dist/private/Picker.css.map +1 -1
  433. package/dist/private/Picker.mjs +277 -277
  434. package/dist/private/Picker.mjs.map +1 -1
  435. package/dist/private/Popover.cjs +99 -87
  436. package/dist/private/Popover.cjs.map +1 -1
  437. package/dist/private/Popover.css +97 -69
  438. package/dist/private/Popover.css.map +1 -1
  439. package/dist/private/Popover.mjs +99 -87
  440. package/dist/private/Popover.mjs.map +1 -1
  441. package/dist/private/ProgressBar.cjs +163 -163
  442. package/dist/private/ProgressBar.cjs.map +1 -1
  443. package/dist/private/ProgressBar.css +99 -99
  444. package/dist/private/ProgressBar.css.map +1 -1
  445. package/dist/private/ProgressBar.mjs +163 -163
  446. package/dist/private/ProgressBar.mjs.map +1 -1
  447. package/dist/private/ProgressCircle.cjs +31 -31
  448. package/dist/private/ProgressCircle.cjs.map +1 -1
  449. package/dist/private/ProgressCircle.css +24 -24
  450. package/dist/private/ProgressCircle.css.map +1 -1
  451. package/dist/private/ProgressCircle.mjs +31 -31
  452. package/dist/private/ProgressCircle.mjs.map +1 -1
  453. package/dist/private/Provider.cjs +23 -11
  454. package/dist/private/Provider.cjs.map +1 -1
  455. package/dist/private/Provider.css +46 -9
  456. package/dist/private/Provider.css.map +1 -1
  457. package/dist/private/Provider.mjs +23 -11
  458. package/dist/private/Provider.mjs.map +1 -1
  459. package/dist/private/RadioGroup.cjs +251 -203
  460. package/dist/private/RadioGroup.cjs.map +1 -1
  461. package/dist/private/RadioGroup.css +167 -135
  462. package/dist/private/RadioGroup.css.map +1 -1
  463. package/dist/private/RadioGroup.mjs +252 -204
  464. package/dist/private/RadioGroup.mjs.map +1 -1
  465. package/dist/private/RangeCalendar.cjs +19 -17
  466. package/dist/private/RangeCalendar.cjs.map +1 -1
  467. package/dist/private/RangeCalendar.css +17 -17
  468. package/dist/private/RangeCalendar.css.map +1 -1
  469. package/dist/private/RangeCalendar.mjs +19 -17
  470. package/dist/private/RangeCalendar.mjs.map +1 -1
  471. package/dist/private/RangeSlider.cjs +7 -15
  472. package/dist/private/RangeSlider.cjs.map +1 -1
  473. package/dist/private/RangeSlider.mjs +8 -16
  474. package/dist/private/RangeSlider.mjs.map +1 -1
  475. package/dist/private/S2_CornerTriangleSize100.cjs +26 -0
  476. package/dist/private/S2_CornerTriangleSize100.cjs.map +1 -0
  477. package/dist/private/S2_CornerTriangleSize100.mjs +21 -0
  478. package/dist/private/S2_CornerTriangleSize100.mjs.map +1 -0
  479. package/dist/private/S2_CornerTriangleSize200.cjs +26 -0
  480. package/dist/private/S2_CornerTriangleSize200.cjs.map +1 -0
  481. package/dist/private/S2_CornerTriangleSize200.mjs +21 -0
  482. package/dist/private/S2_CornerTriangleSize200.mjs.map +1 -0
  483. package/dist/private/S2_CornerTriangleSize300.cjs +26 -0
  484. package/dist/private/S2_CornerTriangleSize300.cjs.map +1 -0
  485. package/dist/private/S2_CornerTriangleSize300.mjs +21 -0
  486. package/dist/private/S2_CornerTriangleSize300.mjs.map +1 -0
  487. package/dist/private/S2_CornerTriangleSize75.cjs +26 -0
  488. package/dist/private/S2_CornerTriangleSize75.cjs.map +1 -0
  489. package/dist/private/S2_CornerTriangleSize75.mjs +21 -0
  490. package/dist/private/S2_CornerTriangleSize75.mjs.map +1 -0
  491. package/dist/private/S2_DragHandleSize100.cjs +60 -0
  492. package/dist/private/S2_DragHandleSize100.cjs.map +1 -0
  493. package/dist/private/S2_DragHandleSize100.mjs +55 -0
  494. package/dist/private/S2_DragHandleSize100.mjs.map +1 -0
  495. package/dist/private/S2_DragHandleSize200.cjs +60 -0
  496. package/dist/private/S2_DragHandleSize200.cjs.map +1 -0
  497. package/dist/private/S2_DragHandleSize200.mjs +55 -0
  498. package/dist/private/S2_DragHandleSize200.mjs.map +1 -0
  499. package/dist/private/S2_DragHandleSize300.cjs +60 -0
  500. package/dist/private/S2_DragHandleSize300.cjs.map +1 -0
  501. package/dist/private/S2_DragHandleSize300.mjs +55 -0
  502. package/dist/private/S2_DragHandleSize300.mjs.map +1 -0
  503. package/dist/private/S2_DragHandleSize75.cjs +60 -0
  504. package/dist/private/S2_DragHandleSize75.cjs.map +1 -0
  505. package/dist/private/S2_DragHandleSize75.mjs +55 -0
  506. package/dist/private/S2_DragHandleSize75.mjs.map +1 -0
  507. package/dist/private/SearchField.cjs +41 -41
  508. package/dist/private/SearchField.cjs.map +1 -1
  509. package/dist/private/SearchField.css +45 -45
  510. package/dist/private/SearchField.css.map +1 -1
  511. package/dist/private/SearchField.mjs +41 -41
  512. package/dist/private/SearchField.mjs.map +1 -1
  513. package/dist/private/SegmentedControl.cjs +178 -178
  514. package/dist/private/SegmentedControl.cjs.map +1 -1
  515. package/dist/private/SegmentedControl.css +123 -123
  516. package/dist/private/SegmentedControl.css.map +1 -1
  517. package/dist/private/SegmentedControl.mjs +178 -178
  518. package/dist/private/SegmentedControl.mjs.map +1 -1
  519. package/dist/private/SelectBoxGroup.cjs +142 -142
  520. package/dist/private/SelectBoxGroup.cjs.map +1 -1
  521. package/dist/private/SelectBoxGroup.css +120 -120
  522. package/dist/private/SelectBoxGroup.css.map +1 -1
  523. package/dist/private/SelectBoxGroup.mjs +142 -142
  524. package/dist/private/SelectBoxGroup.mjs.map +1 -1
  525. package/dist/private/SkeletonCollection.cjs.map +1 -1
  526. package/dist/private/SkeletonCollection.mjs.map +1 -1
  527. package/dist/private/Slider.cjs +318 -332
  528. package/dist/private/Slider.cjs.map +1 -1
  529. package/dist/private/Slider.css +177 -157
  530. package/dist/private/Slider.css.map +1 -1
  531. package/dist/private/Slider.mjs +319 -333
  532. package/dist/private/Slider.mjs.map +1 -1
  533. package/dist/private/StatusLight.cjs +115 -115
  534. package/dist/private/StatusLight.cjs.map +1 -1
  535. package/dist/private/StatusLight.css +59 -59
  536. package/dist/private/StatusLight.css.map +1 -1
  537. package/dist/private/StatusLight.mjs +115 -115
  538. package/dist/private/StatusLight.mjs.map +1 -1
  539. package/dist/private/Switch.cjs +219 -176
  540. package/dist/private/Switch.cjs.map +1 -1
  541. package/dist/private/Switch.css +128 -84
  542. package/dist/private/Switch.css.map +1 -1
  543. package/dist/private/Switch.mjs +219 -176
  544. package/dist/private/Switch.mjs.map +1 -1
  545. package/dist/private/TableView.cjs +739 -510
  546. package/dist/private/TableView.cjs.map +1 -1
  547. package/dist/private/TableView.css +550 -302
  548. package/dist/private/TableView.css.map +1 -1
  549. package/dist/private/TableView.mjs +741 -513
  550. package/dist/private/TableView.mjs.map +1 -1
  551. package/dist/private/Tabs.cjs +123 -123
  552. package/dist/private/Tabs.cjs.map +1 -1
  553. package/dist/private/Tabs.css +105 -105
  554. package/dist/private/Tabs.css.map +1 -1
  555. package/dist/private/Tabs.mjs +123 -123
  556. package/dist/private/Tabs.mjs.map +1 -1
  557. package/dist/private/TabsPicker.cjs +130 -129
  558. package/dist/private/TabsPicker.cjs.map +1 -1
  559. package/dist/private/TabsPicker.css +108 -108
  560. package/dist/private/TabsPicker.css.map +1 -1
  561. package/dist/private/TabsPicker.mjs +130 -129
  562. package/dist/private/TabsPicker.mjs.map +1 -1
  563. package/dist/private/TagGroup.cjs +203 -203
  564. package/dist/private/TagGroup.cjs.map +1 -1
  565. package/dist/private/TagGroup.css +146 -146
  566. package/dist/private/TagGroup.css.map +1 -1
  567. package/dist/private/TagGroup.mjs +203 -203
  568. package/dist/private/TagGroup.mjs.map +1 -1
  569. package/dist/private/TextField.cjs +84 -73
  570. package/dist/private/TextField.cjs.map +1 -1
  571. package/dist/private/TextField.css +54 -54
  572. package/dist/private/TextField.css.map +1 -1
  573. package/dist/private/TextField.mjs +85 -74
  574. package/dist/private/TextField.mjs.map +1 -1
  575. package/dist/private/TimeField.cjs +51 -51
  576. package/dist/private/TimeField.cjs.map +1 -1
  577. package/dist/private/TimeField.css +47 -47
  578. package/dist/private/TimeField.css.map +1 -1
  579. package/dist/private/TimeField.mjs +51 -51
  580. package/dist/private/TimeField.mjs.map +1 -1
  581. package/dist/private/Toast.cjs +122 -121
  582. package/dist/private/Toast.cjs.map +1 -1
  583. package/dist/private/Toast.css +110 -110
  584. package/dist/private/Toast.css.map +1 -1
  585. package/dist/private/Toast.mjs +122 -121
  586. package/dist/private/Toast.mjs.map +1 -1
  587. package/dist/private/Toast.module_css.cjs +21 -21
  588. package/dist/private/Toast.module_css.cjs.map +1 -1
  589. package/dist/private/Toast.module_css.mjs +21 -21
  590. package/dist/private/Toast.module_css.mjs.map +1 -1
  591. package/dist/private/Toast_module.css +44 -44
  592. package/dist/private/Toast_module.css.map +1 -1
  593. package/dist/private/ToggleButton.cjs +59 -26
  594. package/dist/private/ToggleButton.cjs.map +1 -1
  595. package/dist/private/ToggleButton.css +56 -12
  596. package/dist/private/ToggleButton.css.map +1 -1
  597. package/dist/private/ToggleButton.mjs +60 -27
  598. package/dist/private/ToggleButton.mjs.map +1 -1
  599. package/dist/private/ToggleButtonGroup.cjs.map +1 -1
  600. package/dist/private/ToggleButtonGroup.mjs.map +1 -1
  601. package/dist/private/Tooltip.cjs +90 -78
  602. package/dist/private/Tooltip.cjs.map +1 -1
  603. package/dist/private/Tooltip.css +92 -64
  604. package/dist/private/Tooltip.css.map +1 -1
  605. package/dist/private/Tooltip.mjs +90 -78
  606. package/dist/private/Tooltip.mjs.map +1 -1
  607. package/dist/private/TreeView.cjs +300 -233
  608. package/dist/private/TreeView.cjs.map +1 -1
  609. package/dist/private/TreeView.css +243 -181
  610. package/dist/private/TreeView.css.map +1 -1
  611. package/dist/private/TreeView.mjs +301 -234
  612. package/dist/private/TreeView.mjs.map +1 -1
  613. package/dist/private/dnd-utils.cjs +149 -0
  614. package/dist/private/dnd-utils.cjs.map +1 -0
  615. package/dist/private/dnd-utils.css +164 -0
  616. package/dist/private/dnd-utils.css.map +1 -0
  617. package/dist/private/dnd-utils.mjs +143 -0
  618. package/dist/private/dnd-utils.mjs.map +1 -0
  619. package/dist/private/font-faces.css.map +1 -1
  620. package/dist/private/intl/ar-AE.cjs +1 -0
  621. package/dist/private/intl/ar-AE.cjs.map +1 -1
  622. package/dist/private/intl/ar-AE.mjs +1 -0
  623. package/dist/private/intl/ar-AE.mjs.map +1 -1
  624. package/dist/private/intl/bg-BG.cjs +1 -0
  625. package/dist/private/intl/bg-BG.cjs.map +1 -1
  626. package/dist/private/intl/bg-BG.mjs +1 -0
  627. package/dist/private/intl/bg-BG.mjs.map +1 -1
  628. package/dist/private/intl/cs-CZ.cjs +1 -0
  629. package/dist/private/intl/cs-CZ.cjs.map +1 -1
  630. package/dist/private/intl/cs-CZ.mjs +1 -0
  631. package/dist/private/intl/cs-CZ.mjs.map +1 -1
  632. package/dist/private/intl/da-DK.cjs +1 -0
  633. package/dist/private/intl/da-DK.cjs.map +1 -1
  634. package/dist/private/intl/da-DK.mjs +1 -0
  635. package/dist/private/intl/da-DK.mjs.map +1 -1
  636. package/dist/private/intl/de-DE.cjs +1 -0
  637. package/dist/private/intl/de-DE.cjs.map +1 -1
  638. package/dist/private/intl/de-DE.mjs +1 -0
  639. package/dist/private/intl/de-DE.mjs.map +1 -1
  640. package/dist/private/intl/el-GR.cjs +1 -0
  641. package/dist/private/intl/el-GR.cjs.map +1 -1
  642. package/dist/private/intl/el-GR.mjs +1 -0
  643. package/dist/private/intl/el-GR.mjs.map +1 -1
  644. package/dist/private/intl/en-US.cjs +1 -0
  645. package/dist/private/intl/en-US.cjs.map +1 -1
  646. package/dist/private/intl/en-US.mjs +1 -0
  647. package/dist/private/intl/en-US.mjs.map +1 -1
  648. package/dist/private/intl/es-ES.cjs +1 -0
  649. package/dist/private/intl/es-ES.cjs.map +1 -1
  650. package/dist/private/intl/es-ES.mjs +1 -0
  651. package/dist/private/intl/es-ES.mjs.map +1 -1
  652. package/dist/private/intl/et-EE.cjs +1 -0
  653. package/dist/private/intl/et-EE.cjs.map +1 -1
  654. package/dist/private/intl/et-EE.mjs +1 -0
  655. package/dist/private/intl/et-EE.mjs.map +1 -1
  656. package/dist/private/intl/fi-FI.cjs +1 -0
  657. package/dist/private/intl/fi-FI.cjs.map +1 -1
  658. package/dist/private/intl/fi-FI.mjs +1 -0
  659. package/dist/private/intl/fi-FI.mjs.map +1 -1
  660. package/dist/private/intl/fr-FR.cjs +1 -0
  661. package/dist/private/intl/fr-FR.cjs.map +1 -1
  662. package/dist/private/intl/fr-FR.mjs +1 -0
  663. package/dist/private/intl/fr-FR.mjs.map +1 -1
  664. package/dist/private/intl/he-IL.cjs +1 -0
  665. package/dist/private/intl/he-IL.cjs.map +1 -1
  666. package/dist/private/intl/he-IL.mjs +1 -0
  667. package/dist/private/intl/he-IL.mjs.map +1 -1
  668. package/dist/private/intl/hr-HR.cjs +1 -0
  669. package/dist/private/intl/hr-HR.cjs.map +1 -1
  670. package/dist/private/intl/hr-HR.mjs +1 -0
  671. package/dist/private/intl/hr-HR.mjs.map +1 -1
  672. package/dist/private/intl/hu-HU.cjs +1 -0
  673. package/dist/private/intl/hu-HU.cjs.map +1 -1
  674. package/dist/private/intl/hu-HU.mjs +1 -0
  675. package/dist/private/intl/hu-HU.mjs.map +1 -1
  676. package/dist/private/intl/it-IT.cjs +1 -0
  677. package/dist/private/intl/it-IT.cjs.map +1 -1
  678. package/dist/private/intl/it-IT.mjs +1 -0
  679. package/dist/private/intl/it-IT.mjs.map +1 -1
  680. package/dist/private/intl/ja-JP.cjs +1 -0
  681. package/dist/private/intl/ja-JP.cjs.map +1 -1
  682. package/dist/private/intl/ja-JP.mjs +1 -0
  683. package/dist/private/intl/ja-JP.mjs.map +1 -1
  684. package/dist/private/intl/ko-KR.cjs +1 -0
  685. package/dist/private/intl/ko-KR.cjs.map +1 -1
  686. package/dist/private/intl/ko-KR.mjs +1 -0
  687. package/dist/private/intl/ko-KR.mjs.map +1 -1
  688. package/dist/private/intl/lt-LT.cjs +1 -0
  689. package/dist/private/intl/lt-LT.cjs.map +1 -1
  690. package/dist/private/intl/lt-LT.mjs +1 -0
  691. package/dist/private/intl/lt-LT.mjs.map +1 -1
  692. package/dist/private/intl/lv-LV.cjs +1 -0
  693. package/dist/private/intl/lv-LV.cjs.map +1 -1
  694. package/dist/private/intl/lv-LV.mjs +1 -0
  695. package/dist/private/intl/lv-LV.mjs.map +1 -1
  696. package/dist/private/intl/nb-NO.cjs +1 -0
  697. package/dist/private/intl/nb-NO.cjs.map +1 -1
  698. package/dist/private/intl/nb-NO.mjs +1 -0
  699. package/dist/private/intl/nb-NO.mjs.map +1 -1
  700. package/dist/private/intl/nl-NL.cjs +1 -0
  701. package/dist/private/intl/nl-NL.cjs.map +1 -1
  702. package/dist/private/intl/nl-NL.mjs +1 -0
  703. package/dist/private/intl/nl-NL.mjs.map +1 -1
  704. package/dist/private/intl/pl-PL.cjs +1 -0
  705. package/dist/private/intl/pl-PL.cjs.map +1 -1
  706. package/dist/private/intl/pl-PL.mjs +1 -0
  707. package/dist/private/intl/pl-PL.mjs.map +1 -1
  708. package/dist/private/intl/pt-BR.cjs +1 -0
  709. package/dist/private/intl/pt-BR.cjs.map +1 -1
  710. package/dist/private/intl/pt-BR.mjs +1 -0
  711. package/dist/private/intl/pt-BR.mjs.map +1 -1
  712. package/dist/private/intl/pt-PT.cjs +1 -0
  713. package/dist/private/intl/pt-PT.cjs.map +1 -1
  714. package/dist/private/intl/pt-PT.mjs +1 -0
  715. package/dist/private/intl/pt-PT.mjs.map +1 -1
  716. package/dist/private/intl/ro-RO.cjs +1 -0
  717. package/dist/private/intl/ro-RO.cjs.map +1 -1
  718. package/dist/private/intl/ro-RO.mjs +1 -0
  719. package/dist/private/intl/ro-RO.mjs.map +1 -1
  720. package/dist/private/intl/ru-RU.cjs +1 -0
  721. package/dist/private/intl/ru-RU.cjs.map +1 -1
  722. package/dist/private/intl/ru-RU.mjs +1 -0
  723. package/dist/private/intl/ru-RU.mjs.map +1 -1
  724. package/dist/private/intl/sk-SK.cjs +1 -0
  725. package/dist/private/intl/sk-SK.cjs.map +1 -1
  726. package/dist/private/intl/sk-SK.mjs +1 -0
  727. package/dist/private/intl/sk-SK.mjs.map +1 -1
  728. package/dist/private/intl/sl-SI.cjs +1 -0
  729. package/dist/private/intl/sl-SI.cjs.map +1 -1
  730. package/dist/private/intl/sl-SI.mjs +1 -0
  731. package/dist/private/intl/sl-SI.mjs.map +1 -1
  732. package/dist/private/intl/sr-SP.cjs +1 -0
  733. package/dist/private/intl/sr-SP.cjs.map +1 -1
  734. package/dist/private/intl/sr-SP.mjs +1 -0
  735. package/dist/private/intl/sr-SP.mjs.map +1 -1
  736. package/dist/private/intl/sv-SE.cjs +1 -0
  737. package/dist/private/intl/sv-SE.cjs.map +1 -1
  738. package/dist/private/intl/sv-SE.mjs +1 -0
  739. package/dist/private/intl/sv-SE.mjs.map +1 -1
  740. package/dist/private/intl/tr-TR.cjs +1 -0
  741. package/dist/private/intl/tr-TR.cjs.map +1 -1
  742. package/dist/private/intl/tr-TR.mjs +1 -0
  743. package/dist/private/intl/tr-TR.mjs.map +1 -1
  744. package/dist/private/intl/uk-UA.cjs +1 -0
  745. package/dist/private/intl/uk-UA.cjs.map +1 -1
  746. package/dist/private/intl/uk-UA.mjs +1 -0
  747. package/dist/private/intl/uk-UA.mjs.map +1 -1
  748. package/dist/private/intl/zh-CN.cjs +1 -0
  749. package/dist/private/intl/zh-CN.cjs.map +1 -1
  750. package/dist/private/intl/zh-CN.mjs +1 -0
  751. package/dist/private/intl/zh-CN.mjs.map +1 -1
  752. package/dist/private/intl/zh-TW.cjs +1 -0
  753. package/dist/private/intl/zh-TW.cjs.map +1 -1
  754. package/dist/private/intl/zh-TW.mjs +1 -0
  755. package/dist/private/intl/zh-TW.mjs.map +1 -1
  756. package/dist/private/pressScale.cjs.map +1 -1
  757. package/dist/private/pressScale.mjs.map +1 -1
  758. package/dist/private/useDOMRef.cjs +3 -2
  759. package/dist/private/useDOMRef.cjs.map +1 -1
  760. package/dist/private/useDOMRef.mjs +3 -2
  761. package/dist/private/useDOMRef.mjs.map +1 -1
  762. package/dist/private/useDragAndDrop.cjs +25 -0
  763. package/dist/private/useDragAndDrop.cjs.map +1 -0
  764. package/dist/private/useDragAndDrop.mjs +20 -0
  765. package/dist/private/useDragAndDrop.mjs.map +1 -0
  766. package/dist/types/exports/DragPreview.d.ts +2 -0
  767. package/dist/types/exports/LabeledValue.d.ts +2 -0
  768. package/dist/types/exports/TableView.d.ts +2 -2
  769. package/dist/types/exports/index.d.ts +11 -2
  770. package/dist/types/exports/useDragAndDrop.d.ts +8 -0
  771. package/dist/types/src/Accordion.d.ts +22 -6
  772. package/dist/types/src/ActionBar.d.ts +6 -2
  773. package/dist/types/src/ActionButton.d.ts +15 -5
  774. package/dist/types/src/ActionButtonGroup.d.ts +13 -4
  775. package/dist/types/src/ActionMenu.d.ts +1 -1
  776. package/dist/types/src/AlertDialog.d.ts +3 -1
  777. package/dist/types/src/Avatar.d.ts +1 -0
  778. package/dist/types/src/AvatarGroup.d.ts +1 -0
  779. package/dist/types/src/Badge.d.ts +6 -2
  780. package/dist/types/src/Breadcrumbs.d.ts +1 -1
  781. package/dist/types/src/Button.d.ts +2 -1
  782. package/dist/types/src/Calendar.d.ts +8 -5
  783. package/dist/types/src/Card.d.ts +4 -1
  784. package/dist/types/src/CardView.d.ts +6 -1
  785. package/dist/types/src/CenterBaseline.d.ts +2 -1
  786. package/dist/types/src/Checkbox.d.ts +5 -5
  787. package/dist/types/src/CoachMark.d.ts +3 -3
  788. package/dist/types/src/ColorArea.d.ts +2 -1
  789. package/dist/types/src/ColorField.d.ts +6 -0
  790. package/dist/types/src/ColorSwatch.d.ts +2 -0
  791. package/dist/types/src/ColorSwatchPicker.d.ts +3 -0
  792. package/dist/types/src/ComboBox.d.ts +18 -7
  793. package/dist/types/src/ContextualHelp.d.ts +5 -2
  794. package/dist/types/src/CustomDialog.d.ts +1 -0
  795. package/dist/types/src/DatePicker.d.ts +5 -2
  796. package/dist/types/src/DateRangePicker.d.ts +3 -1
  797. package/dist/types/src/Dialog.d.ts +3 -2
  798. package/dist/types/src/DialogTrigger.d.ts +3 -3
  799. package/dist/types/src/Disclosure.d.ts +10 -4
  800. package/dist/types/src/Divider.d.ts +2 -0
  801. package/dist/types/src/DragPreview.d.ts +42 -0
  802. package/dist/types/src/DropZone.d.ts +1 -0
  803. package/dist/types/src/Field.d.ts +5 -3
  804. package/dist/types/src/Form.d.ts +3 -1
  805. package/dist/types/src/FullscreenDialog.d.ts +4 -2
  806. package/dist/types/src/Image.d.ts +6 -5
  807. package/dist/types/src/ImageCoordinator.d.ts +3 -1
  808. package/dist/types/src/InlineAlert.d.ts +4 -2
  809. package/dist/types/src/LabeledValue.d.ts +61 -0
  810. package/dist/types/src/Link.d.ts +1 -0
  811. package/dist/types/src/ListBox.d.ts +1 -1
  812. package/dist/types/src/ListView.d.ts +12 -24
  813. package/dist/types/src/Menu.d.ts +8 -6
  814. package/dist/types/src/Meter.d.ts +4 -1
  815. package/dist/types/src/NumberField.d.ts +9 -1
  816. package/dist/types/src/Picker.d.ts +12 -7
  817. package/dist/types/src/Popover.d.ts +2 -1
  818. package/dist/types/src/ProgressBar.d.ts +3 -2
  819. package/dist/types/src/ProgressCircle.d.ts +2 -2
  820. package/dist/types/src/Provider.d.ts +6 -3
  821. package/dist/types/src/RadioGroup.d.ts +2 -2
  822. package/dist/types/src/RangeCalendar.d.ts +4 -2
  823. package/dist/types/src/RangeSlider.d.ts +6 -3
  824. package/dist/types/src/SelectBoxGroup.d.ts +3 -1
  825. package/dist/types/src/SkeletonCollection.d.ts +2 -1
  826. package/dist/types/src/Slider.d.ts +2 -1
  827. package/dist/types/src/Switch.d.ts +5 -5
  828. package/dist/types/src/TableView.d.ts +29 -9
  829. package/dist/types/src/Tabs.d.ts +5 -2
  830. package/dist/types/src/TabsPicker.d.ts +9 -4
  831. package/dist/types/src/TagGroup.d.ts +10 -4
  832. package/dist/types/src/TextField.d.ts +5 -0
  833. package/dist/types/src/Toast.d.ts +2 -1
  834. package/dist/types/src/ToggleButton.d.ts +9 -2
  835. package/dist/types/src/ToggleButtonGroup.d.ts +4 -1
  836. package/dist/types/src/TreeView.d.ts +6 -3
  837. package/dist/types/src/dnd-utils.d.ts +8 -0
  838. package/dist/types/src/pressScale.d.ts +20 -0
  839. package/dist/types/src/style-utils.d.ts +56 -26
  840. package/dist/types/src/useDOMRef.d.ts +3 -3
  841. package/dist/types/src/useDragAndDrop.d.ts +9 -0
  842. package/dist/types/style/index.d.ts +27 -33
  843. package/dist/types/style/runtime.d.ts +6 -8
  844. package/dist/types/style/spectrum-theme.d.ts +42 -50
  845. package/dist/types/style/style-macro.d.ts +7 -9
  846. package/dist/types/style/tokens.d.ts +2 -2
  847. package/dist/types/ui-icons/CornerTriangle.d.ts +4 -0
  848. package/dist/types/ui-icons/DragHandle.d.ts +4 -0
  849. package/exports/Accordion.ts +17 -2
  850. package/exports/ActionMenu.ts +14 -2
  851. package/exports/Card.ts +16 -2
  852. package/exports/CardView.ts +16 -2
  853. package/exports/ColorArea.ts +8 -1
  854. package/exports/ColorField.ts +8 -1
  855. package/exports/ColorSlider.ts +8 -1
  856. package/exports/ColorSwatch.ts +8 -1
  857. package/exports/ColorSwatchPicker.ts +8 -1
  858. package/exports/ColorWheel.ts +8 -1
  859. package/exports/ContextualHelp.ts +5 -1
  860. package/exports/Disclosure.ts +7 -1
  861. package/exports/DragPreview.ts +2 -0
  862. package/exports/Icon.ts +6 -1
  863. package/exports/LabeledValue.ts +2 -0
  864. package/exports/Menu.ts +17 -2
  865. package/exports/SegmentedControl.ts +5 -1
  866. package/exports/TableView.ts +27 -3
  867. package/exports/TreeView.ts +6 -1
  868. package/exports/index.ts +174 -17
  869. package/exports/useAsyncList.ts +7 -1
  870. package/exports/useDragAndDrop.ts +36 -0
  871. package/icons/Icon.cjs +10 -10
  872. package/icons/Icon.cjs.map +1 -1
  873. package/icons/Icon.css +9 -9
  874. package/icons/Icon.css.map +1 -1
  875. package/icons/Icon.mjs +10 -10
  876. package/icons/Icon.mjs.map +1 -1
  877. package/icons/Skeleton.cjs +2 -2
  878. package/icons/Skeleton.cjs.map +1 -1
  879. package/icons/Skeleton.css +6 -6
  880. package/icons/Skeleton.css.map +1 -1
  881. package/icons/Skeleton.mjs +2 -2
  882. package/icons/Skeleton.mjs.map +1 -1
  883. package/icons/runtime.cjs.map +1 -1
  884. package/icons/runtime.mjs.map +1 -1
  885. package/icons/useMediaQuery.cjs.map +1 -1
  886. package/icons/useMediaQuery.mjs.map +1 -1
  887. package/icons/useSpectrumContextProps.cjs.map +1 -1
  888. package/icons/useSpectrumContextProps.mjs.map +1 -1
  889. package/illustrations/gradient/generic1/Conversationbubbles.cjs.map +1 -1
  890. package/illustrations/gradient/generic1/Conversationbubbles.mjs.map +1 -1
  891. package/illustrations/gradient/generic2/Conversationbubbles.cjs.map +1 -1
  892. package/illustrations/gradient/generic2/Conversationbubbles.mjs.map +1 -1
  893. package/illustrations/linear/BrowserNotCompatible.cjs.map +1 -1
  894. package/illustrations/linear/BrowserNotCompatible.mjs.map +1 -1
  895. package/illustrations/linear/CloudStateDisconnected.cjs.map +1 -1
  896. package/illustrations/linear/CloudStateDisconnected.mjs.map +1 -1
  897. package/illustrations/linear/ConfettiCelebration.cjs.map +1 -1
  898. package/illustrations/linear/ConfettiCelebration.mjs.map +1 -1
  899. package/illustrations/linear/Conversationbubbles.cjs.map +1 -1
  900. package/illustrations/linear/Conversationbubbles.mjs.map +1 -1
  901. package/illustrations/linear/MegaphonePromoteExpressive.cjs.map +1 -1
  902. package/illustrations/linear/MegaphonePromoteExpressive.mjs.map +1 -1
  903. package/illustrations/linear/NoInternetConnection.cjs.map +1 -1
  904. package/illustrations/linear/NoInternetConnection.mjs.map +1 -1
  905. package/package.json +31 -30
  906. package/page.css +11 -0
  907. package/page.css.map +1 -1
  908. package/src/Accordion.tsx +97 -59
  909. package/src/ActionBar.tsx +102 -44
  910. package/src/ActionButton.tsx +359 -252
  911. package/src/ActionButtonGroup.tsx +59 -38
  912. package/src/ActionMenu.tsx +21 -9
  913. package/src/AlertDialog.tsx +28 -25
  914. package/src/Avatar.tsx +41 -28
  915. package/src/AvatarGroup.tsx +34 -16
  916. package/src/Badge.tsx +167 -129
  917. package/src/Breadcrumbs.tsx +173 -96
  918. package/src/Button.tsx +390 -288
  919. package/src/ButtonGroup.tsx +70 -52
  920. package/src/Calendar.tsx +230 -173
  921. package/src/Card.tsx +395 -303
  922. package/src/CardView.tsx +126 -61
  923. package/src/CenterBaseline.tsx +15 -7
  924. package/src/Checkbox.tsx +152 -57
  925. package/src/CheckboxGroup.tsx +96 -63
  926. package/src/ClearButton.tsx +6 -3
  927. package/src/CloseButton.tsx +71 -44
  928. package/src/CoachMark.tsx +204 -192
  929. package/src/ColorArea.tsx +49 -28
  930. package/src/ColorField.tsx +83 -36
  931. package/src/ColorHandle.tsx +36 -25
  932. package/src/ColorSlider.tsx +123 -90
  933. package/src/ColorSwatch.tsx +71 -43
  934. package/src/ColorSwatchPicker.tsx +71 -52
  935. package/src/ColorWheel.tsx +75 -54
  936. package/src/ComboBox.tsx +311 -187
  937. package/src/Content.tsx +59 -38
  938. package/src/ContextualHelp.tsx +82 -49
  939. package/src/CustomDialog.tsx +41 -33
  940. package/src/DateField.tsx +57 -27
  941. package/src/DatePicker.tsx +117 -65
  942. package/src/DateRangePicker.tsx +209 -157
  943. package/src/Dialog.tsx +24 -16
  944. package/src/DialogContainer.tsx +4 -7
  945. package/src/DialogTrigger.tsx +4 -6
  946. package/src/Disclosure.tsx +102 -80
  947. package/src/Divider.tsx +71 -49
  948. package/src/DragPreview.tsx +193 -0
  949. package/src/DropZone.tsx +71 -40
  950. package/src/Field.tsx +239 -107
  951. package/src/Fonts.tsx +18 -11
  952. package/src/Form.tsx +42 -27
  953. package/src/FullscreenDialog.tsx +24 -39
  954. package/src/Icon.tsx +70 -33
  955. package/src/IllustratedMessage.tsx +98 -69
  956. package/src/Image.tsx +105 -49
  957. package/src/ImageCoordinator.tsx +39 -24
  958. package/src/InlineAlert.tsx +90 -80
  959. package/src/LabeledValue.tsx +344 -0
  960. package/src/Link.tsx +99 -45
  961. package/src/ListBox.tsx +2 -9
  962. package/src/ListView.tsx +486 -280
  963. package/src/Menu.tsx +313 -180
  964. package/src/Meter.tsx +51 -21
  965. package/src/Modal.tsx +90 -81
  966. package/src/NotificationBadge.tsx +98 -73
  967. package/src/NumberField.tsx +160 -90
  968. package/src/Picker.tsx +311 -171
  969. package/src/Popover.tsx +195 -149
  970. package/src/ProgressBar.tsx +81 -56
  971. package/src/ProgressCircle.tsx +70 -48
  972. package/src/Provider.tsx +16 -16
  973. package/src/RadioGroup.tsx +164 -55
  974. package/src/RangeCalendar.tsx +63 -41
  975. package/src/RangeSlider.tsx +48 -35
  976. package/src/SearchField.tsx +110 -75
  977. package/src/SegmentedControl.tsx +101 -76
  978. package/src/SelectBoxGroup.tsx +231 -191
  979. package/src/Skeleton.tsx +75 -49
  980. package/src/SkeletonCollection.tsx +16 -16
  981. package/src/Slider.tsx +135 -83
  982. package/src/StatusLight.tsx +61 -22
  983. package/src/Switch.tsx +122 -38
  984. package/src/TableView.tsx +1002 -356
  985. package/src/Tabs.tsx +327 -183
  986. package/src/TabsPicker.tsx +152 -107
  987. package/src/TagGroup.tsx +175 -80
  988. package/src/TextField.tsx +120 -54
  989. package/src/TimeField.tsx +48 -23
  990. package/src/Toast.module.css +11 -5
  991. package/src/Toast.tsx +119 -84
  992. package/src/ToggleButton.tsx +99 -25
  993. package/src/ToggleButtonGroup.tsx +22 -6
  994. package/src/Toolbar.tsx +0 -1
  995. package/src/Tooltip.tsx +64 -26
  996. package/src/TreeView.tsx +346 -91
  997. package/src/bar-utils.ts +65 -68
  998. package/src/dnd-utils.tsx +127 -0
  999. package/src/font-faces.css +129 -33
  1000. package/src/page.macro.ts +28 -2
  1001. package/src/pressScale.ts +24 -1
  1002. package/src/progress-utils.tsx +1 -1
  1003. package/src/style-utils.ts +216 -185
  1004. package/src/useDOMRef.ts +26 -11
  1005. package/src/useDragAndDrop.ts +32 -0
  1006. package/src/useMediaQuery.ts +2 -4
  1007. package/src/useSpectrumContextProps.ts +5 -1
  1008. package/style/__tests__/mergeStyles.test.ts +15 -4
  1009. package/style/__tests__/style-macro.test.js +81 -71
  1010. package/style/dist/main.cjs.map +1 -1
  1011. package/style/dist/module.mjs.map +1 -1
  1012. package/style/dist/spectrum-theme.cjs +4 -5
  1013. package/style/dist/spectrum-theme.cjs.map +1 -1
  1014. package/style/dist/spectrum-theme.mjs +4 -5
  1015. package/style/dist/spectrum-theme.mjs.map +1 -1
  1016. package/style/dist/style-macro.cjs +2 -1
  1017. package/style/dist/style-macro.cjs.map +1 -1
  1018. package/style/dist/style-macro.mjs +2 -1
  1019. package/style/dist/style-macro.mjs.map +1 -1
  1020. package/style/dist/style-utils.cjs +30 -1
  1021. package/style/dist/style-utils.cjs.map +1 -1
  1022. package/style/dist/style-utils.mjs +30 -1
  1023. package/style/dist/style-utils.mjs.map +1 -1
  1024. package/style/index.ts +105 -74
  1025. package/style/package.json +2 -2
  1026. package/style/runtime.ts +6 -8
  1027. package/style/spectrum-theme.ts +482 -194
  1028. package/style/style-macro.ts +310 -121
  1029. package/style/tokens.ts +79 -41
  1030. package/style/types.ts +146 -70
package/src/TableView.tsx CHANGED
@@ -11,7 +11,18 @@
11
11
  */
12
12
 
13
13
  import {ActionButton, ActionButtonContext} from './ActionButton';
14
- import {baseColor, centerPadding, colorMix, focusRing, fontRelative, lightDark, setColorScheme, space, style} from '../style' with {type: 'macro'};
14
+ import {
15
+ baseColor,
16
+ centerPadding,
17
+ color,
18
+ colorMix,
19
+ focusRing,
20
+ fontRelative,
21
+ lightDark,
22
+ setColorScheme,
23
+ space,
24
+ style
25
+ } from '../style' with {type: 'macro'};
15
26
  import {Button, ButtonContext} from 'react-aria-components/Button';
16
27
  import {ButtonGroup} from './ButtonGroup';
17
28
  import {
@@ -27,6 +38,8 @@ import {
27
38
  Table as RACTable,
28
39
  TableBody as RACTableBody,
29
40
  TableBodyProps as RACTableBodyProps,
41
+ TableFooter as RACTableFooter,
42
+ TableFooterProps as RACTableFooterProps,
30
43
  TableHeader as RACTableHeader,
31
44
  TableHeaderProps as RACTableHeaderProps,
32
45
  TableProps as RACTableProps,
@@ -42,34 +55,76 @@ import Checkmark from '../s2wf-icons/S2_Icon_Checkmark_20_N.svg';
42
55
  import Chevron from '../ui-icons/Chevron';
43
56
  import Close from '../s2wf-icons/S2_Icon_Close_20_N.svg';
44
57
  import {Collection} from 'react-aria/Collection';
45
- import {CollectionRendererContext, DefaultCollectionRenderer} from 'react-aria-components/CollectionBuilder';
58
+ import {
59
+ CollectionRendererContext,
60
+ DefaultCollectionRenderer
61
+ } from 'react-aria-components/CollectionBuilder';
46
62
  import {ColumnSize} from 'react-stately/useTableState';
47
63
  import {ContextValue, DEFAULT_SLOT, Provider, useSlottedContext} from 'react-aria-components/slots';
48
- import {controlFont, getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};
64
+ import {
65
+ controlFont,
66
+ getAllowedOverrides,
67
+ StylesPropWithHeight,
68
+ UnsafeStyles
69
+ } from './style-utils' with {type: 'macro'};
49
70
  import {css} from '../style/style-macro' with {type: 'macro'};
50
71
  import {CustomDialog} from './CustomDialog';
51
72
  import {DialogContainer} from './DialogContainer';
52
- import {DOMProps, DOMRef, DOMRefValue, forwardRefType, GlobalDOMAttributes, LinkDOMProps, LoadingState, Node} from '@react-types/shared';
73
+ import {
74
+ DOMProps,
75
+ DOMRef,
76
+ DOMRefValue,
77
+ forwardRefType,
78
+ GlobalDOMAttributes,
79
+ ItemDropTarget,
80
+ LinkDOMProps,
81
+ LoadingState,
82
+ Node
83
+ } from '@react-types/shared';
84
+ import {DragHandleButton, InsertionIndicator} from './dnd-utils';
85
+ import {DragPreview} from './DragPreview';
53
86
  import {Form} from 'react-aria-components/Form';
54
- import {getActiveElement, isFocusWithin, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';
87
+ import {
88
+ getActiveElement,
89
+ isFocusWithin,
90
+ nodeContains
91
+ } from 'react-aria/private/utils/shadowdom/DOMFunctions';
55
92
  import {getOwnerDocument} from 'react-aria/private/utils/domHelpers';
56
93
  import {GridNode} from 'react-stately/private/grid/GridCollection';
57
94
  import {IconContext} from './Icon';
95
+ // @ts-ignore
58
96
  import intlMessages from '../intl/*.json';
59
97
  import {Key} from '@react-types/shared';
98
+ import {LayoutInfo, Rect, TableLayout, Virtualizer} from 'react-aria-components/Virtualizer';
60
99
  import {LayoutNode} from 'react-stately/useVirtualizerState';
61
100
  import {Menu, MenuItem, MenuSection, MenuTrigger} from './Menu';
62
101
  import Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';
63
102
  import {OverlayTriggerStateContext} from 'react-aria-components/Dialog';
64
103
  import {ProgressCircle} from './ProgressCircle';
65
- import {CheckboxContext as RACCheckboxContext} from 'react-aria-components/Checkbox';
66
104
  // @ts-ignore
105
+ import {CheckboxContext as RACCheckboxContext} from 'react-aria-components/Checkbox';
67
106
  import {Popover as RACPopover} from 'react-aria-components/Popover';
68
- import React, {createContext, CSSProperties, FormEvent, FormHTMLAttributes, ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
69
- import {Rect, TableLayout, Virtualizer} from 'react-aria-components/Virtualizer';
107
+ import React, {
108
+ createContext,
109
+ CSSProperties,
110
+ FormEvent,
111
+ FormHTMLAttributes,
112
+ ForwardedRef,
113
+ forwardRef,
114
+ ReactElement,
115
+ ReactNode,
116
+ RefObject,
117
+ useCallback,
118
+ useContext,
119
+ useEffect,
120
+ useMemo,
121
+ useRef,
122
+ useState
123
+ } from 'react';
70
124
  import SortDownArrow from '../s2wf-icons/S2_Icon_SortDown_20_N.svg';
71
125
  import SortUpArrow from '../s2wf-icons/S2_Icon_SortUp_20_N.svg';
72
126
  import {Button as SpectrumButton} from './Button';
127
+ import type {TableState} from 'react-stately/useTableState';
73
128
  import {useActionBarContainer} from './ActionBar';
74
129
  import {useDOMRef} from './useDOMRef';
75
130
  import {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';
@@ -83,63 +138,119 @@ import {VisuallyHidden} from 'react-aria/VisuallyHidden';
83
138
 
84
139
  interface S2TableProps {
85
140
  /** Whether the Table should be displayed with a quiet style. */
86
- isQuiet?: boolean,
141
+ isQuiet?: boolean;
87
142
  /**
88
143
  * Sets the amount of vertical padding within each cell.
144
+ *
89
145
  * @default 'regular'
90
146
  */
91
- density?: 'compact' | 'spacious' | 'regular',
147
+ density?: 'compact' | 'spacious' | 'regular';
92
148
  /**
93
149
  * Sets the overflow behavior for the cell contents.
150
+ *
94
151
  * @default 'truncate'
95
152
  */
96
- overflowMode?: 'wrap' | 'truncate',
153
+ overflowMode?: 'wrap' | 'truncate';
97
154
  // TODO: will we contine with onAction or rename to onRowAction like it is in RAC?
98
155
  /** Handler that is called when a user performs an action on a row. */
99
- onAction?: (key: Key) => void,
156
+ onAction?: (key: Key) => void;
100
157
  /**
101
158
  * Handler that is called when a user starts a column resize.
102
159
  */
103
- onResizeStart?: (widths: Map<Key, ColumnSize>) => void,
160
+ onResizeStart?: (widths: Map<Key, ColumnSize>) => void;
104
161
  /**
105
162
  * Handler that is called when a user performs a column resize.
106
163
  * Can be used with the width property on columns to put the column widths into
107
164
  * a controlled state.
108
165
  */
109
- onResize?: (widths: Map<Key, ColumnSize>) => void,
166
+ onResize?: (widths: Map<Key, ColumnSize>) => void;
110
167
  /**
111
168
  * Handler that is called after a user performs a column resize.
112
169
  * Can be used to store the widths of columns for another future session.
113
170
  */
114
- onResizeEnd?: (widths: Map<Key, ColumnSize>) => void,
171
+ onResizeEnd?: (widths: Map<Key, ColumnSize>) => void;
115
172
  /** The current loading state of the table. */
116
- loadingState?: LoadingState,
173
+ loadingState?: LoadingState;
117
174
  /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
118
- onLoadMore?: () => any,
175
+ onLoadMore?: () => any;
119
176
  /** Provides the ActionBar to display when rows are selected in the TableView. */
120
- renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement
177
+ renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement;
178
+ /**
179
+ * How selection should be displayed.
180
+ *
181
+ * @default 'checkbox'
182
+ */
183
+ selectionStyle?: 'checkbox' | 'highlight';
121
184
  }
122
185
 
123
186
  // TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody
124
- export interface TableViewProps extends Omit<RACTableProps, 'style' | 'className' | 'render' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks' | keyof GlobalDOMAttributes>, DOMProps, UnsafeStyles, S2TableProps {
187
+ export interface TableViewProps
188
+ extends
189
+ Omit<
190
+ RACTableProps,
191
+ | 'style'
192
+ | 'className'
193
+ | 'render'
194
+ | 'onRowAction'
195
+ | 'selectionBehavior'
196
+ | 'onScroll'
197
+ | 'onCellAction'
198
+ | keyof GlobalDOMAttributes
199
+ >,
200
+ DOMProps,
201
+ UnsafeStyles,
202
+ S2TableProps {
125
203
  /** Spectrum-defined styles, returned by the `style()` macro. */
126
- styles?: StylesPropWithHeight
204
+ styles?: StylesPropWithHeight;
127
205
  }
128
206
 
129
- let InternalTableContext = createContext<TableViewProps & {layout?: S2TableLayout<unknown>, setIsInResizeMode?:(val: boolean) => void, isInResizeMode?: boolean, selectionMode?: 'none' | 'single' | 'multiple'}>({});
130
-
131
- const tableWrapper = style({
132
- minHeight: 0,
133
- minWidth: 0,
134
- display: 'flex',
135
- isolation: 'isolate',
136
- disableTapHighlight: true,
137
- position: 'relative',
138
- // Clip ActionBar animation.
139
- overflow: 'clip'
140
- }, getAllowedOverrides({height: true}));
207
+ let InternalTableContext = createContext<
208
+ TableViewProps & {
209
+ layout?: S2TableLayout<unknown>;
210
+ setIsInResizeMode?: (val: boolean) => void;
211
+ isInResizeMode?: boolean;
212
+ selectionMode?: 'none' | 'single' | 'multiple';
213
+ selectionStyle?: 'checkbox' | 'highlight';
214
+ }
215
+ >({});
216
+
217
+ const tableWrapper = style(
218
+ {
219
+ minHeight: 0,
220
+ minWidth: 0,
221
+ display: 'flex',
222
+ isolation: 'isolate',
223
+ disableTapHighlight: true,
224
+ position: 'relative',
225
+ // Clip ActionBar animation.
226
+ overflow: 'clip'
227
+ },
228
+ getAllowedOverrides({height: true})
229
+ );
230
+
231
+ // due to the overflow: clip for actionbar, render the outline via a pseudo element so it isn't
232
+ // clipped. 6px radius matches the table's border radius
233
+ const rootDropOutline = css(`
234
+ &:has([role="grid"][data-drop-target])::after {
235
+ content: "";
236
+ position: absolute;
237
+ inset: 0;
238
+ pointer-events: none;
239
+ border: 2px solid ${color('blue-800')};
240
+ border-radius: 6px;
241
+ z-index: 2;
242
+ }
243
+ @media (forced-colors: active) {
244
+ &:has([role="grid"][data-drop-target])::after {
245
+ border-color: Highlight;
246
+ }
247
+ }
248
+ `);
141
249
 
142
- const table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean}>({
250
+ const dropTargetBackground = colorMix('gray-25', 'blue-900', 10);
251
+ const table = style<
252
+ TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean; isDragAndDrop?: boolean}
253
+ >({
143
254
  width: 'full',
144
255
  height: 'full',
145
256
  boxSizing: 'border-box',
@@ -152,16 +263,23 @@ const table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boo
152
263
  backgroundColor: {
153
264
  default: 'gray-25',
154
265
  isQuiet: 'transparent',
266
+ isDropTarget: dropTargetBackground,
155
267
  forcedColors: 'Background'
156
268
  },
157
- borderColor: 'gray-300',
269
+ borderColor: {
270
+ default: 'gray-300',
271
+ isDropTarget: 'blue-800',
272
+ forcedColors: {
273
+ default: 'ButtonBorder',
274
+ isDropTarget: 'Highlight'
275
+ }
276
+ },
158
277
  borderStyle: 'solid',
159
278
  borderWidth: {
160
279
  default: 1,
161
280
  isQuiet: 0
162
281
  },
163
282
  ...focusRing(),
164
- outlineOffset: -1, // Cover the border
165
283
  borderRadius: {
166
284
  default: '[6px]',
167
285
  isQuiet: 'none'
@@ -175,7 +293,24 @@ const table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boo
175
293
  // Base reproduction: https://codepen.io/lfdanlu/pen/zYVVGPW
176
294
  scrollPaddingTop: 32,
177
295
  scrollPaddingStart: {
178
- isCheckboxSelection: 40
296
+ isCheckboxSelection: 40,
297
+ isDragAndDrop: {
298
+ default: 16,
299
+ isCheckboxSelection: 56
300
+ }
301
+ },
302
+ forcedColorAdjust: 'none',
303
+ '--indicator-level-padding': {
304
+ type: 'width',
305
+ value: {
306
+ // 16 (drag cell width) + 14 (chevron start padding + half of chevron (5) - radius of drop indicator circle (6) - 1 (fudge factor)) + 40 (checkbox cell width)
307
+ default: 30,
308
+ isCheckboxSelection: 71
309
+ }
310
+ },
311
+ '--indent': {
312
+ type: 'width',
313
+ value: 16
179
314
  }
180
315
  });
181
316
 
@@ -206,11 +341,11 @@ export class S2TableLayout<T> extends TableLayout<T> {
206
341
  }
207
342
 
208
343
  protected buildCollection(): LayoutNode[] {
209
- let [header, body] = super.buildCollection();
210
- if (!header) {
344
+ let rowGroups = super.buildCollection();
345
+ if (rowGroups.length < 2) {
211
346
  return [];
212
347
  }
213
- let {layoutInfo} = body;
348
+ let {layoutInfo} = rowGroups[1];
214
349
  // TableLayout's buildCollection always sets the body width to the max width between the header width, but
215
350
  // we want the body to be sticky and only as wide as the table so it is always in view if loading/empty
216
351
  let isEmptyOrLoading = this.virtualizer?.collection.size === 0;
@@ -218,10 +353,7 @@ export class S2TableLayout<T> extends TableLayout<T> {
218
353
  layoutInfo.rect.width = this.virtualizer!.size.width - 80;
219
354
  }
220
355
 
221
- return [
222
- header,
223
- body
224
- ];
356
+ return rowGroups;
225
357
  }
226
358
 
227
359
  protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {
@@ -237,16 +369,23 @@ export class S2TableLayout<T> extends TableLayout<T> {
237
369
  return layoutNode;
238
370
  }
239
371
 
240
- // y is the height of the headers
241
- protected buildBody(y: number): LayoutNode {
242
- let layoutNode = super.buildBody(y);
372
+ protected buildRowGroup(y: number, node: GridNode<T>): LayoutNode {
373
+ let layoutNode = super.buildRowGroup(y, node);
374
+ if (node.type !== 'tablebody') {
375
+ return layoutNode;
376
+ }
243
377
  let {layoutInfo} = layoutNode;
244
378
  // Needs overflow for sticky loader
245
379
  layoutInfo.allowOverflow = true;
246
380
  // If loading or empty, we'll want the body to be sticky and centered
247
381
  let isEmptyOrLoading = this.virtualizer?.collection.size === 0;
248
382
  if (isEmptyOrLoading) {
249
- layoutInfo.rect = new Rect(40, 40, this.virtualizer!.size.width - 80, this.virtualizer!.size.height - 80);
383
+ layoutInfo.rect = new Rect(
384
+ 40,
385
+ 40,
386
+ this.virtualizer!.size.width - 80,
387
+ this.virtualizer!.size.height - 80
388
+ );
250
389
  layoutInfo.isSticky = true;
251
390
  }
252
391
 
@@ -273,14 +412,26 @@ export class S2TableLayout<T> extends TableLayout<T> {
273
412
  layoutNode.layoutInfo.allowOverflow = true;
274
413
  return layoutNode;
275
414
  }
415
+
416
+ getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {
417
+ let layoutInfo = super.getDropTargetLayoutInfo(target);
418
+ layoutInfo.zIndex = 1;
419
+ layoutInfo.allowOverflow = true;
420
+ return layoutInfo;
421
+ }
276
422
  }
277
423
 
278
- export const TableContext = createContext<ContextValue<Partial<TableViewProps>, DOMRefValue<HTMLDivElement>>>(null);
424
+ export const TableContext =
425
+ createContext<ContextValue<Partial<TableViewProps>, DOMRefValue<HTMLDivElement>>>(null);
279
426
 
280
427
  /**
281
- * Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.
428
+ * Tables are containers for displaying information. They allow users to quickly scan, sort,
429
+ * compare, and take action on large amounts of data.
282
430
  */
283
- export const TableView = forwardRef(function TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {
431
+ export const TableView = forwardRef(function TableView(
432
+ props: TableViewProps,
433
+ ref: DOMRef<HTMLDivElement>
434
+ ) {
284
435
  [props, ref] = useSpectrumContextProps(props, ref, TableContext);
285
436
  let {
286
437
  UNSAFE_style,
@@ -296,38 +447,78 @@ export const TableView = forwardRef(function TableView(props: TableViewProps, re
296
447
  onAction,
297
448
  onLoadMore,
298
449
  selectionMode = 'none',
450
+ selectionStyle = 'checkbox',
451
+ dragAndDropHooks,
452
+ disabledBehavior = 'all',
299
453
  ...otherProps
300
454
  } = props;
301
455
 
456
+ if (dragAndDropHooks && dragAndDropHooks.renderDragPreview == null) {
457
+ dragAndDropHooks.renderDragPreview = items => (
458
+ <DragPreview items={items} overflowMode={overflowMode} />
459
+ );
460
+ }
461
+
462
+ if (dragAndDropHooks) {
463
+ dragAndDropHooks.renderDropIndicator = target => (
464
+ <InsertionIndicator target={target as ItemDropTarget} />
465
+ );
466
+ }
467
+
302
468
  let domRef = useDOMRef(ref);
303
469
  let scale = useScale();
304
470
 
305
471
  // Starts when the user selects resize from the menu, ends when resizing ends
306
472
  // used to control the visibility of the resizer Nubbin
307
473
  let [isInResizeMode, setIsInResizeMode] = useState(false);
308
- let onResizeStart = useCallback((widths) => {
309
- propsOnResizeStart?.(widths);
310
- }, [propsOnResizeStart]);
311
- let onResizeEnd = useCallback((widths) => {
312
- setIsInResizeMode(false);
313
- propsOnResizeEnd?.(widths);
314
- }, [propsOnResizeEnd, setIsInResizeMode]);
315
-
316
- let context = useMemo(() => ({
317
- isQuiet,
318
- density,
319
- overflowMode,
320
- loadingState,
321
- onLoadMore,
322
- isInResizeMode,
323
- setIsInResizeMode,
324
- selectionMode
325
- }), [isQuiet, density, overflowMode, loadingState, onLoadMore, isInResizeMode, setIsInResizeMode, selectionMode]);
474
+ let onResizeStart = useCallback(
475
+ widths => {
476
+ propsOnResizeStart?.(widths);
477
+ },
478
+ [propsOnResizeStart]
479
+ );
480
+ let onResizeEnd = useCallback(
481
+ widths => {
482
+ setIsInResizeMode(false);
483
+ propsOnResizeEnd?.(widths);
484
+ },
485
+ [propsOnResizeEnd, setIsInResizeMode]
486
+ );
487
+
488
+ let context = useMemo(
489
+ () => ({
490
+ isQuiet,
491
+ density,
492
+ overflowMode,
493
+ loadingState,
494
+ onLoadMore,
495
+ isInResizeMode,
496
+ setIsInResizeMode,
497
+ selectionMode,
498
+ selectionStyle,
499
+ disabledBehavior
500
+ }),
501
+ [
502
+ isQuiet,
503
+ density,
504
+ overflowMode,
505
+ loadingState,
506
+ onLoadMore,
507
+ isInResizeMode,
508
+ setIsInResizeMode,
509
+ selectionMode,
510
+ selectionStyle,
511
+ disabledBehavior
512
+ ]
513
+ );
326
514
 
327
515
  let scrollRef = useRef<HTMLElement | null>(null);
328
516
  let isCheckboxSelection = selectionMode === 'multiple' || selectionMode === 'single';
329
-
330
- let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});
517
+ let isDragAndDrop = !!dragAndDropHooks?.useDraggableCollectionState;
518
+ let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({
519
+ ...props,
520
+ scrollRef
521
+ });
331
522
 
332
523
  return (
333
524
  <ResizableTableContainer
@@ -336,20 +527,17 @@ export const TableView = forwardRef(function TableView(props: TableViewProps, re
336
527
  onResize={propsOnResize}
337
528
  onResizeEnd={onResizeEnd}
338
529
  onResizeStart={onResizeStart}
339
- className={(UNSAFE_className || '') + tableWrapper(null, styles)}
530
+ className={(UNSAFE_className || '') + tableWrapper(null, styles) + ' ' + rootDropOutline}
340
531
  style={UNSAFE_style}>
341
532
  <Virtualizer
342
533
  layout={S2TableLayout}
343
534
  layoutOptions={{
344
- rowHeight: overflowMode === 'wrap'
345
- ? undefined
346
- : ROW_HEIGHTS[density][scale],
347
- estimatedRowHeight: overflowMode === 'wrap'
348
- ? ROW_HEIGHTS[density][scale]
349
- : undefined,
535
+ rowHeight: overflowMode === 'wrap' ? undefined : ROW_HEIGHTS[density][scale],
536
+ estimatedRowHeight: overflowMode === 'wrap' ? ROW_HEIGHTS[density][scale] : undefined,
350
537
  // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap
351
538
  headingHeight: DEFAULT_HEADER_HEIGHT[scale],
352
- loaderHeight: 60
539
+ loaderHeight: 60,
540
+ dropIndicatorThickness: 0
353
541
  }}>
354
542
  <InternalTableContext.Provider value={context}>
355
543
  <RACTable
@@ -362,18 +550,24 @@ export const TableView = forwardRef(function TableView(props: TableViewProps, re
362
550
  paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,
363
551
  scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0
364
552
  }}
365
- className={renderProps => table({
366
- ...renderProps,
367
- isCheckboxSelection,
368
- isQuiet
369
- })}
370
- selectionBehavior="toggle"
553
+ className={renderProps =>
554
+ table({
555
+ ...renderProps,
556
+ isCheckboxSelection,
557
+ isDragAndDrop,
558
+ isQuiet
559
+ })
560
+ }
561
+ selectionBehavior={selectionStyle === 'highlight' ? 'replace' : 'toggle'}
371
562
  selectionMode={selectionMode}
372
563
  onRowAction={onAction}
564
+ dragAndDropHooks={dragAndDropHooks}
565
+ disabledBehavior={disabledBehavior}
373
566
  {...otherProps}
374
567
  selectedKeys={selectedKeys}
375
568
  defaultSelectedKeys={undefined}
376
- onSelectionChange={onSelectionChange} />
569
+ onSelectionChange={onSelectionChange}
570
+ />
377
571
  </InternalTableContext.Provider>
378
572
  </Virtualizer>
379
573
  {actionBar}
@@ -389,12 +583,18 @@ const centeredWrapper = style({
389
583
  height: 'full'
390
584
  });
391
585
 
392
- export interface TableBodyProps<T> extends Omit<RACTableBodyProps<T>, 'style' | 'className' | 'render' | keyof GlobalDOMAttributes> {}
586
+ export interface TableBodyProps<T> extends Omit<
587
+ RACTableBodyProps<T>,
588
+ 'style' | 'className' | 'render' | keyof GlobalDOMAttributes
589
+ > {}
393
590
 
394
591
  /**
395
592
  * The body of a `<Table>`, containing the table rows.
396
593
  */
397
- export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLDivElement>) {
594
+ export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T>(
595
+ props: TableBodyProps<T>,
596
+ ref: DOMRef<HTMLDivElement>
597
+ ) {
398
598
  let {items, renderEmptyState, children, dependencies = []} = props;
399
599
  let domRef = useDOMRef(ref);
400
600
  let {loadingState, onLoadMore} = useContext(InternalTableContext);
@@ -406,11 +606,12 @@ export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function T
406
606
  // This is because we don't distinguish between loadingMore and loading in the layout, resulting in a different rect being used to build the body. Perhaps can be considered as a user error
407
607
  // if they pass loadingMore without having any other items in the table. Alternatively, could update the layout so it knows the current loading state.
408
608
  let loadMoreSpinner = (
409
- <TableLoadMoreItem isLoading={loadingState === 'loadingMore'} onLoadMore={onLoadMore} className={style({height: 'full', width: 'full'})}>
609
+ <TableLoadMoreItem
610
+ isLoading={loadingState === 'loadingMore'}
611
+ onLoadMore={onLoadMore}
612
+ className={style({height: 'full', width: 'full'})}>
410
613
  <div className={centeredWrapper}>
411
- <ProgressCircle
412
- isIndeterminate
413
- aria-label={stringFormatter.format('table.loadingMore')} />
614
+ <ProgressCircle isIndeterminate aria-label={stringFormatter.format('table.loadingMore')} />
414
615
  </div>
415
616
  </TableLoadMoreItem>
416
617
  );
@@ -448,9 +649,7 @@ export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function T
448
649
  } else if (loadingState === 'loading') {
449
650
  emptyRender = () => (
450
651
  <div className={centeredWrapper}>
451
- <ProgressCircle
452
- isIndeterminate
453
- aria-label={stringFormatter.format('table.loading')} />
652
+ <ProgressCircle isIndeterminate aria-label={stringFormatter.format('table.loading')} />
454
653
  </div>
455
654
  );
456
655
  }
@@ -477,13 +676,24 @@ const cellFocus = {
477
676
  outlineWidth: 2,
478
677
  outlineColor: {
479
678
  default: 'focus-ring',
480
- forcedColors: 'Highlight'
679
+ forcedColors: {
680
+ default: 'Highlight'
681
+ }
481
682
  },
482
- borderRadius: '[6px]'
683
+ borderRadius: '[5px]',
684
+ // We need to render the cell focus ring on top of the cell divider if there is one. The divider has a z-index of 1.
685
+ zIndex: 2
483
686
  } as const;
484
687
 
485
688
  function CellFocusRing() {
486
- return <div role="presentation" className={style({...cellFocus, position: 'absolute', inset: 0, pointerEvents: 'none'})({isFocusVisible: true})} />;
689
+ return (
690
+ <div
691
+ role="presentation"
692
+ className={style({...cellFocus, position: 'absolute', inset: 0, pointerEvents: 'none'})({
693
+ isFocusVisible: true
694
+ })}
695
+ />
696
+ );
487
697
  }
488
698
 
489
699
  const columnStyles = style({
@@ -528,20 +738,24 @@ const columnStyles = style({
528
738
  forcedColorAdjust: 'none'
529
739
  });
530
740
 
531
- export interface ColumnProps extends Omit<RACColumnProps, 'style' | 'className' | 'render' | keyof GlobalDOMAttributes> {
741
+ export interface ColumnProps extends Omit<
742
+ RACColumnProps,
743
+ 'style' | 'className' | 'render' | keyof GlobalDOMAttributes
744
+ > {
532
745
  /** Whether the column should render a divider between it and the next column. */
533
- showDivider?: boolean,
746
+ showDivider?: boolean;
534
747
  /** Whether the column allows resizing. */
535
- allowsResizing?: boolean,
748
+ allowsResizing?: boolean;
536
749
  /**
537
750
  * The alignment of the column's contents relative to its allotted width.
751
+ *
538
752
  * @default 'start'
539
753
  */
540
- align?: 'start' | 'center' | 'end',
754
+ align?: 'start' | 'center' | 'end';
541
755
  /** The content to render as the column header. */
542
- children: ReactNode,
756
+ children: ReactNode;
543
757
  /** Menu fragment to be rendered inside the column header's menu. */
544
- menuItems?: ReactNode
758
+ menuItems?: ReactNode;
545
759
  }
546
760
 
547
761
  /**
@@ -553,26 +767,37 @@ export const Column = forwardRef(function Column(props: ColumnProps, ref: DOMRef
553
767
  let domRef = useDOMRef(ref);
554
768
  let isMenu = allowsResizing || !!props.menuItems;
555
769
 
556
-
557
770
  return (
558
- <RACColumn {...props} ref={domRef} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isMenu, align, isQuiet})}>
771
+ <RACColumn
772
+ {...props}
773
+ ref={domRef}
774
+ style={{borderInlineEndColor: 'transparent'}}
775
+ className={renderProps => columnStyles({...renderProps, isMenu, align, isQuiet})}>
559
776
  {({allowsSorting, sortDirection, isFocusVisible, sort, startResize}) => (
560
777
  <>
561
778
  {/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity
562
779
  (no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}
563
780
  {/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}
564
781
  {isFocusVisible && <CellFocusRing />}
565
- {isMenu ?
566
- (
567
- <ColumnWithMenu isColumnResizable={allowsResizing} menuItems={props.menuItems} allowsSorting={allowsSorting} sortDirection={sortDirection} sort={sort} startResize={startResize} align={align}>
568
- {children}
569
- </ColumnWithMenu>
570
- ) : (
571
- <ColumnContents align={align} allowsSorting={allowsSorting} sortDirection={sortDirection}>
572
- {children}
573
- </ColumnContents>
574
- )
575
- }
782
+ {isMenu ? (
783
+ <ColumnWithMenu
784
+ isColumnResizable={allowsResizing}
785
+ menuItems={props.menuItems}
786
+ allowsSorting={allowsSorting}
787
+ sortDirection={sortDirection}
788
+ sort={sort}
789
+ startResize={startResize}
790
+ align={align}>
791
+ {children}
792
+ </ColumnWithMenu>
793
+ ) : (
794
+ <ColumnContents
795
+ align={align}
796
+ allowsSorting={allowsSorting}
797
+ sortDirection={sortDirection}>
798
+ {children}
799
+ </ColumnContents>
800
+ )}
576
801
  </>
577
802
  )}
578
803
  </RACColumn>
@@ -607,7 +832,10 @@ const sortIcon = style({
607
832
  }
608
833
  });
609
834
 
610
- interface ColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>, Pick<ColumnProps, 'align' | 'children'> {}
835
+ interface ColumnContentProps
836
+ extends
837
+ Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>,
838
+ Pick<ColumnProps, 'align' | 'children'> {}
611
839
 
612
840
  function ColumnContents(props: ColumnContentProps) {
613
841
  let {align, allowsSorting, sortDirection, children} = props;
@@ -617,18 +845,18 @@ function ColumnContents(props: ColumnContentProps) {
617
845
  {allowsSorting && (
618
846
  <Provider
619
847
  values={[
620
- [IconContext, {
621
- styles: sortIcon({})
622
- }]
848
+ [
849
+ IconContext,
850
+ {
851
+ styles: sortIcon({})
852
+ }
853
+ ]
623
854
  ]}>
624
- {sortDirection != null && (
625
- sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />
626
- )}
855
+ {sortDirection != null &&
856
+ (sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />)}
627
857
  </Provider>
628
858
  )}
629
- <span className={columnHeaderText}>
630
- {children}
631
- </span>
859
+ <span className={columnHeaderText}>{children}</span>
632
860
  </div>
633
861
  );
634
862
  }
@@ -671,14 +899,14 @@ const resizerHandleContainer = style({
671
899
  cursor: {
672
900
  default: 'none',
673
901
  resizableDirection: {
674
- 'left': 'e-resize',
675
- 'right': 'w-resize',
676
- 'both': 'ew-resize'
902
+ left: 'e-resize',
903
+ right: 'w-resize',
904
+ both: 'ew-resize'
677
905
  }
678
906
  }
679
907
  });
680
908
 
681
- const resizerHandle = style<{isFocusVisible: boolean, isResizing: boolean}>({
909
+ const resizerHandle = style<{isFocusVisible: boolean; isResizing: boolean}>({
682
910
  backgroundColor: {
683
911
  default: 'gray-300',
684
912
  isFocusVisible: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that will use the focusVisible version
@@ -739,16 +967,28 @@ const nubbin = style({
739
967
  }
740
968
  });
741
969
 
742
- interface ColumnWithMenuProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize'>, Pick<ColumnProps, 'align' | 'children'> {
743
- isColumnResizable?: boolean,
744
- menuItems?: ReactNode
970
+ interface ColumnWithMenuProps
971
+ extends
972
+ Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize'>,
973
+ Pick<ColumnProps, 'align' | 'children'> {
974
+ isColumnResizable?: boolean;
975
+ menuItems?: ReactNode;
745
976
  }
746
977
 
747
978
  function ColumnWithMenu(props: ColumnWithMenuProps) {
748
- let {allowsSorting, sortDirection, sort, startResize, children, align, isColumnResizable, menuItems} = props;
979
+ let {
980
+ allowsSorting,
981
+ sortDirection,
982
+ sort,
983
+ startResize,
984
+ children,
985
+ align,
986
+ isColumnResizable,
987
+ menuItems
988
+ } = props;
749
989
  let {setIsInResizeMode, isInResizeMode} = useContext(InternalTableContext);
750
990
  let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
751
- const onMenuSelect = (key) => {
991
+ const onMenuSelect = key => {
752
992
  switch (key) {
753
993
  case 'sort-asc':
754
994
  sort('ascending');
@@ -764,12 +1004,14 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
764
1004
  };
765
1005
 
766
1006
  let items = useMemo(() => {
767
- let options: Array<{label: string, id: string}> = [];
1007
+ let options: Array<{label: string; id: string}> = [];
768
1008
  if (isColumnResizable) {
769
- options = [{
770
- label: stringFormatter.format('table.resizeColumn'),
771
- id: 'resize'
772
- }];
1009
+ options = [
1010
+ {
1011
+ label: stringFormatter.format('table.resizeColumn'),
1012
+ id: 'resize'
1013
+ }
1014
+ ];
773
1015
  }
774
1016
  if (allowsSorting) {
775
1017
  options = [
@@ -785,7 +1027,7 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
785
1027
  ];
786
1028
  }
787
1029
  return options;
788
- // eslint-disable-next-line react-hooks/exhaustive-deps
1030
+ // eslint-disable-next-line react-hooks/exhaustive-deps
789
1031
  }, [allowsSorting, isColumnResizable]);
790
1032
 
791
1033
  let buttonAlignment = 'start';
@@ -800,30 +1042,31 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
800
1042
  return (
801
1043
  <>
802
1044
  <MenuTrigger align={menuAlign}>
803
- <Button className={(renderProps) => resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})}>
1045
+ <Button
1046
+ className={renderProps =>
1047
+ resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})
1048
+ }>
804
1049
  {allowsSorting && (
805
1050
  <Provider
806
1051
  values={[
807
- [IconContext, {
808
- styles: sortIcon({isButton: true})
809
- }]
1052
+ [
1053
+ IconContext,
1054
+ {
1055
+ styles: sortIcon({isButton: true})
1056
+ }
1057
+ ]
810
1058
  ]}>
811
- {sortDirection != null && (
812
- sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />
813
- )}
1059
+ {sortDirection != null &&
1060
+ (sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />)}
814
1061
  </Provider>
815
1062
  )}
816
- <div className={columnHeaderText}>
817
- {children}
818
- </div>
1063
+ <div className={columnHeaderText}>{children}</div>
819
1064
  <Chevron size="M" className={chevronIcon} />
820
1065
  </Button>
821
1066
  <Menu onAction={onMenuSelect} styles={style({minWidth: 128})}>
822
1067
  {items.length > 0 && (
823
1068
  <MenuSection>
824
- <Collection items={items}>
825
- {(item) => <MenuItem>{item?.label}</MenuItem>}
826
- </Collection>
1069
+ <Collection items={items}>{item => <MenuItem>{item?.label}</MenuItem>}</Collection>
827
1070
  </MenuSection>
828
1071
  )}
829
1072
  {menuItems}
@@ -831,13 +1074,21 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
831
1074
  </MenuTrigger>
832
1075
  {isColumnResizable && (
833
1076
  <div data-react-aria-prevent-focus="true">
834
- <ColumnResizer data-react-aria-prevent-focus="true" className={({resizableDirection, isResizing}) => resizerHandleContainer({resizableDirection, isResizing, isInResizeMode})}>
1077
+ <ColumnResizer
1078
+ data-react-aria-prevent-focus="true"
1079
+ className={({resizableDirection, isResizing}) =>
1080
+ resizerHandleContainer({resizableDirection, isResizing, isInResizeMode})
1081
+ }>
835
1082
  {({isFocusVisible, isResizing}) => (
836
1083
  <>
837
1084
  <ResizerIndicator isFocusVisible={isFocusVisible} isResizing={isResizing} />
838
- {(isFocusVisible || isInResizeMode) && isResizing && <div className={nubbin}><Nubbin /></div>}
1085
+ {(isFocusVisible || isInResizeMode) && isResizing && (
1086
+ <div className={nubbin}>
1087
+ <Nubbin />
1088
+ </div>
1089
+ )}
839
1090
  </>
840
- )}
1091
+ )}
841
1092
  </ColumnResizer>
842
1093
  </div>
843
1094
  )}
@@ -846,15 +1097,16 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
846
1097
  }
847
1098
 
848
1099
  function ResizerIndicator({isFocusVisible, isResizing}) {
849
- return (
850
- <div className={resizerHandle({isFocusVisible, isResizing})} />
851
- );
1100
+ return <div className={resizerHandle({isFocusVisible, isResizing})} />;
852
1101
  }
853
1102
 
854
1103
  const tableHeader = style({
855
1104
  height: 'full',
856
1105
  width: 'full',
857
- backgroundColor: 'gray-75',
1106
+ backgroundColor: {
1107
+ default: 'gray-75',
1108
+ forcedColors: 'transparent'
1109
+ },
858
1110
  // Attempt to prevent 1px area where you can see scrolled cell content between the table outline and the table header
859
1111
  marginTop: '[-1px]',
860
1112
  '--resizerDisplay': {
@@ -866,8 +1118,7 @@ const tableHeader = style({
866
1118
  }
867
1119
  });
868
1120
 
869
- const selectAllCheckbox = style({
870
- });
1121
+ const selectAllCheckbox = style({});
871
1122
 
872
1123
  const selectAllCheckboxColumn = style({
873
1124
  paddingStart: {
@@ -898,66 +1149,94 @@ const selectAllCheckboxColumn = style({
898
1149
  },
899
1150
  borderBottomWidth: 1,
900
1151
  borderStyle: 'solid',
901
- backgroundColor: 'gray-75'
1152
+ backgroundColor: {
1153
+ default: 'gray-75',
1154
+ forcedColors: 'transparent'
1155
+ }
902
1156
  });
903
1157
 
904
- export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'render' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd' | keyof GlobalDOMAttributes> {}
1158
+ export interface TableHeaderProps<T> extends Omit<
1159
+ RACTableHeaderProps<T>,
1160
+ | 'style'
1161
+ | 'className'
1162
+ | 'render'
1163
+ | 'onHoverChange'
1164
+ | 'onHoverStart'
1165
+ | 'onHoverEnd'
1166
+ | keyof GlobalDOMAttributes
1167
+ > {}
905
1168
 
906
1169
  /**
907
1170
  * A header within a `<Table>`, containing the table columns.
908
1171
  */
909
- export const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T extends object>({columns, dependencies, children}: TableHeaderProps<T>, ref: DOMRef<HTMLDivElement>) {
1172
+ export const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T>(
1173
+ {columns, dependencies, children}: TableHeaderProps<T>,
1174
+ ref: DOMRef<HTMLDivElement>
1175
+ ) {
910
1176
  let scale = useScale();
911
- let {selectionBehavior, selectionMode} = useTableOptions();
912
- let {isQuiet} = useContext(InternalTableContext);
1177
+ let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();
1178
+ let {isQuiet, selectionStyle} = useContext(InternalTableContext);
913
1179
  let domRef = useDOMRef(ref);
1180
+ let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
914
1181
 
915
1182
  return (
916
- (<RACTableHeader
1183
+ <RACTableHeader
917
1184
  // @ts-ignore
918
1185
  ref={domRef}
919
1186
  className={tableHeader}>
1187
+ {allowsDragging && (
1188
+ <RACColumn
1189
+ // @ts-ignore
1190
+ isSticky
1191
+ width={scale === 'medium' ? 16 : 20}
1192
+ minWidth={scale === 'medium' ? 16 : 20}
1193
+ className={selectAllCheckboxColumn({isQuiet})}>
1194
+ {({isFocusVisible}) => (
1195
+ <>
1196
+ {isFocusVisible && <CellFocusRing />}
1197
+ <VisuallyHidden>{stringFormatter.format('table.drag')}</VisuallyHidden>
1198
+ </>
1199
+ )}
1200
+ </RACColumn>
1201
+ )}
920
1202
  {/* Add extra columns for selection. */}
921
- {selectionBehavior === 'toggle' && (
922
- // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
923
- // @ts-ignore
924
- (<RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn({isQuiet})}>
1203
+ {selectionBehavior === 'toggle' && selectionStyle === 'checkbox' && (
1204
+ <RACColumn
1205
+ // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
1206
+ // @ts-ignore
1207
+ isSticky
1208
+ width={scale === 'medium' ? 40 : 52}
1209
+ minWidth={scale === 'medium' ? 40 : 52}
1210
+ className={selectAllCheckboxColumn({isQuiet})}>
925
1211
  {({isFocusVisible}) => (
926
1212
  <>
927
- {selectionMode === 'single' &&
1213
+ {selectionMode === 'single' && (
928
1214
  <>
929
1215
  {isFocusVisible && <CellFocusRing />}
930
1216
  <VisuallyHiddenSelectAllLabel />
931
1217
  </>
932
- }
933
- {selectionMode === 'multiple' &&
1218
+ )}
1219
+ {selectionMode === 'multiple' && (
934
1220
  <Checkbox styles={selectAllCheckbox} slot="selection" />
935
- }
1221
+ )}
936
1222
  </>
937
1223
  )}
938
- </RACColumn>)
1224
+ </RACColumn>
939
1225
  )}
940
1226
  <Collection items={columns} dependencies={dependencies}>
941
1227
  {children}
942
1228
  </Collection>
943
- </RACTableHeader>)
1229
+ </RACTableHeader>
944
1230
  );
945
1231
  });
946
1232
 
947
1233
  function VisuallyHiddenSelectAllLabel() {
948
1234
  let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');
949
1235
 
950
- return (
951
- <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>
952
- );
1236
+ return <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>;
953
1237
  }
954
1238
 
955
1239
  const commonCellStyles = {
956
- borderColor: 'transparent',
957
- borderBottomWidth: 1,
958
- borderTopWidth: 0,
959
- borderXWidth: 0,
960
- borderStyle: 'solid',
961
1240
  position: 'relative',
962
1241
  color: '--rowTextColor',
963
1242
  outlineStyle: 'none',
@@ -965,10 +1244,6 @@ const commonCellStyles = {
965
1244
  } as const;
966
1245
 
967
1246
  const treeColumnStyles = {
968
- '--indent': {
969
- type: 'width',
970
- value: 16
971
- },
972
1247
  '--treeColumnPadding': {
973
1248
  type: 'width',
974
1249
  value: {
@@ -982,7 +1257,9 @@ const treeColumnStyles = {
982
1257
  }
983
1258
  } as const;
984
1259
 
985
- const cell = style<CellRenderProps & S2TableProps & {isDivider: boolean, isTreeColumnWithNoChildren: boolean}>({
1260
+ const cell = style<
1261
+ CellRenderProps & S2TableProps & {isDivider: boolean; isTreeColumnWithNoChildren: boolean}
1262
+ >({
986
1263
  ...commonCellStyles,
987
1264
  ...treeColumnStyles,
988
1265
  minHeight: {
@@ -997,19 +1274,18 @@ const cell = style<CellRenderProps & S2TableProps & {isDivider: boolean, isTreeC
997
1274
  width: 'full',
998
1275
  fontSize: controlFont(),
999
1276
  alignItems: 'center',
1000
- display: 'flex',
1001
- borderStyle: {
1002
- default: 'none',
1003
- isDivider: 'solid'
1004
- },
1005
- borderEndWidth: {
1006
- default: 0,
1007
- isDivider: 1
1008
- },
1009
- borderColor: {
1010
- default: 'gray-300',
1011
- forcedColors: 'ButtonBorder'
1012
- }
1277
+ display: 'flex'
1278
+ });
1279
+
1280
+ const divider = style({
1281
+ display: 'block',
1282
+ position: 'absolute',
1283
+ width: '[1px]',
1284
+ height: 'full',
1285
+ insetEnd: 0,
1286
+ backgroundColor: 'var(--borderColorGray)',
1287
+ // set a z index on the divider so the highlight selection border and focus ring can override it
1288
+ zIndex: 1
1013
1289
  });
1014
1290
 
1015
1291
  const stickyCell = {
@@ -1030,6 +1306,17 @@ const checkboxCellStyle = style({
1030
1306
  backgroundColor: '--rowBackgroundColor'
1031
1307
  });
1032
1308
 
1309
+ const dragCellStyle = style({
1310
+ ...commonCellStyles,
1311
+ ...stickyCell,
1312
+ paddingStart: 4,
1313
+ paddingEnd: 4,
1314
+ alignContent: 'center',
1315
+ height: 'calc(100% - 1px)',
1316
+ borderBottomWidth: 0,
1317
+ backgroundColor: '--rowBackgroundColor'
1318
+ });
1319
+
1033
1320
  const cellContent = style({
1034
1321
  truncate: {
1035
1322
  default: true,
@@ -1067,25 +1354,21 @@ const cellContent = style({
1067
1354
  }
1068
1355
  });
1069
1356
 
1070
- export interface CellProps extends Omit<RACCellProps, 'style' | 'className' | 'render' | keyof GlobalDOMAttributes>, Pick<ColumnProps, 'align' | 'showDivider'> {
1357
+ export interface CellProps
1358
+ extends
1359
+ Omit<RACCellProps, 'style' | 'className' | 'render' | keyof GlobalDOMAttributes>,
1360
+ Pick<ColumnProps, 'align' | 'showDivider'> {
1071
1361
  /** @private */
1072
- isSticky?: boolean,
1362
+ isSticky?: boolean;
1073
1363
  /** The content to render as the cell children. */
1074
- children: ReactNode
1364
+ children: ReactNode;
1075
1365
  }
1076
1366
 
1077
1367
  /**
1078
1368
  * A cell within a table row.
1079
1369
  */
1080
1370
  export const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLDivElement>) {
1081
- let {
1082
- children,
1083
- isSticky,
1084
- showDivider = false,
1085
- align,
1086
- textValue,
1087
- ...otherProps
1088
- } = props;
1371
+ let {children, isSticky, showDivider = false, align, textValue, ...otherProps} = props;
1089
1372
  let domRef = useDOMRef(ref);
1090
1373
  let tableVisualOptions = useContext(InternalTableContext);
1091
1374
  textValue ||= typeof children === 'string' ? children : undefined;
@@ -1096,20 +1379,25 @@ export const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLD
1096
1379
  // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
1097
1380
  // @ts-ignore
1098
1381
  isSticky={isSticky}
1099
- className={renderProps => cell({
1100
- ...renderProps,
1101
- ...tableVisualOptions,
1102
- isDivider: showDivider,
1103
- isTreeColumnWithNoChildren: renderProps.isTreeColumn && !renderProps.hasChildItems
1104
- })}
1382
+ className={renderProps =>
1383
+ cell({
1384
+ ...renderProps,
1385
+ ...tableVisualOptions,
1386
+ isDivider: showDivider,
1387
+ isTreeColumnWithNoChildren: renderProps.isTreeColumn && !renderProps.hasChildItems
1388
+ })
1389
+ }
1105
1390
  textValue={textValue}
1106
1391
  {...otherProps}>
1107
1392
  {({id, isFocusVisible, hasChildItems, isTreeColumn, isExpanded, isDisabled}) => (
1108
1393
  <>
1109
- {hasChildItems && isTreeColumn &&
1394
+ {showDivider && <div className={divider} />}
1395
+ {hasChildItems && isTreeColumn && (
1110
1396
  <ExpandableRowChevron key={id} isDisabled={isDisabled} isExpanded={isExpanded} />
1111
- }
1112
- <span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>{children}</span>
1397
+ )}
1398
+ <span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>
1399
+ {children}
1400
+ </span>
1113
1401
  {isFocusVisible && <CellFocusRing />}
1114
1402
  </>
1115
1403
  )}
@@ -1118,10 +1406,10 @@ export const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLD
1118
1406
  });
1119
1407
 
1120
1408
  interface ExpandableRowChevronProps {
1121
- isExpanded?: boolean,
1122
- isDisabled?: boolean,
1123
- isRTL?: boolean,
1124
- isHidden?: boolean
1409
+ isExpanded?: boolean;
1410
+ isDisabled?: boolean;
1411
+ isRTL?: boolean;
1412
+ isHidden?: boolean;
1125
1413
  }
1126
1414
 
1127
1415
  const expandButton = style<ExpandableRowChevronProps>({
@@ -1168,7 +1456,9 @@ function ExpandableRowChevron(props: ExpandableRowChevronProps) {
1168
1456
  {...props}
1169
1457
  ref={ref}
1170
1458
  slot="chevron"
1171
- className={renderProps => expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', isHidden})}>
1459
+ className={renderProps =>
1460
+ expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', isHidden})
1461
+ }>
1172
1462
  <Chevron
1173
1463
  className={style({
1174
1464
  scale: {
@@ -1181,17 +1471,31 @@ function ExpandableRowChevron(props: ExpandableRowChevronProps) {
1181
1471
  type: 'fill',
1182
1472
  value: 'currentColor'
1183
1473
  }
1184
- })({direction})} />
1474
+ })({direction})}
1475
+ />
1185
1476
  </Button>
1186
1477
  );
1187
1478
  }
1188
1479
 
1189
- const editableCell = style<CellRenderProps & S2TableProps & {isDivider: boolean, selectionMode?: 'none' | 'single' | 'multiple', isSaving?: boolean, isTreeColumnWithNoChildren: boolean}>({
1480
+ const editableCell = style<
1481
+ CellRenderProps &
1482
+ S2TableProps & {
1483
+ isDivider: boolean;
1484
+ selectionMode?: 'none' | 'single' | 'multiple';
1485
+ isSaving?: boolean;
1486
+ isTreeColumnWithNoChildren: boolean;
1487
+ }
1488
+ >({
1190
1489
  ...commonCellStyles,
1191
1490
  ...treeColumnStyles,
1192
1491
  color: {
1193
1492
  default: baseColor('neutral'),
1194
- isSaving: baseColor('neutral-subdued')
1493
+ isSaving: baseColor('neutral-subdued'),
1494
+ forcedColors: 'ButtonText',
1495
+ isDisabled: {
1496
+ default: 'disabled',
1497
+ forcedColors: 'GrayText'
1498
+ }
1195
1499
  },
1196
1500
  paddingY: centerPadding(),
1197
1501
  boxSizing: 'border-box',
@@ -1214,52 +1518,58 @@ const editableCell = style<CellRenderProps & S2TableProps & {isDivider: boolean,
1214
1518
  }
1215
1519
  });
1216
1520
 
1217
- let editPopover = style({
1218
- ...setColorScheme(),
1219
- '--s2-container-bg': {
1220
- type: 'backgroundColor',
1221
- value: 'layer-2'
1521
+ let editPopover = style(
1522
+ {
1523
+ ...setColorScheme(),
1524
+ '--s2-container-bg': {
1525
+ type: 'backgroundColor',
1526
+ value: 'layer-2'
1527
+ },
1528
+ backgroundColor: '--s2-container-bg',
1529
+ borderBottomRadius: 'default',
1530
+ // Use box-shadow instead of filter when an arrow is not shown.
1531
+ // This fixes the shadow stacking problem with submenus.
1532
+ boxShadow: 'elevated',
1533
+ borderStyle: 'solid',
1534
+ borderWidth: 1,
1535
+ borderColor: {
1536
+ default: 'gray-200',
1537
+ forcedColors: 'ButtonBorder'
1538
+ },
1539
+ boxSizing: 'content-box',
1540
+ isolation: 'isolate',
1541
+ pointerEvents: {
1542
+ isExiting: 'none'
1543
+ },
1544
+ outlineStyle: 'none',
1545
+ minWidth: '--trigger-width',
1546
+ padding: 8,
1547
+ display: 'flex',
1548
+ alignItems: 'center'
1222
1549
  },
1223
- backgroundColor: '--s2-container-bg',
1224
- borderBottomRadius: 'default',
1225
- // Use box-shadow instead of filter when an arrow is not shown.
1226
- // This fixes the shadow stacking problem with submenus.
1227
- boxShadow: 'elevated',
1228
- borderStyle: 'solid',
1229
- borderWidth: 1,
1230
- borderColor: {
1231
- default: 'gray-200',
1232
- forcedColors: 'ButtonBorder'
1233
- },
1234
- boxSizing: 'content-box',
1235
- isolation: 'isolate',
1236
- pointerEvents: {
1237
- isExiting: 'none'
1238
- },
1239
- outlineStyle: 'none',
1240
- minWidth: '--trigger-width',
1241
- padding: 8,
1242
- display: 'flex',
1243
- alignItems: 'center'
1244
- }, getAllowedOverrides());
1550
+ getAllowedOverrides()
1551
+ );
1245
1552
 
1246
1553
  interface EditableCellProps extends Omit<CellProps, 'isSticky'> {
1247
1554
  /** The component which will handle editing the cell. For example, a `TextField` or a `Picker`. */
1248
- renderEditing: () => ReactNode,
1555
+ renderEditing: () => ReactNode;
1249
1556
  /** Whether the cell is currently being saved. */
1250
- isSaving?: boolean,
1557
+ isSaving?: boolean;
1251
1558
  /** Handler that is called when the value has been changed and is ready to be saved. */
1252
- onSubmit?: (e: FormEvent<HTMLFormElement>) => void,
1559
+ onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
1253
1560
  /** Handler that is called when the user cancels the edit. */
1254
- onCancel?: () => void,
1561
+ onCancel?: () => void;
1255
1562
  /** The action to submit the form to. Only available in React 19+. */
1256
- action?: string | FormHTMLAttributes<HTMLFormElement>['action']
1563
+ action?: string | FormHTMLAttributes<HTMLFormElement>['action'];
1257
1564
  }
1258
1565
 
1259
1566
  /**
1260
1567
  * An editable cell within a table row.
1261
1568
  */
1262
- export const EditableCell = forwardRef(function EditableCell(props: EditableCellProps, ref: ForwardedRef<HTMLDivElement>) {
1569
+ export const EditableCell = forwardRef(function EditableCell(
1570
+ props: EditableCellProps,
1571
+ ref: ForwardedRef<HTMLDivElement>
1572
+ ) {
1263
1573
  let {children, showDivider = false, textValue, isSaving, ...otherProps} = props;
1264
1574
  let tableVisualOptions = useContext(InternalTableContext);
1265
1575
  let domRef = useObjectRef(ref);
@@ -1268,21 +1578,27 @@ export const EditableCell = forwardRef(function EditableCell(props: EditableCell
1268
1578
  return (
1269
1579
  <RACCell
1270
1580
  ref={domRef}
1271
- className={renderProps => editableCell({
1272
- ...renderProps,
1273
- ...tableVisualOptions,
1274
- isDivider: showDivider,
1275
- isSaving,
1276
- isTreeColumnWithNoChildren: renderProps.isTreeColumn && !renderProps.hasChildItems
1277
- })}
1581
+ className={renderProps =>
1582
+ editableCell({
1583
+ ...renderProps,
1584
+ ...tableVisualOptions,
1585
+ isDivider: showDivider,
1586
+ isSaving,
1587
+ isTreeColumnWithNoChildren: renderProps.isTreeColumn && !renderProps.hasChildItems
1588
+ })
1589
+ }
1278
1590
  textValue={textValue}
1279
1591
  {...otherProps}>
1280
1592
  {({id, isFocusVisible, hasChildItems, isTreeColumn, isExpanded, isDisabled}) => (
1281
1593
  <>
1282
- {hasChildItems && isTreeColumn &&
1594
+ {hasChildItems && isTreeColumn && (
1283
1595
  <ExpandableRowChevron key={id} isDisabled={isDisabled} isExpanded={isExpanded} />
1284
- }
1285
- <EditableCellInner {...props} isFocusVisible={isFocusVisible} cellRef={domRef as RefObject<HTMLDivElement>} />
1596
+ )}
1597
+ <EditableCellInner
1598
+ {...props}
1599
+ isFocusVisible={isFocusVisible}
1600
+ cellRef={domRef as RefObject<HTMLDivElement>}
1601
+ />
1286
1602
  </>
1287
1603
  )}
1288
1604
  </RACCell>
@@ -1301,8 +1617,20 @@ const nonTextInputTypes = new Set([
1301
1617
  'reset'
1302
1618
  ]);
1303
1619
 
1304
- function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean, cellRef: RefObject<HTMLDivElement>}) {
1305
- let {children, align, renderEditing, isSaving, onSubmit, isFocusVisible, cellRef, action, onCancel} = props;
1620
+ function EditableCellInner(
1621
+ props: EditableCellProps & {isFocusVisible: boolean; cellRef: RefObject<HTMLDivElement>}
1622
+ ) {
1623
+ let {
1624
+ children,
1625
+ align,
1626
+ renderEditing,
1627
+ isSaving,
1628
+ onSubmit,
1629
+ isFocusVisible,
1630
+ cellRef,
1631
+ action,
1632
+ onCancel
1633
+ } = props;
1306
1634
  let [isOpen, setIsOpen] = useState(false);
1307
1635
  let popoverRef = useRef<HTMLDivElement>(null);
1308
1636
  let formRef = useRef<HTMLFormElement>(null);
@@ -1342,14 +1670,16 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
1342
1670
  useEffect(() => {
1343
1671
  if (isOpen) {
1344
1672
  let activeElement = getActiveElement(getOwnerDocument(formRef.current));
1345
- if (activeElement
1346
- && nodeContains(formRef.current, activeElement)
1673
+ if (
1674
+ activeElement &&
1675
+ nodeContains(formRef.current, activeElement) &&
1347
1676
  // not going to handle contenteditable https://stackoverflow.com/questions/6139107/programmatically-select-text-in-a-contenteditable-html-element
1348
1677
  // seems like an edge case anyways
1349
- && (
1350
- (activeElement instanceof HTMLInputElement && !nonTextInputTypes.has(activeElement.type))
1351
- || activeElement instanceof HTMLTextAreaElement)
1352
- && typeof activeElement.select === 'function') {
1678
+ ((activeElement instanceof HTMLInputElement &&
1679
+ !nonTextInputTypes.has(activeElement.type)) ||
1680
+ activeElement instanceof HTMLTextAreaElement) &&
1681
+ typeof activeElement.select === 'function'
1682
+ ) {
1353
1683
  activeElement.select();
1354
1684
  }
1355
1685
  }
@@ -1386,38 +1716,40 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
1386
1716
  <Provider
1387
1717
  values={[
1388
1718
  [ButtonContext, null],
1389
- [ActionButtonContext, {
1390
- slots: {
1391
- [DEFAULT_SLOT]: {},
1392
- edit: {
1393
- onPress: () => setIsOpen(true),
1394
- isPending: isSaving,
1395
- isQuiet: !isSaving,
1396
- size,
1397
- excludeFromTabOrder: true,
1398
- styles: style({
1399
- // TODO: really need access to display here instead, but not possible right now
1400
- // will be addressable with displayOuter
1401
- // Could use `hidden` attribute instead of css, but I don't have access to much of this state at the moment
1402
- visibility: {
1403
- default: 'hidden',
1404
- isForcedVisible: 'visible',
1405
- ':is([role="row"]:hover *)': 'visible',
1406
- ':is([role="row"][data-focus-visible-within] *)': 'visible',
1407
- '@media not ((hover: hover) and (pointer: fine))': 'visible'
1408
- }
1409
- })({isForcedVisible: isOpen || !!isSaving})
1719
+ [
1720
+ ActionButtonContext,
1721
+ {
1722
+ slots: {
1723
+ [DEFAULT_SLOT]: {},
1724
+ edit: {
1725
+ onPress: () => setIsOpen(true),
1726
+ isPending: isSaving,
1727
+ isQuiet: !isSaving,
1728
+ size,
1729
+ excludeFromTabOrder: true,
1730
+ styles: style({
1731
+ // TODO: really need access to display here instead, but not possible right now
1732
+ // will be addressable with displayOuter
1733
+ // Could use `hidden` attribute instead of css, but I don't have access to much of this state at the moment
1734
+ visibility: {
1735
+ default: 'hidden',
1736
+ isForcedVisible: 'visible',
1737
+ ':is([role="row"]:hover *)': 'visible',
1738
+ ':is([role="row"][data-focus-visible-within] *)': 'visible',
1739
+ '@media not ((hover: hover) and (pointer: fine))': 'visible'
1740
+ }
1741
+ })({isForcedVisible: isOpen || !!isSaving})
1742
+ }
1410
1743
  }
1411
1744
  }
1412
- }]
1745
+ ]
1413
1746
  ]}>
1414
- <span className={cellContent({...tableVisualOptions, align: align || 'start'})}>{children}</span>
1747
+ <span className={cellContent({...tableVisualOptions, align: align || 'start'})}>
1748
+ {children}
1749
+ </span>
1415
1750
  {isFocusVisible && <CellFocusRing />}
1416
1751
 
1417
- <Provider
1418
- values={[
1419
- [ActionButtonContext, null]
1420
- ]}>
1752
+ <Provider values={[[ActionButtonContext, null]]}>
1421
1753
  {!isMobile && (
1422
1754
  <RACPopover
1423
1755
  isOpen={isOpen}
@@ -1441,23 +1773,37 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
1441
1773
  zIndex: undefined
1442
1774
  }}
1443
1775
  className={editPopover}>
1444
- <Provider
1445
- values={[
1446
- [OverlayTriggerStateContext, null]
1447
- ]}>
1776
+ <Provider values={[[OverlayTriggerStateContext, null]]}>
1448
1777
  <Form
1449
1778
  ref={formRef}
1450
1779
  action={action}
1451
- onSubmit={(e) => {
1780
+ onSubmit={e => {
1452
1781
  onSubmit?.(e);
1453
1782
  setIsOpen(false);
1454
1783
  }}
1455
1784
  className={style({width: 'full', display: 'flex', alignItems: 'start', gap: 16})}
1456
1785
  style={{'--input-width': `calc(${triggerWidth}px - 32px)`} as CSSProperties}>
1457
1786
  {renderEditing()}
1458
- <div className={style({display: 'flex', flexDirection: 'row', alignItems: 'baseline', flexShrink: 0, flexGrow: 0})}>
1459
- <ActionButton isQuiet onPress={cancel} aria-label={stringFormatter.format('table.cancel')}><Close /></ActionButton>
1460
- <ActionButton isQuiet type="submit" aria-label={stringFormatter.format('table.save')}><Checkmark /></ActionButton>
1787
+ <div
1788
+ className={style({
1789
+ display: 'flex',
1790
+ flexDirection: 'row',
1791
+ alignItems: 'baseline',
1792
+ flexShrink: 0,
1793
+ flexGrow: 0
1794
+ })}>
1795
+ <ActionButton
1796
+ isQuiet
1797
+ onPress={cancel}
1798
+ aria-label={stringFormatter.format('table.cancel')}>
1799
+ <Close />
1800
+ </ActionButton>
1801
+ <ActionButton
1802
+ isQuiet
1803
+ type="submit"
1804
+ aria-label={stringFormatter.format('table.save')}>
1805
+ <Checkmark />
1806
+ </ActionButton>
1461
1807
  </div>
1462
1808
  </Form>
1463
1809
  </Provider>
@@ -1474,15 +1820,25 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
1474
1820
  <Form
1475
1821
  ref={formRef}
1476
1822
  action={action}
1477
- onSubmit={(e) => {
1823
+ onSubmit={e => {
1478
1824
  onSubmit?.(e);
1479
1825
  setIsOpen(false);
1480
1826
  }}
1481
- className={style({width: 'full', display: 'flex', flexDirection: 'column', alignItems: 'start', gap: 16})}>
1827
+ className={style({
1828
+ width: 'full',
1829
+ display: 'flex',
1830
+ flexDirection: 'column',
1831
+ alignItems: 'start',
1832
+ gap: 16
1833
+ })}>
1482
1834
  {renderEditing()}
1483
1835
  <ButtonGroup align="end" styles={style({alignSelf: 'end'})}>
1484
- <SpectrumButton onPress={cancel} variant="secondary" fillStyle="outline">Cancel</SpectrumButton>
1485
- <SpectrumButton type="submit" variant="accent">Save</SpectrumButton>
1836
+ <SpectrumButton onPress={cancel} variant="secondary" fillStyle="outline">
1837
+ Cancel
1838
+ </SpectrumButton>
1839
+ <SpectrumButton type="submit" variant="accent">
1840
+ Save
1841
+ </SpectrumButton>
1486
1842
  </ButtonGroup>
1487
1843
  </Form>
1488
1844
  </CustomDialog>
@@ -1497,12 +1853,33 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
1497
1853
  // Use color-mix instead of transparency so sticky cells work correctly.
1498
1854
  const selectedBackground = colorMix('gray-25', 'gray-900', 7);
1499
1855
  const selectedActiveBackground = colorMix('gray-25', 'gray-900', 10);
1856
+ // TODO: I made these up, not sure if there is a great way to go from v3 values to
1857
+ // S2. Overall the root drop color should be lighter than the row color during a root drop
1858
+ // which should be lighter than a selected row during root drop. Those root drop row colors should also be darker
1859
+ // than if the row is the drop target itself
1860
+ const rootDropRowBackground = colorMix('gray-25', 'blue-900', 17);
1861
+ const rootDropSelectedRowBackground = colorMix('gray-25', 'blue-900', 28);
1862
+ const rowDropBackground = colorMix('gray-25', 'blue-900', 10);
1863
+ const rowDropSelectedBackground = colorMix('gray-25', 'blue-900', 15);
1864
+ const rootRowDropStyles = {
1865
+ default: rootDropRowBackground,
1866
+ isSelected: rootDropSelectedRowBackground,
1867
+ forcedColors: 'Background'
1868
+ } as const;
1869
+ const rowDropStyles = {
1870
+ default: rowDropBackground,
1871
+ isSelected: rowDropSelectedBackground,
1872
+ forcedColors: 'Background'
1873
+ } as const;
1874
+
1500
1875
  const rowBackgroundColor = {
1501
1876
  default: {
1502
1877
  default: 'gray-25',
1503
1878
  isQuiet: '--s2-container-bg'
1504
1879
  },
1505
- isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
1880
+ forcedColors: {
1881
+ default: 'Background'
1882
+ },
1506
1883
  isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
1507
1884
  isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color
1508
1885
  isSelected: {
@@ -1511,22 +1888,47 @@ const rowBackgroundColor = {
1511
1888
  isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15
1512
1889
  isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15
1513
1890
  },
1514
- forcedColors: {
1515
- default: 'Background'
1516
- }
1891
+ selectionStyle: {
1892
+ highlight: {
1893
+ default: 'gray-25',
1894
+ isQuiet: '--s2-container-bg',
1895
+ isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
1896
+ isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color
1897
+ isSelected: {
1898
+ default: colorMix('gray-25', 'blue-900', 10),
1899
+ isHovered: colorMix('gray-25', 'blue-900', 15),
1900
+ isPressed: colorMix('gray-25', 'blue-900', 15),
1901
+ forcedColors: 'Highlight'
1902
+ }
1903
+ }
1904
+ },
1905
+ isInFooter: 'gray-200',
1906
+ ':is([role="grid"][data-drop-target] *)': rootRowDropStyles,
1907
+ isDropTarget: rowDropStyles
1517
1908
  } as const;
1518
1909
 
1519
1910
  const rowTextColor = {
1520
1911
  default: baseColor('neutral-subdued'),
1521
1912
  isSelected: baseColor('neutral'),
1913
+ forcedColors: {
1914
+ default: 'ButtonText',
1915
+ isSelected: {
1916
+ selectionStyle: {
1917
+ highlight: 'HighlightText'
1918
+ }
1919
+ }
1920
+ },
1522
1921
  isDisabled: {
1523
1922
  default: 'disabled',
1524
1923
  forcedColors: 'GrayText'
1525
1924
  },
1526
- forcedColors: 'ButtonText'
1925
+ isInFooter: 'neutral'
1527
1926
  } as const;
1528
1927
 
1529
- const row = style<RowRenderProps & S2TableProps>({
1928
+ const row = style<
1929
+ RowRenderProps &
1930
+ S2TableProps & {isInFooter?: boolean; isNextSelected?: boolean; isPrevSelected?: boolean}
1931
+ >({
1530
1932
  height: 'full',
1531
1933
  position: 'relative',
1532
1934
  boxSizing: 'border-box',
@@ -1539,13 +1941,6 @@ const row = style<RowRenderProps & S2TableProps>({
1539
1941
  type: 'color',
1540
1942
  value: rowTextColor
1541
1943
  },
1542
- '--rowFocusIndicatorColor': {
1543
- type: 'outlineColor',
1544
- value: {
1545
- default: 'focus-ring',
1546
- forcedColors: 'Highlight'
1547
- }
1548
- },
1549
1944
  // TODO: outline here is to emulate v3 forcedColors experience but runs into the same problem where the sticky column covers the outline
1550
1945
  // This doesn't quite work because it gets cut off by the checkbox cell background masking element, figure out another way. Could shrink the checkbox cell's content even more
1551
1946
  // and offset it by margin top but that messes up the checkbox centering a bit
@@ -1571,18 +1966,183 @@ const row = style<RowRenderProps & S2TableProps>({
1571
1966
  // }
1572
1967
  // },
1573
1968
  outlineStyle: 'none',
1969
+ '--borderBottomRadius': {
1970
+ type: 'borderBottomStartRadius',
1971
+ value: {
1972
+ default: 'none',
1973
+ selectionStyle: {
1974
+ highlight: {
1975
+ default: 'none',
1976
+ isSelected: '[5px]',
1977
+ isNextSelected: 'none'
1978
+ }
1979
+ }
1980
+ }
1981
+ },
1982
+ '--borderTopRadius': {
1983
+ type: 'borderTopStartRadius',
1984
+ value: {
1985
+ default: 'none',
1986
+ selectionStyle: {
1987
+ highlight: {
1988
+ default: 'none',
1989
+ isSelected: '[5px]',
1990
+ isPrevSelected: 'none'
1991
+ }
1992
+ }
1993
+ }
1994
+ },
1995
+ borderBottomRadius: 'var(--borderBottomRadius)',
1996
+ borderTopRadius: 'var(--borderTopRadius)',
1997
+ // We will only use these border values when it is highlight selection
1998
+ '--borderTopWidth': {
1999
+ type: 'width',
2000
+ value: {
2001
+ default: {
2002
+ selectionStyle: {
2003
+ checkbox: 0,
2004
+ highlight: 1
2005
+ }
2006
+ },
2007
+ isPrevSelected: 0
2008
+ }
2009
+ },
2010
+ '--borderBottomWidth': {
2011
+ type: 'width',
2012
+ value: {
2013
+ default: {
2014
+ selectionStyle: {
2015
+ checkbox: 0,
2016
+ highlight: 1
2017
+ }
2018
+ },
2019
+ isNextSelected: 0
2020
+ }
2021
+ },
2022
+ '--borderStartEndWidth': {
2023
+ type: 'width',
2024
+ value: {
2025
+ default: {
2026
+ selectionStyle: {
2027
+ checkbox: 0,
2028
+ highlight: 1
2029
+ }
2030
+ }
2031
+ }
2032
+ },
2033
+ // When checkbox selection, render the gray divider between rows as a border
1574
2034
  borderTopWidth: 0,
1575
- borderBottomWidth: 1,
2035
+ borderBottomWidth: {
2036
+ selectionStyle: {
2037
+ highlight: 0,
2038
+ checkbox: 1
2039
+ }
2040
+ },
1576
2041
  borderStartWidth: 0,
1577
2042
  borderEndWidth: 0,
1578
2043
  borderStyle: 'solid',
1579
2044
  borderColor: {
1580
- default: 'gray-300',
1581
- forcedColors: 'ButtonBorder'
2045
+ selectionStyle: {
2046
+ highlight: 'transparent',
2047
+ checkbox: {
2048
+ default: 'gray-300',
2049
+ forcedColors: 'ButtonBorder'
2050
+ }
2051
+ }
2052
+ },
2053
+ '--borderColorGray': {
2054
+ type: 'borderColor',
2055
+ value: {
2056
+ default: 'gray-300',
2057
+ forcedColors: {
2058
+ default: 'ButtonBorder',
2059
+ isSelected: 'Highlight'
2060
+ }
2061
+ }
2062
+ },
2063
+ '--borderColorBlue': {
2064
+ type: 'borderColor',
2065
+ value: {
2066
+ default: 'blue-900',
2067
+ forcedColors: 'Highlight'
2068
+ }
1582
2069
  },
2070
+ '--borderColor': {
2071
+ type: 'borderColor',
2072
+ value: {
2073
+ default: 'transparent',
2074
+ isSelected: '--borderColorBlue'
2075
+ }
2076
+ },
2077
+ // When highlight selection, render gray dividers as box shadow
2078
+ boxShadow: {
2079
+ selectionStyle: {
2080
+ highlight: {
2081
+ default: '[inset 0 -1px 0px var(--borderColorGray)]',
2082
+ isNextSelected: '[inset 0 0 0 var(--borderColorGray)]'
2083
+ // TODO: Determine if we want to support gray dividers between selected grouped rows
2084
+ // isSelected: {
2085
+ // isNextSelected: '[inset 0 -1px 0px var(--borderColorGray)]'
2086
+ // }
2087
+ }
2088
+ },
2089
+ forcedColors: {
2090
+ isFocusVisible: '[inset 0 0 0 2px Highlight]'
2091
+ }
2092
+ },
2093
+ fontWeight: {
2094
+ default: 'normal',
2095
+ isInFooter: 'bold'
2096
+ },
2097
+ isolation: 'isolate',
1583
2098
  forcedColorAdjust: 'none'
1584
2099
  });
1585
2100
 
2101
+ // Sticky cells (the drag cell, and the checkbox cell when present) get an inline z-index=2 applied by the virtualizer's layout
2102
+ // To ensure that the highlight selection border is painted above the stick cells, set z-index to 3
2103
+ const highlightSelectionBorder = css(
2104
+ `&:before {
2105
+ content: "";
2106
+ width: 100%;
2107
+ height: 100%;
2108
+ position: absolute;
2109
+ inset: 0;
2110
+ z-index: 3;
2111
+ box-sizing: border-box;
2112
+ border-style: solid;
2113
+ border-color: var(--borderColor);
2114
+ border-top-width: var(--borderTopWidth);
2115
+ border-bottom-width: var(--borderBottomWidth);
2116
+ border-inline-start-width: var(--borderStartEndWidth);
2117
+ border-inline-end-width: var(--borderStartEndWidth);
2118
+ border-bottom-left-radius: var(--borderBottomRadius);
2119
+ border-bottom-right-radius: var(--borderBottomRadius);
2120
+ border-top-left-radius: var(--borderTopRadius);
2121
+ border-top-right-radius: var(--borderTopRadius);
2122
+ pointer-events: none;
2123
+ }
2124
+ `
2125
+ );
2126
+
2127
+ const focusIndicator = css(
2128
+ `&:after {
2129
+ content: "";
2130
+ width: 100%;
2131
+ height: 100%;
2132
+ top: 0;
2133
+ z-index: 2;
2134
+ inset-inline-start: 0;
2135
+ border-radius: 5px;
2136
+ position: absolute;
2137
+ outline-style: solid;
2138
+ outline-color: var(--borderColorBlue);
2139
+ outline-width: 2px;
2140
+ outline-offset: -2px;
2141
+ pointer-events: none;
2142
+ }
2143
+ `
2144
+ );
2145
+
1586
2146
  const selectionCheckbox = style({
1587
2147
  visibility: {
1588
2148
  default: 'visible',
@@ -1590,38 +2150,124 @@ const selectionCheckbox = style({
1590
2150
  }
1591
2151
  });
1592
2152
 
1593
- export interface RowProps<T> extends Pick<RACRowProps<T>, 'id' | 'columns' | 'isDisabled' | 'onAction' | 'children' | 'textValue' | 'dependencies' | keyof GlobalDOMAttributes>, LinkDOMProps {}
2153
+ export interface RowProps<T>
2154
+ extends
2155
+ Pick<
2156
+ RACRowProps<T>,
2157
+ | 'id'
2158
+ | 'columns'
2159
+ | 'isDisabled'
2160
+ | 'onAction'
2161
+ | 'children'
2162
+ | 'textValue'
2163
+ | 'dependencies'
2164
+ | keyof GlobalDOMAttributes
2165
+ >,
2166
+ LinkDOMProps {}
1594
2167
 
1595
2168
  /**
1596
2169
  * A row within a `<Table>`.
1597
2170
  */
1598
- export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T extends object>({id, columns, children, dependencies = [], ...otherProps}: RowProps<T>, ref: DOMRef<HTMLDivElement>) {
1599
- let {selectionBehavior, selectionMode} = useTableOptions();
1600
- let tableVisualOptions = useContext(InternalTableContext);
2171
+ export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T>(
2172
+ {id, columns, children, dependencies = [], ...otherProps}: RowProps<T>,
2173
+ ref: DOMRef<HTMLDivElement>
2174
+ ) {
2175
+ let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();
2176
+ let {selectionStyle, ...tableVisualOptions} = useContext(InternalTableContext);
1601
2177
  let domRef = useDOMRef(ref);
2178
+ let isInFooter = useContext(FooterContext);
1602
2179
 
1603
2180
  return (
1604
- (<RACRow
2181
+ <RACRow
1605
2182
  // @ts-ignore
1606
2183
  ref={domRef}
1607
2184
  id={id}
1608
2185
  dependencies={[...dependencies, columns]}
1609
- className={renderProps => row({
1610
- ...renderProps,
1611
- ...tableVisualOptions
1612
- }) + (renderProps.isFocusVisible ? ' ' + css('&:before { content: ""; display: inline-block; position: sticky; inset-inline-start: 0; width: 3px; height: 100%; margin-inline-end: -3px; margin-block-end: 1px; z-index: 3; background-color: var(--rowFocusIndicatorColor)') : '')}
2186
+ isDisabled={isInFooter}
2187
+ disabledBehavior={isInFooter ? 'selection' : undefined}
2188
+ className={renderProps =>
2189
+ row({
2190
+ ...renderProps,
2191
+ ...tableVisualOptions,
2192
+ selectionStyle,
2193
+ isInFooter,
2194
+ isNextSelected: isNextSelected(renderProps.id, renderProps.state),
2195
+ isPrevSelected: isPrevSelected(renderProps.id, renderProps.state)
2196
+ }) +
2197
+ (renderProps.isFocusVisible || renderProps.isDropTarget ? ' ' + focusIndicator : '') +
2198
+ (selectionStyle === 'highlight' ? ' ' + highlightSelectionBorder : '')
2199
+ }
1613
2200
  {...otherProps}>
1614
- {selectionMode !== 'none' && selectionBehavior === 'toggle' && (
1615
- // Not sure what we want to do with this className, in Cell it currently overrides the className that would have been applied.
1616
- // The `spread` otherProps must be after className in Cell.
1617
- // @ts-ignore
1618
- (<Cell isSticky className={checkboxCellStyle}>
1619
- <Checkbox slot="selection" styles={selectionCheckbox} />
1620
- </Cell>)
2201
+ {allowsDragging && (
2202
+ <RACCell
2203
+ // @ts-ignore
2204
+ isSticky
2205
+ className={dragCellStyle}>
2206
+ {({isFocusVisibleWithinRow}) =>
2207
+ !(otherProps.isDisabled && tableVisualOptions.disabledBehavior === 'all') && (
2208
+ <DragHandleButton isFocusVisibleWithin={isFocusVisibleWithinRow} />
2209
+ )
2210
+ }
2211
+ </RACCell>
1621
2212
  )}
2213
+ {selectionMode !== 'none' &&
2214
+ selectionBehavior === 'toggle' &&
2215
+ selectionStyle === 'checkbox' && (
2216
+ // Not sure what we want to do with this className, in Cell it currently overrides the className that would have been applied.
2217
+ // The `spread` otherProps must be after className in Cell.
2218
+ // @ts-ignore
2219
+ <Cell isSticky className={checkboxCellStyle}>
2220
+ <Checkbox slot="selection" styles={selectionCheckbox} />
2221
+ </Cell>
2222
+ )}
1622
2223
  <Collection items={columns} dependencies={[...dependencies, columns]}>
1623
2224
  {children}
1624
2225
  </Collection>
1625
- </RACRow>)
2226
+ </RACRow>
1626
2227
  );
1627
2228
  });
2229
+
2230
+ export interface TableFooterProps<T> extends Omit<
2231
+ RACTableFooterProps<T>,
2232
+ | 'style'
2233
+ | 'className'
2234
+ | 'render'
2235
+ | 'onHoverChange'
2236
+ | 'onHoverStart'
2237
+ | 'onHoverEnd'
2238
+ | keyof GlobalDOMAttributes
2239
+ > {}
2240
+
2241
+ const FooterContext = createContext(false);
2242
+
2243
+ /**
2244
+ * A footer within a `<Table>`, containing summary rows.
2245
+ */
2246
+ export const TableFooter = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableFooter<T>(
2247
+ props: TableFooterProps<T>,
2248
+ ref: DOMRef<HTMLDivElement>
2249
+ ) {
2250
+ let domRef = useDOMRef(ref);
2251
+
2252
+ return (
2253
+ <FooterContext.Provider value>
2254
+ <RACTableFooter {...props} ref={domRef} />
2255
+ </FooterContext.Provider>
2256
+ );
2257
+ });
2258
+
2259
+ export function isNextSelected(id: Key | undefined, state: TableState<unknown>) {
2260
+ if (id == null || !state) {
2261
+ return false;
2262
+ }
2263
+ let keyAfter = state.collection.getKeyAfter(id);
2264
+ return keyAfter != null && state.selectionManager.isSelected(keyAfter);
2265
+ }
2266
+
2267
+ export function isPrevSelected(id: Key | undefined, state: TableState<unknown>) {
2268
+ if (id == null || !state) {
2269
+ return false;
2270
+ }
2271
+ let keyBefore = state.collection.getKeyBefore(id);
2272
+ return keyBefore != null && state.selectionManager.isSelected(keyBefore);
2273
+ }