@react-spectrum/s2 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/dist/exports/CenterBaseline.cjs +12 -0
  2. package/dist/exports/CenterBaseline.cjs.map +1 -0
  3. package/dist/exports/CenterBaseline.mjs +7 -0
  4. package/dist/exports/CenterBaseline.mjs.map +1 -0
  5. package/dist/exports/Skeleton.cjs +1 -0
  6. package/dist/exports/Skeleton.cjs.map +1 -1
  7. package/dist/exports/Skeleton.mjs +2 -2
  8. package/dist/exports/Skeleton.mjs.map +1 -1
  9. package/dist/exports/index.cjs +3 -0
  10. package/dist/exports/index.cjs.map +1 -1
  11. package/dist/exports/index.mjs +3 -1
  12. package/dist/exports/index.mjs.map +1 -1
  13. package/dist/private/Accordion.cjs +2 -2
  14. package/dist/private/Accordion.css +2 -2
  15. package/dist/private/Accordion.mjs +2 -2
  16. package/dist/private/ActionBar.cjs +59 -59
  17. package/dist/private/ActionBar.cjs.map +1 -1
  18. package/dist/private/ActionBar.css +58 -58
  19. package/dist/private/ActionBar.css.map +1 -1
  20. package/dist/private/ActionBar.mjs +59 -59
  21. package/dist/private/ActionBar.mjs.map +1 -1
  22. package/dist/private/ActionButton.cjs +247 -247
  23. package/dist/private/ActionButton.cjs.map +1 -1
  24. package/dist/private/ActionButton.css +169 -169
  25. package/dist/private/ActionButton.css.map +1 -1
  26. package/dist/private/ActionButton.mjs +247 -247
  27. package/dist/private/ActionButton.mjs.map +1 -1
  28. package/dist/private/ActionButtonGroup.cjs +15 -15
  29. package/dist/private/ActionButtonGroup.css +9 -9
  30. package/dist/private/ActionButtonGroup.mjs +15 -15
  31. package/dist/private/ActionMenu.cjs.map +1 -1
  32. package/dist/private/ActionMenu.mjs.map +1 -1
  33. package/dist/private/Add.cjs +10 -10
  34. package/dist/private/Add.css +6 -6
  35. package/dist/private/Add.mjs +10 -10
  36. package/dist/private/AlertDialog.cjs +3 -3
  37. package/dist/private/AlertDialog.cjs.map +1 -1
  38. package/dist/private/AlertDialog.css +3 -3
  39. package/dist/private/AlertDialog.css.map +1 -1
  40. package/dist/private/AlertDialog.mjs +3 -3
  41. package/dist/private/AlertDialog.mjs.map +1 -1
  42. package/dist/private/Asterisk.cjs +6 -6
  43. package/dist/private/Asterisk.css +4 -4
  44. package/dist/private/Asterisk.mjs +6 -6
  45. package/dist/private/Avatar.cjs +16 -16
  46. package/dist/private/Avatar.css +16 -16
  47. package/dist/private/Avatar.mjs +16 -16
  48. package/dist/private/AvatarGroup.cjs +120 -120
  49. package/dist/private/AvatarGroup.css +31 -31
  50. package/dist/private/AvatarGroup.mjs +120 -120
  51. package/dist/private/Badge.cjs +197 -197
  52. package/dist/private/Badge.css +125 -125
  53. package/dist/private/Badge.mjs +197 -197
  54. package/dist/private/Breadcrumbs.cjs +234 -234
  55. package/dist/private/Breadcrumbs.cjs.map +1 -1
  56. package/dist/private/Breadcrumbs.css +100 -100
  57. package/dist/private/Breadcrumbs.css.map +1 -1
  58. package/dist/private/Breadcrumbs.mjs +234 -234
  59. package/dist/private/Breadcrumbs.mjs.map +1 -1
  60. package/dist/private/Button.cjs +326 -326
  61. package/dist/private/Button.cjs.map +1 -1
  62. package/dist/private/Button.css +172 -172
  63. package/dist/private/Button.css.map +1 -1
  64. package/dist/private/Button.mjs +326 -326
  65. package/dist/private/Button.mjs.map +1 -1
  66. package/dist/private/ButtonGroup.cjs +23 -20
  67. package/dist/private/ButtonGroup.cjs.map +1 -1
  68. package/dist/private/ButtonGroup.css +19 -15
  69. package/dist/private/ButtonGroup.css.map +1 -1
  70. package/dist/private/ButtonGroup.mjs +23 -20
  71. package/dist/private/ButtonGroup.mjs.map +1 -1
  72. package/dist/private/Calendar.cjs +232 -232
  73. package/dist/private/Calendar.cjs.map +1 -1
  74. package/dist/private/Calendar.css +149 -149
  75. package/dist/private/Calendar.css.map +1 -1
  76. package/dist/private/Calendar.mjs +232 -232
  77. package/dist/private/Calendar.mjs.map +1 -1
  78. package/dist/private/Card.cjs +309 -309
  79. package/dist/private/Card.css +206 -206
  80. package/dist/private/Card.mjs +309 -309
  81. package/dist/private/CardView.cjs +17 -17
  82. package/dist/private/CardView.css +17 -17
  83. package/dist/private/CardView.mjs +17 -17
  84. package/dist/private/CenterBaseline.cjs +1 -1
  85. package/dist/private/CenterBaseline.cjs.map +1 -1
  86. package/dist/private/CenterBaseline.css +2 -2
  87. package/dist/private/CenterBaseline.css.map +1 -1
  88. package/dist/private/CenterBaseline.mjs +1 -1
  89. package/dist/private/CenterBaseline.mjs.map +1 -1
  90. package/dist/private/Checkbox.cjs +188 -188
  91. package/dist/private/Checkbox.css +110 -110
  92. package/dist/private/Checkbox.mjs +188 -188
  93. package/dist/private/CheckboxGroup.cjs +43 -43
  94. package/dist/private/CheckboxGroup.css +37 -37
  95. package/dist/private/CheckboxGroup.mjs +43 -43
  96. package/dist/private/Checkmark.cjs +12 -12
  97. package/dist/private/Checkmark.css +8 -8
  98. package/dist/private/Checkmark.mjs +12 -12
  99. package/dist/private/Chevron.cjs +12 -12
  100. package/dist/private/Chevron.css +10 -10
  101. package/dist/private/Chevron.mjs +12 -12
  102. package/dist/private/ClearButton.cjs +30 -30
  103. package/dist/private/ClearButton.css +30 -30
  104. package/dist/private/ClearButton.mjs +30 -30
  105. package/dist/private/CloseButton.cjs +52 -52
  106. package/dist/private/CloseButton.cjs.map +1 -1
  107. package/dist/private/CloseButton.css +46 -46
  108. package/dist/private/CloseButton.css.map +1 -1
  109. package/dist/private/CloseButton.mjs +52 -52
  110. package/dist/private/CloseButton.mjs.map +1 -1
  111. package/dist/private/ColorArea.cjs +16 -16
  112. package/dist/private/ColorArea.css +16 -16
  113. package/dist/private/ColorArea.mjs +16 -16
  114. package/dist/private/ColorField.cjs +31 -31
  115. package/dist/private/ColorField.css +27 -27
  116. package/dist/private/ColorField.mjs +31 -31
  117. package/dist/private/ColorHandle.cjs +27 -27
  118. package/dist/private/ColorHandle.css +42 -42
  119. package/dist/private/ColorHandle.mjs +27 -27
  120. package/dist/private/ColorSlider.cjs +108 -108
  121. package/dist/private/ColorSlider.css +52 -52
  122. package/dist/private/ColorSlider.mjs +108 -108
  123. package/dist/private/ColorSwatch.cjs +29 -29
  124. package/dist/private/ColorSwatch.css +29 -29
  125. package/dist/private/ColorSwatch.mjs +29 -29
  126. package/dist/private/ColorSwatchPicker.cjs +29 -29
  127. package/dist/private/ColorSwatchPicker.css +48 -48
  128. package/dist/private/ColorSwatchPicker.mjs +29 -29
  129. package/dist/private/ColorWheel.cjs +26 -26
  130. package/dist/private/ColorWheel.css +17 -17
  131. package/dist/private/ColorWheel.mjs +26 -26
  132. package/dist/private/ComboBox.cjs +381 -381
  133. package/dist/private/ComboBox.cjs.map +1 -1
  134. package/dist/private/ComboBox.css +188 -188
  135. package/dist/private/ComboBox.css.map +1 -1
  136. package/dist/private/ComboBox.mjs +381 -381
  137. package/dist/private/ComboBox.mjs.map +1 -1
  138. package/dist/private/ContextualHelp.cjs +5 -5
  139. package/dist/private/ContextualHelp.cjs.map +1 -1
  140. package/dist/private/ContextualHelp.css +50 -50
  141. package/dist/private/ContextualHelp.css.map +1 -1
  142. package/dist/private/ContextualHelp.mjs +5 -5
  143. package/dist/private/ContextualHelp.mjs.map +1 -1
  144. package/dist/private/CornerTriangle.cjs +8 -8
  145. package/dist/private/CornerTriangle.css +6 -6
  146. package/dist/private/CornerTriangle.mjs +8 -8
  147. package/dist/private/Cross.cjs +14 -14
  148. package/dist/private/Cross.css +10 -10
  149. package/dist/private/Cross.mjs +14 -14
  150. package/dist/private/CustomDialog.cjs +25 -25
  151. package/dist/private/CustomDialog.css +25 -25
  152. package/dist/private/CustomDialog.mjs +25 -25
  153. package/dist/private/Dash.cjs +10 -10
  154. package/dist/private/Dash.css +6 -6
  155. package/dist/private/Dash.mjs +10 -10
  156. package/dist/private/DateField.cjs +73 -73
  157. package/dist/private/DateField.css +77 -77
  158. package/dist/private/DateField.mjs +73 -73
  159. package/dist/private/DatePicker.cjs +172 -172
  160. package/dist/private/DatePicker.cjs.map +1 -1
  161. package/dist/private/DatePicker.css +128 -128
  162. package/dist/private/DatePicker.css.map +1 -1
  163. package/dist/private/DatePicker.mjs +172 -172
  164. package/dist/private/DatePicker.mjs.map +1 -1
  165. package/dist/private/DateRangePicker.cjs +55 -55
  166. package/dist/private/DateRangePicker.cjs.map +1 -1
  167. package/dist/private/DateRangePicker.css +59 -59
  168. package/dist/private/DateRangePicker.css.map +1 -1
  169. package/dist/private/DateRangePicker.mjs +55 -55
  170. package/dist/private/DateRangePicker.mjs.map +1 -1
  171. package/dist/private/Dialog.cjs +17 -17
  172. package/dist/private/Dialog.css +70 -70
  173. package/dist/private/Dialog.mjs +17 -17
  174. package/dist/private/Disclosure.cjs +144 -122
  175. package/dist/private/Disclosure.cjs.map +1 -1
  176. package/dist/private/Disclosure.css +112 -112
  177. package/dist/private/Disclosure.css.map +1 -1
  178. package/dist/private/Disclosure.mjs +144 -122
  179. package/dist/private/Disclosure.mjs.map +1 -1
  180. package/dist/private/Divider.cjs +25 -25
  181. package/dist/private/Divider.css +25 -25
  182. package/dist/private/Divider.mjs +25 -25
  183. package/dist/private/DragHandle.cjs +8 -8
  184. package/dist/private/DragHandle.css +6 -6
  185. package/dist/private/DragHandle.mjs +8 -8
  186. package/dist/private/DragPreview.cjs +154 -154
  187. package/dist/private/DragPreview.css +106 -106
  188. package/dist/private/DragPreview.mjs +154 -154
  189. package/dist/private/DropZone.cjs +61 -61
  190. package/dist/private/DropZone.cjs.map +1 -1
  191. package/dist/private/DropZone.css +57 -57
  192. package/dist/private/DropZone.css.map +1 -1
  193. package/dist/private/DropZone.mjs +61 -61
  194. package/dist/private/DropZone.mjs.map +1 -1
  195. package/dist/private/Field.cjs +360 -360
  196. package/dist/private/Field.cjs.map +1 -1
  197. package/dist/private/Field.css +160 -160
  198. package/dist/private/Field.css.map +1 -1
  199. package/dist/private/Field.mjs +360 -360
  200. package/dist/private/Field.mjs.map +1 -1
  201. package/dist/private/Form.cjs +9 -9
  202. package/dist/private/Form.css +9 -9
  203. package/dist/private/Form.mjs +9 -9
  204. package/dist/private/FullscreenDialog.cjs +5 -5
  205. package/dist/private/FullscreenDialog.css +78 -78
  206. package/dist/private/FullscreenDialog.mjs +5 -5
  207. package/dist/private/IllustratedMessage.cjs +228 -228
  208. package/dist/private/IllustratedMessage.css +72 -72
  209. package/dist/private/IllustratedMessage.mjs +228 -228
  210. package/dist/private/Image.cjs +14 -14
  211. package/dist/private/Image.css +14 -14
  212. package/dist/private/Image.mjs +14 -14
  213. package/dist/private/InlineAlert.cjs +100 -100
  214. package/dist/private/InlineAlert.cjs.map +1 -1
  215. package/dist/private/InlineAlert.css +76 -76
  216. package/dist/private/InlineAlert.css.map +1 -1
  217. package/dist/private/InlineAlert.mjs +100 -100
  218. package/dist/private/InlineAlert.mjs.map +1 -1
  219. package/dist/private/LabeledValue.cjs +134 -134
  220. package/dist/private/LabeledValue.css +63 -63
  221. package/dist/private/LabeledValue.mjs +134 -134
  222. package/dist/private/Link.cjs +49 -49
  223. package/dist/private/Link.css +41 -41
  224. package/dist/private/Link.mjs +49 -49
  225. package/dist/private/LinkOut.cjs +8 -8
  226. package/dist/private/LinkOut.css +8 -8
  227. package/dist/private/LinkOut.mjs +8 -8
  228. package/dist/private/ListView.cjs +245 -245
  229. package/dist/private/ListView.cjs.map +1 -1
  230. package/dist/private/ListView.css +177 -177
  231. package/dist/private/ListView.css.map +1 -1
  232. package/dist/private/ListView.mjs +245 -245
  233. package/dist/private/ListView.mjs.map +1 -1
  234. package/dist/private/Menu.cjs +446 -446
  235. package/dist/private/Menu.cjs.map +1 -1
  236. package/dist/private/Menu.css +196 -196
  237. package/dist/private/Menu.css.map +1 -1
  238. package/dist/private/Menu.mjs +446 -446
  239. package/dist/private/Menu.mjs.map +1 -1
  240. package/dist/private/Meter.cjs +153 -153
  241. package/dist/private/Meter.css +91 -91
  242. package/dist/private/Meter.mjs +153 -153
  243. package/dist/private/Modal.cjs +74 -74
  244. package/dist/private/Modal.css +59 -59
  245. package/dist/private/Modal.mjs +74 -74
  246. package/dist/private/NotificationBadge.cjs +56 -56
  247. package/dist/private/NotificationBadge.cjs.map +1 -1
  248. package/dist/private/NotificationBadge.css +49 -49
  249. package/dist/private/NotificationBadge.css.map +1 -1
  250. package/dist/private/NotificationBadge.mjs +56 -56
  251. package/dist/private/NotificationBadge.mjs.map +1 -1
  252. package/dist/private/NumberField.cjs +114 -114
  253. package/dist/private/NumberField.css +99 -99
  254. package/dist/private/NumberField.mjs +114 -114
  255. package/dist/private/Picker.cjs +275 -275
  256. package/dist/private/Picker.cjs.map +1 -1
  257. package/dist/private/Picker.css +173 -173
  258. package/dist/private/Picker.css.map +1 -1
  259. package/dist/private/Picker.mjs +275 -275
  260. package/dist/private/Picker.mjs.map +1 -1
  261. package/dist/private/Popover.cjs +95 -95
  262. package/dist/private/Popover.cjs.map +1 -1
  263. package/dist/private/Popover.css +75 -75
  264. package/dist/private/Popover.css.map +1 -1
  265. package/dist/private/Popover.mjs +95 -95
  266. package/dist/private/Popover.mjs.map +1 -1
  267. package/dist/private/ProgressBar.cjs +163 -163
  268. package/dist/private/ProgressBar.css +99 -99
  269. package/dist/private/ProgressBar.mjs +163 -163
  270. package/dist/private/ProgressCircle.cjs +34 -31
  271. package/dist/private/ProgressCircle.cjs.map +1 -1
  272. package/dist/private/ProgressCircle.css +24 -24
  273. package/dist/private/ProgressCircle.css.map +1 -1
  274. package/dist/private/ProgressCircle.mjs +34 -31
  275. package/dist/private/ProgressCircle.mjs.map +1 -1
  276. package/dist/private/Provider.cjs +19 -19
  277. package/dist/private/Provider.css +15 -15
  278. package/dist/private/Provider.mjs +19 -19
  279. package/dist/private/RadioGroup.cjs +208 -208
  280. package/dist/private/RadioGroup.css +113 -113
  281. package/dist/private/RadioGroup.mjs +208 -208
  282. package/dist/private/RangeCalendar.cjs +16 -16
  283. package/dist/private/RangeCalendar.cjs.map +1 -1
  284. package/dist/private/RangeCalendar.css +17 -17
  285. package/dist/private/RangeCalendar.css.map +1 -1
  286. package/dist/private/RangeCalendar.mjs +16 -16
  287. package/dist/private/RangeCalendar.mjs.map +1 -1
  288. package/dist/private/RangeSlider.cjs.map +1 -1
  289. package/dist/private/RangeSlider.mjs.map +1 -1
  290. package/dist/private/SearchField.cjs +41 -41
  291. package/dist/private/SearchField.css +45 -45
  292. package/dist/private/SearchField.mjs +41 -41
  293. package/dist/private/SegmentedControl.cjs +178 -178
  294. package/dist/private/SegmentedControl.css +123 -123
  295. package/dist/private/SegmentedControl.mjs +178 -178
  296. package/dist/private/SelectBoxGroup.cjs +142 -142
  297. package/dist/private/SelectBoxGroup.css +120 -120
  298. package/dist/private/SelectBoxGroup.mjs +142 -142
  299. package/dist/private/Slider.cjs +292 -292
  300. package/dist/private/Slider.css +159 -159
  301. package/dist/private/Slider.mjs +292 -292
  302. package/dist/private/StatusLight.cjs +115 -115
  303. package/dist/private/StatusLight.css +59 -59
  304. package/dist/private/StatusLight.mjs +115 -115
  305. package/dist/private/Switch.cjs +171 -171
  306. package/dist/private/Switch.css +85 -85
  307. package/dist/private/Switch.mjs +171 -171
  308. package/dist/private/TableView.cjs +551 -534
  309. package/dist/private/TableView.cjs.map +1 -1
  310. package/dist/private/TableView.css +329 -303
  311. package/dist/private/TableView.css.map +1 -1
  312. package/dist/private/TableView.mjs +551 -534
  313. package/dist/private/TableView.mjs.map +1 -1
  314. package/dist/private/Tabs.cjs +131 -125
  315. package/dist/private/Tabs.cjs.map +1 -1
  316. package/dist/private/Tabs.css +105 -105
  317. package/dist/private/Tabs.css.map +1 -1
  318. package/dist/private/Tabs.mjs +131 -125
  319. package/dist/private/Tabs.mjs.map +1 -1
  320. package/dist/private/TabsPicker.cjs +127 -127
  321. package/dist/private/TabsPicker.css +108 -108
  322. package/dist/private/TabsPicker.mjs +127 -127
  323. package/dist/private/TagGroup.cjs +203 -203
  324. package/dist/private/TagGroup.cjs.map +1 -1
  325. package/dist/private/TagGroup.css +146 -146
  326. package/dist/private/TagGroup.css.map +1 -1
  327. package/dist/private/TagGroup.mjs +203 -203
  328. package/dist/private/TagGroup.mjs.map +1 -1
  329. package/dist/private/TextField.cjs +58 -58
  330. package/dist/private/TextField.css +54 -54
  331. package/dist/private/TextField.mjs +58 -58
  332. package/dist/private/TimeField.cjs +51 -51
  333. package/dist/private/TimeField.css +47 -47
  334. package/dist/private/TimeField.mjs +51 -51
  335. package/dist/private/Toast.cjs +120 -120
  336. package/dist/private/Toast.cjs.map +1 -1
  337. package/dist/private/Toast.css +110 -110
  338. package/dist/private/Toast.css.map +1 -1
  339. package/dist/private/Toast.mjs +120 -120
  340. package/dist/private/Toast.mjs.map +1 -1
  341. package/dist/private/ToggleButton.cjs +16 -16
  342. package/dist/private/ToggleButton.css +23 -23
  343. package/dist/private/ToggleButton.mjs +16 -16
  344. package/dist/private/Tooltip.cjs +86 -86
  345. package/dist/private/Tooltip.css +70 -70
  346. package/dist/private/Tooltip.mjs +86 -86
  347. package/dist/private/TreeView.cjs +229 -229
  348. package/dist/private/TreeView.cjs.map +1 -1
  349. package/dist/private/TreeView.css +184 -184
  350. package/dist/private/TreeView.css.map +1 -1
  351. package/dist/private/TreeView.mjs +229 -229
  352. package/dist/private/TreeView.mjs.map +1 -1
  353. package/dist/private/dnd-utils.cjs +42 -42
  354. package/dist/private/dnd-utils.css +39 -39
  355. package/dist/private/dnd-utils.mjs +42 -42
  356. package/dist/types/exports/CenterBaseline.d.ts +1 -0
  357. package/dist/types/exports/Skeleton.d.ts +1 -1
  358. package/dist/types/exports/index.d.ts +1 -0
  359. package/dist/types/src/CenterBaseline.d.ts +17 -0
  360. package/dist/types/src/ContextualHelp.d.ts +1 -1
  361. package/dist/types/src/Disclosure.d.ts +6 -1
  362. package/dist/types/src/ListView.d.ts +1 -1
  363. package/dist/types/src/Menu.d.ts +1 -1
  364. package/dist/types/src/Popover.d.ts +2 -2
  365. package/dist/types/src/style-utils.d.ts +4 -1
  366. package/exports/CenterBaseline.ts +1 -0
  367. package/exports/Skeleton.ts +1 -1
  368. package/exports/index.ts +2 -0
  369. package/icons/Icon.cjs +10 -10
  370. package/icons/Icon.css +9 -9
  371. package/icons/Icon.mjs +10 -10
  372. package/icons/Skeleton.cjs +2 -2
  373. package/icons/Skeleton.cjs.map +1 -1
  374. package/icons/Skeleton.css +6 -6
  375. package/icons/Skeleton.mjs +2 -2
  376. package/icons/Skeleton.mjs.map +1 -1
  377. package/package.json +6 -6
  378. package/src/ActionBar.tsx +0 -1
  379. package/src/ActionButton.tsx +0 -1
  380. package/src/ActionMenu.tsx +0 -1
  381. package/src/AlertDialog.tsx +0 -1
  382. package/src/Breadcrumbs.tsx +0 -4
  383. package/src/Button.tsx +0 -1
  384. package/src/ButtonGroup.tsx +1 -0
  385. package/src/Calendar.tsx +0 -1
  386. package/src/CenterBaseline.tsx +17 -0
  387. package/src/CloseButton.tsx +0 -1
  388. package/src/ComboBox.tsx +0 -1
  389. package/src/ContextualHelp.tsx +1 -2
  390. package/src/DatePicker.tsx +0 -1
  391. package/src/DateRangePicker.tsx +0 -1
  392. package/src/Disclosure.tsx +92 -79
  393. package/src/DropZone.tsx +0 -1
  394. package/src/Field.tsx +0 -1
  395. package/src/InlineAlert.tsx +0 -1
  396. package/src/ListView.tsx +0 -2
  397. package/src/Menu.tsx +1 -8
  398. package/src/NotificationBadge.tsx +0 -1
  399. package/src/Picker.tsx +0 -1
  400. package/src/Popover.tsx +2 -1
  401. package/src/ProgressCircle.tsx +1 -1
  402. package/src/RangeCalendar.tsx +0 -1
  403. package/src/RangeSlider.tsx +0 -1
  404. package/src/TableView.tsx +75 -37
  405. package/src/Tabs.tsx +9 -2
  406. package/src/TagGroup.tsx +0 -1
  407. package/src/Toast.tsx +0 -3
  408. package/src/TreeView.tsx +0 -1
  409. package/src/style-utils.ts +13 -2
  410. package/style/__tests__/style-macro.test.js +71 -71
  411. package/style/dist/main.cjs +25 -25
  412. package/style/dist/module.mjs +13 -13
  413. package/style/dist/properties.mjs +3 -3
  414. package/style/dist/spectrum-theme.cjs +224 -224
  415. package/style/dist/spectrum-theme.mjs +217 -217
  416. package/style/dist/style-macro.cjs +100 -100
  417. package/style/dist/style-macro.mjs +94 -94
  418. package/style/dist/style-utils.cjs +51 -39
  419. package/style/dist/style-utils.cjs.map +1 -1
  420. package/style/dist/style-utils.mjs +50 -38
  421. package/style/dist/style-utils.mjs.map +1 -1
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;AA8FD,yDAAyD;AACzD,MAAM,iCAAW;AACjB,MAAM,mCAAa;AACnB,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwMb,4BAA4B;AAC5B,MAAM,mCAA0E;IAC9E,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;AACN;AAMO,MAAM,0DACX,CAAA,GAAA,oBAAY,EAAgF;AAOvF,MAAM,0DAAe,CAAA,GAAA,iBAAS,EAAE,SAAS,aAC9C,MAAwB,EACxB,GAAoC;IAEpC,CAAC,QAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,QAAO,KAAK;IACnD,SAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA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ACE,CAAA,GAAA,yCAAU;gCACV;oCACE,QAAQ,CAAA,GAAA,yCAAa,EAAE;wCAAC,MAAM;wCAAQ,MAAM;oCAA2B;oCACvE,QAAQ;;;;;;;sCAML;2DAAC;oCAAiB;gCACvB;6BACD;4BACD;gCACE,CAAA,GAAA,yCAAY;gCACZ;oCACE,MAAM,gCAAU,CAAC,KAAK;oCACtB,MAAM;gCAIR;6BACD;4BACD;gCACE,CAAA,GAAA,yCAAW;gCACX;oCACE,QAAQ;;;;sCAIL;2DAAC;oCAAiB;gCACvB;6BACD;4BACD;gCACE,CAAA,GAAA,yCAAuB;gCACvB;oCACE,aAAa;oCACb,MAAM,OAAM,IAAI,KAAK,OAAO,YAAY,OAAM,IAAI;oCAClD,YAAY;oCACZ,QAAQ;;;;;;;;;;sCAUL;2DAAC;oCAAiB;gCACvB;6BACD;yBACF;;4BACA,OAAO,OAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0CAAG,OAAM,QAAQ;iCAAW,OAAM,QAAQ;4BACnF,2BACC,gBAAC;gCACC,WAAW;;;;;;;;;kCASR;uDAAC;+CAAmB;gCAAS;0CAChC,cAAA,gBAAC,CAAA,GAAA,yCAAa;oCACZ,eAAe;oCACf,cAAY,gBAAgB,MAAM,CAAC;oCACnC,MAAK;oCACL,aAAa;oCACb,QAAQ;;;;;;;;;;;;;sCAUL;8CAAC;oCAAI;;;;;oBAKf,gCACC,gBAAC,CAAA,GAAA,wCAAa;wBACZ,MAAM,SAAS,OAAO,MAAM;wBAC5B,WAAW;;;;;;;;;;;;;;;;;;0BAyBR;uCAAC;kCAAW;wBAAI;;;;;AAOjC","sources":["packages/@react-spectrum/s2/src/ActionButton.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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {AvatarContext} from './Avatar';\nimport {\n baseColor,\n focusRing,\n fontRelative,\n lightDark,\n space,\n style\n} from '../style' with {type: 'macro'};\nimport {ButtonProps, ButtonRenderProps, Button as RACButton} from 'react-aria-components/Button';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, Provider, useSlottedContext} from 'react-aria-components/slots';\nimport {\n control,\n getAllowedOverrides,\n staticColor,\n StyleProps\n} from './style-utils' with {type: 'macro'};\nimport CornerTriangle from '../ui-icons/CornerTriangle';\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {ImageContext} from './Image';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {NotificationBadgeContext} from './NotificationBadge';\nimport {OverlayTriggerStateContext} from 'react-aria-components/Dialog';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from './useDOMRef';\nimport {useFormProps} from './Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {usePendingState} from './Button';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonStyleProps {\n /**\n * The size of the ActionButton.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL';\n /** The static color style to apply. Useful when the ActionButton appears over a color background. */\n staticColor?: 'black' | 'white' | 'auto';\n /**\n * Whether the button should be displayed with a [quiet\n * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n */\n isQuiet?: boolean;\n}\n\ninterface ToggleButtonStyleProps {\n /** Whether the ActionButton should be selected (controlled). */\n isSelected?: boolean;\n /**\n * Whether the button should be displayed with an [emphasized\n * style](https://spectrum.adobe.com/page/action-button/#Emphasis).\n */\n isEmphasized?: boolean;\n}\n\ninterface ActionGroupItemStyleProps {\n density?: 'regular' | 'compact';\n orientation?: 'horizontal' | 'vertical';\n isJustified?: boolean;\n}\n\nexport interface ActionButtonProps\n extends\n Omit<\n ButtonProps,\n | 'className'\n | 'style'\n | 'render'\n | 'children'\n | 'onHover'\n | 'onHoverStart'\n | 'onHoverEnd'\n | 'onHoverChange'\n | 'onClick'\n | keyof GlobalDOMAttributes\n >,\n StyleProps,\n ActionButtonStyleProps {\n /** The content to display in the ActionButton. */\n children: ReactNode;\n}\n\n// These styles handle both ActionButton and ToggleButton\nconst iconOnly = ':has([slot=icon], [slot=avatar]):not(:has([data-rsp-slot=text]))';\nconst avatarOnly = ':has([slot=avatar]):not(:has([slot=icon], [data-rsp-slot=text]))';\nconst textOnly = ':has([data-rsp-slot=text]):not(:has([slot=icon], [slot=avatar]))';\nconst controlStyle = control({shape: 'default', icon: true});\nexport const btnStyles = style<\n ButtonRenderProps &\n ActionButtonStyleProps &\n ToggleButtonStyleProps &\n ActionGroupItemStyleProps & {isInGroup: boolean; isStaticColor: boolean}\n>(\n {\n ...focusRing(),\n ...staticColor(),\n ...controlStyle,\n display: 'grid',\n justifyContent: 'center',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n fontWeight: 'medium',\n width: 'fit',\n userSelect: 'none',\n transition: 'default',\n forcedColorAdjust: 'none',\n position: 'relative',\n gridTemplateAreas: {\n default: ['icon text'],\n [iconOnly]: ['icon'],\n [textOnly]: ['text']\n },\n gridTemplateColumns: {\n default: ['auto', 'auto'],\n [iconOnly]: ['auto'],\n [textOnly]: ['auto']\n },\n backgroundColor: {\n default: {\n ...baseColor('gray-100'),\n default: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isSelected: {\n default: baseColor('neutral'),\n isEmphasized: {\n default: lightDark('accent-900', 'accent-700'),\n isHovered: lightDark('accent-1000', 'accent-600'),\n isPressed: lightDark('accent-1000', 'accent-600'),\n isFocusVisible: lightDark('accent-1000', 'accent-600')\n },\n isDisabled: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isStaticColor: {\n ...baseColor('transparent-overlay-100'),\n default: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n },\n isSelected: {\n default: baseColor('transparent-overlay-800'),\n isDisabled: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n }\n }\n },\n forcedColors: {\n default: 'ButtonFace',\n isSelected: {\n default: 'Highlight',\n isDisabled: 'ButtonFace'\n }\n }\n },\n color: {\n default: baseColor('neutral'),\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n isStaticColor: {\n default: 'transparent-overlay-1000',\n isSelected: 'auto',\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: {\n default: 'GrayText'\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 borderStyle: 'none',\n borderTopStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':first-child': controlStyle.borderRadius\n }\n }\n },\n borderTopEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': controlStyle.borderRadius\n },\n vertical: {\n ':first-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': controlStyle.borderRadius\n },\n vertical: {\n ':last-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':last-child': controlStyle.borderRadius\n }\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true,\n '--badgeTop': {\n type: 'top',\n value: {\n default: 'calc(self(height)/2 - var(--iconWidth)/2)',\n [textOnly]: 0\n }\n },\n '--iconWidth': {\n type: 'width',\n value: fontRelative(20)\n },\n '--badgePosition': {\n type: 'width',\n value: {\n default: '--iconWidth',\n [textOnly]: 'full'\n }\n },\n paddingX: {\n default: controlStyle.paddingX,\n [avatarOnly]: 0\n },\n // `control` sets this, but we need to override it for avatar only buttons.\n '--iconMargin': {\n type: 'marginStart',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0,\n [avatarOnly]: 0\n }\n }\n },\n getAllowedOverrides()\n);\n\n// Matching icon sizes. TBD.\nconst avatarSize: Record<NonNullable<ActionButtonStyleProps['size']>, number> = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n XL: 26\n} as const;\n\ninterface ActionButtonContextProps extends Partial<ActionButtonProps> {\n holdAffordance?: boolean;\n}\n\nexport const ActionButtonContext =\n createContext<ContextValue<ActionButtonContextProps, FocusableRefValue<HTMLButtonElement>>>(null);\n\n/**\n * ActionButtons allow users to perform an action. They're used for similar, task-based options\n * within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of\n * attention.\n */\nexport const ActionButton = forwardRef(function ActionButton(\n props: ActionButtonProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonContext);\n props = useFormProps(props as any);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {isPending = false, holdAffordance} = props as ActionButtonContextProps;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n let ctx = useSlottedContext(ActionButtonGroupContext);\n let isInGroup = !!ctx;\n let {\n density = 'regular',\n isJustified,\n orientation = 'horizontal',\n staticColor = props.staticColor,\n isQuiet = props.isQuiet,\n size = props.size || 'M',\n isDisabled\n } = ctx || {};\n\n let {isProgressVisible} = usePendingState(isPending);\n let {direction} = useLocale();\n\n return (\n <RACButton\n {...props}\n isDisabled={props.isDisabled ?? isDisabled}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps =>\n (props.UNSAFE_className || '') +\n btnStyles(\n {\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n staticColor,\n isStaticColor: !!staticColor,\n size,\n isQuiet,\n density,\n isJustified,\n orientation,\n isInGroup\n },\n props.styles\n )\n }>\n {({isDisabled}) => (\n <>\n <Provider\n values={[\n [SkeletonContext, null],\n [\n TextContext,\n {\n styles: style({\n gridArea: 'text',\n truncate: true,\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\n ],\n [\n IconContext,\n {\n render: centerBaseline({slot: 'icon', styles: style({gridArea: 'icon'})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\n ],\n [\n AvatarContext,\n {\n size: avatarSize[size],\n styles: style({\n marginStart: '--iconMargin',\n gridArea: 'icon'\n })\n }\n ],\n [\n ImageContext,\n {\n styles: style({\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\n ],\n [\n NotificationBadgeContext,\n {\n staticColor: staticColor,\n size: props.size === 'XS' ? undefined : props.size,\n isDisabled: isDisabled,\n styles: style({\n position: 'absolute',\n top: '--badgeTop',\n marginTop: 'calc((self(height) * -1)/2)',\n marginStart: 'calc(var(--iconMargin) * 2 + (self(height) * -1)/4)',\n gridColumnStart: 1,\n insetStart: '--badgePosition',\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\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 visibility: {\n default: 'hidden',\n isProgressVisible: 'visible'\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 XS: 12,\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})}\n />\n </div>\n )}\n </Provider>\n {holdAffordance && (\n <CornerTriangle\n size={size === 'XS' ? 'S' : size}\n className={style({\n position: 'absolute',\n insetEnd: {\n size: {\n XS: space(3),\n S: space(3),\n M: 4,\n L: space(5),\n XL: space(6)\n }\n },\n bottom: {\n size: {\n XS: space(3),\n S: space(3),\n M: 4,\n L: space(5),\n XL: space(6)\n }\n },\n scaleX: {\n direction: {\n rtl: -1\n }\n }\n })({direction, size})}\n />\n )}\n </>\n )}\n </RACButton>\n );\n});\n"],"names":[],"version":3,"file":"ActionButton.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;AA6FD,yDAAyD;AACzD,MAAM,iCAAW;AACjB,MAAM,mCAAa;AACnB,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CACnC,MAAK;oCACL,aAAa;oCACb,QAAQ;;;;;;;;;;;;;sCAUL;8CAAC;oCAAI;;;;;oBAKf,gCACC,gBAAC,CAAA,GAAA,wCAAa;wBACZ,MAAM,SAAS,OAAO,MAAM;wBAC5B,WAAW;;;;;;;;;;;;;;;;;;0BAyBR;uCAAC;kCAAW;wBAAI;;;;;AAOjC","sources":["packages/@react-spectrum/s2/src/ActionButton.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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {AvatarContext} from './Avatar';\nimport {\n baseColor,\n focusRing,\n fontRelative,\n lightDark,\n space,\n style\n} from '../style' with {type: 'macro'};\nimport {ButtonProps, ButtonRenderProps, Button as RACButton} from 'react-aria-components/Button';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, Provider, useSlottedContext} from 'react-aria-components/slots';\nimport {\n control,\n getAllowedOverrides,\n staticColor,\n StyleProps\n} from './style-utils' with {type: 'macro'};\nimport CornerTriangle from '../ui-icons/CornerTriangle';\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {ImageContext} from './Image';\nimport intlMessages from '../intl/*.json';\nimport {NotificationBadgeContext} from './NotificationBadge';\nimport {OverlayTriggerStateContext} from 'react-aria-components/Dialog';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from './useDOMRef';\nimport {useFormProps} from './Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {usePendingState} from './Button';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonStyleProps {\n /**\n * The size of the ActionButton.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL';\n /** The static color style to apply. Useful when the ActionButton appears over a color background. */\n staticColor?: 'black' | 'white' | 'auto';\n /**\n * Whether the button should be displayed with a [quiet\n * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n */\n isQuiet?: boolean;\n}\n\ninterface ToggleButtonStyleProps {\n /** Whether the ActionButton should be selected (controlled). */\n isSelected?: boolean;\n /**\n * Whether the button should be displayed with an [emphasized\n * style](https://spectrum.adobe.com/page/action-button/#Emphasis).\n */\n isEmphasized?: boolean;\n}\n\ninterface ActionGroupItemStyleProps {\n density?: 'regular' | 'compact';\n orientation?: 'horizontal' | 'vertical';\n isJustified?: boolean;\n}\n\nexport interface ActionButtonProps\n extends\n Omit<\n ButtonProps,\n | 'className'\n | 'style'\n | 'render'\n | 'children'\n | 'onHover'\n | 'onHoverStart'\n | 'onHoverEnd'\n | 'onHoverChange'\n | 'onClick'\n | keyof GlobalDOMAttributes\n >,\n StyleProps,\n ActionButtonStyleProps {\n /** The content to display in the ActionButton. */\n children: ReactNode;\n}\n\n// These styles handle both ActionButton and ToggleButton\nconst iconOnly = ':has([slot=icon], [slot=avatar]):not(:has([data-rsp-slot=text]))';\nconst avatarOnly = ':has([slot=avatar]):not(:has([slot=icon], [data-rsp-slot=text]))';\nconst textOnly = ':has([data-rsp-slot=text]):not(:has([slot=icon], [slot=avatar]))';\nconst controlStyle = control({shape: 'default', icon: true});\nexport const btnStyles = style<\n ButtonRenderProps &\n ActionButtonStyleProps &\n ToggleButtonStyleProps &\n ActionGroupItemStyleProps & {isInGroup: boolean; isStaticColor: boolean}\n>(\n {\n ...focusRing(),\n ...staticColor(),\n ...controlStyle,\n display: 'grid',\n justifyContent: 'center',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n fontWeight: 'medium',\n width: 'fit',\n userSelect: 'none',\n transition: 'default',\n forcedColorAdjust: 'none',\n position: 'relative',\n gridTemplateAreas: {\n default: ['icon text'],\n [iconOnly]: ['icon'],\n [textOnly]: ['text']\n },\n gridTemplateColumns: {\n default: ['auto', 'auto'],\n [iconOnly]: ['auto'],\n [textOnly]: ['auto']\n },\n backgroundColor: {\n default: {\n ...baseColor('gray-100'),\n default: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isSelected: {\n default: baseColor('neutral'),\n isEmphasized: {\n default: lightDark('accent-900', 'accent-700'),\n isHovered: lightDark('accent-1000', 'accent-600'),\n isPressed: lightDark('accent-1000', 'accent-600'),\n isFocusVisible: lightDark('accent-1000', 'accent-600')\n },\n isDisabled: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isStaticColor: {\n ...baseColor('transparent-overlay-100'),\n default: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n },\n isSelected: {\n default: baseColor('transparent-overlay-800'),\n isDisabled: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n }\n }\n },\n forcedColors: {\n default: 'ButtonFace',\n isSelected: {\n default: 'Highlight',\n isDisabled: 'ButtonFace'\n }\n }\n },\n color: {\n default: baseColor('neutral'),\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n isStaticColor: {\n default: 'transparent-overlay-1000',\n isSelected: 'auto',\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: {\n default: 'GrayText'\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 borderStyle: 'none',\n borderTopStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':first-child': controlStyle.borderRadius\n }\n }\n },\n borderTopEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': controlStyle.borderRadius\n },\n vertical: {\n ':first-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': controlStyle.borderRadius\n },\n vertical: {\n ':last-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':last-child': controlStyle.borderRadius\n }\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true,\n '--badgeTop': {\n type: 'top',\n value: {\n default: 'calc(self(height)/2 - var(--iconWidth)/2)',\n [textOnly]: 0\n }\n },\n '--iconWidth': {\n type: 'width',\n value: fontRelative(20)\n },\n '--badgePosition': {\n type: 'width',\n value: {\n default: '--iconWidth',\n [textOnly]: 'full'\n }\n },\n paddingX: {\n default: controlStyle.paddingX,\n [avatarOnly]: 0\n },\n // `control` sets this, but we need to override it for avatar only buttons.\n '--iconMargin': {\n type: 'marginStart',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0,\n [avatarOnly]: 0\n }\n }\n },\n getAllowedOverrides()\n);\n\n// Matching icon sizes. TBD.\nconst avatarSize: Record<NonNullable<ActionButtonStyleProps['size']>, number> = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n XL: 26\n} as const;\n\ninterface ActionButtonContextProps extends Partial<ActionButtonProps> {\n holdAffordance?: boolean;\n}\n\nexport const ActionButtonContext =\n createContext<ContextValue<ActionButtonContextProps, FocusableRefValue<HTMLButtonElement>>>(null);\n\n/**\n * ActionButtons allow users to perform an action. They're used for similar, task-based options\n * within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of\n * attention.\n */\nexport const ActionButton = forwardRef(function ActionButton(\n props: ActionButtonProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonContext);\n props = useFormProps(props as any);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {isPending = false, holdAffordance} = props as ActionButtonContextProps;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n let ctx = useSlottedContext(ActionButtonGroupContext);\n let isInGroup = !!ctx;\n let {\n density = 'regular',\n isJustified,\n orientation = 'horizontal',\n staticColor = props.staticColor,\n isQuiet = props.isQuiet,\n size = props.size || 'M',\n isDisabled\n } = ctx || {};\n\n let {isProgressVisible} = usePendingState(isPending);\n let {direction} = useLocale();\n\n return (\n <RACButton\n {...props}\n isDisabled={props.isDisabled ?? isDisabled}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps =>\n (props.UNSAFE_className || '') +\n btnStyles(\n {\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n staticColor,\n isStaticColor: !!staticColor,\n size,\n isQuiet,\n density,\n isJustified,\n orientation,\n isInGroup\n },\n props.styles\n )\n }>\n {({isDisabled}) => (\n <>\n <Provider\n values={[\n [SkeletonContext, null],\n [\n TextContext,\n {\n styles: style({\n gridArea: 'text',\n truncate: true,\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\n ],\n [\n IconContext,\n {\n render: centerBaseline({slot: 'icon', styles: style({gridArea: 'icon'})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\n ],\n [\n AvatarContext,\n {\n size: avatarSize[size],\n styles: style({\n marginStart: '--iconMargin',\n gridArea: 'icon'\n })\n }\n ],\n [\n ImageContext,\n {\n styles: style({\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\n ],\n [\n NotificationBadgeContext,\n {\n staticColor: staticColor,\n size: props.size === 'XS' ? undefined : props.size,\n isDisabled: isDisabled,\n styles: style({\n position: 'absolute',\n top: '--badgeTop',\n marginTop: 'calc((self(height) * -1)/2)',\n marginStart: 'calc(var(--iconMargin) * 2 + (self(height) * -1)/4)',\n gridColumnStart: 1,\n insetStart: '--badgePosition',\n visibility: {\n isProgressVisible: 'hidden'\n }\n })({isProgressVisible})\n }\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 visibility: {\n default: 'hidden',\n isProgressVisible: 'visible'\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 XS: 12,\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})}\n />\n </div>\n )}\n </Provider>\n {holdAffordance && (\n <CornerTriangle\n size={size === 'XS' ? 'S' : size}\n className={style({\n position: 'absolute',\n insetEnd: {\n size: {\n XS: space(3),\n S: space(3),\n M: 4,\n L: space(5),\n XL: space(6)\n }\n },\n bottom: {\n size: {\n XS: space(3),\n S: space(3),\n M: 4,\n L: space(5),\n XL: space(6)\n }\n },\n scaleX: {\n direction: {\n rtl: -1\n }\n }\n })({direction, size})}\n />\n )}\n </>\n )}\n </RACButton>\n );\n});\n"],"names":[],"version":3,"file":"ActionButton.mjs.map"}
@@ -29,23 +29,23 @@ $parcel$export(module.exports, "ActionButtonGroup", () => $7a26131f6144af2b$expo
29
29
  const $7a26131f6144af2b$export$641cbcd1f6f6802f = function anonymous(props, overrides) {
30
30
  let rules = " ";
31
31
  rules += (String(overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
32
- rules += ' sd131';
33
- if (props.orientation === "vertical") rules += ' _ta131';
34
- else if (props.orientation === "horizontal") rules += ' _tc131';
32
+ rules += ' sd15';
33
+ if (props.orientation === "vertical") rules += ' _ta15';
34
+ else if (props.orientation === "horizontal") rules += ' _tc15';
35
35
  if (props.density === "regular") {
36
- if (props.size === "XL") rules += ' Ue131';
37
- else if (props.size === "L") rules += ' Ue131';
38
- else if (props.size === "M") rules += ' Ue131';
39
- else if (props.size === "S") rules += ' Ub131';
40
- else if (props.size === "XS") rules += ' Ub131';
41
- } else if (props.density === "compact") rules += ' Ua131';
36
+ if (props.size === "XL") rules += ' Ue15';
37
+ else if (props.size === "L") rules += ' Ue15';
38
+ else if (props.size === "M") rules += ' Ue15';
39
+ else if (props.size === "S") rules += ' Ub15';
40
+ else if (props.size === "XS") rules += ' Ub15';
41
+ } else if (props.density === "compact") rules += ' Ua15';
42
42
  if (props.density === "regular") {
43
- if (props.size === "XL") rules += ' qe131';
44
- else if (props.size === "L") rules += ' qe131';
45
- else if (props.size === "M") rules += ' qe131';
46
- else if (props.size === "S") rules += ' qb131';
47
- else if (props.size === "XS") rules += ' qb131';
48
- } else if (props.density === "compact") rules += ' qa131';
43
+ if (props.size === "XL") rules += ' qe15';
44
+ else if (props.size === "L") rules += ' qe15';
45
+ else if (props.size === "M") rules += ' qe15';
46
+ else if (props.size === "S") rules += ' qb15';
47
+ else if (props.size === "XS") rules += ' qb15';
48
+ } else if (props.density === "compact") rules += ' qa15';
49
49
  return rules;
50
50
  };
51
51
  const $7a26131f6144af2b$export$33f5f2f2cb85d743 = /*#__PURE__*/ (0, $jGK4W$react.createContext)(null);
@@ -1,37 +1,37 @@
1
1
  @layer _.a {
2
- .sd131 {
2
+ .sd15 {
3
3
  display: flex;
4
4
  }
5
5
 
6
- ._tc131 {
6
+ ._tc15 {
7
7
  flex-direction: row;
8
8
  }
9
9
 
10
- ._ta131 {
10
+ ._ta15 {
11
11
  flex-direction: column;
12
12
  }
13
13
 
14
- .Ua131 {
14
+ .Ua15 {
15
15
  row-gap: .125rem;
16
16
  }
17
17
 
18
- .Ub131 {
18
+ .Ub15 {
19
19
  row-gap: .25rem;
20
20
  }
21
21
 
22
- .Ue131 {
22
+ .Ue15 {
23
23
  row-gap: .5rem;
24
24
  }
25
25
 
26
- .qa131 {
26
+ .qa15 {
27
27
  column-gap: .125rem;
28
28
  }
29
29
 
30
- .qb131 {
30
+ .qb15 {
31
31
  column-gap: .25rem;
32
32
  }
33
33
 
34
- .qe131 {
34
+ .qe15 {
35
35
  column-gap: .5rem;
36
36
  }
37
37
  }
@@ -21,23 +21,23 @@ import {Toolbar as $aTsYn$Toolbar} from "react-aria-components/Toolbar";
21
21
  const $10401bdc118cbc90$export$641cbcd1f6f6802f = function anonymous(props, overrides) {
22
22
  let rules = " ";
23
23
  rules += (String(overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
24
- rules += ' sd131';
25
- if (props.orientation === "vertical") rules += ' _ta131';
26
- else if (props.orientation === "horizontal") rules += ' _tc131';
24
+ rules += ' sd15';
25
+ if (props.orientation === "vertical") rules += ' _ta15';
26
+ else if (props.orientation === "horizontal") rules += ' _tc15';
27
27
  if (props.density === "regular") {
28
- if (props.size === "XL") rules += ' Ue131';
29
- else if (props.size === "L") rules += ' Ue131';
30
- else if (props.size === "M") rules += ' Ue131';
31
- else if (props.size === "S") rules += ' Ub131';
32
- else if (props.size === "XS") rules += ' Ub131';
33
- } else if (props.density === "compact") rules += ' Ua131';
28
+ if (props.size === "XL") rules += ' Ue15';
29
+ else if (props.size === "L") rules += ' Ue15';
30
+ else if (props.size === "M") rules += ' Ue15';
31
+ else if (props.size === "S") rules += ' Ub15';
32
+ else if (props.size === "XS") rules += ' Ub15';
33
+ } else if (props.density === "compact") rules += ' Ua15';
34
34
  if (props.density === "regular") {
35
- if (props.size === "XL") rules += ' qe131';
36
- else if (props.size === "L") rules += ' qe131';
37
- else if (props.size === "M") rules += ' qe131';
38
- else if (props.size === "S") rules += ' qb131';
39
- else if (props.size === "XS") rules += ' qb131';
40
- } else if (props.density === "compact") rules += ' qa131';
35
+ if (props.size === "XL") rules += ' qe15';
36
+ else if (props.size === "L") rules += ' qe15';
37
+ else if (props.size === "M") rules += ' qe15';
38
+ else if (props.size === "S") rules += ' qb15';
39
+ else if (props.size === "XS") rules += ' qb15';
40
+ } else if (props.density === "compact") rules += ' qa15';
41
41
  return rules;
42
42
  };
43
43
  const $10401bdc118cbc90$export$33f5f2f2cb85d743 = /*#__PURE__*/ (0, $aTsYn$createContext)(null);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAmCM,MAAM,0DACX,CAAA,GAAA,0BAAY,EACV;AAMG,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAC9E,KAAyB,EACzB,GAAoC;IAEpC,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,cAAc,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACxD,IAAI,WAAW,CAAC,aAAa,KAAK,WAChC,WAAW,CAAC,aAAa,GAAG,gBAAgB,MAAM,CAAC;IAGrD,qBACE,iCAAC,CAAA,GAAA,qCAAU;QACT,QAAQ,MAAM,MAAM;QACpB,aAAa,MAAM,WAAW;QAC9B,cAAc,MAAM,YAAY;QAChC,OAAO,MAAM,KAAK;QAClB,WAAW,MAAM,SAAS;QAC1B,YAAY,MAAM,UAAU;;0BAC5B,gCAAC,CAAA,GAAA,sCAAW;gBACV,KAAK;gBACL,MAAM,MAAM,IAAI;gBAChB,YAAY,MAAM,UAAU;gBAC5B,WAAW,MAAM,SAAS;gBAC1B,SAAS,MAAM,OAAO;gBACtB,QAAQ,MAAM,MAAM;gBACnB,GAAG,WAAW;0BACf,cAAA,gCAAC,CAAA,GAAA,iCAAO;;0BAEV,gCAAC,CAAA,GAAA,8BAAG;gBACF,OAAO,MAAM,KAAK;gBAClB,cAAc,MAAM,YAAY;gBAChC,UAAU,MAAM,QAAQ;gBACxB,MAAM,MAAM,QAAQ;gBACpB,qBAAqB,MAAM,mBAAmB;0BAC7C,MAAM,QAAQ;;;;AAIvB","sources":["packages/@react-spectrum/s2/src/ActionMenu.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 {ActionButton, ActionButtonProps} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {ContextValue} from 'react-aria-components/slots';\nimport {createContext, forwardRef} from 'react';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType} from './types';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuProps, MenuTrigger, MenuTriggerProps} from './Menu';\nimport MoreIcon from '../s2wf-icons/S2_Icon_More_20_N.svg';\nimport {StyleProps} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionMenuProps<T>\n extends\n Pick<\n MenuTriggerProps,\n 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'align' | 'direction' | 'shouldFlip'\n >,\n Pick<MenuProps<T>, 'children' | 'items' | 'disabledKeys' | 'onAction' | 'shouldCloseOnSelect'>,\n Pick<ActionButtonProps, 'isDisabled' | 'isQuiet' | 'autoFocus' | 'size'>,\n StyleProps,\n DOMProps,\n AriaLabelingProps {\n /**\n * The size of the Menu.\n *\n * @default 'M'\n */\n menuSize?: 'S' | 'M' | 'L' | 'XL';\n}\n\nexport const ActionMenuContext =\n createContext<ContextValue<Partial<ActionMenuProps<any>>, FocusableRefValue<HTMLButtonElement>>>(\n null\n );\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nexport const ActionMenu = /*#__PURE__*/ (forwardRef as forwardRefType)(function ActionMenu<T>(\n props: ActionMenuProps<T>,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, ActionMenuContext);\n let buttonProps = filterDOMProps(props, {labelable: true});\n if (buttonProps['aria-label'] === undefined) {\n buttonProps['aria-label'] = stringFormatter.format('menu.moreActions');\n }\n\n return (\n <MenuTrigger\n isOpen={props.isOpen}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n align={props.align}\n direction={props.direction}\n shouldFlip={props.shouldFlip}>\n <ActionButton\n ref={ref}\n size={props.size}\n isDisabled={props.isDisabled}\n autoFocus={props.autoFocus}\n isQuiet={props.isQuiet}\n styles={props.styles}\n {...buttonProps}>\n <MoreIcon />\n </ActionButton>\n <Menu\n items={props.items}\n disabledKeys={props.disabledKeys}\n onAction={props.onAction}\n size={props.menuSize}\n shouldCloseOnSelect={props.shouldCloseOnSelect}>\n {props.children}\n </Menu>\n </MenuTrigger>\n );\n});\n"],"names":[],"version":3,"file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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 {ActionButton, ActionButtonProps} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {ContextValue} from 'react-aria-components/slots';\nimport {createContext, forwardRef} from 'react';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType} from './types';\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuProps, MenuTrigger, MenuTriggerProps} from './Menu';\nimport MoreIcon from '../s2wf-icons/S2_Icon_More_20_N.svg';\nimport {StyleProps} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionMenuProps<T>\n extends\n Pick<\n MenuTriggerProps,\n 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'align' | 'direction' | 'shouldFlip'\n >,\n Pick<MenuProps<T>, 'children' | 'items' | 'disabledKeys' | 'onAction' | 'shouldCloseOnSelect'>,\n Pick<ActionButtonProps, 'isDisabled' | 'isQuiet' | 'autoFocus' | 'size'>,\n StyleProps,\n DOMProps,\n AriaLabelingProps {\n /**\n * The size of the Menu.\n *\n * @default 'M'\n */\n menuSize?: 'S' | 'M' | 'L' | 'XL';\n}\n\nexport const ActionMenuContext =\n createContext<ContextValue<Partial<ActionMenuProps<any>>, FocusableRefValue<HTMLButtonElement>>>(\n null\n );\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nexport const ActionMenu = /*#__PURE__*/ (forwardRef as forwardRefType)(function ActionMenu<T>(\n props: ActionMenuProps<T>,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, ActionMenuContext);\n let buttonProps = filterDOMProps(props, {labelable: true});\n if (buttonProps['aria-label'] === undefined) {\n buttonProps['aria-label'] = stringFormatter.format('menu.moreActions');\n }\n\n return (\n <MenuTrigger\n isOpen={props.isOpen}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n align={props.align}\n direction={props.direction}\n shouldFlip={props.shouldFlip}>\n <ActionButton\n ref={ref}\n size={props.size}\n isDisabled={props.isDisabled}\n autoFocus={props.autoFocus}\n isQuiet={props.isQuiet}\n styles={props.styles}\n {...buttonProps}>\n <MoreIcon />\n </ActionButton>\n <Menu\n items={props.items}\n disabledKeys={props.disabledKeys}\n onAction={props.onAction}\n size={props.menuSize}\n shouldCloseOnSelect={props.shouldCloseOnSelect}>\n {props.children}\n </Menu>\n </MenuTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ActionMenu.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAmCM,MAAM,0DACX,CAAA,GAAA,oBAAY,EACV;AAMG,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAC9E,KAAyB,EACzB,GAAoC;IAEpC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAChE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,cAAc,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACxD,IAAI,WAAW,CAAC,aAAa,KAAK,WAChC,WAAW,CAAC,aAAa,GAAG,gBAAgB,MAAM,CAAC;IAGrD,qBACE,iBAAC,CAAA,GAAA,yCAAU;QACT,QAAQ,MAAM,MAAM;QACpB,aAAa,MAAM,WAAW;QAC9B,cAAc,MAAM,YAAY;QAChC,OAAO,MAAM,KAAK;QAClB,WAAW,MAAM,SAAS;QAC1B,YAAY,MAAM,UAAU;;0BAC5B,gBAAC,CAAA,GAAA,yCAAW;gBACV,KAAK;gBACL,MAAM,MAAM,IAAI;gBAChB,YAAY,MAAM,UAAU;gBAC5B,WAAW,MAAM,SAAS;gBAC1B,SAAS,MAAM,OAAO;gBACtB,QAAQ,MAAM,MAAM;gBACnB,GAAG,WAAW;0BACf,cAAA,gBAAC,CAAA,GAAA,wCAAO;;0BAEV,gBAAC,CAAA,GAAA,yCAAG;gBACF,OAAO,MAAM,KAAK;gBAClB,cAAc,MAAM,YAAY;gBAChC,UAAU,MAAM,QAAQ;gBACxB,MAAM,MAAM,QAAQ;gBACpB,qBAAqB,MAAM,mBAAmB;0BAC7C,MAAM,QAAQ;;;;AAIvB","sources":["packages/@react-spectrum/s2/src/ActionMenu.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 {ActionButton, ActionButtonProps} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {ContextValue} from 'react-aria-components/slots';\nimport {createContext, forwardRef} from 'react';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType} from './types';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuProps, MenuTrigger, MenuTriggerProps} from './Menu';\nimport MoreIcon from '../s2wf-icons/S2_Icon_More_20_N.svg';\nimport {StyleProps} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionMenuProps<T>\n extends\n Pick<\n MenuTriggerProps,\n 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'align' | 'direction' | 'shouldFlip'\n >,\n Pick<MenuProps<T>, 'children' | 'items' | 'disabledKeys' | 'onAction' | 'shouldCloseOnSelect'>,\n Pick<ActionButtonProps, 'isDisabled' | 'isQuiet' | 'autoFocus' | 'size'>,\n StyleProps,\n DOMProps,\n AriaLabelingProps {\n /**\n * The size of the Menu.\n *\n * @default 'M'\n */\n menuSize?: 'S' | 'M' | 'L' | 'XL';\n}\n\nexport const ActionMenuContext =\n createContext<ContextValue<Partial<ActionMenuProps<any>>, FocusableRefValue<HTMLButtonElement>>>(\n null\n );\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nexport const ActionMenu = /*#__PURE__*/ (forwardRef as forwardRefType)(function ActionMenu<T>(\n props: ActionMenuProps<T>,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, ActionMenuContext);\n let buttonProps = filterDOMProps(props, {labelable: true});\n if (buttonProps['aria-label'] === undefined) {\n buttonProps['aria-label'] = stringFormatter.format('menu.moreActions');\n }\n\n return (\n <MenuTrigger\n isOpen={props.isOpen}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n align={props.align}\n direction={props.direction}\n shouldFlip={props.shouldFlip}>\n <ActionButton\n ref={ref}\n size={props.size}\n isDisabled={props.isDisabled}\n autoFocus={props.autoFocus}\n isQuiet={props.isQuiet}\n styles={props.styles}\n {...buttonProps}>\n <MoreIcon />\n </ActionButton>\n <Menu\n items={props.items}\n disabledKeys={props.disabledKeys}\n onAction={props.onAction}\n size={props.menuSize}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sources":["packages/@react-spectrum/s2/src/ActionMenu.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 {ActionButton, ActionButtonProps} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {ContextValue} from 'react-aria-components/slots';\nimport {createContext, forwardRef} from 'react';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType} from './types';\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuProps, MenuTrigger, MenuTriggerProps} from './Menu';\nimport MoreIcon from '../s2wf-icons/S2_Icon_More_20_N.svg';\nimport {StyleProps} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionMenuProps<T>\n extends\n Pick<\n MenuTriggerProps,\n 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'align' | 'direction' | 'shouldFlip'\n >,\n Pick<MenuProps<T>, 'children' | 'items' | 'disabledKeys' | 'onAction' | 'shouldCloseOnSelect'>,\n Pick<ActionButtonProps, 'isDisabled' | 'isQuiet' | 'autoFocus' | 'size'>,\n StyleProps,\n DOMProps,\n AriaLabelingProps {\n /**\n * The size of the Menu.\n *\n * @default 'M'\n */\n menuSize?: 'S' | 'M' | 'L' | 'XL';\n}\n\nexport const ActionMenuContext =\n createContext<ContextValue<Partial<ActionMenuProps<any>>, FocusableRefValue<HTMLButtonElement>>>(\n null\n );\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nexport const ActionMenu = /*#__PURE__*/ (forwardRef as forwardRefType)(function ActionMenu<T>(\n props: ActionMenuProps<T>,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, ActionMenuContext);\n let buttonProps = filterDOMProps(props, {labelable: true});\n if (buttonProps['aria-label'] === undefined) {\n buttonProps['aria-label'] = stringFormatter.format('menu.moreActions');\n }\n\n return (\n <MenuTrigger\n isOpen={props.isOpen}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n align={props.align}\n direction={props.direction}\n shouldFlip={props.shouldFlip}>\n <ActionButton\n ref={ref}\n size={props.size}\n isDisabled={props.isDisabled}\n autoFocus={props.autoFocus}\n isQuiet={props.isQuiet}\n styles={props.styles}\n {...buttonProps}>\n <MoreIcon />\n </ActionButton>\n <Menu\n items={props.items}\n disabledKeys={props.disabledKeys}\n onAction={props.onAction}\n size={props.menuSize}\n shouldCloseOnSelect={props.shouldCloseOnSelect}>\n {props.children}\n </Menu>\n </MenuTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ActionMenu.mjs.map"}
@@ -30,16 +30,16 @@ $parcel$export(module.exports, "default", () => $54686c7c3f031ee2$export$2e2bcd8
30
30
 
31
31
  let $54686c7c3f031ee2$var$styles = function anonymous(props) {
32
32
  let rules = " ";
33
- if (props.size === "S") rules += ' Zh131';
34
- else if (props.size === "XS") rules += ' Zh131';
35
- else if (props.size === "XL") rules += ' Zj131';
36
- else if (props.size === "L") rules += ' Zj131';
37
- else if (props.size === "M") rules += ' Zi131';
38
- if (props.size === "S") rules += ' Fi131';
39
- else if (props.size === "XS") rules += ' Fi131';
40
- else if (props.size === "XL") rules += ' Fk131';
41
- else if (props.size === "L") rules += ' Fk131';
42
- else if (props.size === "M") rules += ' Fj131';
33
+ if (props.size === "S") rules += ' Zh15';
34
+ else if (props.size === "XS") rules += ' Zh15';
35
+ else if (props.size === "XL") rules += ' Zj15';
36
+ else if (props.size === "L") rules += ' Zj15';
37
+ else if (props.size === "M") rules += ' Zi15';
38
+ if (props.size === "S") rules += ' Fi15';
39
+ else if (props.size === "XS") rules += ' Fi15';
40
+ else if (props.size === "XL") rules += ' Fk15';
41
+ else if (props.size === "L") rules += ' Fk15';
42
+ else if (props.size === "M") rules += ' Fj15';
43
43
  return rules;
44
44
  };
45
45
  function $54686c7c3f031ee2$export$2e2bcd8739ae039(props) {
@@ -1,28 +1,28 @@
1
1
  @layer _.a {
2
- .Zi131 {
2
+ .Zi15 {
3
3
  width: calc(.625rem * var(--s2-scale));
4
4
  }
5
5
 
6
- .Zj131 {
6
+ .Zj15 {
7
7
  width: calc(.75rem * var(--s2-scale));
8
8
  width: calc(.75rem * var(--s2-scale));
9
9
  }
10
10
 
11
- .Zh131 {
11
+ .Zh15 {
12
12
  width: calc(.5rem * var(--s2-scale));
13
13
  width: calc(.5rem * var(--s2-scale));
14
14
  }
15
15
 
16
- .Fj131 {
16
+ .Fj15 {
17
17
  height: calc(.625rem * var(--s2-scale));
18
18
  }
19
19
 
20
- .Fk131 {
20
+ .Fk15 {
21
21
  height: calc(.75rem * var(--s2-scale));
22
22
  height: calc(.75rem * var(--s2-scale));
23
23
  }
24
24
 
25
- .Fi131 {
25
+ .Fi15 {
26
26
  height: calc(.5rem * var(--s2-scale));
27
27
  height: calc(.5rem * var(--s2-scale));
28
28
  }
@@ -24,16 +24,16 @@ import {jsx as $e5O6h$jsx} from "react/jsx-runtime";
24
24
 
25
25
  let $053de6aaf5f9b7bd$var$styles = function anonymous(props) {
26
26
  let rules = " ";
27
- if (props.size === "S") rules += ' Zh131';
28
- else if (props.size === "XS") rules += ' Zh131';
29
- else if (props.size === "XL") rules += ' Zj131';
30
- else if (props.size === "L") rules += ' Zj131';
31
- else if (props.size === "M") rules += ' Zi131';
32
- if (props.size === "S") rules += ' Fi131';
33
- else if (props.size === "XS") rules += ' Fi131';
34
- else if (props.size === "XL") rules += ' Fk131';
35
- else if (props.size === "L") rules += ' Fk131';
36
- else if (props.size === "M") rules += ' Fj131';
27
+ if (props.size === "S") rules += ' Zh15';
28
+ else if (props.size === "XS") rules += ' Zh15';
29
+ else if (props.size === "XL") rules += ' Zj15';
30
+ else if (props.size === "L") rules += ' Zj15';
31
+ else if (props.size === "M") rules += ' Zi15';
32
+ if (props.size === "S") rules += ' Fi15';
33
+ else if (props.size === "XS") rules += ' Fi15';
34
+ else if (props.size === "XL") rules += ' Fk15';
35
+ else if (props.size === "L") rules += ' Fk15';
36
+ else if (props.size === "M") rules += ' Fj15';
37
37
  return rules;
38
38
  };
39
39
  function $053de6aaf5f9b7bd$export$2e2bcd8739ae039(props) {
@@ -50,9 +50,9 @@ $parcel$export(module.exports, "AlertDialog", () => $d67aa10f4fac9e2b$export$de4
50
50
 
51
51
  const $d67aa10f4fac9e2b$var$icon = function anonymous(props) {
52
52
  let rules = " ";
53
- rules += ' Hv131';
54
- if (props.variant === "warning") rules += ' -_8sjo0b-tm131';
55
- else if (props.variant === "error") rules += ' -_8sjo0b-tq131';
53
+ rules += ' Hv15';
54
+ if (props.variant === "warning") rules += ' -_8sjo0b-tm15';
55
+ else if (props.variant === "error") rules += ' -_8sjo0b-tq15';
56
56
  return rules;
57
57
  };
58
58
  const $d67aa10f4fac9e2b$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $dZ5J1$react.forwardRef)(function AlertDialog(props, ref) {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAyDD,MAAM;;;;;;;AAiBC,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAW;IAC7F,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,mBACF,eAAe,eACf,WAAW,wBACX,oBAAoB,sBACpB,kBAA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ACX;;0CAGL,gCAAC,CAAA,GAAA,gCAAK;gCACJ,SAAS;gCACT,YAAY;gCACZ,WAAW,oBAAoB;gCAC/B,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,SAAS;gCAC9B,eAAY;0CACX;;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from 'react-aria/chain';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components/slots';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /**\n * The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog.\n *\n * @default 'confirmation'\n */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning';\n /** The title of the AlertDialog. */\n title: string;\n /** The contents of the AlertDialog. */\n children: ReactNode;\n /** The label to display within the cancel button. */\n cancelLabel?: string;\n /** The label to display within the confirm button. */\n primaryActionLabel: string;\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string;\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean;\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean;\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void;\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void;\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void;\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary';\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L';\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to\n * acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={props.UNSAFE_className || ''}>\n {({close}) => (\n <>\n <Provider values={[[IconContext, {styles: icon({variant})}]]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && (\n <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {variant === 'warning' && (\n <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel && (\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n )}\n {secondaryActionLabel && (\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n )}\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAwDD,MAAM;;;;;;;AAiBC,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAW;IAC7F,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,mBACF,eAAe,eACf,WAAW,wBACX,oBAAoB,sBACpB,kBAAkB,6BAClB,yBAAyB,2BACzB,uBAAuB,YACvB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,UAC3B,KAAK,YACL,QAAQ,WACR,UAAU,gBACX,GAAG;IAEJ,IAAI,gBAAgB;IACpB,IAAI,YAAY,gBACd,gBAA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AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from 'react-aria/chain';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components/slots';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /**\n * The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog.\n *\n * @default 'confirmation'\n */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning';\n /** The title of the AlertDialog. */\n title: string;\n /** The contents of the AlertDialog. */\n children: ReactNode;\n /** The label to display within the cancel button. */\n cancelLabel?: string;\n /** The label to display within the confirm button. */\n primaryActionLabel: string;\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string;\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean;\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean;\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void;\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void;\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void;\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary';\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L';\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to\n * acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={props.UNSAFE_className || ''}>\n {({close}) => (\n <>\n <Provider values={[[IconContext, {styles: icon({variant})}]]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && (\n <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {variant === 'warning' && (\n <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel && (\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n )}\n {secondaryActionLabel && (\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n )}\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.cjs.map"}
@@ -1,13 +1,13 @@
1
1
  @layer _.a {
2
- .Hv131 {
2
+ .Hv15 {
3
3
  margin-inline-end: .5rem;
4
4
  }
5
5
 
6
- .-_8sjo0b-tq131 {
6
+ .-_8sjo0b-tq15 {
7
7
  --iconPrimary: light-dark(#f03823, #fc432e);
8
8
  }
9
9
 
10
- .-_8sjo0b-tm131 {
10
+ .-_8sjo0b-tm15 {
11
11
  --iconPrimary: light-dark(#d45b00, #e06400);
12
12
  }
13
13
  }
@@ -1 +1 @@
1
- {"mappings":"AAmEa;EAAA;;;;EAAA;;;;EAAA","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from 'react-aria/chain';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components/slots';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /**\n * The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog.\n *\n * @default 'confirmation'\n */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning';\n /** The title of the AlertDialog. */\n title: string;\n /** The contents of the AlertDialog. */\n children: ReactNode;\n /** The label to display within the cancel button. */\n cancelLabel?: string;\n /** The label to display within the confirm button. */\n primaryActionLabel: string;\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string;\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean;\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean;\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void;\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void;\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void;\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary';\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L';\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to\n * acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={props.UNSAFE_className || ''}>\n {({close}) => (\n <>\n <Provider values={[[IconContext, {styles: icon({variant})}]]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && (\n <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {variant === 'warning' && (\n <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel && (\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n )}\n {secondaryActionLabel && (\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n )}\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.css.map"}
1
+ {"mappings":"AAkEa;EAAA;;;;EAAA;;;;EAAA","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from 'react-aria/chain';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components/slots';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /**\n * The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog.\n *\n * @default 'confirmation'\n */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning';\n /** The title of the AlertDialog. */\n title: string;\n /** The contents of the AlertDialog. */\n children: ReactNode;\n /** The label to display within the cancel button. */\n cancelLabel?: string;\n /** The label to display within the confirm button. */\n primaryActionLabel: string;\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string;\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean;\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean;\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void;\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void;\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void;\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary';\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L';\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to\n * acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={props.UNSAFE_className || ''}>\n {({close}) => (\n <>\n <Provider values={[[IconContext, {styles: icon({variant})}]]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && (\n <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {variant === 'warning' && (\n <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel && (\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n )}\n {secondaryActionLabel && (\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n )}\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.css.map"}
@@ -44,9 +44,9 @@ function $parcel$interopDefault(a) {
44
44
 
45
45
  const $94a8ad475d9a330c$var$icon = function anonymous(props) {
46
46
  let rules = " ";
47
- rules += ' Hv131';
48
- if (props.variant === "warning") rules += ' -_8sjo0b-tm131';
49
- else if (props.variant === "error") rules += ' -_8sjo0b-tq131';
47
+ rules += ' Hv15';
48
+ if (props.variant === "warning") rules += ' -_8sjo0b-tm15';
49
+ else if (props.variant === "error") rules += ' -_8sjo0b-tq15';
50
50
  return rules;
51
51
  };
52
52
  const $94a8ad475d9a330c$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $2iZqV$forwardRef)(function AlertDialog(props, ref) {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;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M,CAAA,GAAA,YAAI,EAAE,SAAS;gCAC9B,SAAQ;gCACR,WAAU;gCACV,WAAW,oBAAoB;gCAC/B,eAAY;0CACX;;4BAGJ,sCACC,gBAAC,CAAA,GAAA,yCAAK;gCACJ,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,SAAS;gCAC9B,SAAQ;gCACR,YAAY;gCACZ,WAAU;gCACV,WAAW,oBAAoB;gCAC/B,eAAY;0CACX;;0CAGL,gBAAC,CAAA,GAAA,yCAAK;gCACJ,SAAS;gCACT,YAAY;gCACZ,WAAW,oBAAoB;gCAC/B,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,SAAS;gCAC9B,eAAY;0CACX;;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from 'react-aria/chain';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components/slots';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /**\n * The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog.\n *\n * @default 'confirmation'\n */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning';\n /** The title of the AlertDialog. */\n title: string;\n /** The contents of the AlertDialog. */\n children: ReactNode;\n /** The label to display within the cancel button. */\n cancelLabel?: string;\n /** The label to display within the confirm button. */\n primaryActionLabel: string;\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string;\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean;\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean;\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void;\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void;\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void;\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary';\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L';\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to\n * acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={props.UNSAFE_className || ''}>\n {({close}) => (\n <>\n <Provider values={[[IconContext, {styles: icon({variant})}]]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && (\n <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {variant === 'warning' && (\n <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel && (\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n )}\n {secondaryActionLabel && (\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n )}\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAwDD,MAAM;;;;;;;AAiBC,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAW;IAC7F,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,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;gCACR,YAAY;gCACZ,WAAU;gCACV,WAAW,oBAAoB;gCAC/B,eAAY;0CACX;;0CAGL,gBAAC,CAAA,GAAA,yCAAK;gCACJ,SAAS;gCACT,YAAY;gCACZ,WAAW,oBAAoB;gCAC/B,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,SAAS;gCAC9B,eAAY;0CACX;;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from 'react-aria/chain';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components/slots';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /**\n * The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog.\n *\n * @default 'confirmation'\n */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning';\n /** The title of the AlertDialog. */\n title: string;\n /** The contents of the AlertDialog. */\n children: ReactNode;\n /** The label to display within the cancel button. */\n cancelLabel?: string;\n /** The label to display within the confirm button. */\n primaryActionLabel: string;\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string;\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean;\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean;\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void;\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void;\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void;\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary';\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L';\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to\n * acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={props.UNSAFE_className || ''}>\n {({close}) => (\n <>\n <Provider values={[[IconContext, {styles: icon({variant})}]]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && (\n <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {variant === 'warning' && (\n <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />\n )}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel && (\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n )}\n {secondaryActionLabel && (\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n )}\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.mjs.map"}
@@ -26,12 +26,12 @@ $parcel$export(module.exports, "default", () => $5d3efbee7071458b$export$2e2bcd8
26
26
 
27
27
  let $5d3efbee7071458b$var$styles = function anonymous(props) {
28
28
  let rules = " ";
29
- if (props.size === "XL") rules += ' Zi131';
30
- else if (props.size === "L") rules += ' Zi131';
31
- else if (props.size === "M") rules += ' Zh131';
32
- if (props.size === "XL") rules += ' Fj131';
33
- else if (props.size === "L") rules += ' Fj131';
34
- else if (props.size === "M") rules += ' Fi131';
29
+ if (props.size === "XL") rules += ' Zi15';
30
+ else if (props.size === "L") rules += ' Zi15';
31
+ else if (props.size === "M") rules += ' Zh15';
32
+ if (props.size === "XL") rules += ' Fj15';
33
+ else if (props.size === "L") rules += ' Fj15';
34
+ else if (props.size === "M") rules += ' Fi15';
35
35
  return rules;
36
36
  };
37
37
  function $5d3efbee7071458b$export$2e2bcd8739ae039(props) {
@@ -1,18 +1,18 @@
1
1
  @layer _.a {
2
- .Zh131 {
2
+ .Zh15 {
3
3
  width: calc(.5rem * var(--s2-scale));
4
4
  }
5
5
 
6
- .Zi131 {
6
+ .Zi15 {
7
7
  width: calc(.625rem * var(--s2-scale));
8
8
  width: calc(.625rem * var(--s2-scale));
9
9
  }
10
10
 
11
- .Fi131 {
11
+ .Fi15 {
12
12
  height: calc(.5rem * var(--s2-scale));
13
13
  }
14
14
 
15
- .Fj131 {
15
+ .Fj15 {
16
16
  height: calc(.625rem * var(--s2-scale));
17
17
  height: calc(.625rem * var(--s2-scale));
18
18
  }
@@ -20,12 +20,12 @@ import {jsx as $7AxvV$jsx} from "react/jsx-runtime";
20
20
 
21
21
  let $8373af657584cab2$var$styles = function anonymous(props) {
22
22
  let rules = " ";
23
- if (props.size === "XL") rules += ' Zi131';
24
- else if (props.size === "L") rules += ' Zi131';
25
- else if (props.size === "M") rules += ' Zh131';
26
- if (props.size === "XL") rules += ' Fj131';
27
- else if (props.size === "L") rules += ' Fj131';
28
- else if (props.size === "M") rules += ' Fi131';
23
+ if (props.size === "XL") rules += ' Zi15';
24
+ else if (props.size === "L") rules += ' Zi15';
25
+ else if (props.size === "M") rules += ' Zh15';
26
+ if (props.size === "XL") rules += ' Fj15';
27
+ else if (props.size === "L") rules += ' Fj15';
28
+ else if (props.size === "M") rules += ' Fi15';
29
29
  return rules;
30
30
  };
31
31
  function $8373af657584cab2$export$2e2bcd8739ae039(props) {