@react-spectrum/s2 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/dist/Accordion.cjs +5 -8
  2. package/dist/Accordion.cjs.map +1 -1
  3. package/dist/Accordion.css +2 -2
  4. package/dist/Accordion.css.map +1 -1
  5. package/dist/Accordion.mjs +5 -8
  6. package/dist/Accordion.mjs.map +1 -1
  7. package/dist/ActionBar.cjs +264 -0
  8. package/dist/ActionBar.cjs.map +1 -0
  9. package/dist/ActionBar.css +267 -0
  10. package/dist/ActionBar.css.map +1 -0
  11. package/dist/ActionBar.mjs +257 -0
  12. package/dist/ActionBar.mjs.map +1 -0
  13. package/dist/ActionButton.cjs +121 -147
  14. package/dist/ActionButton.cjs.map +1 -1
  15. package/dist/ActionButton.css +133 -153
  16. package/dist/ActionButton.css.map +1 -1
  17. package/dist/ActionButton.mjs +122 -148
  18. package/dist/ActionButton.mjs.map +1 -1
  19. package/dist/ActionButtonGroup.cjs +6 -9
  20. package/dist/ActionButtonGroup.cjs.map +1 -1
  21. package/dist/ActionButtonGroup.css +3 -3
  22. package/dist/ActionButtonGroup.css.map +1 -1
  23. package/dist/ActionButtonGroup.mjs +6 -9
  24. package/dist/ActionButtonGroup.mjs.map +1 -1
  25. package/dist/ActionMenu.cjs +2 -5
  26. package/dist/ActionMenu.cjs.map +1 -1
  27. package/dist/ActionMenu.mjs +2 -5
  28. package/dist/ActionMenu.mjs.map +1 -1
  29. package/dist/AlertDialog.cjs +2 -5
  30. package/dist/AlertDialog.cjs.map +1 -1
  31. package/dist/AlertDialog.css.map +1 -1
  32. package/dist/AlertDialog.mjs +2 -5
  33. package/dist/AlertDialog.mjs.map +1 -1
  34. package/dist/Avatar.cjs +12 -15
  35. package/dist/Avatar.cjs.map +1 -1
  36. package/dist/Avatar.css +11 -11
  37. package/dist/Avatar.css.map +1 -1
  38. package/dist/Avatar.mjs +12 -15
  39. package/dist/Avatar.mjs.map +1 -1
  40. package/dist/AvatarGroup.cjs +99 -102
  41. package/dist/AvatarGroup.cjs.map +1 -1
  42. package/dist/AvatarGroup.css +31 -31
  43. package/dist/AvatarGroup.css.map +1 -1
  44. package/dist/AvatarGroup.mjs +99 -102
  45. package/dist/AvatarGroup.mjs.map +1 -1
  46. package/dist/Badge.cjs +99 -102
  47. package/dist/Badge.cjs.map +1 -1
  48. package/dist/Badge.css +76 -76
  49. package/dist/Badge.css.map +1 -1
  50. package/dist/Badge.mjs +99 -102
  51. package/dist/Badge.mjs.map +1 -1
  52. package/dist/Breadcrumbs.cjs +93 -94
  53. package/dist/Breadcrumbs.cjs.map +1 -1
  54. package/dist/Breadcrumbs.css +70 -64
  55. package/dist/Breadcrumbs.css.map +1 -1
  56. package/dist/Breadcrumbs.mjs +94 -95
  57. package/dist/Breadcrumbs.mjs.map +1 -1
  58. package/dist/Button.cjs +305 -278
  59. package/dist/Button.cjs.map +1 -1
  60. package/dist/Button.css +255 -182
  61. package/dist/Button.css.map +1 -1
  62. package/dist/Button.mjs +307 -280
  63. package/dist/Button.mjs.map +1 -1
  64. package/dist/ButtonGroup.cjs +17 -20
  65. package/dist/ButtonGroup.cjs.map +1 -1
  66. package/dist/ButtonGroup.css +11 -11
  67. package/dist/ButtonGroup.css.map +1 -1
  68. package/dist/ButtonGroup.mjs +18 -21
  69. package/dist/ButtonGroup.mjs.map +1 -1
  70. package/dist/Card.cjs +167 -167
  71. package/dist/Card.css +121 -121
  72. package/dist/Card.mjs +167 -167
  73. package/dist/CardView.cjs +47 -21
  74. package/dist/CardView.cjs.map +1 -1
  75. package/dist/CardView.css +39 -15
  76. package/dist/CardView.css.map +1 -1
  77. package/dist/CardView.mjs +49 -23
  78. package/dist/CardView.mjs.map +1 -1
  79. package/dist/CenterBaseline.cjs +1 -1
  80. package/dist/CenterBaseline.css +2 -2
  81. package/dist/CenterBaseline.mjs +1 -1
  82. package/dist/Checkbox.cjs +58 -62
  83. package/dist/Checkbox.cjs.map +1 -1
  84. package/dist/Checkbox.css +54 -54
  85. package/dist/Checkbox.css.map +1 -1
  86. package/dist/Checkbox.mjs +59 -63
  87. package/dist/Checkbox.mjs.map +1 -1
  88. package/dist/CheckboxGroup.cjs +43 -45
  89. package/dist/CheckboxGroup.cjs.map +1 -1
  90. package/dist/CheckboxGroup.css +32 -32
  91. package/dist/CheckboxGroup.css.map +1 -1
  92. package/dist/CheckboxGroup.mjs +44 -46
  93. package/dist/CheckboxGroup.mjs.map +1 -1
  94. package/dist/ClearButton.cjs +7 -8
  95. package/dist/ClearButton.cjs.map +1 -1
  96. package/dist/ClearButton.css +5 -5
  97. package/dist/ClearButton.css.map +1 -1
  98. package/dist/ClearButton.mjs +7 -8
  99. package/dist/ClearButton.mjs.map +1 -1
  100. package/dist/CloseButton.cjs +40 -53
  101. package/dist/CloseButton.cjs.map +1 -1
  102. package/dist/CloseButton.css +45 -49
  103. package/dist/CloseButton.css.map +1 -1
  104. package/dist/CloseButton.mjs +40 -53
  105. package/dist/CloseButton.mjs.map +1 -1
  106. package/dist/ColorArea.cjs +12 -15
  107. package/dist/ColorArea.cjs.map +1 -1
  108. package/dist/ColorArea.css +10 -10
  109. package/dist/ColorArea.css.map +1 -1
  110. package/dist/ColorArea.mjs +12 -15
  111. package/dist/ColorArea.mjs.map +1 -1
  112. package/dist/ColorField.cjs +31 -34
  113. package/dist/ColorField.cjs.map +1 -1
  114. package/dist/ColorField.css +24 -24
  115. package/dist/ColorField.css.map +1 -1
  116. package/dist/ColorField.mjs +32 -35
  117. package/dist/ColorField.mjs.map +1 -1
  118. package/dist/ColorHandle.cjs +11 -11
  119. package/dist/ColorHandle.css +19 -19
  120. package/dist/ColorHandle.mjs +11 -11
  121. package/dist/ColorSlider.cjs +43 -46
  122. package/dist/ColorSlider.cjs.map +1 -1
  123. package/dist/ColorSlider.css +43 -43
  124. package/dist/ColorSlider.css.map +1 -1
  125. package/dist/ColorSlider.mjs +44 -47
  126. package/dist/ColorSlider.mjs.map +1 -1
  127. package/dist/ColorSwatch.cjs +8 -11
  128. package/dist/ColorSwatch.cjs.map +1 -1
  129. package/dist/ColorSwatch.css +14 -14
  130. package/dist/ColorSwatch.css.map +1 -1
  131. package/dist/ColorSwatch.mjs +9 -12
  132. package/dist/ColorSwatch.mjs.map +1 -1
  133. package/dist/ColorSwatchPicker.cjs +15 -18
  134. package/dist/ColorSwatchPicker.cjs.map +1 -1
  135. package/dist/ColorSwatchPicker.css +33 -33
  136. package/dist/ColorSwatchPicker.css.map +1 -1
  137. package/dist/ColorSwatchPicker.mjs +15 -18
  138. package/dist/ColorSwatchPicker.mjs.map +1 -1
  139. package/dist/ColorWheel.cjs +18 -21
  140. package/dist/ColorWheel.cjs.map +1 -1
  141. package/dist/ColorWheel.css +15 -15
  142. package/dist/ColorWheel.css.map +1 -1
  143. package/dist/ColorWheel.mjs +18 -21
  144. package/dist/ColorWheel.mjs.map +1 -1
  145. package/dist/ComboBox.cjs +61 -61
  146. package/dist/ComboBox.cjs.map +1 -1
  147. package/dist/ComboBox.css +52 -52
  148. package/dist/ComboBox.css.map +1 -1
  149. package/dist/ComboBox.mjs +62 -62
  150. package/dist/ComboBox.mjs.map +1 -1
  151. package/dist/Content.cjs +12 -19
  152. package/dist/Content.cjs.map +1 -1
  153. package/dist/Content.mjs +12 -19
  154. package/dist/Content.mjs.map +1 -1
  155. package/dist/ContextualHelp.cjs +7 -10
  156. package/dist/ContextualHelp.cjs.map +1 -1
  157. package/dist/ContextualHelp.css +23 -23
  158. package/dist/ContextualHelp.css.map +1 -1
  159. package/dist/ContextualHelp.mjs +7 -10
  160. package/dist/ContextualHelp.mjs.map +1 -1
  161. package/dist/CustomDialog.cjs +10 -13
  162. package/dist/CustomDialog.cjs.map +1 -1
  163. package/dist/CustomDialog.css +9 -9
  164. package/dist/CustomDialog.css.map +1 -1
  165. package/dist/CustomDialog.mjs +10 -13
  166. package/dist/CustomDialog.mjs.map +1 -1
  167. package/dist/Dialog.cjs +12 -16
  168. package/dist/Dialog.cjs.map +1 -1
  169. package/dist/Dialog.css +39 -39
  170. package/dist/Dialog.css.map +1 -1
  171. package/dist/Dialog.mjs +12 -16
  172. package/dist/Dialog.mjs.map +1 -1
  173. package/dist/Disclosure.cjs +60 -69
  174. package/dist/Disclosure.cjs.map +1 -1
  175. package/dist/Disclosure.css +49 -49
  176. package/dist/Disclosure.css.map +1 -1
  177. package/dist/Disclosure.mjs +61 -70
  178. package/dist/Disclosure.mjs.map +1 -1
  179. package/dist/Divider.cjs +15 -19
  180. package/dist/Divider.cjs.map +1 -1
  181. package/dist/Divider.css +18 -18
  182. package/dist/Divider.css.map +1 -1
  183. package/dist/Divider.mjs +15 -19
  184. package/dist/Divider.mjs.map +1 -1
  185. package/dist/DropZone.cjs +30 -33
  186. package/dist/DropZone.cjs.map +1 -1
  187. package/dist/DropZone.css +26 -26
  188. package/dist/DropZone.css.map +1 -1
  189. package/dist/DropZone.mjs +30 -33
  190. package/dist/DropZone.mjs.map +1 -1
  191. package/dist/Field.cjs +133 -131
  192. package/dist/Field.cjs.map +1 -1
  193. package/dist/Field.css +76 -84
  194. package/dist/Field.css.map +1 -1
  195. package/dist/Field.mjs +133 -131
  196. package/dist/Field.mjs.map +1 -1
  197. package/dist/Form.cjs +6 -9
  198. package/dist/Form.cjs.map +1 -1
  199. package/dist/Form.css +3 -3
  200. package/dist/Form.css.map +1 -1
  201. package/dist/Form.mjs +6 -9
  202. package/dist/Form.mjs.map +1 -1
  203. package/dist/FullscreenDialog.cjs +7 -10
  204. package/dist/FullscreenDialog.cjs.map +1 -1
  205. package/dist/FullscreenDialog.css +54 -54
  206. package/dist/FullscreenDialog.css.map +1 -1
  207. package/dist/FullscreenDialog.mjs +7 -10
  208. package/dist/FullscreenDialog.mjs.map +1 -1
  209. package/dist/IllustratedMessage.cjs +128 -132
  210. package/dist/IllustratedMessage.cjs.map +1 -1
  211. package/dist/IllustratedMessage.css +58 -58
  212. package/dist/IllustratedMessage.css.map +1 -1
  213. package/dist/IllustratedMessage.mjs +128 -132
  214. package/dist/IllustratedMessage.mjs.map +1 -1
  215. package/dist/Image.cjs +12 -13
  216. package/dist/Image.cjs.map +1 -1
  217. package/dist/Image.css +11 -11
  218. package/dist/Image.css.map +1 -1
  219. package/dist/Image.mjs +13 -14
  220. package/dist/Image.mjs.map +1 -1
  221. package/dist/InlineAlert.cjs +75 -84
  222. package/dist/InlineAlert.cjs.map +1 -1
  223. package/dist/InlineAlert.css +59 -63
  224. package/dist/InlineAlert.css.map +1 -1
  225. package/dist/InlineAlert.mjs +76 -85
  226. package/dist/InlineAlert.mjs.map +1 -1
  227. package/dist/Link.cjs +36 -39
  228. package/dist/Link.cjs.map +1 -1
  229. package/dist/Link.css +42 -42
  230. package/dist/Link.css.map +1 -1
  231. package/dist/Link.mjs +37 -40
  232. package/dist/Link.mjs.map +1 -1
  233. package/dist/Menu.cjs +322 -234
  234. package/dist/Menu.cjs.map +1 -1
  235. package/dist/Menu.css +118 -116
  236. package/dist/Menu.css.map +1 -1
  237. package/dist/Menu.mjs +323 -235
  238. package/dist/Menu.mjs.map +1 -1
  239. package/dist/Meter.cjs +66 -70
  240. package/dist/Meter.cjs.map +1 -1
  241. package/dist/Meter.css +69 -73
  242. package/dist/Meter.css.map +1 -1
  243. package/dist/Meter.mjs +66 -70
  244. package/dist/Meter.mjs.map +1 -1
  245. package/dist/Modal.cjs +36 -45
  246. package/dist/Modal.cjs.map +1 -1
  247. package/dist/Modal.css +48 -72
  248. package/dist/Modal.css.map +1 -1
  249. package/dist/Modal.mjs +37 -46
  250. package/dist/Modal.mjs.map +1 -1
  251. package/dist/NumberField.cjs +66 -69
  252. package/dist/NumberField.cjs.map +1 -1
  253. package/dist/NumberField.css +70 -70
  254. package/dist/NumberField.css.map +1 -1
  255. package/dist/NumberField.mjs +67 -70
  256. package/dist/NumberField.mjs.map +1 -1
  257. package/dist/Picker.cjs +122 -122
  258. package/dist/Picker.cjs.map +1 -1
  259. package/dist/Picker.css +84 -84
  260. package/dist/Picker.css.map +1 -1
  261. package/dist/Picker.mjs +123 -123
  262. package/dist/Picker.mjs.map +1 -1
  263. package/dist/Popover.cjs +47 -69
  264. package/dist/Popover.cjs.map +1 -1
  265. package/dist/Popover.css +55 -126
  266. package/dist/Popover.css.map +1 -1
  267. package/dist/Popover.mjs +48 -70
  268. package/dist/Popover.mjs.map +1 -1
  269. package/dist/ProgressBar.cjs +85 -87
  270. package/dist/ProgressBar.cjs.map +1 -1
  271. package/dist/ProgressBar.css +81 -85
  272. package/dist/ProgressBar.css.map +1 -1
  273. package/dist/ProgressBar.mjs +85 -87
  274. package/dist/ProgressBar.mjs.map +1 -1
  275. package/dist/ProgressCircle.cjs +16 -18
  276. package/dist/ProgressCircle.cjs.map +1 -1
  277. package/dist/ProgressCircle.css +16 -16
  278. package/dist/ProgressCircle.css.map +1 -1
  279. package/dist/ProgressCircle.mjs +16 -18
  280. package/dist/ProgressCircle.mjs.map +1 -1
  281. package/dist/Provider.cjs +5 -5
  282. package/dist/Provider.css +6 -6
  283. package/dist/Provider.mjs +5 -5
  284. package/dist/Radio.cjs +54 -58
  285. package/dist/Radio.cjs.map +1 -1
  286. package/dist/Radio.css +50 -50
  287. package/dist/Radio.css.map +1 -1
  288. package/dist/Radio.mjs +55 -59
  289. package/dist/Radio.mjs.map +1 -1
  290. package/dist/RadioGroup.cjs +39 -43
  291. package/dist/RadioGroup.cjs.map +1 -1
  292. package/dist/RadioGroup.css +32 -32
  293. package/dist/RadioGroup.css.map +1 -1
  294. package/dist/RadioGroup.mjs +40 -44
  295. package/dist/RadioGroup.mjs.map +1 -1
  296. package/dist/RangeSlider.cjs +2 -3
  297. package/dist/RangeSlider.cjs.map +1 -1
  298. package/dist/RangeSlider.mjs +3 -4
  299. package/dist/RangeSlider.mjs.map +1 -1
  300. package/dist/SearchField.cjs +34 -37
  301. package/dist/SearchField.cjs.map +1 -1
  302. package/dist/SearchField.css +30 -30
  303. package/dist/SearchField.css.map +1 -1
  304. package/dist/SearchField.mjs +35 -38
  305. package/dist/SearchField.mjs.map +1 -1
  306. package/dist/SegmentedControl.cjs +67 -73
  307. package/dist/SegmentedControl.cjs.map +1 -1
  308. package/dist/SegmentedControl.css +63 -63
  309. package/dist/SegmentedControl.css.map +1 -1
  310. package/dist/SegmentedControl.mjs +68 -74
  311. package/dist/SegmentedControl.mjs.map +1 -1
  312. package/dist/Slider.cjs +111 -112
  313. package/dist/Slider.cjs.map +1 -1
  314. package/dist/Slider.css +87 -87
  315. package/dist/Slider.css.map +1 -1
  316. package/dist/Slider.mjs +112 -113
  317. package/dist/Slider.mjs.map +1 -1
  318. package/dist/StatusLight.cjs +28 -32
  319. package/dist/StatusLight.cjs.map +1 -1
  320. package/dist/StatusLight.css +26 -26
  321. package/dist/StatusLight.css.map +1 -1
  322. package/dist/StatusLight.mjs +28 -32
  323. package/dist/StatusLight.mjs.map +1 -1
  324. package/dist/Switch.cjs +56 -60
  325. package/dist/Switch.cjs.map +1 -1
  326. package/dist/Switch.css +48 -48
  327. package/dist/Switch.css.map +1 -1
  328. package/dist/Switch.mjs +57 -61
  329. package/dist/Switch.mjs.map +1 -1
  330. package/dist/TableView.cjs +209 -196
  331. package/dist/TableView.cjs.map +1 -1
  332. package/dist/TableView.css +95 -95
  333. package/dist/TableView.css.map +1 -1
  334. package/dist/TableView.mjs +211 -198
  335. package/dist/TableView.mjs.map +1 -1
  336. package/dist/Tabs.cjs +59 -62
  337. package/dist/Tabs.cjs.map +1 -1
  338. package/dist/Tabs.css +42 -42
  339. package/dist/Tabs.css.map +1 -1
  340. package/dist/Tabs.mjs +59 -62
  341. package/dist/Tabs.mjs.map +1 -1
  342. package/dist/TagGroup.cjs +122 -124
  343. package/dist/TagGroup.cjs.map +1 -1
  344. package/dist/TagGroup.css +93 -93
  345. package/dist/TagGroup.css.map +1 -1
  346. package/dist/TagGroup.mjs +122 -124
  347. package/dist/TagGroup.mjs.map +1 -1
  348. package/dist/TextField.cjs +44 -55
  349. package/dist/TextField.cjs.map +1 -1
  350. package/dist/TextField.css +33 -33
  351. package/dist/TextField.css.map +1 -1
  352. package/dist/TextField.mjs +45 -56
  353. package/dist/TextField.mjs.map +1 -1
  354. package/dist/ToggleButton.cjs +6 -9
  355. package/dist/ToggleButton.cjs.map +1 -1
  356. package/dist/ToggleButton.css +7 -7
  357. package/dist/ToggleButton.css.map +1 -1
  358. package/dist/ToggleButton.mjs +6 -9
  359. package/dist/ToggleButton.mjs.map +1 -1
  360. package/dist/ToggleButtonGroup.cjs +2 -5
  361. package/dist/ToggleButtonGroup.cjs.map +1 -1
  362. package/dist/ToggleButtonGroup.mjs +2 -5
  363. package/dist/ToggleButtonGroup.mjs.map +1 -1
  364. package/dist/Tooltip.cjs +48 -48
  365. package/dist/Tooltip.cjs.map +1 -1
  366. package/dist/Tooltip.css +55 -70
  367. package/dist/Tooltip.css.map +1 -1
  368. package/dist/Tooltip.mjs +49 -49
  369. package/dist/Tooltip.mjs.map +1 -1
  370. package/dist/ar-AE.cjs +10 -2
  371. package/dist/ar-AE.cjs.map +1 -1
  372. package/dist/ar-AE.mjs +10 -2
  373. package/dist/ar-AE.mjs.map +1 -1
  374. package/dist/bg-BG.cjs +11 -2
  375. package/dist/bg-BG.cjs.map +1 -1
  376. package/dist/bg-BG.mjs +11 -2
  377. package/dist/bg-BG.mjs.map +1 -1
  378. package/dist/cs-CZ.cjs +7 -2
  379. package/dist/cs-CZ.cjs.map +1 -1
  380. package/dist/cs-CZ.mjs +7 -2
  381. package/dist/cs-CZ.mjs.map +1 -1
  382. package/dist/da-DK.cjs +12 -4
  383. package/dist/da-DK.cjs.map +1 -1
  384. package/dist/da-DK.mjs +12 -4
  385. package/dist/da-DK.mjs.map +1 -1
  386. package/dist/de-DE.cjs +11 -2
  387. package/dist/de-DE.cjs.map +1 -1
  388. package/dist/de-DE.mjs +11 -2
  389. package/dist/de-DE.mjs.map +1 -1
  390. package/dist/el-GR.cjs +11 -2
  391. package/dist/el-GR.cjs.map +1 -1
  392. package/dist/el-GR.mjs +11 -2
  393. package/dist/el-GR.mjs.map +1 -1
  394. package/dist/en-US.cjs +8 -0
  395. package/dist/en-US.cjs.map +1 -1
  396. package/dist/en-US.mjs +8 -0
  397. package/dist/en-US.mjs.map +1 -1
  398. package/dist/es-ES.cjs +11 -2
  399. package/dist/es-ES.cjs.map +1 -1
  400. package/dist/es-ES.mjs +11 -2
  401. package/dist/es-ES.mjs.map +1 -1
  402. package/dist/et-EE.cjs +10 -2
  403. package/dist/et-EE.cjs.map +1 -1
  404. package/dist/et-EE.mjs +10 -2
  405. package/dist/et-EE.mjs.map +1 -1
  406. package/dist/fi-FI.cjs +10 -2
  407. package/dist/fi-FI.cjs.map +1 -1
  408. package/dist/fi-FI.mjs +10 -2
  409. package/dist/fi-FI.mjs.map +1 -1
  410. package/dist/fr-FR.cjs +11 -2
  411. package/dist/fr-FR.cjs.map +1 -1
  412. package/dist/fr-FR.mjs +11 -2
  413. package/dist/fr-FR.mjs.map +1 -1
  414. package/dist/he-IL.cjs +11 -2
  415. package/dist/he-IL.cjs.map +1 -1
  416. package/dist/he-IL.mjs +11 -2
  417. package/dist/he-IL.mjs.map +1 -1
  418. package/dist/hr-HR.cjs +7 -2
  419. package/dist/hr-HR.cjs.map +1 -1
  420. package/dist/hr-HR.mjs +7 -2
  421. package/dist/hr-HR.mjs.map +1 -1
  422. package/dist/hu-HU.cjs +10 -2
  423. package/dist/hu-HU.cjs.map +1 -1
  424. package/dist/hu-HU.mjs +10 -2
  425. package/dist/hu-HU.mjs.map +1 -1
  426. package/dist/it-IT.cjs +11 -2
  427. package/dist/it-IT.cjs.map +1 -1
  428. package/dist/it-IT.mjs +11 -2
  429. package/dist/it-IT.mjs.map +1 -1
  430. package/dist/ja-JP.cjs +10 -2
  431. package/dist/ja-JP.cjs.map +1 -1
  432. package/dist/ja-JP.mjs +10 -2
  433. package/dist/ja-JP.mjs.map +1 -1
  434. package/dist/ko-KR.cjs +12 -4
  435. package/dist/ko-KR.cjs.map +1 -1
  436. package/dist/ko-KR.mjs +12 -4
  437. package/dist/ko-KR.mjs.map +1 -1
  438. package/dist/lt-LT.cjs +9 -4
  439. package/dist/lt-LT.cjs.map +1 -1
  440. package/dist/lt-LT.mjs +9 -4
  441. package/dist/lt-LT.mjs.map +1 -1
  442. package/dist/lv-LV.cjs +11 -3
  443. package/dist/lv-LV.cjs.map +1 -1
  444. package/dist/lv-LV.mjs +11 -3
  445. package/dist/lv-LV.mjs.map +1 -1
  446. package/dist/main.cjs +4 -0
  447. package/dist/main.cjs.map +1 -1
  448. package/dist/module.mjs +3 -1
  449. package/dist/module.mjs.map +1 -1
  450. package/dist/nb-NO.cjs +9 -4
  451. package/dist/nb-NO.cjs.map +1 -1
  452. package/dist/nb-NO.mjs +9 -4
  453. package/dist/nb-NO.mjs.map +1 -1
  454. package/dist/nl-NL.cjs +10 -2
  455. package/dist/nl-NL.cjs.map +1 -1
  456. package/dist/nl-NL.mjs +10 -2
  457. package/dist/nl-NL.mjs.map +1 -1
  458. package/dist/pl-PL.cjs +8 -3
  459. package/dist/pl-PL.cjs.map +1 -1
  460. package/dist/pl-PL.mjs +8 -3
  461. package/dist/pl-PL.mjs.map +1 -1
  462. package/dist/pt-BR.cjs +11 -2
  463. package/dist/pt-BR.cjs.map +1 -1
  464. package/dist/pt-BR.mjs +11 -2
  465. package/dist/pt-BR.mjs.map +1 -1
  466. package/dist/pt-PT.cjs +11 -2
  467. package/dist/pt-PT.cjs.map +1 -1
  468. package/dist/pt-PT.mjs +11 -2
  469. package/dist/pt-PT.mjs.map +1 -1
  470. package/dist/ro-RO.cjs +12 -3
  471. package/dist/ro-RO.cjs.map +1 -1
  472. package/dist/ro-RO.mjs +12 -3
  473. package/dist/ro-RO.mjs.map +1 -1
  474. package/dist/ru-RU.cjs +7 -2
  475. package/dist/ru-RU.cjs.map +1 -1
  476. package/dist/ru-RU.mjs +7 -2
  477. package/dist/ru-RU.mjs.map +1 -1
  478. package/dist/sk-SK.cjs +7 -2
  479. package/dist/sk-SK.cjs.map +1 -1
  480. package/dist/sk-SK.mjs +7 -2
  481. package/dist/sk-SK.mjs.map +1 -1
  482. package/dist/sl-SI.cjs +7 -2
  483. package/dist/sl-SI.cjs.map +1 -1
  484. package/dist/sl-SI.mjs +7 -2
  485. package/dist/sl-SI.mjs.map +1 -1
  486. package/dist/sr-SP.cjs +7 -2
  487. package/dist/sr-SP.cjs.map +1 -1
  488. package/dist/sr-SP.mjs +7 -2
  489. package/dist/sr-SP.mjs.map +1 -1
  490. package/dist/sv-SE.cjs +11 -2
  491. package/dist/sv-SE.cjs.map +1 -1
  492. package/dist/sv-SE.mjs +11 -2
  493. package/dist/sv-SE.mjs.map +1 -1
  494. package/dist/tr-TR.cjs +10 -2
  495. package/dist/tr-TR.cjs.map +1 -1
  496. package/dist/tr-TR.mjs +10 -2
  497. package/dist/tr-TR.mjs.map +1 -1
  498. package/dist/types.d.ts +109 -89
  499. package/dist/types.d.ts.map +1 -1
  500. package/dist/uk-UA.cjs +7 -2
  501. package/dist/uk-UA.cjs.map +1 -1
  502. package/dist/uk-UA.mjs +7 -2
  503. package/dist/uk-UA.mjs.map +1 -1
  504. package/dist/zh-CN.cjs +10 -2
  505. package/dist/zh-CN.cjs.map +1 -1
  506. package/dist/zh-CN.mjs +10 -2
  507. package/dist/zh-CN.mjs.map +1 -1
  508. package/dist/zh-TW.cjs +10 -2
  509. package/dist/zh-TW.cjs.map +1 -1
  510. package/dist/zh-TW.mjs +10 -2
  511. package/dist/zh-TW.mjs.map +1 -1
  512. package/icons/Skeleton.cjs +2 -2
  513. package/icons/Skeleton.css +5 -5
  514. package/icons/Skeleton.mjs +2 -2
  515. package/package.json +20 -21
  516. package/src/Accordion.tsx +5 -8
  517. package/src/ActionBar.tsx +229 -0
  518. package/src/ActionButton.tsx +25 -52
  519. package/src/ActionButtonGroup.tsx +9 -11
  520. package/src/ActionMenu.tsx +5 -8
  521. package/src/AlertDialog.tsx +5 -8
  522. package/src/Avatar.tsx +5 -8
  523. package/src/AvatarGroup.tsx +5 -8
  524. package/src/Badge.tsx +5 -8
  525. package/src/Breadcrumbs.tsx +6 -12
  526. package/src/Button.tsx +197 -154
  527. package/src/ButtonGroup.tsx +5 -8
  528. package/src/CardView.tsx +37 -12
  529. package/src/Checkbox.tsx +6 -9
  530. package/src/CheckboxGroup.tsx +6 -9
  531. package/src/ClearButton.tsx +2 -5
  532. package/src/CloseButton.tsx +21 -31
  533. package/src/ColorArea.tsx +5 -8
  534. package/src/ColorField.tsx +5 -8
  535. package/src/ColorSlider.tsx +5 -8
  536. package/src/ColorSwatch.tsx +5 -8
  537. package/src/ColorSwatchPicker.tsx +5 -8
  538. package/src/ColorWheel.tsx +5 -8
  539. package/src/ComboBox.tsx +7 -9
  540. package/src/Content.tsx +12 -30
  541. package/src/ContextualHelp.tsx +5 -8
  542. package/src/CustomDialog.tsx +5 -8
  543. package/src/Dialog.tsx +6 -9
  544. package/src/Disclosure.tsx +15 -24
  545. package/src/Divider.tsx +16 -25
  546. package/src/DropZone.tsx +5 -8
  547. package/src/Field.tsx +25 -32
  548. package/src/Form.tsx +5 -8
  549. package/src/FullscreenDialog.tsx +5 -8
  550. package/src/IllustratedMessage.tsx +6 -9
  551. package/src/Image.tsx +3 -6
  552. package/src/InlineAlert.tsx +6 -10
  553. package/src/Link.tsx +13 -21
  554. package/src/Menu.tsx +69 -33
  555. package/src/Meter.tsx +13 -23
  556. package/src/Modal.tsx +22 -52
  557. package/src/NumberField.tsx +5 -8
  558. package/src/Picker.tsx +7 -9
  559. package/src/Popover.tsx +30 -104
  560. package/src/ProgressBar.tsx +14 -24
  561. package/src/ProgressCircle.tsx +18 -24
  562. package/src/Radio.tsx +6 -9
  563. package/src/RadioGroup.tsx +6 -9
  564. package/src/RangeSlider.tsx +2 -5
  565. package/src/SearchField.tsx +5 -8
  566. package/src/SegmentedControl.tsx +10 -16
  567. package/src/Slider.tsx +2 -5
  568. package/src/StatusLight.tsx +6 -9
  569. package/src/Switch.tsx +6 -9
  570. package/src/TableView.tsx +53 -50
  571. package/src/Tabs.tsx +5 -8
  572. package/src/TagGroup.tsx +7 -14
  573. package/src/TextField.tsx +20 -28
  574. package/src/ToggleButton.tsx +7 -9
  575. package/src/ToggleButtonGroup.tsx +5 -8
  576. package/src/Tooltip.tsx +30 -51
  577. package/src/bar-utils.ts +3 -10
  578. package/src/index.ts +2 -0
  579. package/src/style-utils.ts +15 -8
  580. package/style/dist/main.cjs +1 -0
  581. package/style/dist/main.cjs.map +1 -1
  582. package/style/dist/module.mjs +2 -2
  583. package/style/dist/module.mjs.map +1 -1
  584. package/style/dist/spectrum-theme.cjs +72 -5
  585. package/style/dist/spectrum-theme.cjs.map +1 -1
  586. package/style/dist/spectrum-theme.mjs +72 -6
  587. package/style/dist/spectrum-theme.mjs.map +1 -1
  588. package/style/dist/style-macro.cjs +13 -1
  589. package/style/dist/style-macro.cjs.map +1 -1
  590. package/style/dist/style-macro.mjs +13 -1
  591. package/style/dist/style-macro.mjs.map +1 -1
  592. package/style/dist/types.d.ts +50 -29
  593. package/style/dist/types.d.ts.map +1 -1
  594. package/style/index.ts +1 -1
  595. package/style/spectrum-theme.ts +72 -7
  596. package/style/style-macro.ts +20 -4
  597. package/style/tokens.ts +30 -0
  598. package/style/types.ts +1 -1
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqDM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAmE;AACrG,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAmE;AAEhH,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SAAS,IAAI,qBAAqB,UAAU;gBACnE,SAAS,MAAM,OAAO,IAAI;gBAC1B,WAAW,MAAM,SAAS,IAAI;gBAC9B,MAAM,MAAM,IAAI,IAAI;gBACpB,aAAa,MAAM,WAAW;gBAC9B,WAAW;YACb,GAAG,MAAM,MAAM;kBACf,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAc;oBAAG;iBAAK;gBACvB;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,MAAM;wBACN,kHAAkH;wBAClH,iBAAiB;oBACnB;iBAAE;gBACF;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,MAAM;oBACR;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0BAAG,MAAM,QAAQ;iBAAW,MAAM,QAAQ;;;AAI5F;AAEA;;CAEC,GACD,IAAI,0DAAc,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Button.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 {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonStyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button.\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'accent' | 'negative',\n /**\n * The background style of the Button.\n *\n * @default 'fill'\n */\n fillStyle?: 'fill' | 'outline',\n /**\n * The size of the Button.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the Button appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\nexport interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);\nexport const LinkButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLAnchorElement>>>(null);\n\nconst iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';\nconst button = style<ButtonRenderProps & ButtonStyleProps>({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n alignItems: {\n default: 'baseline',\n [iconOnly]: 'center'\n },\n justifyContent: 'center',\n textAlign: 'start',\n columnGap: 'text-to-visual',\n font: 'control',\n fontWeight: 'bold',\n userSelect: 'none',\n minHeight: 'control',\n minWidth: {\n [iconOnly]: 'control'\n },\n borderRadius: 'pill',\n boxSizing: 'border-box',\n width: 'fit',\n textDecoration: 'none', // for link buttons\n paddingX: {\n default: 'pill',\n [iconOnly]: 0\n },\n paddingY: 0,\n aspectRatio: {\n [iconOnly]: 'square'\n },\n transition: 'default',\n borderStyle: 'solid',\n borderWidth: {\n fillStyle: {\n fill: 0,\n outline: 2\n }\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n borderColor: {\n variant: {\n primary: baseColor('gray-800'),\n secondary: baseColor('gray-300')\n },\n isDisabled: 'disabled',\n staticColor: {\n white: {\n variant: {\n primary: baseColor('transparent-white-800'),\n secondary: baseColor('transparent-white-300')\n },\n isDisabled: 'transparent-white-300'\n },\n black: {\n variant: {\n primary: baseColor('transparent-black-800'),\n secondary: baseColor('transparent-black-300')\n },\n isDisabled: 'transparent-black-300'\n }\n },\n forcedColors: {\n default: 'ButtonBorder',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'neutral',\n secondary: baseColor('gray-100'),\n accent: 'accent',\n negative: 'negative'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: 'transparent'\n }\n },\n staticColor: {\n white: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-white-800'),\n secondary: baseColor('transparent-white-100')\n },\n isDisabled: 'transparent-white-100'\n },\n outline: {\n default: 'transparent',\n isHovered: 'transparent-white-100',\n isPressed: 'transparent-white-100',\n isFocusVisible: 'transparent-white-100',\n isDisabled: 'transparent'\n }\n }\n },\n black: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-black-800'),\n secondary: baseColor('transparent-black-100')\n },\n isDisabled: 'transparent-black-100'\n },\n outline: {\n default: 'transparent',\n isHovered: 'transparent-black-100',\n isPressed: 'transparent-black-100',\n isFocusVisible: 'transparent-black-100',\n isDisabled: 'transparent'\n }\n }\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n },\n outline: 'ButtonFace'\n }\n }\n },\n color: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'gray-25',\n secondary: 'neutral',\n accent: 'white',\n negative: 'white'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n isDisabled: 'disabled'\n }\n },\n staticColor: {\n white: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'black',\n secondary: baseColor('transparent-white-800')\n }\n },\n outline: baseColor('transparent-white-800')\n },\n isDisabled: 'transparent-white-400'\n },\n black: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'white',\n secondary: baseColor('transparent-black-800')\n }\n },\n outline: baseColor('transparent-black-800')\n },\n isDisabled: 'transparent-black-400'\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonFace',\n isDisabled: 'HighlightText'\n },\n outline: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n staticColor: {\n white: 'white',\n black: 'black'\n },\n forcedColors: 'Highlight'\n },\n forcedColorAdjust: 'none',\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nfunction Button(props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonContext);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isPending,\n variant = 'primary',\n fillStyle = 'fill',\n size = 'M',\n staticColor\n } = props;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n let [isProgressVisible, setIsProgressVisible] = useState(false);\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n\n if (isPending) {\n // Start timer when isPending is set to true.\n timeout = setTimeout(() => {\n setIsProgressVisible(true);\n }, 1000);\n } else {\n // Exit loading state when isPending is set to false. */\n setIsProgressVisible(false);\n }\n return () => {\n // Clean up on unmount or when user removes isPending prop before entering loading state.\n clearTimeout(timeout);\n };\n }, [isPending]);\n\n return (\n <RACButton\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant,\n fillStyle,\n size,\n staticColor\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({\n paddingY: '--labelPadding',\n order: 1,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n flexShrink: 0,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n {isPending &&\n <div\n className={style({\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translate(-50%, -50%)',\n opacity: {\n default: 0,\n isProgressVisible: 1\n }\n })({isProgressVisible, isPending})}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('button.pending')}\n size=\"S\"\n staticColor={staticColor}\n styles={style({\n size: {\n size: {\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})} />\n </div>\n }\n </Provider>\n </RACButton>\n );\n}\n\n/**\n * Buttons allow users to perform an action.\n * They have multiple styles for various needs, and are ideal for calling attention to\n * where a user needs to do something in order to move forward in a flow.\n */\nlet _Button = forwardRef(Button);\nexport {_Button as Button};\n\nfunction LinkButton(props: LinkButtonProps, ref: FocusableRef<HTMLAnchorElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, LinkButtonContext);\n props = useFormProps(props);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n return (\n <Link\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n variant: props.variant || 'primary',\n fillStyle: props.fillStyle || 'fill',\n size: props.size || 'M',\n staticColor: props.staticColor,\n isPending: false\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({paddingY: '--labelPadding', order: 1}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </Link>\n );\n}\n\n/**\n * A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.\n */\nlet _LinkButton = forwardRef(LinkButton);\nexport {_LinkButton as LinkButton};\n"],"names":[],"version":3,"file":"Button.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqDM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAmE;AACrG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MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0BAAG,MAAM,QAAQ;iBAAW,MAAM,QAAQ;;;AAI5F","sources":["packages/@react-spectrum/s2/src/Button.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 {baseColor, focusRing, fontRelative, linearGradient, style} from '../style' with {type: 'macro'};\nimport {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonStyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button.\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'accent' | 'negative' | 'premium' | 'genai',\n /**\n * The background style of the Button.\n *\n * @default 'fill'\n */\n fillStyle?: 'fill' | 'outline',\n /**\n * The size of the Button.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the Button appears over a color background. */\n staticColor?: 'white' | 'black' | 'auto'\n}\n\nexport interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);\nexport const LinkButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLAnchorElement>>>(null);\n\nconst iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';\nconst button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n position: 'relative',\n display: 'flex',\n alignItems: {\n default: 'baseline',\n [iconOnly]: 'center'\n },\n justifyContent: 'center',\n textAlign: 'start',\n columnGap: 'text-to-visual',\n font: 'control',\n fontWeight: 'bold',\n userSelect: 'none',\n minHeight: 'control',\n minWidth: {\n [iconOnly]: 'control'\n },\n borderRadius: 'pill',\n boxSizing: 'border-box',\n width: 'fit',\n textDecoration: 'none', // for link buttons\n paddingX: {\n default: 'pill',\n [iconOnly]: 0\n },\n paddingY: 0,\n aspectRatio: {\n [iconOnly]: 'square'\n },\n transition: 'default',\n borderStyle: 'solid',\n borderWidth: {\n fillStyle: {\n fill: 0,\n outline: 2\n },\n variant: {\n premium: 0,\n genai: 0\n }\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n borderColor: {\n variant: {\n primary: baseColor('gray-800'),\n secondary: baseColor('gray-300')\n },\n isDisabled: 'disabled',\n isStaticColor: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-300')\n },\n isDisabled: 'transparent-overlay-300'\n },\n forcedColors: {\n default: 'ButtonBorder',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'neutral',\n secondary: baseColor('gray-100'),\n accent: 'accent',\n negative: 'negative',\n premium: 'gray-100',\n genai: 'gray-100'\n },\n isDisabled: 'disabled'\n },\n outline: {\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n },\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: {\n default: 'transparent',\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n }\n }\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-100'),\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n },\n isDisabled: 'transparent-overlay-100'\n },\n outline: {\n variant: {\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n },\n default: 'transparent',\n isHovered: 'transparent-overlay-100',\n isPressed: 'transparent-overlay-100',\n isFocusVisible: 'transparent-overlay-100',\n isDisabled: {\n default: 'transparent',\n variant: {\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n }\n }\n }\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n },\n outline: 'ButtonFace'\n }\n }\n },\n color: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'gray-25',\n secondary: 'neutral',\n accent: 'white',\n negative: 'white',\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n variant: {\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'auto',\n secondary: baseColor('transparent-overlay-800'),\n premium: 'white',\n genai: 'white'\n }\n },\n outline: {\n variant: {\n premium: 'white',\n genai: 'white'\n },\n default: baseColor('transparent-overlay-800')\n }\n },\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonFace',\n isDisabled: 'HighlightText'\n },\n outline: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n forcedColorAdjust: 'none',\n disableTapHighlight: true\n}, getAllowedOverrides());\n\n// Put the gradient background on a separate element from the button to work around a Safari\n// bug where transitions of custom properties cause layout flickering if any properties use rems. 🤣\n// https://bugs.webkit.org/show_bug.cgi?id=285622\nconst gradient = style({\n position: 'absolute',\n inset: 0,\n zIndex: -1,\n transition: 'default',\n borderRadius: '[inherit]',\n backgroundImage: {\n variant: {\n premium: {\n default: linearGradient('to bottom right', ['fuchsia-900', 0], ['indigo-900', 66], ['blue-900', 100]),\n isHovered: linearGradient('to bottom right', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isPressed: linearGradient('to bottom right', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isFocusVisible: linearGradient('to bottom right', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100])\n },\n genai: {\n default: linearGradient('to bottom right', ['red-900', 0], ['magenta-900', 33], ['indigo-900', 100]),\n isHovered: linearGradient('to bottom right', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isPressed: linearGradient('to bottom right', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isFocusVisible: linearGradient('to bottom right', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100])\n }\n },\n isDisabled: 'none',\n forcedColors: 'none'\n },\n // Force gradient colors to remain static between light and dark theme.\n colorScheme: {\n variant: {\n premium: 'light',\n genai: 'light'\n }\n }\n});\n\n/**\n * Buttons allow users to perform an action.\n * They have multiple styles for various needs, and are ideal for calling attention to\n * where a user needs to do something in order to move forward in a flow.\n */\nexport const Button = forwardRef(function Button(props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonContext);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isPending,\n variant = 'primary',\n fillStyle = 'fill',\n size = 'M',\n staticColor\n } = props;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n let [isProgressVisible, setIsProgressVisible] = useState(false);\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n\n if (isPending) {\n // Start timer when isPending is set to true.\n timeout = setTimeout(() => {\n setIsProgressVisible(true);\n }, 1000);\n } else {\n // Exit loading state when isPending is set to false. */\n setIsProgressVisible(false);\n }\n return () => {\n // Clean up on unmount or when user removes isPending prop before entering loading state.\n clearTimeout(timeout);\n };\n }, [isPending]);\n\n return (\n <RACButton\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant,\n fillStyle,\n size,\n staticColor,\n isStaticColor: !!staticColor\n }, props.styles)}>\n {(renderProps) => (<>\n {variant === 'genai' || variant === 'premium' \n ? (\n <span\n className={gradient({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant\n })} />\n )\n : null}\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({\n paddingY: '--labelPadding',\n order: 1,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n flexShrink: 0,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n {isPending &&\n <div\n className={style({\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translate(-50%, -50%)',\n opacity: {\n default: 0,\n isProgressVisible: 1\n }\n })({isProgressVisible, isPending})}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('button.pending')}\n size=\"S\"\n staticColor={staticColor}\n styles={style({\n size: {\n size: {\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})} />\n </div>\n }\n </Provider>\n </>)}\n </RACButton>\n );\n});\n\n/**\n * A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.\n */\nexport const LinkButton = forwardRef(function LinkButton(props: LinkButtonProps, ref: FocusableRef<HTMLAnchorElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, LinkButtonContext);\n props = useFormProps(props);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n return (\n <Link\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n variant: props.variant || 'primary',\n fillStyle: props.fillStyle || 'fill',\n size: props.size || 'M',\n staticColor: props.staticColor,\n isStaticColor: !!props.staticColor,\n isPending: false\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({paddingY: '--labelPadding', order: 1}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </Link>\n );\n});\n"],"names":[],"version":3,"file":"Button.mjs.map"}
@@ -34,12 +34,12 @@ $parcel$export(module.exports, "ButtonGroup", () => $e1016b8947dbadb8$export$69b
34
34
  const $e1016b8947dbadb8$export$4c574c91bb0be0e2 = /*#__PURE__*/ (0, $5rFNy$react.createContext)({});
35
35
  const $e1016b8947dbadb8$var$buttongroup = function anonymous(props, overrides) {
36
36
  let rules = " .";
37
- let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
37
+ let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
38
38
  rules += matches.join('');
39
- let $U = false;
40
- for (let p of matches)if (/^\s*U/.test(p)) $U = true;
41
- rules += ' _Ze';
42
- if (!$U) rules += ' Uc';
39
+ let $V = false;
40
+ for (let p of matches)if (/^\s*V/.test(p)) $V = true;
41
+ rules += ' _0e';
42
+ if (!$V) rules += ' Vc';
43
43
  if (props.size === "XL") rules += ' ie';
44
44
  else if (props.size === "L") rules += ' ie';
45
45
  else if (props.size === "M") rules += ' ie';
@@ -48,21 +48,21 @@ const $e1016b8947dbadb8$var$buttongroup = function anonymous(props, overrides) {
48
48
  else if (props.size === "L") rules += ' je';
49
49
  else if (props.size === "M") rules += ' je';
50
50
  else if (props.size === "S") rules += ' jd';
51
- if (props.orientation === "vertical") rules += ' _6b';
52
- else rules += ' _6a';
51
+ if (props.orientation === "vertical") rules += ' _7b';
52
+ else rules += ' _7a';
53
53
  if (props.orientation === "vertical") {
54
- if (props.align === "center") rules += ' _1c';
55
- else if (props.align === "end") rules += ' _1b';
56
- else rules += ' _1a';
57
- } else rules += ' _1c';
54
+ if (props.align === "center") rules += ' _2c';
55
+ else if (props.align === "end") rules += ' _2b';
56
+ else rules += ' _2a';
57
+ } else rules += ' _2c';
58
58
  if (props.orientation === "vertical") {
59
- if (props.align === "center") rules += ' _2d';
60
- else if (props.align === "end") rules += ' _2c';
61
- else rules += ' _2b';
59
+ if (props.align === "center") rules += ' _3d';
60
+ else if (props.align === "end") rules += ' _3c';
61
+ else rules += ' _3b';
62
62
  }
63
63
  return rules;
64
64
  };
65
- function $e1016b8947dbadb8$var$ButtonGroup(props, ref) {
65
+ const $e1016b8947dbadb8$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $5rFNy$react.forwardRef)(function ButtonGroup(props, ref) {
66
66
  [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $e1016b8947dbadb8$export$4c574c91bb0be0e2);
67
67
  let domRef = (0, $5rFNy$reactspectrumutils.useDOMRef)(ref);
68
68
  let { size: size = 'M', orientation: orientation = 'horizontal', align: align = 'start', children: children, isDisabled: isDisabled } = props;
@@ -112,7 +112,7 @@ function $e1016b8947dbadb8$var$ButtonGroup(props, ref) {
112
112
  });
113
113
  if (props.isHidden) return null;
114
114
  let context = {
115
- styles: " . _8-3t1x",
115
+ styles: " . _9-3t1x",
116
116
  size: size,
117
117
  isDisabled: isDisabled
118
118
  };
@@ -138,10 +138,7 @@ function $e1016b8947dbadb8$var$ButtonGroup(props, ref) {
138
138
  children: children
139
139
  })
140
140
  });
141
- }
142
- /**
143
- * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
144
- */ const $e1016b8947dbadb8$export$69b1032f2ecdf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ACF,GAAG;QAAC;KAAiB;IAErB,wKAAwK;IACxK,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAsB;IACxC,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,OAAO,OAAO,EAChB,OAAO,OAAO,GAAG,OAAO,OAAO,CAAC,aAAa;IAEjD,uDAAuD;IACvD,GAAG;QAAC,OAAO,OAAO;KAAC;IACnB,CAAA,GAAA,2CAAgB,EAAE;QAAC,KAAK;QAAQ,UAAU;IAAgB;IAE1D,IAAI,AAAC,MAAkC,QAAQ,EAC7C,OAAO;IAGT,IAAI,UAAU;QAAC,MAAM;cAA0B;oBAAM;IAAU;IAC/D,qBACE,gCAAC;QACC,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,kCAAY;mBACtD;YACA,aAAa,gBAAgB,cAAc,cAAc,aAAa;kBACtE;QACF,GAAG,MAAM,MAAM;kBACf,cAAA,gCAAC,CAAA,GAAA,mCAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,uCAAY;oBAAG;iBAAQ;gBACxB;oBAAC,CAAA,GAAA,2CAAgB;oBAAG;iBAAQ;aAC7B;sBACA;;;AAIT;AAEA;;CAEC,GACD,MAAM,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ButtonGroup.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 {ButtonContext, LinkButtonContext} from './Button';\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {\n useDOMRef,\n useResizeObserver\n} from '@react-spectrum/utils';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonGroupStyleProps {\n /**\n * The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent\n * any switching behaviors between 'vertical' and 'horizontal'.\n *\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /**\n * The alignment of the Buttons within the ButtonGroup.\n *\n * @default 'start'\n */\n align?: 'start' | 'end' | 'center',\n /**\n * The size of the Buttons within the ButtonGroup.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface ButtonGroupProps extends ButtonGroupStyleProps, SlotProps, StyleProps, DOMProps {\n /** The Buttons contained within the ButtonGroup. */\n children: ReactNode,\n /** Whether the Buttons in the ButtonGroup are all disabled. */\n isDisabled?: boolean\n}\n\ninterface ButtonGroupContextValue extends Partial<ButtonGroupProps> {\n /** Whether the ButtonGroup shouldn't be rendered. */\n isHidden?: boolean\n}\n\nexport const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});\n\nconst buttongroup = style<ButtonGroupStyleProps>({\n display: 'inline-flex',\n position: 'relative',\n gap: {\n size: {\n S: 8,\n M: 12,\n L: 12,\n XL: 12\n }\n },\n flexDirection: {\n default: 'row',\n orientation: {\n vertical: 'column'\n }\n },\n alignItems: {\n default: 'center',\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n },\n justifyContent: {\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction ButtonGroup(props: ButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonGroupContext);\n let domRef = useDOMRef(ref);\n let {\n size = 'M',\n orientation = 'horizontal',\n align = 'start',\n children,\n isDisabled\n } = props;\n\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n if ((props as ButtonGroupContextValue).isHidden) {\n return null;\n }\n\n let context = {styles: style({flexShrink: 0}), size, isDisabled};\n return (\n <div\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + buttongroup({\n align,\n orientation: orientation === 'vertical' || hasOverflow ? 'vertical' : 'horizontal',\n size\n }, props.styles)}>\n <Provider\n values={[\n [ButtonContext, context],\n [LinkButtonContext, context]\n ]}>\n {children}\n </Provider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nconst _ButtonGroup = forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n"],"names":[],"version":3,"file":"ButtonGroup.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiDM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsE,CAAC;AAErH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CC,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAA2B;IAC7G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,QACF,OAAO,kBACP,cAAc,qBACd,QAAQ,mBACR,QAAQ,cACR,UAAU,EACX,GAAG;IAEJ,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,oCAAa,EAAE;IAEnD,IAAI,mBAAmB,CAAA,GAAA,wBAAU,EAAE;QACjC,IAAI,qBAAqB;YACvB,IAAI,OAAO,OAAO,IAAI,gBAAgB,cAAc;gBAClD,IAAI,sBAAsB,MAAM,IAAI,CAAC,OAAO,OAAO,CAAC,QAAQ;gBAC5D,IAAI,OAAO,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,qCAAqC;gBAChF,0EAA0E;gBAC1E,0EAA0E;gBAC1E,IAAI,oBAAoB,IAAI,CAAC,CAAA,QAAS,MAAM,UAAU,GAAG,KAAK,MAAM,UAAU,GAAG,MAAM,WAAW,GAAG,OACnG,OAAO;gBAET,OAAO;YACT;QACF;QACA,IAAI,gBAAgB,cAClB,eAAe;YACb,uCAAuC;YACvC,MAAM;YAEN,4CAA4C;YAC5C,MAAM;QACR;IAEJ,uDAAuD;IACvD,GAAG;QAAC;QAAQ;QAAa;QAAgB;KAAS;IAElD,mDAAmD;IACnD,8HAA8H;IAC9H,CAAA,GAAA,qCAAc,EAAE;QACd;IACF,GAAG;QAAC;KAAiB;IAErB,wKAAwK;IACxK,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAsB;IACxC,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,OAAO,OAAO,EAChB,OAAO,OAAO,GAAG,OAAO,OAAO,CAAC,aAAa;IAEjD,uDAAuD;IACvD,GAAG;QAAC,OAAO,OAAO;KAAC;IACnB,CAAA,GAAA,2CAAgB,EAAE;QAAC,KAAK;QAAQ,UAAU;IAAgB;IAE1D,IAAI,AAAC,MAAkC,QAAQ,EAC7C,OAAO;IAGT,IAAI,UAAU;QAAC,MAAM;cAA0B;oBAAM;IAAU;IAC/D,qBACE,gCAAC;QACC,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,kCAAY;mBACtD;YACA,aAAa,gBAAgB,cAAc,cAAc,aAAa;kBACtE;QACF,GAAG,MAAM,MAAM;kBACf,cAAA,gCAAC,CAAA,GAAA,mCAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,uCAAY;oBAAG;iBAAQ;gBACxB;oBAAC,CAAA,GAAA,2CAAgB;oBAAG;iBAAQ;aAC7B;sBACA;;;AAIT","sources":["packages/@react-spectrum/s2/src/ButtonGroup.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 {ButtonContext, LinkButtonContext} from './Button';\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {\n useDOMRef,\n useResizeObserver\n} from '@react-spectrum/utils';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonGroupStyleProps {\n /**\n * The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent\n * any switching behaviors between 'vertical' and 'horizontal'.\n *\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /**\n * The alignment of the Buttons within the ButtonGroup.\n *\n * @default 'start'\n */\n align?: 'start' | 'end' | 'center',\n /**\n * The size of the Buttons within the ButtonGroup.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface ButtonGroupProps extends ButtonGroupStyleProps, SlotProps, StyleProps, DOMProps {\n /** The Buttons contained within the ButtonGroup. */\n children: ReactNode,\n /** Whether the Buttons in the ButtonGroup are all disabled. */\n isDisabled?: boolean\n}\n\ninterface ButtonGroupContextValue extends Partial<ButtonGroupProps> {\n /** Whether the ButtonGroup shouldn't be rendered. */\n isHidden?: boolean\n}\n\nexport const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});\n\nconst buttongroup = style<ButtonGroupStyleProps>({\n display: 'inline-flex',\n position: 'relative',\n gap: {\n size: {\n S: 8,\n M: 12,\n L: 12,\n XL: 12\n }\n },\n flexDirection: {\n default: 'row',\n orientation: {\n vertical: 'column'\n }\n },\n alignItems: {\n default: 'center',\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n },\n justifyContent: {\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nexport const ButtonGroup = forwardRef(function ButtonGroup(props: ButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonGroupContext);\n let domRef = useDOMRef(ref);\n let {\n size = 'M',\n orientation = 'horizontal',\n align = 'start',\n children,\n isDisabled\n } = props;\n\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n if ((props as ButtonGroupContextValue).isHidden) {\n return null;\n }\n\n let context = {styles: style({flexShrink: 0}), size, isDisabled};\n return (\n <div\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + buttongroup({\n align,\n orientation: orientation === 'vertical' || hasOverflow ? 'vertical' : 'horizontal',\n size\n }, props.styles)}>\n <Provider\n values={[\n [ButtonContext, context],\n [LinkButtonContext, context]\n ]}>\n {children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ButtonGroup.cjs.map"}
@@ -1,9 +1,9 @@
1
1
  @layer _.a {
2
- ._Ze {
2
+ ._0e {
3
3
  display: inline-flex;
4
4
  }
5
5
 
6
- .Uc {
6
+ .Vc {
7
7
  position: relative;
8
8
  }
9
9
 
@@ -23,39 +23,39 @@
23
23
  column-gap: .75rem;
24
24
  }
25
25
 
26
- ._6a {
26
+ ._7a {
27
27
  flex-direction: row;
28
28
  }
29
29
 
30
- ._6b {
30
+ ._7b {
31
31
  flex-direction: column;
32
32
  }
33
33
 
34
- ._1a {
34
+ ._2a {
35
35
  align-items: start;
36
36
  }
37
37
 
38
- ._1b {
38
+ ._2b {
39
39
  align-items: end;
40
40
  }
41
41
 
42
- ._1c {
42
+ ._2c {
43
43
  align-items: center;
44
44
  }
45
45
 
46
- ._2b {
46
+ ._3b {
47
47
  justify-content: start;
48
48
  }
49
49
 
50
- ._2c {
50
+ ._3c {
51
51
  justify-content: end;
52
52
  }
53
53
 
54
- ._2d {
54
+ ._3d {
55
55
  justify-content: center;
56
56
  }
57
57
 
58
- ._8-3t1x {
58
+ ._9-3t1x {
59
59
  flex-shrink: 0;
60
60
  }
61
61
  }
@@ -1 +1 @@
1
- {"mappings":"AC6DoB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoGK;;;;;AApGL;;AAoGK","sources":["46da5d9d2ee61a4a","packages/@react-spectrum/s2/src/ButtonGroup.tsx"],"sourcesContent":["@import \"8be38106edd06864\";\n@import \"d77a01524490dd5a\";\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 {ButtonContext, LinkButtonContext} from './Button';\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {\n useDOMRef,\n useResizeObserver\n} from '@react-spectrum/utils';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonGroupStyleProps {\n /**\n * The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent\n * any switching behaviors between 'vertical' and 'horizontal'.\n *\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /**\n * The alignment of the Buttons within the ButtonGroup.\n *\n * @default 'start'\n */\n align?: 'start' | 'end' | 'center',\n /**\n * The size of the Buttons within the ButtonGroup.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface ButtonGroupProps extends ButtonGroupStyleProps, SlotProps, StyleProps, DOMProps {\n /** The Buttons contained within the ButtonGroup. */\n children: ReactNode,\n /** Whether the Buttons in the ButtonGroup are all disabled. */\n isDisabled?: boolean\n}\n\ninterface ButtonGroupContextValue extends Partial<ButtonGroupProps> {\n /** Whether the ButtonGroup shouldn't be rendered. */\n isHidden?: boolean\n}\n\nexport const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});\n\nconst buttongroup = style<ButtonGroupStyleProps>({\n display: 'inline-flex',\n position: 'relative',\n gap: {\n size: {\n S: 8,\n M: 12,\n L: 12,\n XL: 12\n }\n },\n flexDirection: {\n default: 'row',\n orientation: {\n vertical: 'column'\n }\n },\n alignItems: {\n default: 'center',\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n },\n justifyContent: {\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction ButtonGroup(props: ButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonGroupContext);\n let domRef = useDOMRef(ref);\n let {\n size = 'M',\n orientation = 'horizontal',\n align = 'start',\n children,\n isDisabled\n } = props;\n\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n if ((props as ButtonGroupContextValue).isHidden) {\n return null;\n }\n\n let context = {styles: style({flexShrink: 0}), size, isDisabled};\n return (\n <div\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + buttongroup({\n align,\n orientation: orientation === 'vertical' || hasOverflow ? 'vertical' : 'horizontal',\n size\n }, props.styles)}>\n <Provider\n values={[\n [ButtonContext, context],\n [LinkButtonContext, context]\n ]}>\n {children}\n </Provider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nconst _ButtonGroup = forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n"],"names":[],"version":3,"file":"ButtonGroup.css.map"}
1
+ {"mappings":"AC6DoB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuGK;;;;;AAvGL;;AAuGK","sources":["46da5d9d2ee61a4a","packages/@react-spectrum/s2/src/ButtonGroup.tsx"],"sourcesContent":["@import \"8be38106edd06864\";\n@import \"d77a01524490dd5a\";\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 {ButtonContext, LinkButtonContext} from './Button';\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {\n useDOMRef,\n useResizeObserver\n} from '@react-spectrum/utils';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonGroupStyleProps {\n /**\n * The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent\n * any switching behaviors between 'vertical' and 'horizontal'.\n *\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /**\n * The alignment of the Buttons within the ButtonGroup.\n *\n * @default 'start'\n */\n align?: 'start' | 'end' | 'center',\n /**\n * The size of the Buttons within the ButtonGroup.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface ButtonGroupProps extends ButtonGroupStyleProps, SlotProps, StyleProps, DOMProps {\n /** The Buttons contained within the ButtonGroup. */\n children: ReactNode,\n /** Whether the Buttons in the ButtonGroup are all disabled. */\n isDisabled?: boolean\n}\n\ninterface ButtonGroupContextValue extends Partial<ButtonGroupProps> {\n /** Whether the ButtonGroup shouldn't be rendered. */\n isHidden?: boolean\n}\n\nexport const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});\n\nconst buttongroup = style<ButtonGroupStyleProps>({\n display: 'inline-flex',\n position: 'relative',\n gap: {\n size: {\n S: 8,\n M: 12,\n L: 12,\n XL: 12\n }\n },\n flexDirection: {\n default: 'row',\n orientation: {\n vertical: 'column'\n }\n },\n alignItems: {\n default: 'center',\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n },\n justifyContent: {\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nexport const ButtonGroup = forwardRef(function ButtonGroup(props: ButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonGroupContext);\n let domRef = useDOMRef(ref);\n let {\n size = 'M',\n orientation = 'horizontal',\n align = 'start',\n children,\n isDisabled\n } = props;\n\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n if ((props as ButtonGroupContextValue).isHidden) {\n return null;\n }\n\n let context = {styles: style({flexShrink: 0}), size, isDisabled};\n return (\n <div\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + buttongroup({\n align,\n orientation: orientation === 'vertical' || hasOverflow ? 'vertical' : 'horizontal',\n size\n }, props.styles)}>\n <Provider\n values={[\n [ButtonContext, context],\n [LinkButtonContext, context]\n ]}>\n {children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ButtonGroup.css.map"}
@@ -3,7 +3,7 @@ import {ButtonContext as $067ea9f64ccd4e8e$export$24d547caef80ccd1, LinkButtonCo
3
3
  import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
4
4
  import {jsx as $bnJX2$jsx} from "react/jsx-runtime";
5
5
  import {Provider as $bnJX2$Provider} from "react-aria-components";
6
- import {createContext as $bnJX2$createContext, useCallback as $bnJX2$useCallback, useRef as $bnJX2$useRef, forwardRef as $bnJX2$forwardRef} from "react";
6
+ import {createContext as $bnJX2$createContext, forwardRef as $bnJX2$forwardRef, useCallback as $bnJX2$useCallback, useRef as $bnJX2$useRef} from "react";
7
7
  import {useDOMRef as $bnJX2$useDOMRef, useResizeObserver as $bnJX2$useResizeObserver} from "@react-spectrum/utils";
8
8
  import {useValueEffect as $bnJX2$useValueEffect, useLayoutEffect as $bnJX2$useLayoutEffect} from "@react-aria/utils";
9
9
 
@@ -27,12 +27,12 @@ import {useValueEffect as $bnJX2$useValueEffect, useLayoutEffect as $bnJX2$useLa
27
27
  const $472eaa9a9b344b9a$export$4c574c91bb0be0e2 = /*#__PURE__*/ (0, $bnJX2$createContext)({});
28
28
  const $472eaa9a9b344b9a$var$buttongroup = function anonymous(props, overrides) {
29
29
  let rules = " .";
30
- let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
30
+ let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
31
31
  rules += matches.join('');
32
- let $U = false;
33
- for (let p of matches)if (/^\s*U/.test(p)) $U = true;
34
- rules += ' _Ze';
35
- if (!$U) rules += ' Uc';
32
+ let $V = false;
33
+ for (let p of matches)if (/^\s*V/.test(p)) $V = true;
34
+ rules += ' _0e';
35
+ if (!$V) rules += ' Vc';
36
36
  if (props.size === "XL") rules += ' ie';
37
37
  else if (props.size === "L") rules += ' ie';
38
38
  else if (props.size === "M") rules += ' ie';
@@ -41,21 +41,21 @@ const $472eaa9a9b344b9a$var$buttongroup = function anonymous(props, overrides) {
41
41
  else if (props.size === "L") rules += ' je';
42
42
  else if (props.size === "M") rules += ' je';
43
43
  else if (props.size === "S") rules += ' jd';
44
- if (props.orientation === "vertical") rules += ' _6b';
45
- else rules += ' _6a';
44
+ if (props.orientation === "vertical") rules += ' _7b';
45
+ else rules += ' _7a';
46
46
  if (props.orientation === "vertical") {
47
- if (props.align === "center") rules += ' _1c';
48
- else if (props.align === "end") rules += ' _1b';
49
- else rules += ' _1a';
50
- } else rules += ' _1c';
47
+ if (props.align === "center") rules += ' _2c';
48
+ else if (props.align === "end") rules += ' _2b';
49
+ else rules += ' _2a';
50
+ } else rules += ' _2c';
51
51
  if (props.orientation === "vertical") {
52
- if (props.align === "center") rules += ' _2d';
53
- else if (props.align === "end") rules += ' _2c';
54
- else rules += ' _2b';
52
+ if (props.align === "center") rules += ' _3d';
53
+ else if (props.align === "end") rules += ' _3c';
54
+ else rules += ' _3b';
55
55
  }
56
56
  return rules;
57
57
  };
58
- function $472eaa9a9b344b9a$var$ButtonGroup(props, ref) {
58
+ const $472eaa9a9b344b9a$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $bnJX2$forwardRef)(function ButtonGroup(props, ref) {
59
59
  [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $472eaa9a9b344b9a$export$4c574c91bb0be0e2);
60
60
  let domRef = (0, $bnJX2$useDOMRef)(ref);
61
61
  let { size: size = 'M', orientation: orientation = 'horizontal', align: align = 'start', children: children, isDisabled: isDisabled } = props;
@@ -105,7 +105,7 @@ function $472eaa9a9b344b9a$var$ButtonGroup(props, ref) {
105
105
  });
106
106
  if (props.isHidden) return null;
107
107
  let context = {
108
- styles: " . _8-3t1x",
108
+ styles: " . _9-3t1x",
109
109
  size: size,
110
110
  isDisabled: isDisabled
111
111
  };
@@ -131,10 +131,7 @@ function $472eaa9a9b344b9a$var$ButtonGroup(props, ref) {
131
131
  children: children
132
132
  })
133
133
  });
134
- }
135
- /**
136
- * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
137
- */ const $472eaa9a9b344b9a$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $bnJX2$forwardRef)($472eaa9a9b344b9a$var$ButtonGroup);
134
+ });
138
135
 
139
136
 
140
137
  export {$472eaa9a9b344b9a$export$4c574c91bb0be0e2 as ButtonGroupContext, $472eaa9a9b344b9a$export$69b1032f2ecdf404 as ButtonGroup};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiDM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsE,CAAC;AAErH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CN,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,QACF,OAAO,kBACP,cAAc,qBACd,QAAQ,mBACR,QAAQ,cACR,UAAU,EACX,GAAG;IAEJ,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAa,EAAE;IAEnD,IAAI,mBAAmB,CAAA,GAAA,kBA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;gBACN;oBAAC,CAAA,GAAA,yCAAY;oBAAG;iBAAQ;gBACxB;oBAAC,CAAA,GAAA,yCAAgB;oBAAG;iBAAQ;aAC7B;sBACA;;;AAIT;AAEA;;CAEC,GACD,MAAM,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ButtonGroup.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 {ButtonContext, LinkButtonContext} from './Button';\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {\n useDOMRef,\n useResizeObserver\n} from '@react-spectrum/utils';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonGroupStyleProps {\n /**\n * The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent\n * any switching behaviors between 'vertical' and 'horizontal'.\n *\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /**\n * The alignment of the Buttons within the ButtonGroup.\n *\n * @default 'start'\n */\n align?: 'start' | 'end' | 'center',\n /**\n * The size of the Buttons within the ButtonGroup.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface ButtonGroupProps extends ButtonGroupStyleProps, SlotProps, StyleProps, DOMProps {\n /** The Buttons contained within the ButtonGroup. */\n children: ReactNode,\n /** Whether the Buttons in the ButtonGroup are all disabled. */\n isDisabled?: boolean\n}\n\ninterface ButtonGroupContextValue extends Partial<ButtonGroupProps> {\n /** Whether the ButtonGroup shouldn't be rendered. */\n isHidden?: boolean\n}\n\nexport const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});\n\nconst buttongroup = style<ButtonGroupStyleProps>({\n display: 'inline-flex',\n position: 'relative',\n gap: {\n size: {\n S: 8,\n M: 12,\n L: 12,\n XL: 12\n }\n },\n flexDirection: {\n default: 'row',\n orientation: {\n vertical: 'column'\n }\n },\n alignItems: {\n default: 'center',\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n },\n justifyContent: {\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction ButtonGroup(props: ButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonGroupContext);\n let domRef = useDOMRef(ref);\n let {\n size = 'M',\n orientation = 'horizontal',\n align = 'start',\n children,\n isDisabled\n } = props;\n\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n if ((props as ButtonGroupContextValue).isHidden) {\n return null;\n }\n\n let context = {styles: style({flexShrink: 0}), size, isDisabled};\n return (\n <div\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + buttongroup({\n align,\n orientation: orientation === 'vertical' || hasOverflow ? 'vertical' : 'horizontal',\n size\n }, props.styles)}>\n <Provider\n values={[\n [ButtonContext, context],\n [LinkButtonContext, context]\n ]}>\n {children}\n </Provider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nconst _ButtonGroup = forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n"],"names":[],"version":3,"file":"ButtonGroup.mjs.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiDM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsE,CAAC;AAErH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CC,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAA2B;IAC7G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,QACF,OAAO,kBACP,cAAc,qBACd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,EAAC,IAAK,kCAAY;mBACtD;YACA,aAAa,gBAAgB,cAAc,cAAc,aAAa;kBACtE;QACF,GAAG,MAAM,MAAM;kBACf,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAY;oBAAG;iBAAQ;gBACxB;oBAAC,CAAA,GAAA,yCAAgB;oBAAG;iBAAQ;aAC7B;sBACA;;;AAIT","sources":["packages/@react-spectrum/s2/src/ButtonGroup.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 {ButtonContext, LinkButtonContext} from './Button';\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {\n useDOMRef,\n useResizeObserver\n} from '@react-spectrum/utils';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonGroupStyleProps {\n /**\n * The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent\n * any switching behaviors between 'vertical' and 'horizontal'.\n *\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /**\n * The alignment of the Buttons within the ButtonGroup.\n *\n * @default 'start'\n */\n align?: 'start' | 'end' | 'center',\n /**\n * The size of the Buttons within the ButtonGroup.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface ButtonGroupProps extends ButtonGroupStyleProps, SlotProps, StyleProps, DOMProps {\n /** The Buttons contained within the ButtonGroup. */\n children: ReactNode,\n /** Whether the Buttons in the ButtonGroup are all disabled. */\n isDisabled?: boolean\n}\n\ninterface ButtonGroupContextValue extends Partial<ButtonGroupProps> {\n /** Whether the ButtonGroup shouldn't be rendered. */\n isHidden?: boolean\n}\n\nexport const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});\n\nconst buttongroup = style<ButtonGroupStyleProps>({\n display: 'inline-flex',\n position: 'relative',\n gap: {\n size: {\n S: 8,\n M: 12,\n L: 12,\n XL: 12\n }\n },\n flexDirection: {\n default: 'row',\n orientation: {\n vertical: 'column'\n }\n },\n alignItems: {\n default: 'center',\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n },\n justifyContent: {\n orientation: {\n vertical: {\n default: 'start',\n align: {\n end: 'end',\n center: 'center'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nexport const ButtonGroup = forwardRef(function ButtonGroup(props: ButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonGroupContext);\n let domRef = useDOMRef(ref);\n let {\n size = 'M',\n orientation = 'horizontal',\n align = 'start',\n children,\n isDisabled\n } = props;\n\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n if ((props as ButtonGroupContextValue).isHidden) {\n return null;\n }\n\n let context = {styles: style({flexShrink: 0}), size, isDisabled};\n return (\n <div\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + buttongroup({\n align,\n orientation: orientation === 'vertical' || hasOverflow ? 'vertical' : 'horizontal',\n size\n }, props.styles)}>\n <Provider\n values={[\n [ButtonContext, context],\n [LinkButtonContext, context]\n ]}>\n {children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ButtonGroup.mjs.map"}