@react-spectrum/s2 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/dist/Accordion.cjs +5 -8
  2. package/dist/Accordion.cjs.map +1 -1
  3. package/dist/Accordion.css +2 -2
  4. package/dist/Accordion.css.map +1 -1
  5. package/dist/Accordion.mjs +5 -8
  6. package/dist/Accordion.mjs.map +1 -1
  7. package/dist/ActionBar.cjs +264 -0
  8. package/dist/ActionBar.cjs.map +1 -0
  9. package/dist/ActionBar.css +267 -0
  10. package/dist/ActionBar.css.map +1 -0
  11. package/dist/ActionBar.mjs +257 -0
  12. package/dist/ActionBar.mjs.map +1 -0
  13. package/dist/ActionButton.cjs +121 -147
  14. package/dist/ActionButton.cjs.map +1 -1
  15. package/dist/ActionButton.css +133 -153
  16. package/dist/ActionButton.css.map +1 -1
  17. package/dist/ActionButton.mjs +122 -148
  18. package/dist/ActionButton.mjs.map +1 -1
  19. package/dist/ActionButtonGroup.cjs +6 -9
  20. package/dist/ActionButtonGroup.cjs.map +1 -1
  21. package/dist/ActionButtonGroup.css +3 -3
  22. package/dist/ActionButtonGroup.css.map +1 -1
  23. package/dist/ActionButtonGroup.mjs +6 -9
  24. package/dist/ActionButtonGroup.mjs.map +1 -1
  25. package/dist/ActionMenu.cjs +2 -5
  26. package/dist/ActionMenu.cjs.map +1 -1
  27. package/dist/ActionMenu.mjs +2 -5
  28. package/dist/ActionMenu.mjs.map +1 -1
  29. package/dist/AlertDialog.cjs +2 -5
  30. package/dist/AlertDialog.cjs.map +1 -1
  31. package/dist/AlertDialog.css.map +1 -1
  32. package/dist/AlertDialog.mjs +2 -5
  33. package/dist/AlertDialog.mjs.map +1 -1
  34. package/dist/Avatar.cjs +12 -15
  35. package/dist/Avatar.cjs.map +1 -1
  36. package/dist/Avatar.css +11 -11
  37. package/dist/Avatar.css.map +1 -1
  38. package/dist/Avatar.mjs +12 -15
  39. package/dist/Avatar.mjs.map +1 -1
  40. package/dist/AvatarGroup.cjs +99 -102
  41. package/dist/AvatarGroup.cjs.map +1 -1
  42. package/dist/AvatarGroup.css +31 -31
  43. package/dist/AvatarGroup.css.map +1 -1
  44. package/dist/AvatarGroup.mjs +99 -102
  45. package/dist/AvatarGroup.mjs.map +1 -1
  46. package/dist/Badge.cjs +99 -102
  47. package/dist/Badge.cjs.map +1 -1
  48. package/dist/Badge.css +76 -76
  49. package/dist/Badge.css.map +1 -1
  50. package/dist/Badge.mjs +99 -102
  51. package/dist/Badge.mjs.map +1 -1
  52. package/dist/Breadcrumbs.cjs +93 -94
  53. package/dist/Breadcrumbs.cjs.map +1 -1
  54. package/dist/Breadcrumbs.css +70 -64
  55. package/dist/Breadcrumbs.css.map +1 -1
  56. package/dist/Breadcrumbs.mjs +94 -95
  57. package/dist/Breadcrumbs.mjs.map +1 -1
  58. package/dist/Button.cjs +305 -278
  59. package/dist/Button.cjs.map +1 -1
  60. package/dist/Button.css +255 -182
  61. package/dist/Button.css.map +1 -1
  62. package/dist/Button.mjs +307 -280
  63. package/dist/Button.mjs.map +1 -1
  64. package/dist/ButtonGroup.cjs +17 -20
  65. package/dist/ButtonGroup.cjs.map +1 -1
  66. package/dist/ButtonGroup.css +11 -11
  67. package/dist/ButtonGroup.css.map +1 -1
  68. package/dist/ButtonGroup.mjs +18 -21
  69. package/dist/ButtonGroup.mjs.map +1 -1
  70. package/dist/Card.cjs +167 -167
  71. package/dist/Card.css +121 -121
  72. package/dist/Card.mjs +167 -167
  73. package/dist/CardView.cjs +47 -21
  74. package/dist/CardView.cjs.map +1 -1
  75. package/dist/CardView.css +39 -15
  76. package/dist/CardView.css.map +1 -1
  77. package/dist/CardView.mjs +49 -23
  78. package/dist/CardView.mjs.map +1 -1
  79. package/dist/CenterBaseline.cjs +1 -1
  80. package/dist/CenterBaseline.css +2 -2
  81. package/dist/CenterBaseline.mjs +1 -1
  82. package/dist/Checkbox.cjs +58 -62
  83. package/dist/Checkbox.cjs.map +1 -1
  84. package/dist/Checkbox.css +54 -54
  85. package/dist/Checkbox.css.map +1 -1
  86. package/dist/Checkbox.mjs +59 -63
  87. package/dist/Checkbox.mjs.map +1 -1
  88. package/dist/CheckboxGroup.cjs +43 -45
  89. package/dist/CheckboxGroup.cjs.map +1 -1
  90. package/dist/CheckboxGroup.css +32 -32
  91. package/dist/CheckboxGroup.css.map +1 -1
  92. package/dist/CheckboxGroup.mjs +44 -46
  93. package/dist/CheckboxGroup.mjs.map +1 -1
  94. package/dist/ClearButton.cjs +7 -8
  95. package/dist/ClearButton.cjs.map +1 -1
  96. package/dist/ClearButton.css +5 -5
  97. package/dist/ClearButton.css.map +1 -1
  98. package/dist/ClearButton.mjs +7 -8
  99. package/dist/ClearButton.mjs.map +1 -1
  100. package/dist/CloseButton.cjs +40 -53
  101. package/dist/CloseButton.cjs.map +1 -1
  102. package/dist/CloseButton.css +45 -49
  103. package/dist/CloseButton.css.map +1 -1
  104. package/dist/CloseButton.mjs +40 -53
  105. package/dist/CloseButton.mjs.map +1 -1
  106. package/dist/ColorArea.cjs +12 -15
  107. package/dist/ColorArea.cjs.map +1 -1
  108. package/dist/ColorArea.css +10 -10
  109. package/dist/ColorArea.css.map +1 -1
  110. package/dist/ColorArea.mjs +12 -15
  111. package/dist/ColorArea.mjs.map +1 -1
  112. package/dist/ColorField.cjs +31 -34
  113. package/dist/ColorField.cjs.map +1 -1
  114. package/dist/ColorField.css +24 -24
  115. package/dist/ColorField.css.map +1 -1
  116. package/dist/ColorField.mjs +32 -35
  117. package/dist/ColorField.mjs.map +1 -1
  118. package/dist/ColorHandle.cjs +11 -11
  119. package/dist/ColorHandle.css +19 -19
  120. package/dist/ColorHandle.mjs +11 -11
  121. package/dist/ColorSlider.cjs +43 -46
  122. package/dist/ColorSlider.cjs.map +1 -1
  123. package/dist/ColorSlider.css +43 -43
  124. package/dist/ColorSlider.css.map +1 -1
  125. package/dist/ColorSlider.mjs +44 -47
  126. package/dist/ColorSlider.mjs.map +1 -1
  127. package/dist/ColorSwatch.cjs +8 -11
  128. package/dist/ColorSwatch.cjs.map +1 -1
  129. package/dist/ColorSwatch.css +14 -14
  130. package/dist/ColorSwatch.css.map +1 -1
  131. package/dist/ColorSwatch.mjs +9 -12
  132. package/dist/ColorSwatch.mjs.map +1 -1
  133. package/dist/ColorSwatchPicker.cjs +15 -18
  134. package/dist/ColorSwatchPicker.cjs.map +1 -1
  135. package/dist/ColorSwatchPicker.css +33 -33
  136. package/dist/ColorSwatchPicker.css.map +1 -1
  137. package/dist/ColorSwatchPicker.mjs +15 -18
  138. package/dist/ColorSwatchPicker.mjs.map +1 -1
  139. package/dist/ColorWheel.cjs +18 -21
  140. package/dist/ColorWheel.cjs.map +1 -1
  141. package/dist/ColorWheel.css +15 -15
  142. package/dist/ColorWheel.css.map +1 -1
  143. package/dist/ColorWheel.mjs +18 -21
  144. package/dist/ColorWheel.mjs.map +1 -1
  145. package/dist/ComboBox.cjs +61 -61
  146. package/dist/ComboBox.cjs.map +1 -1
  147. package/dist/ComboBox.css +52 -52
  148. package/dist/ComboBox.css.map +1 -1
  149. package/dist/ComboBox.mjs +62 -62
  150. package/dist/ComboBox.mjs.map +1 -1
  151. package/dist/Content.cjs +12 -19
  152. package/dist/Content.cjs.map +1 -1
  153. package/dist/Content.mjs +12 -19
  154. package/dist/Content.mjs.map +1 -1
  155. package/dist/ContextualHelp.cjs +7 -10
  156. package/dist/ContextualHelp.cjs.map +1 -1
  157. package/dist/ContextualHelp.css +23 -23
  158. package/dist/ContextualHelp.css.map +1 -1
  159. package/dist/ContextualHelp.mjs +7 -10
  160. package/dist/ContextualHelp.mjs.map +1 -1
  161. package/dist/CustomDialog.cjs +10 -13
  162. package/dist/CustomDialog.cjs.map +1 -1
  163. package/dist/CustomDialog.css +9 -9
  164. package/dist/CustomDialog.css.map +1 -1
  165. package/dist/CustomDialog.mjs +10 -13
  166. package/dist/CustomDialog.mjs.map +1 -1
  167. package/dist/Dialog.cjs +12 -16
  168. package/dist/Dialog.cjs.map +1 -1
  169. package/dist/Dialog.css +39 -39
  170. package/dist/Dialog.css.map +1 -1
  171. package/dist/Dialog.mjs +12 -16
  172. package/dist/Dialog.mjs.map +1 -1
  173. package/dist/Disclosure.cjs +60 -69
  174. package/dist/Disclosure.cjs.map +1 -1
  175. package/dist/Disclosure.css +49 -49
  176. package/dist/Disclosure.css.map +1 -1
  177. package/dist/Disclosure.mjs +61 -70
  178. package/dist/Disclosure.mjs.map +1 -1
  179. package/dist/Divider.cjs +15 -19
  180. package/dist/Divider.cjs.map +1 -1
  181. package/dist/Divider.css +18 -18
  182. package/dist/Divider.css.map +1 -1
  183. package/dist/Divider.mjs +15 -19
  184. package/dist/Divider.mjs.map +1 -1
  185. package/dist/DropZone.cjs +30 -33
  186. package/dist/DropZone.cjs.map +1 -1
  187. package/dist/DropZone.css +26 -26
  188. package/dist/DropZone.css.map +1 -1
  189. package/dist/DropZone.mjs +30 -33
  190. package/dist/DropZone.mjs.map +1 -1
  191. package/dist/Field.cjs +133 -131
  192. package/dist/Field.cjs.map +1 -1
  193. package/dist/Field.css +76 -84
  194. package/dist/Field.css.map +1 -1
  195. package/dist/Field.mjs +133 -131
  196. package/dist/Field.mjs.map +1 -1
  197. package/dist/Form.cjs +6 -9
  198. package/dist/Form.cjs.map +1 -1
  199. package/dist/Form.css +3 -3
  200. package/dist/Form.css.map +1 -1
  201. package/dist/Form.mjs +6 -9
  202. package/dist/Form.mjs.map +1 -1
  203. package/dist/FullscreenDialog.cjs +7 -10
  204. package/dist/FullscreenDialog.cjs.map +1 -1
  205. package/dist/FullscreenDialog.css +54 -54
  206. package/dist/FullscreenDialog.css.map +1 -1
  207. package/dist/FullscreenDialog.mjs +7 -10
  208. package/dist/FullscreenDialog.mjs.map +1 -1
  209. package/dist/IllustratedMessage.cjs +128 -132
  210. package/dist/IllustratedMessage.cjs.map +1 -1
  211. package/dist/IllustratedMessage.css +58 -58
  212. package/dist/IllustratedMessage.css.map +1 -1
  213. package/dist/IllustratedMessage.mjs +128 -132
  214. package/dist/IllustratedMessage.mjs.map +1 -1
  215. package/dist/Image.cjs +12 -13
  216. package/dist/Image.cjs.map +1 -1
  217. package/dist/Image.css +11 -11
  218. package/dist/Image.css.map +1 -1
  219. package/dist/Image.mjs +13 -14
  220. package/dist/Image.mjs.map +1 -1
  221. package/dist/InlineAlert.cjs +75 -84
  222. package/dist/InlineAlert.cjs.map +1 -1
  223. package/dist/InlineAlert.css +59 -63
  224. package/dist/InlineAlert.css.map +1 -1
  225. package/dist/InlineAlert.mjs +76 -85
  226. package/dist/InlineAlert.mjs.map +1 -1
  227. package/dist/Link.cjs +36 -39
  228. package/dist/Link.cjs.map +1 -1
  229. package/dist/Link.css +42 -42
  230. package/dist/Link.css.map +1 -1
  231. package/dist/Link.mjs +37 -40
  232. package/dist/Link.mjs.map +1 -1
  233. package/dist/Menu.cjs +322 -234
  234. package/dist/Menu.cjs.map +1 -1
  235. package/dist/Menu.css +118 -116
  236. package/dist/Menu.css.map +1 -1
  237. package/dist/Menu.mjs +323 -235
  238. package/dist/Menu.mjs.map +1 -1
  239. package/dist/Meter.cjs +66 -70
  240. package/dist/Meter.cjs.map +1 -1
  241. package/dist/Meter.css +69 -73
  242. package/dist/Meter.css.map +1 -1
  243. package/dist/Meter.mjs +66 -70
  244. package/dist/Meter.mjs.map +1 -1
  245. package/dist/Modal.cjs +36 -45
  246. package/dist/Modal.cjs.map +1 -1
  247. package/dist/Modal.css +48 -72
  248. package/dist/Modal.css.map +1 -1
  249. package/dist/Modal.mjs +37 -46
  250. package/dist/Modal.mjs.map +1 -1
  251. package/dist/NumberField.cjs +66 -69
  252. package/dist/NumberField.cjs.map +1 -1
  253. package/dist/NumberField.css +70 -70
  254. package/dist/NumberField.css.map +1 -1
  255. package/dist/NumberField.mjs +67 -70
  256. package/dist/NumberField.mjs.map +1 -1
  257. package/dist/Picker.cjs +122 -122
  258. package/dist/Picker.cjs.map +1 -1
  259. package/dist/Picker.css +84 -84
  260. package/dist/Picker.css.map +1 -1
  261. package/dist/Picker.mjs +123 -123
  262. package/dist/Picker.mjs.map +1 -1
  263. package/dist/Popover.cjs +47 -69
  264. package/dist/Popover.cjs.map +1 -1
  265. package/dist/Popover.css +55 -126
  266. package/dist/Popover.css.map +1 -1
  267. package/dist/Popover.mjs +48 -70
  268. package/dist/Popover.mjs.map +1 -1
  269. package/dist/ProgressBar.cjs +85 -87
  270. package/dist/ProgressBar.cjs.map +1 -1
  271. package/dist/ProgressBar.css +81 -85
  272. package/dist/ProgressBar.css.map +1 -1
  273. package/dist/ProgressBar.mjs +85 -87
  274. package/dist/ProgressBar.mjs.map +1 -1
  275. package/dist/ProgressCircle.cjs +16 -18
  276. package/dist/ProgressCircle.cjs.map +1 -1
  277. package/dist/ProgressCircle.css +16 -16
  278. package/dist/ProgressCircle.css.map +1 -1
  279. package/dist/ProgressCircle.mjs +16 -18
  280. package/dist/ProgressCircle.mjs.map +1 -1
  281. package/dist/Provider.cjs +5 -5
  282. package/dist/Provider.css +6 -6
  283. package/dist/Provider.mjs +5 -5
  284. package/dist/Radio.cjs +54 -58
  285. package/dist/Radio.cjs.map +1 -1
  286. package/dist/Radio.css +50 -50
  287. package/dist/Radio.css.map +1 -1
  288. package/dist/Radio.mjs +55 -59
  289. package/dist/Radio.mjs.map +1 -1
  290. package/dist/RadioGroup.cjs +39 -43
  291. package/dist/RadioGroup.cjs.map +1 -1
  292. package/dist/RadioGroup.css +32 -32
  293. package/dist/RadioGroup.css.map +1 -1
  294. package/dist/RadioGroup.mjs +40 -44
  295. package/dist/RadioGroup.mjs.map +1 -1
  296. package/dist/RangeSlider.cjs +2 -3
  297. package/dist/RangeSlider.cjs.map +1 -1
  298. package/dist/RangeSlider.mjs +3 -4
  299. package/dist/RangeSlider.mjs.map +1 -1
  300. package/dist/SearchField.cjs +34 -37
  301. package/dist/SearchField.cjs.map +1 -1
  302. package/dist/SearchField.css +30 -30
  303. package/dist/SearchField.css.map +1 -1
  304. package/dist/SearchField.mjs +35 -38
  305. package/dist/SearchField.mjs.map +1 -1
  306. package/dist/SegmentedControl.cjs +67 -73
  307. package/dist/SegmentedControl.cjs.map +1 -1
  308. package/dist/SegmentedControl.css +63 -63
  309. package/dist/SegmentedControl.css.map +1 -1
  310. package/dist/SegmentedControl.mjs +68 -74
  311. package/dist/SegmentedControl.mjs.map +1 -1
  312. package/dist/Slider.cjs +111 -112
  313. package/dist/Slider.cjs.map +1 -1
  314. package/dist/Slider.css +87 -87
  315. package/dist/Slider.css.map +1 -1
  316. package/dist/Slider.mjs +112 -113
  317. package/dist/Slider.mjs.map +1 -1
  318. package/dist/StatusLight.cjs +28 -32
  319. package/dist/StatusLight.cjs.map +1 -1
  320. package/dist/StatusLight.css +26 -26
  321. package/dist/StatusLight.css.map +1 -1
  322. package/dist/StatusLight.mjs +28 -32
  323. package/dist/StatusLight.mjs.map +1 -1
  324. package/dist/Switch.cjs +56 -60
  325. package/dist/Switch.cjs.map +1 -1
  326. package/dist/Switch.css +48 -48
  327. package/dist/Switch.css.map +1 -1
  328. package/dist/Switch.mjs +57 -61
  329. package/dist/Switch.mjs.map +1 -1
  330. package/dist/TableView.cjs +209 -196
  331. package/dist/TableView.cjs.map +1 -1
  332. package/dist/TableView.css +95 -95
  333. package/dist/TableView.css.map +1 -1
  334. package/dist/TableView.mjs +211 -198
  335. package/dist/TableView.mjs.map +1 -1
  336. package/dist/Tabs.cjs +59 -62
  337. package/dist/Tabs.cjs.map +1 -1
  338. package/dist/Tabs.css +42 -42
  339. package/dist/Tabs.css.map +1 -1
  340. package/dist/Tabs.mjs +59 -62
  341. package/dist/Tabs.mjs.map +1 -1
  342. package/dist/TagGroup.cjs +122 -124
  343. package/dist/TagGroup.cjs.map +1 -1
  344. package/dist/TagGroup.css +93 -93
  345. package/dist/TagGroup.css.map +1 -1
  346. package/dist/TagGroup.mjs +122 -124
  347. package/dist/TagGroup.mjs.map +1 -1
  348. package/dist/TextField.cjs +44 -55
  349. package/dist/TextField.cjs.map +1 -1
  350. package/dist/TextField.css +33 -33
  351. package/dist/TextField.css.map +1 -1
  352. package/dist/TextField.mjs +45 -56
  353. package/dist/TextField.mjs.map +1 -1
  354. package/dist/ToggleButton.cjs +6 -9
  355. package/dist/ToggleButton.cjs.map +1 -1
  356. package/dist/ToggleButton.css +7 -7
  357. package/dist/ToggleButton.css.map +1 -1
  358. package/dist/ToggleButton.mjs +6 -9
  359. package/dist/ToggleButton.mjs.map +1 -1
  360. package/dist/ToggleButtonGroup.cjs +2 -5
  361. package/dist/ToggleButtonGroup.cjs.map +1 -1
  362. package/dist/ToggleButtonGroup.mjs +2 -5
  363. package/dist/ToggleButtonGroup.mjs.map +1 -1
  364. package/dist/Tooltip.cjs +48 -48
  365. package/dist/Tooltip.cjs.map +1 -1
  366. package/dist/Tooltip.css +55 -70
  367. package/dist/Tooltip.css.map +1 -1
  368. package/dist/Tooltip.mjs +49 -49
  369. package/dist/Tooltip.mjs.map +1 -1
  370. package/dist/ar-AE.cjs +10 -2
  371. package/dist/ar-AE.cjs.map +1 -1
  372. package/dist/ar-AE.mjs +10 -2
  373. package/dist/ar-AE.mjs.map +1 -1
  374. package/dist/bg-BG.cjs +11 -2
  375. package/dist/bg-BG.cjs.map +1 -1
  376. package/dist/bg-BG.mjs +11 -2
  377. package/dist/bg-BG.mjs.map +1 -1
  378. package/dist/cs-CZ.cjs +7 -2
  379. package/dist/cs-CZ.cjs.map +1 -1
  380. package/dist/cs-CZ.mjs +7 -2
  381. package/dist/cs-CZ.mjs.map +1 -1
  382. package/dist/da-DK.cjs +12 -4
  383. package/dist/da-DK.cjs.map +1 -1
  384. package/dist/da-DK.mjs +12 -4
  385. package/dist/da-DK.mjs.map +1 -1
  386. package/dist/de-DE.cjs +11 -2
  387. package/dist/de-DE.cjs.map +1 -1
  388. package/dist/de-DE.mjs +11 -2
  389. package/dist/de-DE.mjs.map +1 -1
  390. package/dist/el-GR.cjs +11 -2
  391. package/dist/el-GR.cjs.map +1 -1
  392. package/dist/el-GR.mjs +11 -2
  393. package/dist/el-GR.mjs.map +1 -1
  394. package/dist/en-US.cjs +8 -0
  395. package/dist/en-US.cjs.map +1 -1
  396. package/dist/en-US.mjs +8 -0
  397. package/dist/en-US.mjs.map +1 -1
  398. package/dist/es-ES.cjs +11 -2
  399. package/dist/es-ES.cjs.map +1 -1
  400. package/dist/es-ES.mjs +11 -2
  401. package/dist/es-ES.mjs.map +1 -1
  402. package/dist/et-EE.cjs +10 -2
  403. package/dist/et-EE.cjs.map +1 -1
  404. package/dist/et-EE.mjs +10 -2
  405. package/dist/et-EE.mjs.map +1 -1
  406. package/dist/fi-FI.cjs +10 -2
  407. package/dist/fi-FI.cjs.map +1 -1
  408. package/dist/fi-FI.mjs +10 -2
  409. package/dist/fi-FI.mjs.map +1 -1
  410. package/dist/fr-FR.cjs +11 -2
  411. package/dist/fr-FR.cjs.map +1 -1
  412. package/dist/fr-FR.mjs +11 -2
  413. package/dist/fr-FR.mjs.map +1 -1
  414. package/dist/he-IL.cjs +11 -2
  415. package/dist/he-IL.cjs.map +1 -1
  416. package/dist/he-IL.mjs +11 -2
  417. package/dist/he-IL.mjs.map +1 -1
  418. package/dist/hr-HR.cjs +7 -2
  419. package/dist/hr-HR.cjs.map +1 -1
  420. package/dist/hr-HR.mjs +7 -2
  421. package/dist/hr-HR.mjs.map +1 -1
  422. package/dist/hu-HU.cjs +10 -2
  423. package/dist/hu-HU.cjs.map +1 -1
  424. package/dist/hu-HU.mjs +10 -2
  425. package/dist/hu-HU.mjs.map +1 -1
  426. package/dist/it-IT.cjs +11 -2
  427. package/dist/it-IT.cjs.map +1 -1
  428. package/dist/it-IT.mjs +11 -2
  429. package/dist/it-IT.mjs.map +1 -1
  430. package/dist/ja-JP.cjs +10 -2
  431. package/dist/ja-JP.cjs.map +1 -1
  432. package/dist/ja-JP.mjs +10 -2
  433. package/dist/ja-JP.mjs.map +1 -1
  434. package/dist/ko-KR.cjs +12 -4
  435. package/dist/ko-KR.cjs.map +1 -1
  436. package/dist/ko-KR.mjs +12 -4
  437. package/dist/ko-KR.mjs.map +1 -1
  438. package/dist/lt-LT.cjs +9 -4
  439. package/dist/lt-LT.cjs.map +1 -1
  440. package/dist/lt-LT.mjs +9 -4
  441. package/dist/lt-LT.mjs.map +1 -1
  442. package/dist/lv-LV.cjs +11 -3
  443. package/dist/lv-LV.cjs.map +1 -1
  444. package/dist/lv-LV.mjs +11 -3
  445. package/dist/lv-LV.mjs.map +1 -1
  446. package/dist/main.cjs +4 -0
  447. package/dist/main.cjs.map +1 -1
  448. package/dist/module.mjs +3 -1
  449. package/dist/module.mjs.map +1 -1
  450. package/dist/nb-NO.cjs +9 -4
  451. package/dist/nb-NO.cjs.map +1 -1
  452. package/dist/nb-NO.mjs +9 -4
  453. package/dist/nb-NO.mjs.map +1 -1
  454. package/dist/nl-NL.cjs +10 -2
  455. package/dist/nl-NL.cjs.map +1 -1
  456. package/dist/nl-NL.mjs +10 -2
  457. package/dist/nl-NL.mjs.map +1 -1
  458. package/dist/pl-PL.cjs +8 -3
  459. package/dist/pl-PL.cjs.map +1 -1
  460. package/dist/pl-PL.mjs +8 -3
  461. package/dist/pl-PL.mjs.map +1 -1
  462. package/dist/pt-BR.cjs +11 -2
  463. package/dist/pt-BR.cjs.map +1 -1
  464. package/dist/pt-BR.mjs +11 -2
  465. package/dist/pt-BR.mjs.map +1 -1
  466. package/dist/pt-PT.cjs +11 -2
  467. package/dist/pt-PT.cjs.map +1 -1
  468. package/dist/pt-PT.mjs +11 -2
  469. package/dist/pt-PT.mjs.map +1 -1
  470. package/dist/ro-RO.cjs +12 -3
  471. package/dist/ro-RO.cjs.map +1 -1
  472. package/dist/ro-RO.mjs +12 -3
  473. package/dist/ro-RO.mjs.map +1 -1
  474. package/dist/ru-RU.cjs +7 -2
  475. package/dist/ru-RU.cjs.map +1 -1
  476. package/dist/ru-RU.mjs +7 -2
  477. package/dist/ru-RU.mjs.map +1 -1
  478. package/dist/sk-SK.cjs +7 -2
  479. package/dist/sk-SK.cjs.map +1 -1
  480. package/dist/sk-SK.mjs +7 -2
  481. package/dist/sk-SK.mjs.map +1 -1
  482. package/dist/sl-SI.cjs +7 -2
  483. package/dist/sl-SI.cjs.map +1 -1
  484. package/dist/sl-SI.mjs +7 -2
  485. package/dist/sl-SI.mjs.map +1 -1
  486. package/dist/sr-SP.cjs +7 -2
  487. package/dist/sr-SP.cjs.map +1 -1
  488. package/dist/sr-SP.mjs +7 -2
  489. package/dist/sr-SP.mjs.map +1 -1
  490. package/dist/sv-SE.cjs +11 -2
  491. package/dist/sv-SE.cjs.map +1 -1
  492. package/dist/sv-SE.mjs +11 -2
  493. package/dist/sv-SE.mjs.map +1 -1
  494. package/dist/tr-TR.cjs +10 -2
  495. package/dist/tr-TR.cjs.map +1 -1
  496. package/dist/tr-TR.mjs +10 -2
  497. package/dist/tr-TR.mjs.map +1 -1
  498. package/dist/types.d.ts +109 -89
  499. package/dist/types.d.ts.map +1 -1
  500. package/dist/uk-UA.cjs +7 -2
  501. package/dist/uk-UA.cjs.map +1 -1
  502. package/dist/uk-UA.mjs +7 -2
  503. package/dist/uk-UA.mjs.map +1 -1
  504. package/dist/zh-CN.cjs +10 -2
  505. package/dist/zh-CN.cjs.map +1 -1
  506. package/dist/zh-CN.mjs +10 -2
  507. package/dist/zh-CN.mjs.map +1 -1
  508. package/dist/zh-TW.cjs +10 -2
  509. package/dist/zh-TW.cjs.map +1 -1
  510. package/dist/zh-TW.mjs +10 -2
  511. package/dist/zh-TW.mjs.map +1 -1
  512. package/icons/Skeleton.cjs +2 -2
  513. package/icons/Skeleton.css +5 -5
  514. package/icons/Skeleton.mjs +2 -2
  515. package/package.json +20 -21
  516. package/src/Accordion.tsx +5 -8
  517. package/src/ActionBar.tsx +229 -0
  518. package/src/ActionButton.tsx +25 -52
  519. package/src/ActionButtonGroup.tsx +9 -11
  520. package/src/ActionMenu.tsx +5 -8
  521. package/src/AlertDialog.tsx +5 -8
  522. package/src/Avatar.tsx +5 -8
  523. package/src/AvatarGroup.tsx +5 -8
  524. package/src/Badge.tsx +5 -8
  525. package/src/Breadcrumbs.tsx +6 -12
  526. package/src/Button.tsx +197 -154
  527. package/src/ButtonGroup.tsx +5 -8
  528. package/src/CardView.tsx +37 -12
  529. package/src/Checkbox.tsx +6 -9
  530. package/src/CheckboxGroup.tsx +6 -9
  531. package/src/ClearButton.tsx +2 -5
  532. package/src/CloseButton.tsx +21 -31
  533. package/src/ColorArea.tsx +5 -8
  534. package/src/ColorField.tsx +5 -8
  535. package/src/ColorSlider.tsx +5 -8
  536. package/src/ColorSwatch.tsx +5 -8
  537. package/src/ColorSwatchPicker.tsx +5 -8
  538. package/src/ColorWheel.tsx +5 -8
  539. package/src/ComboBox.tsx +7 -9
  540. package/src/Content.tsx +12 -30
  541. package/src/ContextualHelp.tsx +5 -8
  542. package/src/CustomDialog.tsx +5 -8
  543. package/src/Dialog.tsx +6 -9
  544. package/src/Disclosure.tsx +15 -24
  545. package/src/Divider.tsx +16 -25
  546. package/src/DropZone.tsx +5 -8
  547. package/src/Field.tsx +25 -32
  548. package/src/Form.tsx +5 -8
  549. package/src/FullscreenDialog.tsx +5 -8
  550. package/src/IllustratedMessage.tsx +6 -9
  551. package/src/Image.tsx +3 -6
  552. package/src/InlineAlert.tsx +6 -10
  553. package/src/Link.tsx +13 -21
  554. package/src/Menu.tsx +69 -33
  555. package/src/Meter.tsx +13 -23
  556. package/src/Modal.tsx +22 -52
  557. package/src/NumberField.tsx +5 -8
  558. package/src/Picker.tsx +7 -9
  559. package/src/Popover.tsx +30 -104
  560. package/src/ProgressBar.tsx +14 -24
  561. package/src/ProgressCircle.tsx +18 -24
  562. package/src/Radio.tsx +6 -9
  563. package/src/RadioGroup.tsx +6 -9
  564. package/src/RangeSlider.tsx +2 -5
  565. package/src/SearchField.tsx +5 -8
  566. package/src/SegmentedControl.tsx +10 -16
  567. package/src/Slider.tsx +2 -5
  568. package/src/StatusLight.tsx +6 -9
  569. package/src/Switch.tsx +6 -9
  570. package/src/TableView.tsx +53 -50
  571. package/src/Tabs.tsx +5 -8
  572. package/src/TagGroup.tsx +7 -14
  573. package/src/TextField.tsx +20 -28
  574. package/src/ToggleButton.tsx +7 -9
  575. package/src/ToggleButtonGroup.tsx +5 -8
  576. package/src/Tooltip.tsx +30 -51
  577. package/src/bar-utils.ts +3 -10
  578. package/src/index.ts +2 -0
  579. package/src/style-utils.ts +15 -8
  580. package/style/dist/main.cjs +1 -0
  581. package/style/dist/main.cjs.map +1 -1
  582. package/style/dist/module.mjs +2 -2
  583. package/style/dist/module.mjs.map +1 -1
  584. package/style/dist/spectrum-theme.cjs +72 -5
  585. package/style/dist/spectrum-theme.cjs.map +1 -1
  586. package/style/dist/spectrum-theme.mjs +72 -6
  587. package/style/dist/spectrum-theme.mjs.map +1 -1
  588. package/style/dist/style-macro.cjs +13 -1
  589. package/style/dist/style-macro.cjs.map +1 -1
  590. package/style/dist/style-macro.mjs +13 -1
  591. package/style/dist/style-macro.mjs.map +1 -1
  592. package/style/dist/types.d.ts +50 -29
  593. package/style/dist/types.d.ts.map +1 -1
  594. package/style/index.ts +1 -1
  595. package/style/spectrum-theme.ts +72 -7
  596. package/style/style-macro.ts +20 -4
  597. package/style/tokens.ts +30 -0
  598. package/style/types.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  @layer _.a {
2
- ._Zd {
2
+ ._0d {
3
3
  display: flex;
4
4
  }
5
5
 
@@ -11,7 +11,7 @@
11
11
  column-gap: .428571em;
12
12
  }
13
13
 
14
- ._1d {
14
+ ._2d {
15
15
  align-items: baseline;
16
16
  }
17
17
 
@@ -19,37 +19,37 @@
19
19
  width: fit-content;
20
20
  }
21
21
 
22
- ._ca {
22
+ ._da {
23
23
  font-family: adobe-clean-variable, adobe-clean, ui-sans-serif, system-ui, sans-serif;
24
24
  }
25
25
 
26
- ._de {
26
+ ._ee {
27
27
  font-size: .875rem;
28
28
  }
29
29
 
30
- ._da {
30
+ ._ea {
31
31
  font-size: .6875rem;
32
32
  }
33
33
 
34
- ._dc {
34
+ ._ec {
35
35
  font-size: .75rem;
36
36
  }
37
37
 
38
- ._dg {
38
+ ._eg {
39
39
  font-size: 1rem;
40
40
  }
41
41
 
42
- ._di {
42
+ ._ei {
43
43
  font-size: 1.125rem;
44
44
  }
45
45
 
46
- ._eb {
46
+ ._fb {
47
47
  font-variation-settings: "wght" 400;
48
48
  font-synthesis-weight: none;
49
49
  font-weight: 400;
50
50
  }
51
51
 
52
- ._fa {
52
+ ._ga {
53
53
  line-height: 1.3;
54
54
  }
55
55
 
@@ -65,7 +65,7 @@
65
65
  color: var(--lightningcss-light, #717171) var(--lightningcss-dark, #8a8a8a);
66
66
  }
67
67
 
68
- .__R-yksgrp {
68
+ .__S-yksgrp {
69
69
  -webkit-tap-highlight-color: #0000;
70
70
  }
71
71
 
@@ -181,57 +181,57 @@
181
181
  fill: var(--lightningcss-light, #e1e1e1) var(--lightningcss-dark, #323232);
182
182
  }
183
183
 
184
- .__vd {
184
+ .__wd {
185
185
  overflow-x: visible;
186
186
  }
187
187
 
188
- .__wd {
188
+ .__xd {
189
189
  overflow-y: visible;
190
190
  }
191
191
  }
192
192
 
193
193
  @layer _.b {
194
- ._c-enzrfpb:lang(ar) {
194
+ ._d-enzrfpb:lang(ar) {
195
195
  font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
196
196
  }
197
197
 
198
- ._f-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
198
+ ._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
199
199
  line-height: 1.5;
200
200
  }
201
201
  }
202
202
 
203
203
  @layer _.c {
204
- ._c-enzwzjc:lang(he) {
204
+ ._d-enzwzjc:lang(he) {
205
205
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
206
206
  }
207
207
  }
208
208
 
209
209
  @layer _.d {
210
- ._c-enzykdd:lang(ja) {
210
+ ._d-enzykdd:lang(ja) {
211
211
  font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
212
212
  }
213
213
  }
214
214
 
215
215
  @layer _.e {
216
- ._c-enzzrge:lang(ko) {
216
+ ._d-enzzrge:lang(ko) {
217
217
  font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
218
218
  }
219
219
  }
220
220
 
221
221
  @layer _.f {
222
- ._c-eo0c6sf:lang(zh) {
222
+ ._d-eo0c6sf:lang(zh) {
223
223
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
224
224
  }
225
225
  }
226
226
 
227
227
  @layer _.g {
228
- ._c-1uotwbwg:lang(zh-hant) {
228
+ ._d-1uotwbwg:lang(zh-hant) {
229
229
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
230
230
  }
231
231
  }
232
232
 
233
233
  @layer _.h {
234
- ._c-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
234
+ ._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
235
235
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
236
236
  }
237
237
  }
@@ -248,23 +248,23 @@
248
248
  column-gap: .470588em;
249
249
  }
250
250
 
251
- ._dbf {
251
+ ._ebf {
252
252
  font-size: 1.0625rem;
253
253
  }
254
254
 
255
- ._dbb {
255
+ ._ebb {
256
256
  font-size: .8125rem;
257
257
  }
258
258
 
259
- ._dbd {
259
+ ._ebd {
260
260
  font-size: .9375rem;
261
261
  }
262
262
 
263
- ._dbh {
263
+ ._ebh {
264
264
  font-size: 1.1875rem;
265
265
  }
266
266
 
267
- ._dbj {
267
+ ._ebj {
268
268
  font-size: 1.375rem;
269
269
  }
270
270
  }
@@ -1 +1 @@
1
- {"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAeF","sources":["dcb557d93c6b9336","packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["@import \"f9aed9e8e46292d1\";\n@import \"946093cc8d031f9b\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: 10,\n L: 12,\n XL: 14\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n },\n overflow: 'visible' // prevents the light from getting clipped on iOS\n});\n\nfunction StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n}\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nlet _StatusLight = /*#__PURE__*/ forwardRef(StatusLight);\nexport {_StatusLight as StatusLight};\n"],"names":[],"version":3,"file":"StatusLight.css.map"}
1
+ {"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAeF","sources":["dcb557d93c6b9336","packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["@import \"f9aed9e8e46292d1\";\n@import \"946093cc8d031f9b\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: 10,\n L: 12,\n XL: 14\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n },\n overflow: 'visible' // prevents the light from getting clipped on iOS\n});\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nexport const StatusLight = /*#__PURE__*/ forwardRef(function StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"StatusLight.css.map"}
@@ -29,44 +29,44 @@ import {useDOMRef as $2PVgW$useDOMRef} from "@react-spectrum/utils";
29
29
  const $cd71613dba8ee178$export$d8f8c0b091d8cb9b = /*#__PURE__*/ (0, $2PVgW$createContext)(null);
30
30
  const $cd71613dba8ee178$var$wrapper = function anonymous(props, overrides) {
31
31
  let rules = " .";
32
- let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
32
+ let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
33
33
  rules += matches.join('');
34
34
  let $l = false;
35
35
  for (let p of matches)if (/^\s*l/.test(p)) $l = true;
36
- rules += ' _Zd';
36
+ rules += ' _0d';
37
37
  rules += ' ibH';
38
38
  rules += ' iG';
39
39
  rules += ' jbH';
40
40
  rules += ' jG';
41
- rules += ' _1d';
41
+ rules += ' _2d';
42
42
  if (!$l) rules += ' le';
43
- rules += ' _c-bc1l9oh';
44
- rules += ' _c-1uotwbwg';
45
- rules += ' _c-eo0c6sf';
46
- rules += ' _c-enzzrge';
47
- rules += ' _c-enzykdd';
48
- rules += ' _c-enzwzjc';
49
- rules += ' _c-enzrfpb';
50
- rules += ' _ca';
43
+ rules += ' _d-bc1l9oh';
44
+ rules += ' _d-1uotwbwg';
45
+ rules += ' _d-eo0c6sf';
46
+ rules += ' _d-enzzrge';
47
+ rules += ' _d-enzykdd';
48
+ rules += ' _d-enzwzjc';
49
+ rules += ' _d-enzrfpb';
50
+ rules += ' _da';
51
51
  if (props.size === "XL") {
52
- rules += ' _dbj';
53
- rules += ' _di';
52
+ rules += ' _ebj';
53
+ rules += ' _ei';
54
54
  } else if (props.size === "L") {
55
- rules += ' _dbh';
56
- rules += ' _dg';
55
+ rules += ' _ebh';
56
+ rules += ' _eg';
57
57
  } else if (props.size === "S") {
58
- rules += ' _dbd';
59
- rules += ' _dc';
58
+ rules += ' _ebd';
59
+ rules += ' _ec';
60
60
  } else if (props.size === "XS") {
61
- rules += ' _dbb';
62
- rules += ' _da';
61
+ rules += ' _ebb';
62
+ rules += ' _ea';
63
63
  } else {
64
- rules += ' _dbf';
65
- rules += ' _de';
64
+ rules += ' _ebf';
65
+ rules += ' _ee';
66
66
  }
67
- rules += ' _eb';
68
- rules += ' _f-1x99dlob';
69
- rules += ' _fa';
67
+ rules += ' _fb';
68
+ rules += ' _g-1x99dlob';
69
+ rules += ' _ga';
70
70
  if (props.variant === "neutral") rules += ' al';
71
71
  else {
72
72
  if (props.isPressed) rules += ' ao';
@@ -74,7 +74,7 @@ const $cd71613dba8ee178$var$wrapper = function anonymous(props, overrides) {
74
74
  else if (props.isHovered) rules += ' ao';
75
75
  else rules += ' an';
76
76
  }
77
- rules += ' __R-yksgrp';
77
+ rules += ' __S-yksgrp';
78
78
  return rules;
79
79
  };
80
80
  const $cd71613dba8ee178$var$light = function anonymous(props) {
@@ -107,11 +107,11 @@ const $cd71613dba8ee178$var$light = function anonymous(props) {
107
107
  else if (props.variant === "positive") rules += ' ef';
108
108
  else if (props.variant === "neutral") rules += ' ed';
109
109
  else if (props.variant === "informative") rules += ' ec';
110
- rules += ' __vd';
111
110
  rules += ' __wd';
111
+ rules += ' __xd';
112
112
  return rules;
113
113
  };
114
- function $cd71613dba8ee178$var$StatusLight(props, ref) {
114
+ const $cd71613dba8ee178$export$5f84c37a31c6e41c = /*#__PURE__*/ (0, $2PVgW$forwardRef)(function StatusLight(props, ref) {
115
115
  [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $cd71613dba8ee178$export$d8f8c0b091d8cb9b);
116
116
  let { children: children, size: size = 'M', variant: variant, role: role, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles } = props;
117
117
  let domRef = (0, $2PVgW$useDOMRef)(ref);
@@ -150,11 +150,7 @@ function $cd71613dba8ee178$var$StatusLight(props, ref) {
150
150
  })
151
151
  ]
152
152
  });
153
- }
154
- /**
155
- * Status lights are used to color code categories and labels commonly found in data visualization.
156
- * When status lights have a semantic meaning, they should use semantic variant colors.
157
- */ let $cd71613dba8ee178$export$5f84c37a31c6e41c = /*#__PURE__*/ (0, $2PVgW$forwardRef)($cd71613dba8ee178$var$StatusLight);
153
+ });
158
154
 
159
155
 
160
156
  export {$cd71613dba8ee178$export$d8f8c0b091d8cb9b as StatusLightContext, $cd71613dba8ee178$export$5f84c37a31c6e41c as StatusLight};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAyCM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA+D;AAE7G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCN,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,YAAC,QAAQ,QAAE,OAAO,cAAK,OAAO,QAAE,IAAI,oBAAE,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACzF,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,yCAAY;IAE7B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,EACnC,QAAQ,IAAI,CAAC;IAGf,IAAI,CAAC,QAAS,CAAA,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,kBAAkB,AAAD,GAC1D,QAAQ,IAAI,CAAC;IAGf,qBACE,iBAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO;YAAC,WAAW,CAAC,CAAC;QAAI,EAAE;QAC9C,KAAK;QACL,MAAM;QACN,OAAO;QACP,WAAW,mBAAmB,8BAAQ;kBAAC;qBAAM;QAAO,GAAG;;0BACvD,gBAAC,CAAA,GAAA,yCAAa;0BACZ,cAAA,gBAAC;oBAAI,WAAW,4BAAM;8BAAC;iCAAM;oCAAS;oBAAU;oBAAI,eAAY;8BAC9D,cAAA,gBAAC;wBAAO,GAAE;wBAAM,IAAG;wBAAM,IAAG;;;;0BAGhC,gBAAC,CAAA,GAAA,yCAAG;0BAAG;;;;AAGb;AAEA;;;CAGC,GACD,IAAI,4CAAe,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: 10,\n L: 12,\n XL: 14\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n },\n overflow: 'visible' // prevents the light from getting clipped on iOS\n});\n\nfunction StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n}\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nlet _StatusLight = /*#__PURE__*/ forwardRef(StatusLight);\nexport {_StatusLight as StatusLight};\n"],"names":[],"version":3,"file":"StatusLight.mjs.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAyCM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA+D;AAE7G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCC,MAAM,4CAAc,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAA2B;IAC3H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,YAAC,QAAQ,QAAE,OAAO,cAAK,OAAO,QAAE,IAAI,oBAAE,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACzF,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,yCAAY;IAE7B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,EACnC,QAAQ,IAAI,CAAC;IAGf,IAAI,CAAC,QAAS,CAAA,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,kBAAkB,AAAD,GAC1D,QAAQ,IAAI,CAAC;IAGf,qBACE,iBAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO;YAAC,WAAW,CAAC,CAAC;QAAI,EAAE;QAC9C,KAAK;QACL,MAAM;QACN,OAAO;QACP,WAAW,mBAAmB,8BAAQ;kBAAC;qBAAM;QAAO,GAAG;;0BACvD,gBAAC,CAAA,GAAA,yCAAa;0BACZ,cAAA,gBAAC;oBAAI,WAAW,4BAAM;8BAAC;iCAAM;oCAAS;oBAAU;oBAAI,eAAY;8BAC9D,cAAA,gBAAC;wBAAO,GAAE;wBAAM,IAAG;wBAAM,IAAG;;;;0BAGhC,gBAAC,CAAA,GAAA,yCAAG;0BAAG;;;;AAGb","sources":["packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: 10,\n L: 12,\n XL: 14\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n },\n overflow: 'visible' // prevents the light from getting clipped on iOS\n});\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nexport const StatusLight = /*#__PURE__*/ forwardRef(function StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"StatusLight.mjs.map"}
package/dist/Switch.cjs CHANGED
@@ -36,47 +36,47 @@ $parcel$export(module.exports, "Switch", () => $0bb99ae32af8596c$export$b5d5cf89
36
36
  const $0bb99ae32af8596c$export$8699e3b644d5a28a = /*#__PURE__*/ (0, $bxoLC$react.createContext)(null);
37
37
  const $0bb99ae32af8596c$var$wrapper = function anonymous(props, overrides) {
38
38
  let rules = " .";
39
- let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
39
+ let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
40
40
  rules += matches.join('');
41
41
  let $l = false;
42
- let $__a = false;
42
+ let $__b = false;
43
43
  for (let p of matches){
44
44
  if (/^\s*l/.test(p)) $l = true;
45
- if (/^\s*__a/.test(p)) $__a = true;
45
+ if (/^\s*__b/.test(p)) $__b = true;
46
46
  }
47
- rules += ' _Zd';
47
+ rules += ' _0d';
48
48
  rules += ' jF';
49
- rules += ' _1d';
49
+ rules += ' _2d';
50
50
  if (!$l) rules += ' le';
51
- rules += ' _c-bc1l9oh';
52
- rules += ' _c-1uotwbwg';
53
- rules += ' _c-eo0c6sf';
54
- rules += ' _c-enzzrge';
55
- rules += ' _c-enzykdd';
56
- rules += ' _c-enzwzjc';
57
- rules += ' _c-enzrfpb';
58
- rules += ' _ca';
51
+ rules += ' _d-bc1l9oh';
52
+ rules += ' _d-1uotwbwg';
53
+ rules += ' _d-eo0c6sf';
54
+ rules += ' _d-enzzrge';
55
+ rules += ' _d-enzykdd';
56
+ rules += ' _d-enzwzjc';
57
+ rules += ' _d-enzrfpb';
58
+ rules += ' _da';
59
59
  if (props.size === "XL") {
60
- rules += ' _dbj';
61
- rules += ' _di';
60
+ rules += ' _ebj';
61
+ rules += ' _ei';
62
62
  } else if (props.size === "L") {
63
- rules += ' _dbh';
64
- rules += ' _dg';
63
+ rules += ' _ebh';
64
+ rules += ' _eg';
65
65
  } else if (props.size === "S") {
66
- rules += ' _dbd';
67
- rules += ' _dc';
66
+ rules += ' _ebd';
67
+ rules += ' _ec';
68
68
  } else if (props.size === "XS") {
69
- rules += ' _dbb';
70
- rules += ' _da';
69
+ rules += ' _ebb';
70
+ rules += ' _ea';
71
71
  } else {
72
- rules += ' _dbf';
73
- rules += ' _de';
72
+ rules += ' _ebf';
73
+ rules += ' _ee';
74
74
  }
75
- rules += ' _eb';
76
- rules += ' _f-1x99dlob';
77
- rules += ' _fa';
75
+ rules += ' _fb';
76
+ rules += ' _g-1x99dlob';
77
+ rules += ' _ga';
78
78
  if (props.isDisabled) {
79
- rules += ' aa_____B';
79
+ rules += ' aa_____O';
80
80
  rules += ' aj';
81
81
  } else {
82
82
  if (props.isPressed) rules += ' ao';
@@ -84,27 +84,27 @@ const $0bb99ae32af8596c$var$wrapper = function anonymous(props, overrides) {
84
84
  else if (props.isHovered) rules += ' ao';
85
85
  else rules += ' an';
86
86
  }
87
- rules += ' _Ob';
88
- rules += ' _Q-375x7f';
89
- rules += ' _Ra';
90
- if (!$__a) {
91
- if (props.isInForm) rules += ' __a-4a7c5l';
87
+ rules += ' _Pb';
88
+ rules += ' _R-375x7f';
89
+ rules += ' _Sa';
90
+ if (!$__b) {
91
+ if (props.isInForm) rules += ' __b-e10s0d';
92
92
  }
93
- rules += ' __R-yksgrp';
93
+ rules += ' __S-yksgrp';
94
94
  return rules;
95
95
  };
96
96
  const $0bb99ae32af8596c$var$track = function anonymous(props) {
97
97
  let rules = " .";
98
- if (props.isFocusVisible) rules += ' _Lb';
99
- else rules += ' _La';
100
- rules += ' da_____z';
98
+ if (props.isFocusVisible) rules += ' _Mb';
99
+ else rules += ' _Ma';
100
+ rules += ' da_____M';
101
101
  rules += ' dx';
102
- rules += ' _Nc';
103
- rules += ' _M-3t1z';
104
- rules += ' _vf';
102
+ rules += ' _Oc';
103
+ rules += ' _N-3t1z';
105
104
  rules += ' _wf';
106
105
  rules += ' _xf';
107
106
  rules += ' _yf';
107
+ rules += ' _zf';
108
108
  rules += ' -rcxrzo_l--unb2ci';
109
109
  if (props.size === "XL") rules += ' -_14pdrm5_k-g';
110
110
  else if (props.size === "L") rules += ' -_14pdrm5_k-m';
@@ -112,22 +112,22 @@ const $0bb99ae32af8596c$var$track = function anonymous(props) {
112
112
  else rules += ' -_14pdrm5_k-k';
113
113
  rules += ' l-rcxrzo';
114
114
  rules += ' k-14pdrm5';
115
- rules += ' __na';
115
+ rules += ' __oa';
116
116
  rules += ' uc';
117
117
  rules += ' vc';
118
118
  rules += ' sc';
119
119
  rules += ' tc';
120
120
  rules += ' wa';
121
- rules += ' _Oa';
122
- rules += ' _Q-375x7f';
123
- rules += ' _Ra';
124
- rules += ' _zb';
121
+ rules += ' _Pa';
122
+ rules += ' _R-375x7f';
123
+ rules += ' _Sa';
124
+ rules += ' _Ab';
125
125
  if (props.isSelected) rules += ' ca';
126
126
  else if (props.isDisabled) {
127
- rules += ' ca_____B';
127
+ rules += ' ca_____O';
128
128
  rules += ' cj';
129
129
  } else {
130
- rules += ' ca_____v';
130
+ rules += ' ca_____I';
131
131
  if (props.isPressed) rules += ' co';
132
132
  else if (props.isFocusVisible) rules += ' co';
133
133
  else if (props.isHovered) rules += ' co';
@@ -135,10 +135,10 @@ const $0bb99ae32af8596c$var$track = function anonymous(props) {
135
135
  }
136
136
  if (props.isSelected) {
137
137
  if (props.isDisabled) {
138
- rules += ' ba_____B';
138
+ rules += ' ba_____O';
139
139
  rules += ' bj';
140
140
  } else {
141
- rules += ' ba_____z';
141
+ rules += ' ba_____M';
142
142
  if (props.isEmphasized) {
143
143
  if (props.isPressed) rules += ' bz';
144
144
  else if (props.isFocusVisible) rules += ' bz';
@@ -157,14 +157,14 @@ const $0bb99ae32af8596c$var$track = function anonymous(props) {
157
157
  const $0bb99ae32af8596c$var$handle = function anonymous(props) {
158
158
  let rules = " .";
159
159
  rules += ' kb';
160
- rules += ' _bb';
161
- rules += ' _vf';
160
+ rules += ' _cb';
162
161
  rules += ' _wf';
163
162
  rules += ' _xf';
164
163
  rules += ' _yf';
164
+ rules += ' _zf';
165
165
  if (props.isSelected) rules += ' bd';
166
166
  else if (props.isDisabled) {
167
- rules += ' ba_____B';
167
+ rules += ' ba_____O';
168
168
  rules += ' bj';
169
169
  } else {
170
170
  if (props.isPressed) rules += ' bo';
@@ -172,9 +172,9 @@ const $0bb99ae32af8596c$var$handle = function anonymous(props) {
172
172
  else if (props.isHovered) rules += ' bo';
173
173
  else rules += ' bn';
174
174
  }
175
- rules += ' _Oa';
176
- rules += ' _Q-375x7f';
177
- rules += ' _Ra';
175
+ rules += ' _Pa';
176
+ rules += ' _R-375x7f';
177
+ rules += ' _Sa';
178
178
  return rules;
179
179
  };
180
180
  // Use an inline style to calculate the transform so we can combine it with the press scale.
@@ -199,7 +199,7 @@ const $0bb99ae32af8596c$var$transformStyle = ({ isSelected: isSelected })=>({
199
199
  // selectedPerspective = 2 * (trackHeight - 6px)
200
200
  transform: isSelected ? 'translateX(calc(var(--trackWidth) - 100% - 4px)) perspective(calc(2 * (var(--trackHeight) - 6px))) translateZ(-4px)' : 'perspective(calc(var(--trackHeight) - 8px)) translateZ(-4px)'
201
201
  });
202
- function $0bb99ae32af8596c$var$Switch(props, ref) {
202
+ const $0bb99ae32af8596c$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $bxoLC$react.forwardRef)(function Switch(props, ref) {
203
203
  [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $0bb99ae32af8596c$export$8699e3b644d5a28a);
204
204
  let { children: children, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style } = props;
205
205
  let inputRef = (0, $bxoLC$react.useRef)(null);
@@ -237,11 +237,7 @@ function $0bb99ae32af8596c$var$Switch(props, ref) {
237
237
  ]
238
238
  })
239
239
  });
240
- }
241
- /**
242
- * Switches allow users to turn an individual option on or off.
243
- * They are usually used to activate or deactivate a specific setting.
244
- */ let $0bb99ae32af8596c$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $bxoLC$react.forwardRef)($0bb99ae32af8596c$var$Switch);
240
+ });
245
241
 
246
242
 
247
243
  //# sourceMappingURL=Switch.cjs.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAqCM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAkE;AAE3G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCN,MAAM;;;;;;;;;;;;;;;;;;;;;;;AAeN,4FAA4F;AAC5F,MAAM,uCAAiB,CAAC,cAAC,UAAU,EAAoB,GAAM,CAAA;QAC3D,wHAAwH;QACxH,0GAA0G;QAC1G,8GAA8G;QAC9G,sHAAsH;QACtH,uHAAuH;QACvH,mDAAmD;QACnD,EAAE;QACF,qDAAqD;QACrD,EAAE;QACF,uFAAuF;QACvF,EAAE;QACF,6DAA6D;QAC7D,8DAA8D;QAC9D,EAAE;QACF,+FAA+F;QAC/F,EAAE;QACF,4CAA4C;QAC5C,mDAAmD;QACnD,WAAW,aAEP,wHACA;IACN,CAAA;AAEA,SAAS,6BAAO,KAAkB,EAAE,GAAmC;IACrE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,YAAC,QAAQ,oBAAE,mBAAmB,kBAAI,YAAY,EAAC,GAAG;IACtD,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,WAAW,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACtC,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,qBACE,gCAAC,CAAA,GAAA,iCAAS;QACP,GAAG,KAAK;QACT,KAAK;QACL,UAAU;QACV,OAAO;QACP,WAAW,CAAA,cAAe,mBAAmB,8BAAQ;gBAAC,GAAG,WAAW;0BAAE;gBAAU,MAAM,MAAM,IAAI,IAAI;YAAG,GAAG,MAAM,MAAM;kBACrH,CAAA,4BACC;;kCACE,gCAAC,CAAA,GAAA,wCAAa;kCACZ,cAAA,gCAAC;4BACC,WAAW,4BAAM;gCACf,GAAG,WAAW;gCACd,MAAM,MAAM,IAAI,IAAI;gCACpB,cAAc,MAAM,YAAY;4BAClC;sCACA,cAAA,gCAAC;gCACC,KAAK;gCACL,OAAO,CAAA,GAAA,oCAAS,EAAE,WAAW,sCAAgB;gCAC7C,WAAW,6BAAO;;;;oBAGvB;;;;AAKX;AAEA;;;CAGC,GACD,IAAI,4CAAU,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Switch.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 {\n Switch as AriaSwitch,\n SwitchProps as AriaSwitchProps,\n ContextValue,\n SwitchRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface SwitchStyleProps {\n /**\n * The size of the Switch.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Switch should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends SwitchRenderProps, SwitchStyleProps {}\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, SwitchStyleProps {\n children?: ReactNode\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst track = style<RenderProps>({\n ...focusRing(),\n borderRadius: 'full',\n '--trackWidth': {\n type: 'width',\n value: fontRelative(26)\n },\n '--trackHeight': {\n type: 'height',\n value: 'control-sm'\n },\n width: '--trackWidth',\n height: '--trackHeight',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n },\n backgroundColor: {\n default: 'gray-25',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n }\n});\n\nconst handle = style<RenderProps>({\n height: 'full',\n aspectRatio: 'square',\n borderRadius: 'full',\n backgroundColor: {\n default: 'neutral',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'gray-25'\n },\n transition: 'default'\n});\n\n// Use an inline style to calculate the transform so we can combine it with the press scale.\nconst transformStyle = ({isSelected}: SwitchRenderProps) => ({\n // In the default state, the handle is 8px smaller than the track. When selected it grows to 6px smaller than the track.\n // Normally this could be calculated as a scale transform with (trackHeight - 8px) / trackHeight, however,\n // CSS does not allow division with units. To solve this we use a 3d perspective transform. Perspective is the\n // distance from the Z=0 plane to the viewer. Since we want to scale the handle by a fixed amount and we cannot divide\n // by a value with units, we can set the Z translation to a fixed amount and change the perspective in order to achieve\n // the desired effect. Given the following formula:\n //\n // scale = perspective / (perspective - translateZ)\n //\n // and desired scale factors (accounting for the 2px border on each side of the track):\n //\n // defaultScale = (trackHeight - 8px) / (trackHeight - 4px)\n // selectedScale = (trackHeight - 6px) / (trackHeight - 4px)\n //\n // we can solve for the perspective needed in each case where translateZ is hard coded to -4px:\n //\n // defaultPerspective = trackHeight - 8px\n // selectedPerspective = 2 * (trackHeight - 6px)\n transform: isSelected\n // The selected state also translates the X position to the end of the track (minus the borders).\n ? 'translateX(calc(var(--trackWidth) - 100% - 4px)) perspective(calc(2 * (var(--trackHeight) - 6px))) translateZ(-4px)'\n : 'perspective(calc(var(--trackHeight) - 8px)) translateZ(-4px)'\n});\n\nfunction Switch(props: SwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SwitchContext);\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let handleRef = useRef(null);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n return (\n <AriaSwitch\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n className={track({\n ...renderProps,\n size: props.size || 'M',\n isEmphasized: props.isEmphasized\n })}>\n <div\n ref={handleRef}\n style={pressScale(handleRef, transformStyle)(renderProps)}\n className={handle(renderProps)} />\n </div>\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaSwitch>\n );\n}\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nlet _Switch = /*#__PURE__*/ forwardRef(Switch);\nexport {_Switch as Switch};\n"],"names":[],"version":3,"file":"Switch.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAqCM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAkE;AAE3G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCN,MAAM;;;;;;;;;;;;;;;;;;;;;;;AAeN,4FAA4F;AAC5F,MAAM,uCAAiB,CAAC,cAAC,UAAU,EAAoB,GAAM,CAAA;QAC3D,wHAAwH;QACxH,0GAA0G;QAC1G,8GAA8G;QAC9G,sHAAsH;QACtH,uHAAuH;QACvH,mDAAmD;QACnD,EAAE;QACF,qDAAqD;QACrD,EAAE;QACF,uFAAuF;QACvF,EAAE;QACF,6DAA6D;QAC7D,8DAA8D;QAC9D,EAAE;QACF,+FAA+F;QAC/F,EAAE;QACF,4CAA4C;QAC5C,mDAAmD;QACnD,WAAW,aAEP,wHACA;IACN,CAAA;AAMO,MAAM,4CAAS,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,OAAO,KAAkB,EAAE,GAAmC;IACpH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,YAAC,QAAQ,oBAAE,mBAAmB,kBAAI,YAAY,EAAC,GAAG;IACtD,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,WAAW,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACtC,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,qBACE,gCAAC,CAAA,GAAA,iCAAS;QACP,GAAG,KAAK;QACT,KAAK;QACL,UAAU;QACV,OAAO;QACP,WAAW,CAAA,cAAe,mBAAmB,8BAAQ;gBAAC,GAAG,WAAW;0BAAE;gBAAU,MAAM,MAAM,IAAI,IAAI;YAAG,GAAG,MAAM,MAAM;kBACrH,CAAA,4BACC;;kCACE,gCAAC,CAAA,GAAA,wCAAa;kCACZ,cAAA,gCAAC;4BACC,WAAW,4BAAM;gCACf,GAAG,WAAW;gCACd,MAAM,MAAM,IAAI,IAAI;gCACpB,cAAc,MAAM,YAAY;4BAClC;sCACA,cAAA,gCAAC;gCACC,KAAK;gCACL,OAAO,CAAA,GAAA,oCAAS,EAAE,WAAW,sCAAgB;gCAC7C,WAAW,6BAAO;;;;oBAGvB;;;;AAKX","sources":["packages/@react-spectrum/s2/src/Switch.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 {\n Switch as AriaSwitch,\n SwitchProps as AriaSwitchProps,\n ContextValue,\n SwitchRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface SwitchStyleProps {\n /**\n * The size of the Switch.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Switch should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends SwitchRenderProps, SwitchStyleProps {}\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, SwitchStyleProps {\n children?: ReactNode\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst track = style<RenderProps>({\n ...focusRing(),\n borderRadius: 'full',\n '--trackWidth': {\n type: 'width',\n value: fontRelative(26)\n },\n '--trackHeight': {\n type: 'height',\n value: 'control-sm'\n },\n width: '--trackWidth',\n height: '--trackHeight',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n },\n backgroundColor: {\n default: 'gray-25',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n }\n});\n\nconst handle = style<RenderProps>({\n height: 'full',\n aspectRatio: 'square',\n borderRadius: 'full',\n backgroundColor: {\n default: 'neutral',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'gray-25'\n },\n transition: 'default'\n});\n\n// Use an inline style to calculate the transform so we can combine it with the press scale.\nconst transformStyle = ({isSelected}: SwitchRenderProps) => ({\n // In the default state, the handle is 8px smaller than the track. When selected it grows to 6px smaller than the track.\n // Normally this could be calculated as a scale transform with (trackHeight - 8px) / trackHeight, however,\n // CSS does not allow division with units. To solve this we use a 3d perspective transform. Perspective is the\n // distance from the Z=0 plane to the viewer. Since we want to scale the handle by a fixed amount and we cannot divide\n // by a value with units, we can set the Z translation to a fixed amount and change the perspective in order to achieve\n // the desired effect. Given the following formula:\n //\n // scale = perspective / (perspective - translateZ)\n //\n // and desired scale factors (accounting for the 2px border on each side of the track):\n //\n // defaultScale = (trackHeight - 8px) / (trackHeight - 4px)\n // selectedScale = (trackHeight - 6px) / (trackHeight - 4px)\n //\n // we can solve for the perspective needed in each case where translateZ is hard coded to -4px:\n //\n // defaultPerspective = trackHeight - 8px\n // selectedPerspective = 2 * (trackHeight - 6px)\n transform: isSelected\n // The selected state also translates the X position to the end of the track (minus the borders).\n ? 'translateX(calc(var(--trackWidth) - 100% - 4px)) perspective(calc(2 * (var(--trackHeight) - 6px))) translateZ(-4px)'\n : 'perspective(calc(var(--trackHeight) - 8px)) translateZ(-4px)'\n});\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nexport const Switch = /*#__PURE__*/ forwardRef(function Switch(props: SwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SwitchContext);\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let handleRef = useRef(null);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n return (\n <AriaSwitch\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n className={track({\n ...renderProps,\n size: props.size || 'M',\n isEmphasized: props.isEmphasized\n })}>\n <div\n ref={handleRef}\n style={pressScale(handleRef, transformStyle)(renderProps)}\n className={handle(renderProps)} />\n </div>\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaSwitch>\n );\n});\n"],"names":[],"version":3,"file":"Switch.cjs.map"}