@react-spectrum/s2 3.0.0-nightly-412a51816-250219 → 3.0.0-nightly-a792c1ad5-250222

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 (440) hide show
  1. package/dist/Breadcrumbs.cjs +3 -3
  2. package/dist/Breadcrumbs.cjs.map +1 -1
  3. package/dist/Breadcrumbs.css.map +1 -1
  4. package/dist/Breadcrumbs.mjs +4 -4
  5. package/dist/Breadcrumbs.mjs.map +1 -1
  6. package/dist/CardView.cjs +2 -258
  7. package/dist/CardView.cjs.map +1 -1
  8. package/dist/CardView.css.map +1 -1
  9. package/dist/CardView.mjs +5 -261
  10. package/dist/CardView.mjs.map +1 -1
  11. package/dist/Picker.cjs +91 -68
  12. package/dist/Picker.cjs.map +1 -1
  13. package/dist/Picker.css.map +1 -1
  14. package/dist/Picker.mjs +92 -69
  15. package/dist/Picker.mjs.map +1 -1
  16. package/dist/SegmentedControl.cjs +4 -4
  17. package/dist/SegmentedControl.cjs.map +1 -1
  18. package/dist/SegmentedControl.css.map +1 -1
  19. package/dist/SegmentedControl.mjs +5 -5
  20. package/dist/SegmentedControl.mjs.map +1 -1
  21. package/dist/TableView.cjs +61 -77
  22. package/dist/TableView.cjs.map +1 -1
  23. package/dist/TableView.css +10 -2
  24. package/dist/TableView.css.map +1 -1
  25. package/dist/TableView.mjs +63 -79
  26. package/dist/TableView.mjs.map +1 -1
  27. package/dist/Tooltip.cjs +1 -1
  28. package/dist/Tooltip.cjs.map +1 -1
  29. package/dist/Tooltip.css.map +1 -1
  30. package/dist/Tooltip.mjs +1 -1
  31. package/dist/Tooltip.mjs.map +1 -1
  32. package/dist/TreeView.cjs +12 -16
  33. package/dist/TreeView.cjs.map +1 -1
  34. package/dist/TreeView.css +4 -4
  35. package/dist/TreeView.css.map +1 -1
  36. package/dist/TreeView.mjs +14 -18
  37. package/dist/TreeView.mjs.map +1 -1
  38. package/dist/main.cjs +1 -1
  39. package/dist/main.cjs.map +1 -1
  40. package/dist/module.mjs +2 -2
  41. package/dist/module.mjs.map +1 -1
  42. package/dist/types.d.ts +5 -3
  43. package/dist/types.d.ts.map +1 -1
  44. package/icons/3DMaterial.cjs.map +1 -1
  45. package/icons/3DMaterial.mjs.map +1 -1
  46. package/icons/ABC.cjs +36 -0
  47. package/icons/ABC.cjs.map +1 -0
  48. package/icons/ABC.mjs +25 -0
  49. package/icons/ABC.mjs.map +1 -0
  50. package/icons/AlertDiamond.cjs.map +1 -1
  51. package/icons/AlertDiamond.mjs.map +1 -1
  52. package/icons/Animation.cjs.map +1 -1
  53. package/icons/Animation.mjs.map +1 -1
  54. package/icons/AnimationNo.cjs.map +1 -1
  55. package/icons/AnimationNo.mjs.map +1 -1
  56. package/icons/App.cjs +42 -0
  57. package/icons/App.cjs.map +1 -0
  58. package/icons/App.mjs +31 -0
  59. package/icons/App.mjs.map +1 -0
  60. package/icons/AspectRatio.cjs.map +1 -1
  61. package/icons/AspectRatio.mjs.map +1 -1
  62. package/icons/Asset.cjs +1 -5
  63. package/icons/Asset.cjs.map +1 -1
  64. package/icons/Asset.mjs +1 -5
  65. package/icons/Asset.mjs.map +1 -1
  66. package/icons/AudioWave.cjs.map +1 -1
  67. package/icons/AudioWave.mjs.map +1 -1
  68. package/icons/BadgeVerified.cjs.map +1 -1
  69. package/icons/BadgeVerified.mjs.map +1 -1
  70. package/icons/Bell.cjs.map +1 -1
  71. package/icons/Bell.mjs.map +1 -1
  72. package/icons/Bookmark.cjs +36 -0
  73. package/icons/Bookmark.cjs.map +1 -0
  74. package/icons/Bookmark.mjs +25 -0
  75. package/icons/Bookmark.mjs.map +1 -0
  76. package/icons/Brand.cjs.map +1 -1
  77. package/icons/Brand.mjs.map +1 -1
  78. package/icons/Building.cjs +62 -0
  79. package/icons/Building.cjs.map +1 -0
  80. package/icons/Building.mjs +51 -0
  81. package/icons/Building.mjs.map +1 -0
  82. package/icons/CalendarEdit.cjs.map +1 -1
  83. package/icons/CalendarEdit.mjs.map +1 -1
  84. package/icons/CallCenter.cjs +36 -0
  85. package/icons/CallCenter.cjs.map +1 -0
  86. package/icons/CallCenter.mjs +25 -0
  87. package/icons/CallCenter.mjs.map +1 -0
  88. package/icons/CameraProperties.cjs.map +1 -1
  89. package/icons/CameraProperties.mjs.map +1 -1
  90. package/icons/Channel.cjs.map +1 -1
  91. package/icons/Channel.mjs.map +1 -1
  92. package/icons/ChartBarVert.cjs +36 -0
  93. package/icons/ChartBarVert.cjs.map +1 -0
  94. package/icons/ChartBarVert.mjs +25 -0
  95. package/icons/ChartBarVert.mjs.map +1 -0
  96. package/icons/ChartPie.cjs +36 -0
  97. package/icons/ChartPie.cjs.map +1 -0
  98. package/icons/ChartPie.mjs +25 -0
  99. package/icons/ChartPie.mjs.map +1 -0
  100. package/icons/ChartTrend.cjs +36 -0
  101. package/icons/ChartTrend.cjs.map +1 -0
  102. package/icons/ChartTrend.mjs +25 -0
  103. package/icons/ChartTrend.mjs.map +1 -0
  104. package/icons/Chat.cjs +36 -0
  105. package/icons/Chat.cjs.map +1 -0
  106. package/icons/Chat.mjs +25 -0
  107. package/icons/Chat.mjs.map +1 -0
  108. package/icons/CheckBox.cjs.map +1 -1
  109. package/icons/CheckBox.mjs.map +1 -1
  110. package/icons/Checkmark.cjs +8 -8
  111. package/icons/Checkmark.cjs.map +1 -1
  112. package/icons/Checkmark.mjs +8 -8
  113. package/icons/Checkmark.mjs.map +1 -1
  114. package/icons/ChevronDoubleLeft.cjs +42 -0
  115. package/icons/ChevronDoubleLeft.cjs.map +1 -0
  116. package/icons/ChevronDoubleLeft.d.ts +5 -0
  117. package/icons/ChevronDoubleLeft.mjs +31 -0
  118. package/icons/ChevronDoubleLeft.mjs.map +1 -0
  119. package/icons/ChevronDoubleRight.cjs +42 -0
  120. package/icons/ChevronDoubleRight.cjs.map +1 -0
  121. package/icons/ChevronDoubleRight.d.ts +5 -0
  122. package/icons/ChevronDoubleRight.mjs +31 -0
  123. package/icons/ChevronDoubleRight.mjs.map +1 -0
  124. package/icons/ChevronDown.cjs +8 -8
  125. package/icons/ChevronDown.cjs.map +1 -1
  126. package/icons/ChevronDown.mjs +8 -8
  127. package/icons/ChevronDown.mjs.map +1 -1
  128. package/icons/ChevronLeft.cjs.map +1 -1
  129. package/icons/ChevronLeft.mjs.map +1 -1
  130. package/icons/ChevronRight.cjs.map +1 -1
  131. package/icons/ChevronRight.mjs.map +1 -1
  132. package/icons/ChevronUp.cjs +36 -0
  133. package/icons/ChevronUp.cjs.map +1 -0
  134. package/icons/ChevronUp.d.ts +5 -0
  135. package/icons/ChevronUp.mjs +25 -0
  136. package/icons/ChevronUp.mjs.map +1 -0
  137. package/icons/Circle.cjs.map +1 -1
  138. package/icons/Circle.mjs.map +1 -1
  139. package/icons/Close.cjs.map +1 -1
  140. package/icons/Close.mjs.map +1 -1
  141. package/icons/CloseCaptions.cjs.map +1 -1
  142. package/icons/CloseCaptions.mjs.map +1 -1
  143. package/icons/Code.cjs +36 -0
  144. package/icons/Code.cjs.map +1 -0
  145. package/icons/Code.d.ts +5 -0
  146. package/icons/Code.mjs +25 -0
  147. package/icons/Code.mjs.map +1 -0
  148. package/icons/Collection.cjs.map +1 -1
  149. package/icons/Collection.mjs.map +1 -1
  150. package/icons/ColorHarmony.cjs.map +1 -1
  151. package/icons/ColorHarmony.mjs.map +1 -1
  152. package/icons/CommentCheckmark.cjs.map +1 -1
  153. package/icons/CommentCheckmark.mjs.map +1 -1
  154. package/icons/CommentHide.cjs.map +1 -1
  155. package/icons/CommentHide.mjs.map +1 -1
  156. package/icons/CommentRemove.cjs.map +1 -1
  157. package/icons/CommentRemove.mjs.map +1 -1
  158. package/icons/Compare.cjs +42 -0
  159. package/icons/Compare.cjs.map +1 -0
  160. package/icons/Compare.d.ts +5 -0
  161. package/icons/Compare.mjs +31 -0
  162. package/icons/Compare.mjs.map +1 -0
  163. package/icons/ContextualTaskBar.cjs.map +1 -1
  164. package/icons/ContextualTaskBar.mjs.map +1 -1
  165. package/icons/CornerRadiusBottomLeft.cjs.map +1 -1
  166. package/icons/CornerRadiusBottomLeft.mjs.map +1 -1
  167. package/icons/CornerRadiusBottomRight.cjs.map +1 -1
  168. package/icons/CornerRadiusBottomRight.mjs.map +1 -1
  169. package/icons/CornerRadiusTopLeft.cjs.map +1 -1
  170. package/icons/CornerRadiusTopLeft.mjs.map +1 -1
  171. package/icons/CornerRadiusTopRight.cjs.map +1 -1
  172. package/icons/CornerRadiusTopRight.mjs.map +1 -1
  173. package/icons/CursorClick.cjs.map +1 -1
  174. package/icons/CursorClick.mjs.map +1 -1
  175. package/icons/Data.cjs +1 -1
  176. package/icons/Data.cjs.map +1 -1
  177. package/icons/Data.mjs +1 -1
  178. package/icons/Data.mjs.map +1 -1
  179. package/icons/DataAdd.cjs.map +1 -1
  180. package/icons/DataAdd.mjs.map +1 -1
  181. package/icons/DataRefresh.cjs +42 -0
  182. package/icons/DataRefresh.cjs.map +1 -0
  183. package/icons/DataRefresh.d.ts +5 -0
  184. package/icons/DataRefresh.mjs +31 -0
  185. package/icons/DataRefresh.mjs.map +1 -0
  186. package/icons/DataSettings.cjs +2 -2
  187. package/icons/DataSettings.cjs.map +1 -1
  188. package/icons/DataSettings.mjs +2 -2
  189. package/icons/DataSettings.mjs.map +1 -1
  190. package/icons/DataUpload.cjs +2 -2
  191. package/icons/DataUpload.cjs.map +1 -1
  192. package/icons/DataUpload.mjs +2 -2
  193. package/icons/DataUpload.mjs.map +1 -1
  194. package/icons/DeviceTablet.cjs.map +1 -1
  195. package/icons/DeviceTablet.mjs.map +1 -1
  196. package/icons/Draw.cjs.map +1 -1
  197. package/icons/Draw.mjs.map +1 -1
  198. package/icons/Edit.cjs.map +1 -1
  199. package/icons/Edit.mjs.map +1 -1
  200. package/icons/EditNo.cjs.map +1 -1
  201. package/icons/EditNo.mjs.map +1 -1
  202. package/icons/Email.cjs.map +1 -1
  203. package/icons/Email.mjs.map +1 -1
  204. package/icons/Enterprise.cjs +46 -0
  205. package/icons/Enterprise.cjs.map +1 -0
  206. package/icons/Enterprise.d.ts +5 -0
  207. package/icons/Enterprise.mjs +35 -0
  208. package/icons/Enterprise.mjs.map +1 -0
  209. package/icons/Export.cjs +42 -0
  210. package/icons/Export.cjs.map +1 -0
  211. package/icons/Export.d.ts +5 -0
  212. package/icons/Export.mjs +31 -0
  213. package/icons/Export.mjs.map +1 -0
  214. package/icons/Filter.cjs.map +1 -1
  215. package/icons/Filter.mjs.map +1 -1
  216. package/icons/FlipHorizontal.cjs +1 -21
  217. package/icons/FlipHorizontal.cjs.map +1 -1
  218. package/icons/FlipHorizontal.mjs +1 -21
  219. package/icons/FlipHorizontal.mjs.map +1 -1
  220. package/icons/FlipVertical.cjs +1 -21
  221. package/icons/FlipVertical.cjs.map +1 -1
  222. package/icons/FlipVertical.mjs +1 -21
  223. package/icons/FlipVertical.mjs.map +1 -1
  224. package/icons/FolderMoveTo.cjs.map +1 -1
  225. package/icons/FolderMoveTo.mjs.map +1 -1
  226. package/icons/FolderSearch.cjs +42 -0
  227. package/icons/FolderSearch.cjs.map +1 -0
  228. package/icons/FolderSearch.d.ts +5 -0
  229. package/icons/FolderSearch.mjs +31 -0
  230. package/icons/FolderSearch.mjs.map +1 -0
  231. package/icons/FontPicker.cjs.map +1 -1
  232. package/icons/FontPicker.mjs.map +1 -1
  233. package/icons/GlobeGrid.cjs.map +1 -1
  234. package/icons/GlobeGrid.mjs.map +1 -1
  235. package/icons/GradientHorizontal.cjs.map +1 -1
  236. package/icons/GradientHorizontal.mjs.map +1 -1
  237. package/icons/GridsAndRulers.cjs.map +1 -1
  238. package/icons/GridsAndRulers.mjs.map +1 -1
  239. package/icons/Image.cjs.map +1 -1
  240. package/icons/Image.mjs.map +1 -1
  241. package/icons/ImageAdd.cjs +1 -5
  242. package/icons/ImageAdd.cjs.map +1 -1
  243. package/icons/ImageAdd.mjs +1 -5
  244. package/icons/ImageAdd.mjs.map +1 -1
  245. package/icons/ImageBackgroundRemove.cjs.map +1 -1
  246. package/icons/ImageBackgroundRemove.mjs.map +1 -1
  247. package/icons/Images.cjs.map +1 -1
  248. package/icons/Images.mjs.map +1 -1
  249. package/icons/Import.cjs +42 -0
  250. package/icons/Import.cjs.map +1 -0
  251. package/icons/Import.d.ts +5 -0
  252. package/icons/Import.mjs +31 -0
  253. package/icons/Import.mjs.map +1 -0
  254. package/icons/Key.cjs +36 -0
  255. package/icons/Key.cjs.map +1 -0
  256. package/icons/Key.d.ts +5 -0
  257. package/icons/Key.mjs +25 -0
  258. package/icons/Key.mjs.map +1 -0
  259. package/icons/ListMultiSelect.cjs.map +1 -1
  260. package/icons/ListMultiSelect.mjs.map +1 -1
  261. package/icons/ListNumbered.cjs.map +1 -1
  262. package/icons/ListNumbered.mjs.map +1 -1
  263. package/icons/Logo.cjs.map +1 -1
  264. package/icons/Logo.mjs.map +1 -1
  265. package/icons/Market.cjs.map +1 -1
  266. package/icons/Market.mjs.map +1 -1
  267. package/icons/Microphone.cjs.map +1 -1
  268. package/icons/Microphone.mjs.map +1 -1
  269. package/icons/MicrophoneOff.cjs.map +1 -1
  270. package/icons/MicrophoneOff.mjs.map +1 -1
  271. package/icons/MusicNote.cjs.map +1 -1
  272. package/icons/MusicNote.mjs.map +1 -1
  273. package/icons/OrientationPortrait.cjs.map +1 -1
  274. package/icons/OrientationPortrait.mjs.map +1 -1
  275. package/icons/Pause.cjs.map +1 -1
  276. package/icons/Pause.mjs.map +1 -1
  277. package/icons/PauseCircle.cjs.map +1 -1
  278. package/icons/PauseCircle.mjs.map +1 -1
  279. package/icons/PeopleGroup.cjs +36 -0
  280. package/icons/PeopleGroup.cjs.map +1 -0
  281. package/icons/PeopleGroup.d.ts +5 -0
  282. package/icons/PeopleGroup.mjs +25 -0
  283. package/icons/PeopleGroup.mjs.map +1 -0
  284. package/icons/Percentage.cjs.map +1 -1
  285. package/icons/Percentage.mjs.map +1 -1
  286. package/icons/PinOff.cjs.map +1 -1
  287. package/icons/PinOff.mjs.map +1 -1
  288. package/icons/PinOn.cjs.map +1 -1
  289. package/icons/PinOn.mjs.map +1 -1
  290. package/icons/Play.cjs.map +1 -1
  291. package/icons/Play.mjs.map +1 -1
  292. package/icons/PluginGear.cjs.map +1 -1
  293. package/icons/PluginGear.mjs.map +1 -1
  294. package/icons/Polygon6.cjs.map +1 -1
  295. package/icons/Polygon6.mjs.map +1 -1
  296. package/icons/Publish.cjs.map +1 -1
  297. package/icons/Publish.mjs.map +1 -1
  298. package/icons/PublishNo.cjs.map +1 -1
  299. package/icons/PublishNo.mjs.map +1 -1
  300. package/icons/RadioButton.cjs.map +1 -1
  301. package/icons/RadioButton.mjs.map +1 -1
  302. package/icons/RectangleHoriz.cjs.map +1 -1
  303. package/icons/RectangleHoriz.mjs.map +1 -1
  304. package/icons/RocketQuickActions.cjs.map +1 -1
  305. package/icons/RocketQuickActions.mjs.map +1 -1
  306. package/icons/RotateCW.cjs.map +1 -1
  307. package/icons/RotateCW.mjs.map +1 -1
  308. package/icons/Ruler.cjs.map +1 -1
  309. package/icons/Ruler.mjs.map +1 -1
  310. package/icons/SaveFloppy.cjs +36 -0
  311. package/icons/SaveFloppy.cjs.map +1 -0
  312. package/icons/SaveFloppy.d.ts +5 -0
  313. package/icons/SaveFloppy.mjs +25 -0
  314. package/icons/SaveFloppy.mjs.map +1 -0
  315. package/icons/Select.cjs.map +1 -1
  316. package/icons/Select.mjs.map +1 -1
  317. package/icons/Send.cjs.map +1 -1
  318. package/icons/Send.mjs.map +1 -1
  319. package/icons/Shuffle.cjs.map +1 -1
  320. package/icons/Shuffle.mjs.map +1 -1
  321. package/icons/Skeleton.cjs +4 -2
  322. package/icons/Skeleton.cjs.map +1 -1
  323. package/icons/Skeleton.css.map +1 -1
  324. package/icons/Skeleton.mjs +4 -2
  325. package/icons/Skeleton.mjs.map +1 -1
  326. package/icons/SlowConnectionCircle.cjs.map +1 -1
  327. package/icons/SlowConnectionCircle.mjs.map +1 -1
  328. package/icons/SpeedFast.cjs +36 -0
  329. package/icons/SpeedFast.cjs.map +1 -0
  330. package/icons/SpeedFast.d.ts +5 -0
  331. package/icons/SpeedFast.mjs +25 -0
  332. package/icons/SpeedFast.mjs.map +1 -0
  333. package/icons/StepBackward.cjs.map +1 -1
  334. package/icons/StepBackward.mjs.map +1 -1
  335. package/icons/StepForward.cjs.map +1 -1
  336. package/icons/StepForward.mjs.map +1 -1
  337. package/icons/Table.cjs.map +1 -1
  338. package/icons/Table.mjs.map +1 -1
  339. package/icons/Tag.cjs.map +1 -1
  340. package/icons/Tag.mjs.map +1 -1
  341. package/icons/Target.cjs.map +1 -1
  342. package/icons/Target.mjs.map +1 -1
  343. package/icons/TextBold.cjs.map +1 -1
  344. package/icons/TextBold.mjs.map +1 -1
  345. package/icons/TextHighlight.cjs.map +1 -1
  346. package/icons/TextHighlight.mjs.map +1 -1
  347. package/icons/TextIncrease.cjs.map +1 -1
  348. package/icons/TextIncrease.mjs.map +1 -1
  349. package/icons/TextNumbers.cjs.map +1 -1
  350. package/icons/TextNumbers.mjs.map +1 -1
  351. package/icons/TextParagraph.cjs.map +1 -1
  352. package/icons/TextParagraph.mjs.map +1 -1
  353. package/icons/TextReplaceComment.cjs.map +1 -1
  354. package/icons/TextReplaceComment.mjs.map +1 -1
  355. package/icons/Tools.cjs.map +1 -1
  356. package/icons/Tools.mjs.map +1 -1
  357. package/icons/TouchOneFingerSwipeLeftRight.cjs.map +1 -1
  358. package/icons/TouchOneFingerSwipeLeftRight.mjs.map +1 -1
  359. package/icons/Transcript.cjs.map +1 -1
  360. package/icons/Transcript.mjs.map +1 -1
  361. package/icons/Translate.cjs.map +1 -1
  362. package/icons/Translate.mjs.map +1 -1
  363. package/icons/UserAvatarCursor.cjs.map +1 -1
  364. package/icons/UserAvatarCursor.mjs.map +1 -1
  365. package/icons/UserEdit.cjs.map +1 -1
  366. package/icons/UserEdit.mjs.map +1 -1
  367. package/icons/UserGroup.cjs.map +1 -1
  368. package/icons/UserGroup.mjs.map +1 -1
  369. package/icons/UserSettings.cjs +44 -0
  370. package/icons/UserSettings.cjs.map +1 -0
  371. package/icons/UserSettings.d.ts +5 -0
  372. package/icons/UserSettings.mjs +33 -0
  373. package/icons/UserSettings.mjs.map +1 -0
  374. package/icons/VectorDraw.cjs.map +1 -1
  375. package/icons/VectorDraw.mjs.map +1 -1
  376. package/icons/ViewGridFluid.cjs +36 -0
  377. package/icons/ViewGridFluid.cjs.map +1 -0
  378. package/icons/ViewGridFluid.d.ts +5 -0
  379. package/icons/ViewGridFluid.mjs +25 -0
  380. package/icons/ViewGridFluid.mjs.map +1 -0
  381. package/icons/ZoomIn.cjs.map +1 -1
  382. package/icons/ZoomIn.mjs.map +1 -1
  383. package/icons/ZoomOut.cjs.map +1 -1
  384. package/icons/ZoomOut.mjs.map +1 -1
  385. package/package.json +21 -21
  386. package/src/Breadcrumbs.tsx +7 -7
  387. package/src/CardView.tsx +8 -362
  388. package/src/Picker.tsx +78 -59
  389. package/src/SegmentedControl.tsx +4 -7
  390. package/src/Skeleton.tsx +2 -4
  391. package/src/TableView.tsx +64 -69
  392. package/src/Tooltip.tsx +1 -1
  393. package/src/TreeView.tsx +26 -25
  394. package/src/index.ts +2 -2
  395. package/src/style-utils.ts +0 -1
  396. package/icons/CloudStateDefault.cjs +0 -36
  397. package/icons/CloudStateDefault.cjs.map +0 -1
  398. package/icons/CloudStateDefault.mjs +0 -25
  399. package/icons/CloudStateDefault.mjs.map +0 -1
  400. package/icons/CloudStateDisconnected.cjs +0 -36
  401. package/icons/CloudStateDisconnected.cjs.map +0 -1
  402. package/icons/CloudStateDisconnected.mjs +0 -25
  403. package/icons/CloudStateDisconnected.mjs.map +0 -1
  404. package/icons/CloudStateError.cjs +0 -36
  405. package/icons/CloudStateError.cjs.map +0 -1
  406. package/icons/CloudStateError.mjs +0 -25
  407. package/icons/CloudStateError.mjs.map +0 -1
  408. package/icons/CloudStateErrorRed.cjs +0 -46
  409. package/icons/CloudStateErrorRed.cjs.map +0 -1
  410. package/icons/CloudStateErrorRed.mjs +0 -35
  411. package/icons/CloudStateErrorRed.mjs.map +0 -1
  412. package/icons/CloudStateInProgress.cjs +0 -36
  413. package/icons/CloudStateInProgress.cjs.map +0 -1
  414. package/icons/CloudStateInProgress.mjs +0 -25
  415. package/icons/CloudStateInProgress.mjs.map +0 -1
  416. package/icons/CloudStateOnline.cjs +0 -50
  417. package/icons/CloudStateOnline.cjs.map +0 -1
  418. package/icons/CloudStateOnline.mjs +0 -39
  419. package/icons/CloudStateOnline.mjs.map +0 -1
  420. package/icons/CloudStatePaused.cjs +0 -36
  421. package/icons/CloudStatePaused.cjs.map +0 -1
  422. package/icons/CloudStatePaused.mjs +0 -25
  423. package/icons/CloudStatePaused.mjs.map +0 -1
  424. package/icons/CloudStatePending.cjs +0 -42
  425. package/icons/CloudStatePending.cjs.map +0 -1
  426. package/icons/CloudStatePending.mjs +0 -31
  427. package/icons/CloudStatePending.mjs.map +0 -1
  428. package/icons/CloudStateSlowConnection.cjs +0 -36
  429. package/icons/CloudStateSlowConnection.cjs.map +0 -1
  430. package/icons/CloudStateSlowConnection.mjs +0 -25
  431. package/icons/CloudStateSlowConnection.mjs.map +0 -1
  432. /package/icons/{CloudStateDefault.d.ts → ABC.d.ts} +0 -0
  433. /package/icons/{CloudStateDisconnected.d.ts → App.d.ts} +0 -0
  434. /package/icons/{CloudStateError.d.ts → Bookmark.d.ts} +0 -0
  435. /package/icons/{CloudStateErrorRed.d.ts → Building.d.ts} +0 -0
  436. /package/icons/{CloudStateInProgress.d.ts → CallCenter.d.ts} +0 -0
  437. /package/icons/{CloudStateOnline.d.ts → ChartBarVert.d.ts} +0 -0
  438. /package/icons/{CloudStatePaused.d.ts → ChartPie.d.ts} +0 -0
  439. /package/icons/{CloudStatePending.d.ts → ChartTrend.d.ts} +0 -0
  440. /package/icons/{CloudStateSlowConnection.d.ts → Chat.d.ts} +0 -0
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA4CM,MAAM,0DAA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4BAAQ,OAAO,CAAA,GAAA,oCAAS,EAAE,QAAQ;2CAAC;4BAAS;4BAAI,SAAS;sCAChE,OAAO,MAAM,QAAQ,KAAK,yBAAW,gCAAC,CAAA,GAAA,8BAAG;0CAAG,MAAM,QAAQ;iCAAW,MAAM,QAAQ;;;;;;AAQlG","sources":["packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA4CM,MAAM,0DAA0B,CAAA,GAAA,0BAAY,EAA6E;AAEhI,MAAM;;;;;;;;;;;;;;;;;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;AA0CN,MAAM,sEAAkC,CAAA,GAAA,0BAAY,EAAwC,CAAC;AAKtF,MAAM,4CAAmB,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,iBAAiB,KAA4B,EAAE,GAA2B;IAC1I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,sBACF,kBAAkB,eAClB,WAAW,qBACX,iBAAiB,EAClB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,UAAU,CAAA,GAAA,mBAAK,EAAW;IAC9B,IAAI,qBAAqB,CAAA,GAAA,mBAAK,EAAkB;IAEhD,IAAI,WAAW,CAAC;QACd,IAAI,mBAAmB,OAAO,EAC5B,QAAQ,OAAO,GAAG,oBAA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AAC;wBAAI,WAAW,6BAAO;wCAAC;wBAAU;wBAAI,KAAK;;kCAC1D,gCAAC,CAAA,GAAA,mCAAO;wBACN,QAAQ;4BACN;gCAAC,CAAA,GAAA,qCAAU;gCAAG;oCACZ,QAAQ,CAAA,GAAA,wCAAa,EAAE;wCAAC,MAAM;wCAAQ,MAAM;oCAAkC;gCAChF;6BAAE;4BACF;gCAAC,CAAA,GAAA,sCAAa;gCAAG;oCAAC,OAAO;wCAAC,CAAC,CAAA,GAAA,uCAAW,EAAE,EAAE,CAAC;oCAAC;gCAAC;6BAAE;4BAC/C;gCAAC,CAAA,GAAA,qCAAU;gCAAG;oCAAC,MAAM;gCAAmC;6BAAE;yBAC3D;kCACD,cAAA,gCAAC;4BAAI,KAAK;4BAAQ,OAAO,CAAA,GAAA,oCAAS,EAAE,QAAQ;2CAAC;4BAAS;4BAAI,SAAS;sCAChE,OAAO,MAAM,QAAQ,KAAK,yBAAW,gCAAC,CAAA,GAAA,8BAAG;0CAAG,MAAM,QAAQ;iCAAW,MAAM,QAAQ;;;;;;AAQlG","sources":["packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let reduceMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !reduceMotion) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected, reduceMotion]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":"ACwDyB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkK+C;;;;EAAA;;;;EAGzB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAE4C;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA5NxD;EAQL;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA6CL;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA7CK;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAoN6D;;;;IAAA","sources":["90909571be522c78","packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["@import \"3076f581d900045a\";\n@import \"37c2fdb040131115\";\n@import \"d075b97bae773d34\";\n@import \"6903fca31535b056\";\n@import \"a6b79b4602e6c53c\";\n@import \"c3f3a2eb3541e76f\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.css.map"}
1
+ {"mappings":"ACwDyB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+J+C;;;;EAAA;;;;EAGzB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAE4C;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAzNxD;EAQL;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA6CL;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA7CK;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAiN6D;;;;IAAA","sources":["90909571be522c78","packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["@import \"3076f581d900045a\";\n@import \"37c2fdb040131115\";\n@import \"d075b97bae773d34\";\n@import \"6903fca31535b056\";\n@import \"a6b79b4602e6c53c\";\n@import \"c3f3a2eb3541e76f\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let reduceMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !reduceMotion) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected, reduceMotion]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.css.map"}
@@ -7,7 +7,7 @@ import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} fr
7
7
  import {jsx as $ae3Tm$jsx, jsxs as $ae3Tm$jsxs, Fragment as $ae3Tm$Fragment} from "react/jsx-runtime";
8
8
  import {ToggleButtonGroup as $ae3Tm$ToggleButtonGroup, ToggleGroupStateContext as $ae3Tm$ToggleGroupStateContext, Provider as $ae3Tm$Provider, ToggleButton as $ae3Tm$ToggleButton, TextContext as $ae3Tm$TextContext, DEFAULT_SLOT as $ae3Tm$DEFAULT_SLOT} from "react-aria-components";
9
9
  import {createContext as $ae3Tm$createContext, forwardRef as $ae3Tm$forwardRef, useRef as $ae3Tm$useRef, useContext as $ae3Tm$useContext, useCallback as $ae3Tm$useCallback} from "react";
10
- import {useDOMRef as $ae3Tm$useDOMRef, useFocusableRef as $ae3Tm$useFocusableRef} from "@react-spectrum/utils";
10
+ import {useDOMRef as $ae3Tm$useDOMRef, useFocusableRef as $ae3Tm$useFocusableRef, useMediaQuery as $ae3Tm$useMediaQuery} from "@react-spectrum/utils";
11
11
  import {useLayoutEffect as $ae3Tm$useLayoutEffect} from "@react-aria/utils";
12
12
 
13
13
  /*
@@ -236,13 +236,12 @@ const $c679c2152e03f8bf$export$4fc12f2742e8cf3f = /*#__PURE__*/ (0, $ae3Tm$forwa
236
236
  let state = (0, $ae3Tm$useContext)((0, $ae3Tm$ToggleGroupStateContext));
237
237
  let isSelected = state?.selectedKeys.has(props.id);
238
238
  // do not apply animation if a user has the prefers-reduced-motion setting
239
- let isReduced = false;
240
- if (window?.matchMedia) isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
239
+ let reduceMotion = (0, $ae3Tm$useMediaQuery)('(prefers-reduced-motion: reduce)');
241
240
  (0, $ae3Tm$useLayoutEffect)(()=>{
242
241
  register?.(props.id);
243
242
  }, []);
244
243
  (0, $ae3Tm$useLayoutEffect)(()=>{
245
- if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {
244
+ if (isSelected && prevRef?.current && currentSelectedRef?.current && !reduceMotion) {
246
245
  let currentItem = currentSelectedRef?.current.getBoundingClientRect();
247
246
  let deltaX = prevRef?.current.left - currentItem?.left;
248
247
  currentSelectedRef.current.animate([
@@ -261,7 +260,8 @@ const $c679c2152e03f8bf$export$4fc12f2742e8cf3f = /*#__PURE__*/ (0, $ae3Tm$forwa
261
260
  prevRef.current = null;
262
261
  }
263
262
  }, [
264
- isSelected
263
+ isSelected,
264
+ reduceMotion
265
265
  ]);
266
266
  return /*#__PURE__*/ (0, $ae3Tm$jsx)((0, $ae3Tm$ToggleButton), {
267
267
  ...props,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA4CM,MAAM,0DAA0B,CAAA,GAAA,oBAAY,EAA6E;AAEhI,MAAM;;;;;;;;;;;;;;;;;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;AA0CN,MAAM,sEAAkC,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAKtF,MAAM,4CAAmB,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,SAAS,iBAAiB,KAA4B,EAAE,GAA2B;IAC1I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,sBACF,kBAAkB,eAClB,WAAW,qBACX,iBAAiB,EAClB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAAW;IAC9B,IAAI,qBAAqB,CAAA,GAAA,aAAK,EAAkB;IAEhD,IAAI,WAAW,CAAC;QACd,IAAI,mBAAmB,OAAO,EAC5B,QAAQ,OAAO,GAAG,oBAAoB,QAAQ;QAGhD,IAAI,mBACF,kBAAkB,OAAO,MAAM,GAAG,IAAI,G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AU;wBAAI,KAAK;;kCAC1D,gBAAC,CAAA,GAAA,eAAO;wBACN,QAAQ;4BACN;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;wCAAC,MAAM;wCAAQ,MAAM;oCAAkC;gCAChF;6BAAE;4BACF;gCAAC,CAAA,GAAA,kBAAa;gCAAG;oCAAC,OAAO;wCAAC,CAAC,CAAA,GAAA,mBAAW,EAAE,EAAE,CAAC;oCAAC;gCAAC;6BAAE;4BAC/C;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCAAC,MAAM;gCAAmC;6BAAE;yBAC3D;kCACD,cAAA,gBAAC;4BAAI,KAAK;4BAAQ,OAAO,CAAA,GAAA,yCAAS,EAAE,QAAQ;2CAAC;4BAAS;4BAAI,SAAS;sCAChE,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0CAAG,MAAM,QAAQ;iCAAW,MAAM,QAAQ;;;;;;AAQlG","sources":["packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA4CM,MAAM,0DAA0B,CAAA,GAAA,oBAAY,EAA6E;AAEhI,MAAM;;;;;;;;;;;;;;;;;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;AA0CN,MAAM,sEAAkC,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAKtF,MAAM,4CAAmB,WAA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AAE,CAAC;gBAAA;aAC/D,EACD;gBACE,UAAU;gBACV,QAAQ;YACV;YAGF,QAAQ,OAAO,GAAG;QACpB;IACF,GAAG;QAAC;QAAY;KAAa;IAE7B,qBACE,gBAAC,CAAA,GAAA,mBAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,kCAAY;gBAAC,GAAG,WAAW;6BAAE;YAAW,GAAG,MAAM,MAAM;kBACjH,CAAC,cAAC,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,iBACnC;;oBACG,4BAAc,gBAAC;wBAAI,WAAW,6BAAO;wCAAC;wBAAU;wBAAI,KAAK;;kCAC1D,gBAAC,CAAA,GAAA,eAAO;wBACN,QAAQ;4BACN;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;wCAAC,MAAM;wCAAQ,MAAM;oCAAkC;gCAChF;6BAAE;4BACF;gCAAC,CAAA,GAAA,kBAAa;gCAAG;oCAAC,OAAO;wCAAC,CAAC,CAAA,GAAA,mBAAW,EAAE,EAAE,CAAC;oCAAC;gCAAC;6BAAE;4BAC/C;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCAAC,MAAM;gCAAmC;6BAAE;yBAC3D;kCACD,cAAA,gBAAC;4BAAI,KAAK;4BAAQ,OAAO,CAAA,GAAA,yCAAS,EAAE,QAAQ;2CAAC;4BAAS;4BAAI,SAAS;sCAChE,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0CAAG,MAAM,QAAQ;iCAAW,MAAM,QAAQ;;;;;;AAQlG","sources":["packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let reduceMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !reduceMotion) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected, reduceMotion]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.mjs.map"}
@@ -147,13 +147,7 @@ const $bed37377ec7a3a9e$var$ROW_HEIGHTS = {
147
147
  large: 60
148
148
  }
149
149
  };
150
- class $bed37377ec7a3a9e$export$4e03bdf0174fd602 extends (0, $iLVc8$reactariacomponents.UNSTABLE_TableLayout) {
151
- constructor(options){
152
- super({
153
- ...options,
154
- loaderHeight: 60
155
- });
156
- }
150
+ class $bed37377ec7a3a9e$export$4e03bdf0174fd602 extends (0, $iLVc8$reactariacomponents.TableLayout) {
157
151
  isStickyColumn(node) {
158
152
  return node.props.isSticky;
159
153
  }
@@ -216,18 +210,6 @@ const $bed37377ec7a3a9e$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $iLVc8$react.
216
210
  let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className, isQuiet: isQuiet = false, density: density = 'regular', overflowMode: overflowMode = 'truncate', styles: styles, loadingState: loadingState, onLoadMore: onLoadMore, onResize: propsOnResize, onResizeStart: propsOnResizeStart, onResizeEnd: propsOnResizeEnd, onAction: onAction, ...otherProps } = props;
217
211
  let domRef = (0, $iLVc8$reactspectrumutils.useDOMRef)(ref);
218
212
  let scale = (0, $ee7b4c497f520c08$exports.useScale)();
219
- let layout = (0, $iLVc8$react.useMemo)(()=>{
220
- return new $bed37377ec7a3a9e$export$4e03bdf0174fd602({
221
- rowHeight: overflowMode === 'wrap' ? undefined : $bed37377ec7a3a9e$var$ROW_HEIGHTS[density][scale],
222
- estimatedRowHeight: overflowMode === 'wrap' ? $bed37377ec7a3a9e$var$ROW_HEIGHTS[density][scale] : undefined,
223
- // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap
224
- headingHeight: $bed37377ec7a3a9e$var$DEFAULT_HEADER_HEIGHT[scale]
225
- });
226
- }, [
227
- overflowMode,
228
- density,
229
- scale
230
- ]);
231
213
  // Starts when the user selects resize from the menu, ends when resizing ends
232
214
  // used to control the visibility of the resizer Nubbin
233
215
  let [isInResizeMode, setIsInResizeMode] = (0, $iLVc8$react.useState)(false);
@@ -282,8 +264,15 @@ const $bed37377ec7a3a9e$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $iLVc8$react.
282
264
  className: (UNSAFE_className || '') + (0, $308b180f49d82d28$exports.mergeStyles)($bed37377ec7a3a9e$var$tableWrapper, styles),
283
265
  style: UNSAFE_style,
284
266
  children: [
285
- /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.UNSTABLE_Virtualizer), {
286
- layout: layout,
267
+ /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.Virtualizer), {
268
+ layout: $bed37377ec7a3a9e$export$4e03bdf0174fd602,
269
+ layoutOptions: {
270
+ rowHeight: overflowMode === 'wrap' ? undefined : $bed37377ec7a3a9e$var$ROW_HEIGHTS[density][scale],
271
+ estimatedRowHeight: overflowMode === 'wrap' ? $bed37377ec7a3a9e$var$ROW_HEIGHTS[density][scale] : undefined,
272
+ // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap
273
+ headingHeight: $bed37377ec7a3a9e$var$DEFAULT_HEADER_HEIGHT[scale],
274
+ loaderHeight: 60
275
+ },
287
276
  children: /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$InternalTableContext.Provider, {
288
277
  value: context,
289
278
  children: /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.Table), {
@@ -467,7 +456,6 @@ const $bed37377ec7a3a9e$var$columnStyles = function anonymous(props) {
467
456
  return rules;
468
457
  };
469
458
  const $bed37377ec7a3a9e$export$816b5d811295e6bc = /*#__PURE__*/ (0, $iLVc8$react.forwardRef)(function Column(props, ref) {
470
- let { isHeaderRowHovered: isHeaderRowHovered } = (0, $iLVc8$react.useContext)($bed37377ec7a3a9e$var$InternalTableHeaderContext);
471
459
  let { isQuiet: isQuiet } = (0, $iLVc8$react.useContext)($bed37377ec7a3a9e$var$InternalTableContext);
472
460
  let { allowsResizing: allowsResizing, children: children, align: align = 'start' } = props;
473
461
  let domRef = (0, $iLVc8$reactspectrumutils.useDOMRef)(ref);
@@ -484,7 +472,7 @@ const $bed37377ec7a3a9e$export$816b5d811295e6bc = /*#__PURE__*/ (0, $iLVc8$react
484
472
  align: align,
485
473
  isQuiet: isQuiet
486
474
  }),
487
- children: ({ allowsSorting: allowsSorting, sortDirection: sortDirection, isFocusVisible: isFocusVisible, sort: sort, startResize: startResize, isHovered: isHovered })=>/*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
475
+ children: ({ allowsSorting: allowsSorting, sortDirection: sortDirection, isFocusVisible: isFocusVisible, sort: sort, startResize: startResize })=>/*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
488
476
  children: [
489
477
  isFocusVisible && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$CellFocusRing, {}),
490
478
  isColumnResizable ? /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$ResizableColumnContents, {
@@ -492,7 +480,6 @@ const $bed37377ec7a3a9e$export$816b5d811295e6bc = /*#__PURE__*/ (0, $iLVc8$react
492
480
  sortDirection: sortDirection,
493
481
  sort: sort,
494
482
  startResize: startResize,
495
- isHovered: isHeaderRowHovered || isHovered,
496
483
  align: align,
497
484
  children: children
498
485
  }) : /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$ColumnContents, {
@@ -595,9 +582,9 @@ const $bed37377ec7a3a9e$var$resizableMenuButtonWrapper = function anonymous(prop
595
582
  };
596
583
  const $bed37377ec7a3a9e$var$resizerHandleContainer = function anonymous(props) {
597
584
  let rules = " .";
598
- if (props.isHovered) rules += ' _0a';
585
+ if (props.isInResizeMode) rules += ' _0a';
599
586
  else if (props.isResizing) rules += ' _0a';
600
- else rules += ' _0j';
587
+ else rules += ' _0-zw4ipl';
601
588
  rules += ' lA';
602
589
  rules += ' kb';
603
590
  rules += ' Va';
@@ -617,8 +604,7 @@ const $bed37377ec7a3a9e$var$resizerHandle = function anonymous(props) {
617
604
  else rules += ' ba_____H';
618
605
  if (props.isResizing) rules += ' b-14crvkh';
619
606
  else if (props.isFocusVisible) rules += ' b-14crvkh';
620
- else if (props.isHovered) rules += ' bi';
621
- else rules += ' ba';
607
+ else rules += ' bi';
622
608
  if (props.isResizing) rules += ' kn';
623
609
  else rules += ' kb';
624
610
  if (props.isResizing) rules += ' lq';
@@ -631,7 +617,7 @@ const $bed37377ec7a3a9e$var$columnHeaderText = " __wb __xb _na _qb q-1wikn8b __a
631
617
  const $bed37377ec7a3a9e$var$chevronIcon = " R-3hn0u yG ybH q-1wikn8b _9-3t1x -rwx0fg_e-b";
632
618
  const $bed37377ec7a3a9e$var$nubbin = " Va Ya W-avx9c1 l-1wikn8b k-1wikn8b e-14crvkh ea______a -rwx0fg_e-A -rwx0fg_e-a______b";
633
619
  function $bed37377ec7a3a9e$var$ResizableColumnContents(props) {
634
- let { allowsSorting: allowsSorting, sortDirection: sortDirection, sort: sort, startResize: startResize, children: children, isHovered: isHovered, align: align } = props;
620
+ let { allowsSorting: allowsSorting, sortDirection: sortDirection, sort: sort, startResize: startResize, children: children, align: align } = props;
635
621
  let { setIsInResizeMode: setIsInResizeMode, isInResizeMode: isInResizeMode } = (0, $iLVc8$react.useContext)($bed37377ec7a3a9e$var$InternalTableContext);
636
622
  let stringFormatter = (0, $iLVc8$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($4526404114e78c80$exports))), '@react-spectrum/s2');
637
623
  const onMenuSelect = (key)=>{
@@ -729,14 +715,13 @@ function $bed37377ec7a3a9e$var$ResizableColumnContents(props) {
729
715
  className: ({ resizableDirection: resizableDirection, isResizing: isResizing })=>$bed37377ec7a3a9e$var$resizerHandleContainer({
730
716
  resizableDirection: resizableDirection,
731
717
  isResizing: isResizing,
732
- isHovered: isInResizeMode || isHovered
718
+ isInResizeMode: isInResizeMode
733
719
  }),
734
720
  children: ({ isFocusVisible: isFocusVisible, isResizing: isResizing })=>/*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
735
721
  children: [
736
722
  /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$ResizerIndicator, {
737
723
  isInResizeMode: isInResizeMode,
738
724
  isFocusVisible: isFocusVisible,
739
- isHovered: isHovered,
740
725
  isResizing: isResizing
741
726
  }),
742
727
  (isFocusVisible || isInResizeMode) && isResizing && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)("div", {
@@ -750,16 +735,25 @@ function $bed37377ec7a3a9e$var$ResizableColumnContents(props) {
750
735
  ]
751
736
  });
752
737
  }
753
- function $bed37377ec7a3a9e$var$ResizerIndicator({ isFocusVisible: isFocusVisible, isHovered: isHovered, isResizing: isResizing, isInResizeMode: isInResizeMode }) {
738
+ function $bed37377ec7a3a9e$var$ResizerIndicator({ isFocusVisible: isFocusVisible, isResizing: isResizing, isInResizeMode: isInResizeMode }) {
754
739
  return /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)("div", {
755
740
  className: $bed37377ec7a3a9e$var$resizerHandle({
756
741
  isFocusVisible: isFocusVisible,
757
- isHovered: isHovered || isInResizeMode,
742
+ isInResizeMode: isInResizeMode,
758
743
  isResizing: isResizing
759
744
  })
760
745
  });
761
746
  }
762
- const $bed37377ec7a3a9e$var$tableHeader = " kb lb bf A-yj899n";
747
+ const $bed37377ec7a3a9e$var$tableHeader = function anonymous(props) {
748
+ let rules = " .";
749
+ rules += ' kb';
750
+ rules += ' lb';
751
+ rules += ' bf';
752
+ rules += ' A-yj899n';
753
+ if (props.isHovered) rules += ' -zw4ipl__0-a';
754
+ else rules += ' -zw4ipl__0-j';
755
+ return rules;
756
+ };
763
757
  const $bed37377ec7a3a9e$var$selectAllCheckbox = " yf";
764
758
  const $bed37377ec7a3a9e$var$selectAllCheckboxColumn = function anonymous(props) {
765
759
  let rules = " .";
@@ -783,56 +777,46 @@ const $bed37377ec7a3a9e$var$selectAllCheckboxColumn = function anonymous(props)
783
777
  rules += ' bf';
784
778
  return rules;
785
779
  };
786
- let $bed37377ec7a3a9e$var$InternalTableHeaderContext = /*#__PURE__*/ (0, $iLVc8$react.createContext)({
787
- isHeaderRowHovered: false
788
- });
789
780
  const $bed37377ec7a3a9e$export$f850895b287ef28e = /*#__PURE__*/ (0, $iLVc8$react.forwardRef)(function TableHeader({ columns: columns, children: children }, ref) {
790
781
  let scale = (0, $ee7b4c497f520c08$exports.useScale)();
791
782
  let { selectionBehavior: selectionBehavior, selectionMode: selectionMode } = (0, $iLVc8$reactariacomponents.useTableOptions)();
792
783
  let { isQuiet: isQuiet } = (0, $iLVc8$react.useContext)($bed37377ec7a3a9e$var$InternalTableContext);
793
- let [isHeaderRowHovered, setHeaderRowHovered] = (0, $iLVc8$react.useState)(false);
794
784
  let domRef = (0, $iLVc8$reactspectrumutils.useDOMRef)(ref);
795
- return /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$InternalTableHeaderContext.Provider, {
796
- value: {
797
- isHeaderRowHovered: isHeaderRowHovered
798
- },
799
- children: /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactariacomponents.TableHeader), {
785
+ return /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactariacomponents.TableHeader), {
786
+ // @ts-ignore
787
+ ref: domRef,
788
+ className: $bed37377ec7a3a9e$var$tableHeader,
789
+ children: [
790
+ selectionBehavior === 'toggle' && // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
800
791
  // @ts-ignore
801
- ref: domRef,
802
- onHoverChange: setHeaderRowHovered,
803
- className: $bed37377ec7a3a9e$var$tableHeader,
804
- children: [
805
- selectionBehavior === 'toggle' && // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
806
- // @ts-ignore
807
- /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.Column), {
808
- isSticky: true,
809
- width: scale === 'medium' ? 40 : 52,
810
- minWidth: scale === 'medium' ? 40 : 52,
811
- className: $bed37377ec7a3a9e$var$selectAllCheckboxColumn({
812
- isQuiet: isQuiet
813
- }),
814
- children: ({ isFocusVisible: isFocusVisible })=>/*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
815
- children: [
816
- selectionMode === 'single' && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
817
- children: [
818
- isFocusVisible && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$CellFocusRing, {}),
819
- /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$VisuallyHiddenSelectAllLabel, {})
820
- ]
821
- }),
822
- selectionMode === 'multiple' && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $af04e099a53d3e85$exports.Checkbox), {
823
- isEmphasized: true,
824
- styles: $bed37377ec7a3a9e$var$selectAllCheckbox,
825
- slot: "selection"
826
- })
827
- ]
828
- })
792
+ /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.Column), {
793
+ isSticky: true,
794
+ width: scale === 'medium' ? 40 : 52,
795
+ minWidth: scale === 'medium' ? 40 : 52,
796
+ className: $bed37377ec7a3a9e$var$selectAllCheckboxColumn({
797
+ isQuiet: isQuiet
829
798
  }),
830
- /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.Collection), {
831
- items: columns,
832
- children: children
833
- })
834
- ]
835
- })
799
+ children: ({ isFocusVisible: isFocusVisible })=>/*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
800
+ children: [
801
+ selectionMode === 'single' && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsxs)((0, $iLVc8$reactjsxruntime.Fragment), {
802
+ children: [
803
+ isFocusVisible && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$CellFocusRing, {}),
804
+ /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)($bed37377ec7a3a9e$var$VisuallyHiddenSelectAllLabel, {})
805
+ ]
806
+ }),
807
+ selectionMode === 'multiple' && /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $af04e099a53d3e85$exports.Checkbox), {
808
+ isEmphasized: true,
809
+ styles: $bed37377ec7a3a9e$var$selectAllCheckbox,
810
+ slot: "selection"
811
+ })
812
+ ]
813
+ })
814
+ }),
815
+ /*#__PURE__*/ (0, $iLVc8$reactjsxruntime.jsx)((0, $iLVc8$reactariacomponents.Collection), {
816
+ items: columns,
817
+ children: children
818
+ })
819
+ ]
836
820
  });
837
821
  });
838
822
  function $bed37377ec7a3a9e$var$VisuallyHiddenSelectAllLabel() {