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