react-aria-components 1.10.0 → 1.11.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 (302) hide show
  1. package/dist/Breadcrumbs.main.js +9 -2
  2. package/dist/Breadcrumbs.main.js.map +1 -1
  3. package/dist/Breadcrumbs.mjs +10 -3
  4. package/dist/Breadcrumbs.module.js +10 -3
  5. package/dist/Breadcrumbs.module.js.map +1 -1
  6. package/dist/Button.main.js +7 -17
  7. package/dist/Button.main.js.map +1 -1
  8. package/dist/Button.mjs +7 -17
  9. package/dist/Button.module.js +7 -17
  10. package/dist/Button.module.js.map +1 -1
  11. package/dist/Calendar.main.js +36 -14
  12. package/dist/Calendar.main.js.map +1 -1
  13. package/dist/Calendar.mjs +38 -16
  14. package/dist/Calendar.module.js +38 -16
  15. package/dist/Calendar.module.js.map +1 -1
  16. package/dist/Checkbox.main.js +8 -3
  17. package/dist/Checkbox.main.js.map +1 -1
  18. package/dist/Checkbox.mjs +10 -5
  19. package/dist/Checkbox.module.js +10 -5
  20. package/dist/Checkbox.module.js.map +1 -1
  21. package/dist/Collection.main.js.map +1 -1
  22. package/dist/Collection.module.js.map +1 -1
  23. package/dist/ColorArea.main.js +4 -4
  24. package/dist/ColorArea.main.js.map +1 -1
  25. package/dist/ColorArea.mjs +5 -5
  26. package/dist/ColorArea.module.js +5 -5
  27. package/dist/ColorArea.module.js.map +1 -1
  28. package/dist/ColorField.main.js +14 -1
  29. package/dist/ColorField.main.js.map +1 -1
  30. package/dist/ColorField.mjs +14 -1
  31. package/dist/ColorField.module.js +14 -1
  32. package/dist/ColorField.module.js.map +1 -1
  33. package/dist/ColorSlider.main.js +3 -1
  34. package/dist/ColorSlider.main.js.map +1 -1
  35. package/dist/ColorSlider.mjs +3 -1
  36. package/dist/ColorSlider.module.js +3 -1
  37. package/dist/ColorSlider.module.js.map +1 -1
  38. package/dist/ColorSwatch.main.js +6 -2
  39. package/dist/ColorSwatch.main.js.map +1 -1
  40. package/dist/ColorSwatch.mjs +6 -2
  41. package/dist/ColorSwatch.module.js +6 -2
  42. package/dist/ColorSwatch.module.js.map +1 -1
  43. package/dist/ColorSwatchPicker.main.js.map +1 -1
  44. package/dist/ColorSwatchPicker.module.js.map +1 -1
  45. package/dist/ColorThumb.main.js +3 -1
  46. package/dist/ColorThumb.main.js.map +1 -1
  47. package/dist/ColorThumb.mjs +3 -1
  48. package/dist/ColorThumb.module.js +3 -1
  49. package/dist/ColorThumb.module.js.map +1 -1
  50. package/dist/ColorWheel.main.js +3 -1
  51. package/dist/ColorWheel.main.js.map +1 -1
  52. package/dist/ColorWheel.mjs +3 -1
  53. package/dist/ColorWheel.module.js +3 -1
  54. package/dist/ColorWheel.module.js.map +1 -1
  55. package/dist/ComboBox.main.js +4 -1
  56. package/dist/ComboBox.main.js.map +1 -1
  57. package/dist/ComboBox.mjs +4 -1
  58. package/dist/ComboBox.module.js +4 -1
  59. package/dist/ComboBox.module.js.map +1 -1
  60. package/dist/DateField.main.js +16 -3
  61. package/dist/DateField.main.js.map +1 -1
  62. package/dist/DateField.mjs +16 -3
  63. package/dist/DateField.module.js +16 -3
  64. package/dist/DateField.module.js.map +1 -1
  65. package/dist/DatePicker.main.js +15 -8
  66. package/dist/DatePicker.main.js.map +1 -1
  67. package/dist/DatePicker.mjs +16 -9
  68. package/dist/DatePicker.module.js +16 -9
  69. package/dist/DatePicker.module.js.map +1 -1
  70. package/dist/Dialog.main.js +4 -3
  71. package/dist/Dialog.main.js.map +1 -1
  72. package/dist/Dialog.mjs +5 -4
  73. package/dist/Dialog.module.js +5 -4
  74. package/dist/Dialog.module.js.map +1 -1
  75. package/dist/Disclosure.main.js +12 -10
  76. package/dist/Disclosure.main.js.map +1 -1
  77. package/dist/Disclosure.mjs +13 -11
  78. package/dist/Disclosure.module.js +13 -11
  79. package/dist/Disclosure.module.js.map +1 -1
  80. package/dist/DragAndDrop.main.js +31 -3
  81. package/dist/DragAndDrop.main.js.map +1 -1
  82. package/dist/DragAndDrop.mjs +31 -3
  83. package/dist/DragAndDrop.module.js +31 -3
  84. package/dist/DragAndDrop.module.js.map +1 -1
  85. package/dist/DropZone.main.js +4 -3
  86. package/dist/DropZone.main.js.map +1 -1
  87. package/dist/DropZone.mjs +4 -3
  88. package/dist/DropZone.module.js +4 -3
  89. package/dist/DropZone.module.js.map +1 -1
  90. package/dist/FieldError.main.js +3 -1
  91. package/dist/FieldError.main.js.map +1 -1
  92. package/dist/FieldError.mjs +3 -1
  93. package/dist/FieldError.module.js +3 -1
  94. package/dist/FieldError.module.js.map +1 -1
  95. package/dist/FileTrigger.main.js +3 -1
  96. package/dist/FileTrigger.main.js.map +1 -1
  97. package/dist/FileTrigger.mjs +3 -1
  98. package/dist/FileTrigger.module.js +3 -1
  99. package/dist/FileTrigger.module.js.map +1 -1
  100. package/dist/Form.main.js.map +1 -1
  101. package/dist/Form.module.js.map +1 -1
  102. package/dist/GridList.main.js +20 -13
  103. package/dist/GridList.main.js.map +1 -1
  104. package/dist/GridList.mjs +21 -14
  105. package/dist/GridList.module.js +21 -14
  106. package/dist/GridList.module.js.map +1 -1
  107. package/dist/HiddenDateInput.main.js +118 -0
  108. package/dist/HiddenDateInput.main.js.map +1 -0
  109. package/dist/HiddenDateInput.mjs +109 -0
  110. package/dist/HiddenDateInput.module.js +109 -0
  111. package/dist/HiddenDateInput.module.js.map +1 -0
  112. package/dist/Link.main.js +7 -1
  113. package/dist/Link.main.js.map +1 -1
  114. package/dist/Link.mjs +7 -1
  115. package/dist/Link.module.js +7 -1
  116. package/dist/Link.module.js.map +1 -1
  117. package/dist/ListBox.main.js +22 -19
  118. package/dist/ListBox.main.js.map +1 -1
  119. package/dist/ListBox.mjs +23 -20
  120. package/dist/ListBox.module.js +23 -20
  121. package/dist/ListBox.module.js.map +1 -1
  122. package/dist/Menu.main.js +15 -8
  123. package/dist/Menu.main.js.map +1 -1
  124. package/dist/Menu.mjs +16 -9
  125. package/dist/Menu.module.js +16 -9
  126. package/dist/Menu.module.js.map +1 -1
  127. package/dist/Meter.main.js +6 -2
  128. package/dist/Meter.main.js.map +1 -1
  129. package/dist/Meter.mjs +6 -2
  130. package/dist/Meter.module.js +6 -2
  131. package/dist/Meter.module.js.map +1 -1
  132. package/dist/Modal.main.js +31 -6
  133. package/dist/Modal.main.js.map +1 -1
  134. package/dist/Modal.mjs +31 -6
  135. package/dist/Modal.module.js +31 -6
  136. package/dist/Modal.module.js.map +1 -1
  137. package/dist/NumberField.main.js +4 -1
  138. package/dist/NumberField.main.js.map +1 -1
  139. package/dist/NumberField.mjs +4 -1
  140. package/dist/NumberField.module.js +4 -1
  141. package/dist/NumberField.module.js.map +1 -1
  142. package/dist/Popover.main.js +3 -1
  143. package/dist/Popover.main.js.map +1 -1
  144. package/dist/Popover.mjs +3 -1
  145. package/dist/Popover.module.js +3 -1
  146. package/dist/Popover.module.js.map +1 -1
  147. package/dist/ProgressBar.main.js +6 -2
  148. package/dist/ProgressBar.main.js.map +1 -1
  149. package/dist/ProgressBar.mjs +6 -2
  150. package/dist/ProgressBar.module.js +6 -2
  151. package/dist/ProgressBar.module.js.map +1 -1
  152. package/dist/RadioGroup.main.js +8 -3
  153. package/dist/RadioGroup.main.js.map +1 -1
  154. package/dist/RadioGroup.mjs +9 -4
  155. package/dist/RadioGroup.module.js +9 -4
  156. package/dist/RadioGroup.module.js.map +1 -1
  157. package/dist/SearchField.main.js +3 -1
  158. package/dist/SearchField.main.js.map +1 -1
  159. package/dist/SearchField.mjs +3 -1
  160. package/dist/SearchField.module.js +3 -1
  161. package/dist/SearchField.module.js.map +1 -1
  162. package/dist/Select.main.js +12 -14
  163. package/dist/Select.main.js.map +1 -1
  164. package/dist/Select.mjs +13 -15
  165. package/dist/Select.module.js +13 -15
  166. package/dist/Select.module.js.map +1 -1
  167. package/dist/Separator.main.js +4 -2
  168. package/dist/Separator.main.js.map +1 -1
  169. package/dist/Separator.mjs +5 -3
  170. package/dist/Separator.module.js +5 -3
  171. package/dist/Separator.module.js.map +1 -1
  172. package/dist/Slider.main.js +7 -5
  173. package/dist/Slider.main.js.map +1 -1
  174. package/dist/Slider.mjs +8 -6
  175. package/dist/Slider.module.js +8 -6
  176. package/dist/Slider.module.js.map +1 -1
  177. package/dist/Switch.main.js +4 -1
  178. package/dist/Switch.main.js.map +1 -1
  179. package/dist/Switch.mjs +4 -1
  180. package/dist/Switch.module.js +4 -1
  181. package/dist/Switch.module.js.map +1 -1
  182. package/dist/Table.main.js +47 -26
  183. package/dist/Table.main.js.map +1 -1
  184. package/dist/Table.mjs +48 -27
  185. package/dist/Table.module.js +48 -27
  186. package/dist/Table.module.js.map +1 -1
  187. package/dist/Tabs.main.js +22 -11
  188. package/dist/Tabs.main.js.map +1 -1
  189. package/dist/Tabs.mjs +23 -12
  190. package/dist/Tabs.module.js +23 -12
  191. package/dist/Tabs.module.js.map +1 -1
  192. package/dist/TagGroup.main.js +14 -8
  193. package/dist/TagGroup.main.js.map +1 -1
  194. package/dist/TagGroup.mjs +14 -8
  195. package/dist/TagGroup.module.js +14 -8
  196. package/dist/TagGroup.module.js.map +1 -1
  197. package/dist/TextField.main.js +13 -1
  198. package/dist/TextField.main.js.map +1 -1
  199. package/dist/TextField.mjs +13 -1
  200. package/dist/TextField.module.js +13 -1
  201. package/dist/TextField.module.js.map +1 -1
  202. package/dist/Toast.main.js +9 -5
  203. package/dist/Toast.main.js.map +1 -1
  204. package/dist/Toast.mjs +9 -5
  205. package/dist/Toast.module.js +9 -5
  206. package/dist/Toast.module.js.map +1 -1
  207. package/dist/ToggleButton.main.js +8 -2
  208. package/dist/ToggleButton.main.js.map +1 -1
  209. package/dist/ToggleButton.mjs +8 -2
  210. package/dist/ToggleButton.module.js +8 -2
  211. package/dist/ToggleButton.module.js.map +1 -1
  212. package/dist/ToggleButtonGroup.main.js +6 -2
  213. package/dist/ToggleButtonGroup.main.js.map +1 -1
  214. package/dist/ToggleButtonGroup.mjs +6 -2
  215. package/dist/ToggleButtonGroup.module.js +6 -2
  216. package/dist/ToggleButtonGroup.module.js.map +1 -1
  217. package/dist/Toolbar.main.js +4 -3
  218. package/dist/Toolbar.main.js.map +1 -1
  219. package/dist/Toolbar.mjs +4 -3
  220. package/dist/Toolbar.module.js +4 -3
  221. package/dist/Toolbar.module.js.map +1 -1
  222. package/dist/Tooltip.main.js +5 -3
  223. package/dist/Tooltip.main.js.map +1 -1
  224. package/dist/Tooltip.mjs +5 -3
  225. package/dist/Tooltip.module.js +5 -3
  226. package/dist/Tooltip.module.js.map +1 -1
  227. package/dist/Tree.main.js +73 -26
  228. package/dist/Tree.main.js.map +1 -1
  229. package/dist/Tree.mjs +74 -27
  230. package/dist/Tree.module.js +74 -27
  231. package/dist/Tree.module.js.map +1 -1
  232. package/dist/TreeDropTargetDelegate.main.js +8 -5
  233. package/dist/TreeDropTargetDelegate.main.js.map +1 -1
  234. package/dist/TreeDropTargetDelegate.mjs +8 -5
  235. package/dist/TreeDropTargetDelegate.module.js +8 -5
  236. package/dist/TreeDropTargetDelegate.module.js.map +1 -1
  237. package/dist/import.mjs +5 -5
  238. package/dist/main.js +4 -4
  239. package/dist/main.js.map +1 -1
  240. package/dist/module.js +5 -5
  241. package/dist/module.js.map +1 -1
  242. package/dist/types.d.ts +212 -203
  243. package/dist/types.d.ts.map +1 -1
  244. package/dist/useDragAndDrop.main.js.map +1 -1
  245. package/dist/useDragAndDrop.module.js.map +1 -1
  246. package/dist/utils.main.js.map +1 -1
  247. package/dist/utils.module.js.map +1 -1
  248. package/i18n/de-DE.js +1 -1
  249. package/i18n/de-DE.mjs +1 -1
  250. package/package.json +25 -25
  251. package/src/Breadcrumbs.tsx +10 -6
  252. package/src/Button.tsx +8 -30
  253. package/src/Calendar.tsx +41 -24
  254. package/src/Checkbox.tsx +8 -6
  255. package/src/Collection.tsx +2 -2
  256. package/src/ColorArea.tsx +5 -6
  257. package/src/ColorField.tsx +6 -4
  258. package/src/ColorSlider.tsx +3 -2
  259. package/src/ColorSwatch.tsx +6 -3
  260. package/src/ColorSwatchPicker.tsx +3 -3
  261. package/src/ColorThumb.tsx +3 -3
  262. package/src/ColorWheel.tsx +6 -5
  263. package/src/ComboBox.tsx +4 -4
  264. package/src/DateField.tsx +15 -10
  265. package/src/DatePicker.tsx +14 -12
  266. package/src/Dialog.tsx +6 -6
  267. package/src/Disclosure.tsx +10 -14
  268. package/src/DragAndDrop.tsx +31 -1
  269. package/src/DropZone.tsx +4 -5
  270. package/src/FieldError.tsx +3 -3
  271. package/src/FileTrigger.tsx +4 -3
  272. package/src/Form.tsx +2 -1
  273. package/src/GridList.tsx +25 -18
  274. package/src/HiddenDateInput.tsx +142 -0
  275. package/src/Link.tsx +7 -3
  276. package/src/ListBox.tsx +30 -26
  277. package/src/Menu.tsx +15 -12
  278. package/src/Meter.tsx +6 -3
  279. package/src/Modal.tsx +16 -5
  280. package/src/NumberField.tsx +4 -4
  281. package/src/Popover.tsx +3 -3
  282. package/src/ProgressBar.tsx +6 -2
  283. package/src/RadioGroup.tsx +8 -6
  284. package/src/SearchField.tsx +3 -2
  285. package/src/Select.tsx +13 -16
  286. package/src/Separator.tsx +6 -4
  287. package/src/Slider.tsx +9 -11
  288. package/src/Switch.tsx +4 -3
  289. package/src/Table.tsx +58 -56
  290. package/src/Tabs.tsx +20 -16
  291. package/src/TagGroup.tsx +13 -12
  292. package/src/TextField.tsx +5 -2
  293. package/src/Toast.tsx +10 -8
  294. package/src/ToggleButton.tsx +8 -4
  295. package/src/ToggleButtonGroup.tsx +6 -4
  296. package/src/Toolbar.tsx +4 -5
  297. package/src/Tooltip.tsx +6 -5
  298. package/src/Tree.tsx +90 -42
  299. package/src/TreeDropTargetDelegate.ts +5 -1
  300. package/src/index.ts +8 -8
  301. package/src/useDragAndDrop.tsx +2 -2
  302. package/src/utils.tsx +9 -9
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,aAAa,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,AAAC,eAA+B;IAC9C,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,cAAc;QAClB,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria';\nimport {ContextValue, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {createContext, ElementType, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps {}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport const Separator = /*#__PURE__*/ createLeafComponent('separator', function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = (elementType as ElementType) || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n return (\n <Element\n {...filterDOMProps(props)}\n {...separatorProps}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Separator.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAWM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,aAAa,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,AAAC,eAA+B;IAC9C,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria';\nimport {ContextValue, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from '@react-aria/collections';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLElement> {}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport const Separator = /*#__PURE__*/ createLeafComponent('separator', function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = (elementType as ElementType) || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <Element\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Separator.module.js.map"}
@@ -64,7 +64,9 @@ const $b7152ce4839d0838$export$472062a354075cee = /*#__PURE__*/ (0, $e0QX4$react
64
64
  },
65
65
  defaultClassName: 'react-aria-Slider'
66
66
  });
67
- let DOMProps = (0, $e0QX4$reactariautils.filterDOMProps)(props);
67
+ let DOMProps = (0, $e0QX4$reactariautils.filterDOMProps)(props, {
68
+ global: true
69
+ });
68
70
  delete DOMProps.id;
69
71
  return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
70
72
  values: [
@@ -92,9 +94,7 @@ const $b7152ce4839d0838$export$472062a354075cee = /*#__PURE__*/ (0, $e0QX4$react
92
94
  ]
93
95
  ]
94
96
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement("div", {
95
- ...DOMProps,
96
- ...groupProps,
97
- ...renderProps,
97
+ ...(0, $e0QX4$reactaria.mergeProps)(DOMProps, renderProps, groupProps),
98
98
  ref: ref,
99
99
  slot: props.slot || undefined,
100
100
  "data-orientation": state.orientation,
@@ -182,7 +182,9 @@ const $b7152ce4839d0838$export$2c1b491743890dec = /*#__PURE__*/ (0, $e0QX4$react
182
182
  isDisabled: isDisabled
183
183
  }
184
184
  });
185
- let DOMProps = (0, $e0QX4$reactariautils.filterDOMProps)(props);
185
+ let DOMProps = (0, $e0QX4$reactariautils.filterDOMProps)(props, {
186
+ global: true
187
+ });
186
188
  delete DOMProps.id;
187
189
  return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement("div", {
188
190
  ...(0, $e0QX4$reactaria.mergeProps)(DOMProps, thumbProps, hoverProps),
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,K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AAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,+BAAa,uBACZ,0DAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;uBAE9D,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...DOMProps}\n {...groupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,mCAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE;QAAC,GAAG,KAAK;yBAAE;IAAe;IACrD,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG,CAAA,GAAA,0BAAQ,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK,GAAG,OAAO;IAExC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,a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AAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;QAC3F,GAAG,KAAK;eACR;QACA,UAAU;kBACV;eACA;IACF,GAAG;IAEH,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IAEvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;mBACN;uBACA;wBACA;uBACA;4BACA;wBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,YAAY,WAAW;QAC/C,GAAG,WAAW;QACf,KAAK;QACL,OAAO;YAAC,GAAG,WAAW,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACjD,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,+BAAa,uBACZ,0DAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;uBAE9D,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps>, GlobalDOMAttributes<HTMLOutputElement> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps>, GlobalDOMAttributes<HTMLDivElement> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
package/dist/Slider.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
2
2
  import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.mjs";
3
- import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, useHover as $6YMke$useHover, mergeProps as $6YMke$mergeProps, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
3
+ import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, mergeProps as $6YMke$mergeProps, useHover as $6YMke$useHover, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
4
4
  import {filterDOMProps as $6YMke$filterDOMProps} from "@react-aria/utils";
5
5
  import $6YMke$react, {createContext as $6YMke$createContext, forwardRef as $6YMke$forwardRef, useRef as $6YMke$useRef, useContext as $6YMke$useContext} from "react";
6
6
  import {useSliderState as $6YMke$useSliderState} from "react-stately";
@@ -47,7 +47,9 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
47
47
  },
48
48
  defaultClassName: 'react-aria-Slider'
49
49
  });
50
- let DOMProps = (0, $6YMke$filterDOMProps)(props);
50
+ let DOMProps = (0, $6YMke$filterDOMProps)(props, {
51
+ global: true
52
+ });
51
53
  delete DOMProps.id;
52
54
  return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
53
55
  values: [
@@ -75,9 +77,7 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
75
77
  ]
76
78
  ]
77
79
  }, /*#__PURE__*/ (0, $6YMke$react).createElement("div", {
78
- ...DOMProps,
79
- ...groupProps,
80
- ...renderProps,
80
+ ...(0, $6YMke$mergeProps)(DOMProps, renderProps, groupProps),
81
81
  ref: ref,
82
82
  slot: props.slot || undefined,
83
83
  "data-orientation": state.orientation,
@@ -165,7 +165,9 @@ const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwa
165
165
  isDisabled: isDisabled
166
166
  }
167
167
  });
168
- let DOMProps = (0, $6YMke$filterDOMProps)(props);
168
+ let DOMProps = (0, $6YMke$filterDOMProps)(props, {
169
+ global: true
170
+ });
169
171
  delete DOMProps.id;
170
172
  return /*#__PURE__*/ (0, $6YMke$react).createElement("div", {
171
173
  ...(0, $6YMke$mergeProps)(DOMProps, thumbProps, hoverProps),
@@ -1,6 +1,6 @@
1
1
  import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
2
2
  import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.module.js";
3
- import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, useHover as $6YMke$useHover, mergeProps as $6YMke$mergeProps, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
3
+ import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, mergeProps as $6YMke$mergeProps, useHover as $6YMke$useHover, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
4
4
  import {filterDOMProps as $6YMke$filterDOMProps} from "@react-aria/utils";
5
5
  import $6YMke$react, {createContext as $6YMke$createContext, forwardRef as $6YMke$forwardRef, useRef as $6YMke$useRef, useContext as $6YMke$useContext} from "react";
6
6
  import {useSliderState as $6YMke$useSliderState} from "react-stately";
@@ -47,7 +47,9 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
47
47
  },
48
48
  defaultClassName: 'react-aria-Slider'
49
49
  });
50
- let DOMProps = (0, $6YMke$filterDOMProps)(props);
50
+ let DOMProps = (0, $6YMke$filterDOMProps)(props, {
51
+ global: true
52
+ });
51
53
  delete DOMProps.id;
52
54
  return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
53
55
  values: [
@@ -75,9 +77,7 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
75
77
  ]
76
78
  ]
77
79
  }, /*#__PURE__*/ (0, $6YMke$react).createElement("div", {
78
- ...DOMProps,
79
- ...groupProps,
80
- ...renderProps,
80
+ ...(0, $6YMke$mergeProps)(DOMProps, renderProps, groupProps),
81
81
  ref: ref,
82
82
  slot: props.slot || undefined,
83
83
  "data-orientation": state.orientation,
@@ -165,7 +165,9 @@ const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwa
165
165
  isDisabled: isDisabled
166
166
  }
167
167
  });
168
- let DOMProps = (0, $6YMke$filterDOMProps)(props);
168
+ let DOMProps = (0, $6YMke$filterDOMProps)(props, {
169
+ global: true
170
+ });
169
171
  delete DOMProps.id;
170
172
  return /*#__PURE__*/ (0, $6YMke$react).createElement("div", {
171
173
  ...(0, $6YMke$mergeProps)(DOMProps, thumbProps, hoverProps),
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA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AS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,WAAW;QAC/C,GAAG,WAAW;QACf,KAAK;QACL,OAAO;YAAC,GAAG,WAAW,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACjD,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;uBAE9D,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...DOMProps}\n {...groupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,aAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,yBAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,qBAAa,EAAE;QAAC,GAAG,KAAK;yBAAE;IAAe;IACrD,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI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oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSliderProps, AriaSliderThumbProps, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps>, GlobalDOMAttributes<HTMLOutputElement> {}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps>, GlobalDOMAttributes<HTMLDivElement> {}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
@@ -61,8 +61,11 @@ const $8d81efc5c2ff8011$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hNQDK$react
61
61
  state: state
62
62
  }
63
63
  });
64
- let DOMProps = (0, $hNQDK$reactariautils.filterDOMProps)(props);
64
+ let DOMProps = (0, $hNQDK$reactariautils.filterDOMProps)(props, {
65
+ global: true
66
+ });
65
67
  delete DOMProps.id;
68
+ delete DOMProps.onClick;
66
69
  return /*#__PURE__*/ (0, ($parcel$interopDefault($hNQDK$react))).createElement("label", {
67
70
  ...(0, $hNQDK$reactaria.mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
68
71
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA+C;AAKjF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAO,KAAkB,EAAE,GAAmC;IACxI,IAAI,EACF,UAAU,uBAAuB,IAAI,EACrC,GAAG,YACJ,GAAG;IACJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,YAAY,KAAK;IAChD,IAAI,WAAW,CAAA,GAAA,kCAAW,EAAE,CAAA,GAAA,+BAAQ,EAAE,sBAAsB,MAAM,QAAQ,KAAK,YAAY,MAAM,QAAQ,GAAG;IAC5G,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE;IAC3B,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,0BAAQ,EAAE;QACtF,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;QAC9B,kDAAkD;QAClD,UAAU,OAAO,MAAM,QAAQ,KAAK,aAAa,OAAO,MAAM,QAAQ;IACxE,GAAG,OAAO;IACV,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW;IACzD,IAAI,wBAAwB,MAAM,UAAU,IAAI,MAAM,UAAU;IAEhE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY;IACd;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;uBACA;uBACA;uBACA;4BACA;wBACA;wBACA;mBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,+BAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSwitchProps, HoverEvents, mergeProps, useFocusRing, useHover, useSwitch, VisuallyHidden} from 'react-aria';\nimport {ContextValue, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'children'>, HoverEvents, RenderProps<SwitchRenderProps>, SlotProps {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface SwitchRenderProps {\n /**\n * Whether the switch is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the switch is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the switch is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the switch is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the switch is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the switch is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the switch is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * State of the switch.\n */\n state: ToggleState\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n */\nexport const Switch = /*#__PURE__*/ (forwardRef as forwardRefType)(function Switch(props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, SwitchContext);\n let inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));\n let state = useToggleState(props);\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed} = useSwitch({\n ...removeDataAttributes(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = props.isDisabled || props.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Switch',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Switch.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA+C;AAKjF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAO,KAAkB,EAAE,GAAmC;IACxI,IAAI,EACF,UAAU,uBAAuB,IAAI,EACrC,GAAG,YACJ,GAAG;IACJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,YAAY,KAAK;IAChD,IAAI,WAAW,CAAA,GAAA,kCAAW,E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GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSwitchProps, HoverEvents, mergeProps, useFocusRing, useHover, useSwitch, VisuallyHidden} from 'react-aria';\nimport {ContextValue, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'children'>, HoverEvents, RenderProps<SwitchRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface SwitchRenderProps {\n /**\n * Whether the switch is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the switch is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the switch is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the switch is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the switch is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the switch is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the switch is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * State of the switch.\n */\n state: ToggleState\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n */\nexport const Switch = /*#__PURE__*/ (forwardRef as forwardRefType)(function Switch(props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, SwitchContext);\n let inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));\n let state = useToggleState(props);\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed} = useSwitch({\n ...removeDataAttributes(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = props.isDisabled || props.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Switch',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Switch.main.js.map"}
package/dist/Switch.mjs CHANGED
@@ -50,8 +50,11 @@ const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hYf9o$forwa
50
50
  state: state
51
51
  }
52
52
  });
53
- let DOMProps = (0, $hYf9o$filterDOMProps)(props);
53
+ let DOMProps = (0, $hYf9o$filterDOMProps)(props, {
54
+ global: true
55
+ });
54
56
  delete DOMProps.id;
57
+ delete DOMProps.onClick;
55
58
  return /*#__PURE__*/ (0, $hYf9o$react).createElement("label", {
56
59
  ...(0, $hYf9o$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
57
60
  ref: ref,
@@ -50,8 +50,11 @@ const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hYf9o$forwa
50
50
  state: state
51
51
  }
52
52
  });
53
- let DOMProps = (0, $hYf9o$filterDOMProps)(props);
53
+ let DOMProps = (0, $hYf9o$filterDOMProps)(props, {
54
+ global: true
55
+ });
54
56
  delete DOMProps.id;
57
+ delete DOMProps.onClick;
55
58
  return /*#__PURE__*/ (0, $hYf9o$react).createElement("label", {
56
59
  ...(0, $hYf9o$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
57
60
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA+C;AAKjF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAO,KAAkB,EAAE,GAAmC;IACxI,IAAI,EACF,UAAU,uBAAuB,IAAI,EACrC,GAAG,YACJ,GAAG;IACJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,YAAY,KAAK;IAChD,IAAI,WAAW,CAAA,GAAA,mBAAW,EAAE,CAAA,GAAA,gBAAQ,EAAE,sBAAsB,MAAM,QAAQ,KA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tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSwitchProps, HoverEvents, mergeProps, useFocusRing, useHover, useSwitch, VisuallyHidden} from 'react-aria';\nimport {ContextValue, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'children'>, HoverEvents, RenderProps<SwitchRenderProps>, SlotProps {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface SwitchRenderProps {\n /**\n * Whether the switch is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the switch is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the switch is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the switch is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the switch is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the switch is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the switch is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * State of the switch.\n */\n state: ToggleState\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n */\nexport const Switch = /*#__PURE__*/ (forwardRef as forwardRefType)(function Switch(props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, SwitchContext);\n let inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));\n let state = useToggleState(props);\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed} = useSwitch({\n ...removeDataAttributes(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = props.isDisabled || props.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Switch',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Switch.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA+C;AAKjF,MAAM,4CAAuB,AAAd,WAAW,GAAI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,IAAI,IAAI;QACpB,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaSwitchProps, HoverEvents, mergeProps, useFocusRing, useHover, useSwitch, VisuallyHidden} from 'react-aria';\nimport {ContextValue, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'children'>, HoverEvents, RenderProps<SwitchRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface SwitchRenderProps {\n /**\n * Whether the switch is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the switch is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the switch is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the switch is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the switch is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the switch is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the switch is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * State of the switch.\n */\n state: ToggleState\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n */\nexport const Switch = /*#__PURE__*/ (forwardRef as forwardRefType)(function Switch(props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, SwitchContext);\n let inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));\n let state = useToggleState(props);\n let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed} = useSwitch({\n ...removeDataAttributes(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let isInteractionDisabled = props.isDisabled || props.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: isInteractionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Switch',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Switch.module.js.map"}
@@ -33,7 +33,7 @@ $parcel$export(module.exports, "ColumnResizer", () => $37b9a5d4bd0d4ded$export$e
33
33
  $parcel$export(module.exports, "TableBody", () => $37b9a5d4bd0d4ded$export$76ccd210b9029917);
34
34
  $parcel$export(module.exports, "Row", () => $37b9a5d4bd0d4ded$export$b59bdbef9ce70de2);
35
35
  $parcel$export(module.exports, "Cell", () => $37b9a5d4bd0d4ded$export$f6f0c3fe4ec306ea);
36
- $parcel$export(module.exports, "UNSTABLE_TableLoadingSentinel", () => $37b9a5d4bd0d4ded$export$92aad1076056e17a);
36
+ $parcel$export(module.exports, "TableLoadMoreItem", () => $37b9a5d4bd0d4ded$export$8f5bea0338ed243c);
37
37
 
38
38
 
39
39
 
@@ -101,9 +101,6 @@ class $37b9a5d4bd0d4ded$var$TableCollection extends (0, $5VUTk$reactariacollecti
101
101
  yield this.head;
102
102
  yield this.body;
103
103
  }
104
- get size() {
105
- return this.rows.length;
106
- }
107
104
  getFirstKey() {
108
105
  return this.body.firstChildKey;
109
106
  }
@@ -207,7 +204,9 @@ const $37b9a5d4bd0d4ded$export$7063e69b8a954175 = /*#__PURE__*/ (0, $5VUTk$react
207
204
  props.onResizeEnd
208
205
  ]);
209
206
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement("div", {
210
- ...(0, $5VUTk$reactariautils.filterDOMProps)(props),
207
+ ...(0, $5VUTk$reactariautils.filterDOMProps)(props, {
208
+ global: true
209
+ }),
211
210
  ref: containerRef,
212
211
  className: props.className || 'react-aria-ResizableTableContainer',
213
212
  style: props.style,
@@ -347,6 +346,9 @@ function $37b9a5d4bd0d4ded$var$TableInner({ props: props, forwardedRef: ref, sel
347
346
  };
348
347
  }
349
348
  let ElementType = $37b9a5d4bd0d4ded$var$useElementType('table');
349
+ let DOMProps = (0, $5VUTk$reactariautils.filterDOMProps)(props, {
350
+ global: true
351
+ });
350
352
  var _tableContainerContext_scrollRef;
351
353
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
352
354
  values: [
@@ -374,9 +376,7 @@ function $37b9a5d4bd0d4ded$var$TableInner({ props: props, forwardedRef: ref, sel
374
376
  ]
375
377
  ]
376
378
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement((0, $5VUTk$reactaria.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(ElementType, {
377
- ...(0, $5VUTk$reactariautils.filterDOMProps)(props),
378
- ...renderProps,
379
- ...(0, $5VUTk$reactaria.mergeProps)(gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
379
+ ...(0, $5VUTk$reactaria.mergeProps)(DOMProps, renderProps, gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
380
380
  style: style,
381
381
  ref: ref,
382
382
  slot: props.slot || undefined,
@@ -430,7 +430,9 @@ const $37b9a5d4bd0d4ded$export$f850895b287ef28e = /*#__PURE__*/ (0, $5VUTk$react
430
430
  }
431
431
  });
432
432
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(THead, {
433
- ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props), rowGroupProps, hoverProps),
433
+ ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props, {
434
+ global: true
435
+ }), rowGroupProps, hoverProps),
434
436
  ...renderProps,
435
437
  ref: ref,
436
438
  "data-hovered": isHovered || undefined
@@ -521,8 +523,12 @@ const $37b9a5d4bd0d4ded$export$816b5d811295e6bc = /*#__PURE__*/ (0, $5VUTk$react
521
523
  width: layoutState.getColumnWidth(column.key)
522
524
  };
523
525
  let TH = $37b9a5d4bd0d4ded$var$useElementType('th');
526
+ let DOMProps = (0, $5VUTk$reactariautils.filterDOMProps)(props, {
527
+ global: true
528
+ });
529
+ delete DOMProps.id;
524
530
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TH, {
525
- ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props), columnHeaderProps, focusProps, hoverProps),
531
+ ...(0, $5VUTk$reactaria.mergeProps)(DOMProps, columnHeaderProps, focusProps, hoverProps),
526
532
  ...renderProps,
527
533
  style: style,
528
534
  ref: ref,
@@ -599,12 +605,13 @@ const $37b9a5d4bd0d4ded$export$ee689e97a7664bfd = /*#__PURE__*/ (0, $5VUTk$react
599
605
  if (e.pointerType === 'mouse') setMouseDown(true);
600
606
  };
601
607
  if (!isResizing && isMouseDown) setMouseDown(false);
608
+ let DOMProps = (0, $5VUTk$reactariautils.filterDOMProps)(props, {
609
+ global: true
610
+ });
602
611
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement("div", {
603
612
  ref: objectRef,
604
613
  role: "presentation",
605
- ...(0, $5VUTk$reactariautils.filterDOMProps)(props),
606
- ...renderProps,
607
- ...(0, $5VUTk$reactaria.mergeProps)(resizerProps, {
614
+ ...(0, $5VUTk$reactaria.mergeProps)(DOMProps, renderProps, resizerProps, {
608
615
  onPointerDown: onPointerDown
609
616
  }, hoverProps),
610
617
  "data-hovered": isHovered || undefined,
@@ -637,7 +644,7 @@ const $37b9a5d4bd0d4ded$export$76ccd210b9029917 = /*#__PURE__*/ (0, $5VUTk$react
637
644
  let isRootDropTarget = isDroppable && !!dropState && ((_dropState_isDropTarget = dropState.isDropTarget({
638
645
  type: 'root'
639
646
  })) !== null && _dropState_isDropTarget !== void 0 ? _dropState_isDropTarget : false);
640
- let isEmpty = collection.size === 0 || collection.rows.length === 1 && collection.rows[0].type === 'loader';
647
+ let isEmpty = collection.size === 0;
641
648
  let renderValues = {
642
649
  isDropTarget: isRootDropTarget,
643
650
  isEmpty: isEmpty
@@ -658,7 +665,6 @@ const $37b9a5d4bd0d4ded$export$76ccd210b9029917 = /*#__PURE__*/ (0, $5VUTk$react
658
665
  let rowHeaderProps = {};
659
666
  let style = {};
660
667
  if (isVirtualized) {
661
- rowProps['aria-rowindex'] = collection.headerRows.length + 1;
662
668
  rowHeaderProps['aria-colspan'] = numColumns;
663
669
  style = {
664
670
  display: 'contents'
@@ -676,11 +682,13 @@ const $37b9a5d4bd0d4ded$export$76ccd210b9029917 = /*#__PURE__*/ (0, $5VUTk$react
676
682
  }
677
683
  let { rowGroupProps: rowGroupProps } = (0, $5VUTk$reactaria.useTableRowGroup)();
678
684
  let TBody = $37b9a5d4bd0d4ded$var$useElementType('tbody');
685
+ let DOMProps = (0, $5VUTk$reactariautils.filterDOMProps)(props, {
686
+ global: true
687
+ });
679
688
  // TODO: TableBody doesn't support being the scrollable body of the table yet, to revisit if needed. Would need to
680
689
  // call useLoadMore here and walk up the DOM to the nearest scrollable element to set scrollRef
681
690
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TBody, {
682
- ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props), rowGroupProps),
683
- ...renderProps,
691
+ ...(0, $5VUTk$reactaria.mergeProps)(DOMProps, renderProps, rowGroupProps),
684
692
  ref: ref,
685
693
  "data-empty": isEmpty || undefined
686
694
  }, isDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement($37b9a5d4bd0d4ded$var$RootDropIndicator, null), /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(CollectionBranch, {
@@ -754,6 +762,11 @@ const $37b9a5d4bd0d4ded$export$b59bdbef9ce70de2 = /*#__PURE__*/ (0, $5VUTk$react
754
762
  });
755
763
  let TR = $37b9a5d4bd0d4ded$var$useElementType('tr');
756
764
  let TD = $37b9a5d4bd0d4ded$var$useElementType('td');
765
+ let DOMProps = (0, $5VUTk$reactariautils.filterDOMProps)(props, {
766
+ global: true
767
+ });
768
+ delete DOMProps.id;
769
+ delete DOMProps.onClick;
757
770
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement((0, ($parcel$interopDefault($5VUTk$react))).Fragment, null, dropIndicator && !dropIndicator.isHidden && /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TR, {
758
771
  role: "row",
759
772
  style: {
@@ -771,8 +784,7 @@ const $37b9a5d4bd0d4ded$export$b59bdbef9ce70de2 = /*#__PURE__*/ (0, $5VUTk$react
771
784
  ...dropIndicator.dropIndicatorProps,
772
785
  ref: dropIndicatorRef
773
786
  }))), /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TR, {
774
- ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props), rowProps, focusProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, focusWithinProps),
775
- ...renderProps,
787
+ ...(0, $5VUTk$reactaria.mergeProps)(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, focusWithinProps),
776
788
  ref: ref,
777
789
  "data-disabled": states.isDisabled || undefined,
778
790
  "data-selected": states.isSelected || undefined,
@@ -852,9 +864,12 @@ const $37b9a5d4bd0d4ded$export$f6f0c3fe4ec306ea = /*#__PURE__*/ (0, $5VUTk$react
852
864
  }
853
865
  });
854
866
  let TD = $37b9a5d4bd0d4ded$var$useElementType('td');
867
+ let DOMProps = (0, $5VUTk$reactariautils.filterDOMProps)(props, {
868
+ global: true
869
+ });
870
+ delete DOMProps.id;
855
871
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TD, {
856
- ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props), gridCellProps, focusProps, hoverProps),
857
- ...renderProps,
872
+ ...(0, $5VUTk$reactaria.mergeProps)(DOMProps, renderProps, gridCellProps, focusProps, hoverProps),
858
873
  ref: ref,
859
874
  "data-focused": isFocused || undefined,
860
875
  "data-focus-visible": isFocusVisible || undefined,
@@ -891,7 +906,9 @@ function $37b9a5d4bd0d4ded$var$TableDropIndicator(props, ref) {
891
906
  let TR = $37b9a5d4bd0d4ded$var$useElementType('tr');
892
907
  let TD = $37b9a5d4bd0d4ded$var$useElementType('td');
893
908
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TR, {
894
- ...(0, $5VUTk$reactariautils.filterDOMProps)(props),
909
+ ...(0, $5VUTk$reactariautils.filterDOMProps)(props, {
910
+ global: true
911
+ }),
895
912
  ...renderProps,
896
913
  role: "row",
897
914
  ref: ref,
@@ -945,7 +962,7 @@ function $37b9a5d4bd0d4ded$var$RootDropIndicator() {
945
962
  ref: ref
946
963
  })));
947
964
  }
948
- const $37b9a5d4bd0d4ded$export$92aad1076056e17a = (0, $5VUTk$reactariacollections.createLeafComponent)('loader', function TableLoadingIndicator(props, ref, item) {
965
+ const $37b9a5d4bd0d4ded$export$8f5bea0338ed243c = (0, $5VUTk$reactariacollections.createLeafComponent)('loader', function TableLoadingIndicator(props, ref, item) {
949
966
  let state = (0, $5VUTk$react.useContext)($37b9a5d4bd0d4ded$export$38de1cb0526c21fb);
950
967
  let { isVirtualized: isVirtualized } = (0, $5VUTk$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
951
968
  let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
@@ -961,7 +978,7 @@ const $37b9a5d4bd0d4ded$export$92aad1076056e17a = (0, $5VUTk$reactariacollection
961
978
  scrollOffset,
962
979
  state === null || state === void 0 ? void 0 : state.collection
963
980
  ]);
964
- (0, $5VUTk$reactariautils.UNSTABLE_useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
981
+ (0, $5VUTk$reactariautils.useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
965
982
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
966
983
  ...otherProps,
967
984
  id: undefined,
@@ -975,7 +992,9 @@ const $37b9a5d4bd0d4ded$export$92aad1076056e17a = (0, $5VUTk$reactariacollection
975
992
  let rowHeaderProps = {};
976
993
  let style = {};
977
994
  if (isVirtualized) {
978
- rowProps['aria-rowindex'] = item.index + 1 + state.collection.headerRows.length;
995
+ // For now don't include aria-rowindex on loader since they aren't keyboard focusable
996
+ // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the
997
+ // row count
979
998
  rowHeaderProps['aria-colspan'] = numColumns;
980
999
  style = {
981
1000
  display: 'contents'
@@ -1000,7 +1019,9 @@ const $37b9a5d4bd0d4ded$export$92aad1076056e17a = (0, $5VUTk$reactariacollection
1000
1019
  width: 1
1001
1020
  }
1002
1021
  }))), isLoading && renderProps.children && /*#__PURE__*/ (0, ($parcel$interopDefault($5VUTk$react))).createElement(TR, {
1003
- ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props), rowProps),
1022
+ ...(0, $5VUTk$reactaria.mergeProps)((0, $5VUTk$reactariautils.filterDOMProps)(props, {
1023
+ global: true
1024
+ }), rowProps),
1004
1025
  ...renderProps,
1005
1026
  role: "row",
1006
1027
  ref: ref