react-aria-components 1.10.1 → 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 +20 -10
  188. package/dist/Tabs.main.js.map +1 -1
  189. package/dist/Tabs.mjs +21 -11
  190. package/dist/Tabs.module.js +21 -11
  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 +18 -15
  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
@@ -40,13 +40,16 @@ const $afa44b644f65ed30$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $l7mU3$react.
40
40
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $afa44b644f65ed30$export$65596d3621b0a4a0);
41
41
  let { CollectionRoot: CollectionRoot } = (0, $l7mU3$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
42
42
  let { navProps: navProps } = (0, $l7mU3$reactaria.useBreadcrumbs)(props);
43
+ let DOMProps = (0, $l7mU3$reactariautils.filterDOMProps)(props, {
44
+ global: true
45
+ });
43
46
  return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.CollectionBuilder), {
44
47
  content: /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.Collection), props)
45
48
  }, (collection)=>{
46
49
  var _props_className;
47
50
  return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("ol", {
48
51
  ref: ref,
49
- ...navProps,
52
+ ...(0, $l7mU3$reactariautils.mergeProps)(DOMProps, navProps),
50
53
  slot: props.slot || undefined,
51
54
  style: props.style,
52
55
  className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
@@ -75,8 +78,12 @@ const $afa44b644f65ed30$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $l7mU3$react
75
78
  },
76
79
  defaultClassName: 'react-aria-Breadcrumb'
77
80
  });
81
+ let DOMProps = (0, $l7mU3$reactariautils.filterDOMProps)(props, {
82
+ global: true
83
+ });
84
+ delete DOMProps.id;
78
85
  return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("li", {
79
- ...(0, $l7mU3$reactariautils.filterDOMProps)(props),
86
+ ...DOMProps,
80
87
  ...renderProps,
81
88
  ref: ref,
82
89
  "data-disabled": isDisabled || isCurrent || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,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ACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
1
+ {"mappings":";;;;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A,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLOListElement> {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, GlobalDOMAttributes<HTMLLIElement> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
@@ -3,7 +3,7 @@ import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderP
3
3
  import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.mjs";
4
4
  import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
5
5
  import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
6
- import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
6
+ import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
7
7
  import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
8
8
 
9
9
  /*
@@ -28,13 +28,16 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
28
28
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
29
29
  let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
30
30
  let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
31
+ let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
32
+ global: true
33
+ });
31
34
  return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
32
35
  content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
33
36
  }, (collection)=>{
34
37
  var _props_className;
35
38
  return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
36
39
  ref: ref,
37
- ...navProps,
40
+ ...(0, $c5cc5$mergeProps)(DOMProps, navProps),
38
41
  slot: props.slot || undefined,
39
42
  style: props.style,
40
43
  className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
@@ -63,8 +66,12 @@ const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$creat
63
66
  },
64
67
  defaultClassName: 'react-aria-Breadcrumb'
65
68
  });
69
+ let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
70
+ global: true
71
+ });
72
+ delete DOMProps.id;
66
73
  return /*#__PURE__*/ (0, $c5cc5$react).createElement("li", {
67
- ...(0, $c5cc5$filterDOMProps)(props),
74
+ ...DOMProps,
68
75
  ...renderProps,
69
76
  ref: ref,
70
77
  "data-disabled": isDisabled || isCurrent || undefined,
@@ -3,7 +3,7 @@ import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderP
3
3
  import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.module.js";
4
4
  import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
5
5
  import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
6
- import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
6
+ import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
7
7
  import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
8
8
 
9
9
  /*
@@ -28,13 +28,16 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
28
28
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
29
29
  let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
30
30
  let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
31
+ let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
32
+ global: true
33
+ });
31
34
  return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
32
35
  content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
33
36
  }, (collection)=>{
34
37
  var _props_className;
35
38
  return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
36
39
  ref: ref,
37
- ...navProps,
40
+ ...(0, $c5cc5$mergeProps)(DOMProps, navProps),
38
41
  slot: props.slot || undefined,
39
42
  style: props.style,
40
43
  className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
@@ -63,8 +66,12 @@ const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$creat
63
66
  },
64
67
  defaultClassName: 'react-aria-Breadcrumb'
65
68
  });
69
+ let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
70
+ global: true
71
+ });
72
+ delete DOMProps.id;
66
73
  return /*#__PURE__*/ (0, $c5cc5$react).createElement("li", {
67
- ...(0, $c5cc5$filterDOMProps)(props),
74
+ ...DOMProps,
68
75
  ...renderProps,
69
76
  ref: ref,
70
77
  "data-disabled": isDisabled || isCurrent || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM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C;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.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,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLOListElement> {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, GlobalDOMAttributes<HTMLLIElement> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
@@ -34,16 +34,6 @@ $parcel$export(module.exports, "Button", () => $b856e6788a7ea5bf$export$353f5b6f
34
34
 
35
35
 
36
36
 
37
- const $b856e6788a7ea5bf$var$additionalButtonHTMLAttributes = new Set([
38
- 'form',
39
- 'formAction',
40
- 'formEncType',
41
- 'formMethod',
42
- 'formNoValidate',
43
- 'formTarget',
44
- 'name',
45
- 'value'
46
- ]);
47
37
  const $b856e6788a7ea5bf$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $3vfYa$react.createContext)({});
48
38
  const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$reactariacollections.createHideableComponent)(function Button(props, ref) {
49
39
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $b856e6788a7ea5bf$export$24d547caef80ccd1);
@@ -92,14 +82,14 @@ const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$react
92
82
  ariaLabelledby,
93
83
  buttonId
94
84
  ]);
95
- // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
96
- // We do this by changing the button's type to button.
85
+ let DOMProps = (0, $3vfYa$reactariautils.filterDOMProps)(props, {
86
+ global: true
87
+ });
88
+ delete DOMProps.onClick;
97
89
  return /*#__PURE__*/ (0, ($parcel$interopDefault($3vfYa$react))).createElement("button", {
98
- ...(0, $3vfYa$reactariautils.filterDOMProps)(props, {
99
- propNames: $b856e6788a7ea5bf$var$additionalButtonHTMLAttributes
100
- }),
101
- ...(0, $3vfYa$reactaria.mergeProps)(buttonProps, focusProps, hoverProps),
102
- ...renderProps,
90
+ ...(0, $3vfYa$reactaria.mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
91
+ // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
92
+ // We do this by changing the button's type to button.
103
93
  type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
104
94
  id: buttonId,
105
95
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2FD,MAAM,uDAAiC,IAAI,IAAI;IAAC;IAAQ;IAAc;IAAe;IAAc;IAAkB;IAAc;IAAQ;CAAQ;AAE5I,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAuD,CAAC;AAK1F,MAAM,4CAAS,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,OAAO,KAAkB,EAAE,GAAoC;IAClI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,QAAQ,0CAAoB;IAC5B,IAAI,MAAM;IACV,IAAI,aAAC,SAAS,EAAC,GAAG;IAClB,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,0BAAQ,EAAE,OAAO;IAChD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY,MAAM,U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iB;QACjB,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,YAAY,SAAS,WAAW,CAAC,gBAAgB;QAChE,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,aAAa,SAAS,IAAI;QACxC,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,4CAAiB,EAAE,QAAQ;QAAC,OAAO;YAAC,IAAI;QAAU;OAChD,YAAY,QAAQ;AAI7B;AAEA,SAAS,0CAAoB,KAAK;IAChC,kDAAkD;IAClD,IAAI,MAAM,SAAS,EAAE;QACnB,MAAM,OAAO,GAAG;QAChB,MAAM,YAAY,GAAG;QACrB,MAAM,UAAU,GAAG;QACnB,MAAM,aAAa,GAAG;QACtB,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;QAClB,MAAM,OAAO,GAAG;QAChB,MAAM,OAAO,GAAG;QAChB,MAAM,IAAI,GAAG;IACf;IACA,OAAO;AACT","sources":["packages/react-aria-components/src/Button.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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps> {\n /**\n * The `<form>` element to associate the button with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n */\n form?: string,\n /**\n * The URL that processes the information submitted by the button.\n * Overrides the action attribute of the button's form owner.\n */\n formAction?: string,\n /** Indicates how to encode the form data that is submitted. */\n formEncType?: string,\n /** Indicates the HTTP method used to submit the form. */\n formMethod?: string,\n /** Indicates that the form is not to be validated when it is submitted. */\n formNoValidate?: boolean,\n /** Overrides the target attribute of the button's form owner. */\n formTarget?: string,\n /** Submitted as a pair with the button's value as part of the form data. */\n name?: string,\n /** The value associated with the button's name when it's submitted with the form data. */\n value?: string,\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nconst additionalButtonHTMLAttributes = new Set(['form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'name', 'value']);\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n return (\n <button\n {...filterDOMProps(props, {propNames: additionalButtonHTMLAttributes})}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n {...renderProps}\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAsEM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAuD,CAAC;AAK1F,MAAM,4CAAS,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,OAAO,KAAkB,EAAE,GAAoC;IAClI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,QAAQ,0CAAoB;IAC5B,IAAI,MAAM;IACV,IAAI,aAAC,SAAS,EAAC,GAAG;IAClB,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,0BAAQ,EAAE,OAAO;IAChD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY,MAAM,UAAU,IAAI;IAClC;IACA,IAAI,eAAe;mBACjB;QACA,WAAW,AAAC,CAAA,IAAI,SAAS,IAAI,SAAQ,KAAM,CAAC;mBAC5C;wBACA;QACA,YAAY,MAAM,UAAU,IAAI;QAChC,WAAW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S,IAAI;QACxC,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,4CAAiB,EAAE,QAAQ;QAAC,OAAO;YAAC,IAAI;QAAU;OAChD,YAAY,QAAQ;AAI7B;AAEA,SAAS,0CAAoB,KAAK;IAChC,kDAAkD;IAClD,IAAI,MAAM,SAAS,EAAE;QACnB,MAAM,OAAO,GAAG;QAChB,MAAM,YAAY,GAAG;QACrB,MAAM,UAAU,GAAG;QACnB,MAAM,aAAa,GAAG;QACtB,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;QAClB,MAAM,OAAO,GAAG;QAChB,MAAM,OAAO,GAAG;QAChB,MAAM,IAAI,GAAG;IACf;IACA,OAAO;AACT","sources":["packages/react-aria-components/src/Button.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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.main.js.map"}
package/dist/Button.mjs CHANGED
@@ -23,16 +23,6 @@ import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$us
23
23
 
24
24
 
25
25
 
26
- const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
27
- 'form',
28
- 'formAction',
29
- 'formEncType',
30
- 'formMethod',
31
- 'formNoValidate',
32
- 'formTarget',
33
- 'name',
34
- 'value'
35
- ]);
36
26
  const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
37
27
  const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
38
28
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
@@ -81,14 +71,14 @@ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$creat
81
71
  ariaLabelledby,
82
72
  buttonId
83
73
  ]);
84
- // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
85
- // We do this by changing the button's type to button.
74
+ let DOMProps = (0, $fM325$filterDOMProps)(props, {
75
+ global: true
76
+ });
77
+ delete DOMProps.onClick;
86
78
  return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
87
- ...(0, $fM325$filterDOMProps)(props, {
88
- propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
89
- }),
90
- ...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
91
- ...renderProps,
79
+ ...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
80
+ // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
81
+ // We do this by changing the button's type to button.
92
82
  type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
93
83
  id: buttonId,
94
84
  ref: ref,
@@ -23,16 +23,6 @@ import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$us
23
23
 
24
24
 
25
25
 
26
- const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
27
- 'form',
28
- 'formAction',
29
- 'formEncType',
30
- 'formMethod',
31
- 'formNoValidate',
32
- 'formTarget',
33
- 'name',
34
- 'value'
35
- ]);
36
26
  const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
37
27
  const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
38
28
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
@@ -81,14 +71,14 @@ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$creat
81
71
  ariaLabelledby,
82
72
  buttonId
83
73
  ]);
84
- // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
85
- // We do this by changing the button's type to button.
74
+ let DOMProps = (0, $fM325$filterDOMProps)(props, {
75
+ global: true
76
+ });
77
+ delete DOMProps.onClick;
86
78
  return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
87
- ...(0, $fM325$filterDOMProps)(props, {
88
- propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
89
- }),
90
- ...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
91
- ...renderProps,
79
+ ...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
80
+ // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
81
+ // We do this by changing the button's type to button.
92
82
  type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
93
83
  id: buttonId,
94
84
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2FD,MAAM,uDAAiC,IAAI,IAAI;IAAC;IAAQ;IAAc;IAAe;IAAc;IAAkB;IAAc;IAAQ;CAAQ;AAE5I,MAAM,0DAAgB,CAAA,GAA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ights 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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps> {\n /**\n * The `<form>` element to associate the button with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n */\n form?: string,\n /**\n * The URL that processes the information submitted by the button.\n * Overrides the action attribute of the button's form owner.\n */\n formAction?: string,\n /** Indicates how to encode the form data that is submitted. */\n formEncType?: string,\n /** Indicates the HTTP method used to submit the form. */\n formMethod?: string,\n /** Indicates that the form is not to be validated when it is submitted. */\n formNoValidate?: boolean,\n /** Overrides the target attribute of the button's form owner. */\n formTarget?: string,\n /** Submitted as a pair with the button's value as part of the form data. */\n name?: string,\n /** The value associated with the button's name when it's submitted with the form data. */\n value?: string,\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nconst additionalButtonHTMLAttributes = new Set(['form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'name', 'value']);\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n return (\n <button\n {...filterDOMProps(props, {propNames: additionalButtonHTMLAttributes})}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n {...renderProps}\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAsEM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAuD,CAAC;AAK1F,MAAM,4CAAS,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,OAAO,KAAkB,EAAE,GAAoC;IAClI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,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;QAEpB,WAAW,OAAO,GAAG;IACvB,GAAG;QAAC;QAAW;QAAW;QAAgB;KAAS;IAEnD,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,qIAAqI;QACrI,sDAAsD;QACtD,MAAM,YAAY,IAAI,KAAK,YAAY,YAAY,WAAW,YAAY,IAAI;QAC9E,IAAI;QACJ,KAAK;QACL,mBAAiB;QACjB,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,YAAY,SAAS,WAAW,CAAC,gBAAgB;QAChE,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,aAAa,SAAS,IAAI;QACxC,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,gCAAC,CAAA,GAAA,yCAAiB,EAAE,QAAQ;QAAC,OAAO;YAAC,IAAI;QAAU;OAChD,YAAY,QAAQ;AAI7B;AAEA,SAAS,0CAAoB,KAAK;IAChC,kDAAkD;IAClD,IAAI,MAAM,SAAS,EAAE;QACnB,MAAM,OAAO,GAAG;QAChB,MAAM,YAAY,GAAG;QACrB,MAAM,UAAU,GAAG;QACnB,MAAM,aAAa,GAAG;QACtB,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;QAClB,MAAM,OAAO,GAAG;QAChB,MAAM,OAAO,GAAG;QAChB,MAAM,IAAI,GAAG;IACf;IACA,OAAO;AACT","sources":["packages/react-aria-components/src/Button.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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.module.js.map"}
@@ -69,9 +69,11 @@ const $3f539f26b167ddde$export$e1aef45b828286de = /*#__PURE__*/ (0, $iJp6C$react
69
69
  },
70
70
  defaultClassName: 'react-aria-Calendar'
71
71
  });
72
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
73
+ global: true
74
+ });
72
75
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("div", {
73
- ...renderProps,
74
- ...calendarProps,
76
+ ...(0, $iJp6C$reactaria.mergeProps)(DOMProps, renderProps, calendarProps),
75
77
  ref: ref,
76
78
  slot: props.slot || undefined,
77
79
  "data-disabled": props.isDisabled || undefined,
@@ -137,9 +139,11 @@ const $3f539f26b167ddde$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $iJp6C$react
137
139
  },
138
140
  defaultClassName: 'react-aria-RangeCalendar'
139
141
  });
142
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
143
+ global: true
144
+ });
140
145
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("div", {
141
- ...renderProps,
142
- ...calendarProps,
146
+ ...(0, $iJp6C$reactaria.mergeProps)(renderProps, DOMProps, calendarProps),
143
147
  ref: ref,
144
148
  slot: props.slot || undefined,
145
149
  "data-disabled": props.isDisabled || undefined,
@@ -204,6 +208,9 @@ const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react
204
208
  weekdayStyle: props.weekdayStyle,
205
209
  firstDayOfWeek: firstDayOfWeek
206
210
  }, state);
211
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
212
+ global: true
213
+ });
207
214
  var _props_className;
208
215
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$var$InternalCalendarGridContext.Provider, {
209
216
  value: {
@@ -213,19 +220,21 @@ const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react
213
220
  weeksInMonth: weeksInMonth
214
221
  }
215
222
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("table", {
216
- ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
217
- ...gridProps,
223
+ ...(0, $iJp6C$reactaria.mergeProps)(DOMProps, gridProps),
218
224
  ref: ref,
219
225
  style: props.style,
226
+ cellPadding: 0,
220
227
  className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-CalendarGrid'
221
228
  }, typeof props.children !== 'function' ? props.children : /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement((0, ($parcel$interopDefault($iJp6C$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$export$22e2d15eaa4d2377, null, (day)=>/*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$export$ad2135cac3a11b3d, null, day)), /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$export$e11f8ba65d857bff, null, props.children))));
222
229
  });
223
230
  function $3f539f26b167ddde$var$CalendarGridHeader(props, ref) {
224
231
  let { children: children, style: style, className: className } = props;
225
232
  let { headerProps: headerProps, weekDays: weekDays } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
233
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
234
+ global: true
235
+ });
226
236
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("thead", {
227
- ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
228
- ...headerProps,
237
+ ...(0, $iJp6C$reactaria.mergeProps)(DOMProps, headerProps),
229
238
  ref: ref,
230
239
  style: style,
231
240
  className: className || 'react-aria-CalendarGridHeader'
@@ -238,8 +247,11 @@ function $3f539f26b167ddde$var$CalendarGridHeader(props, ref) {
238
247
  */ const $3f539f26b167ddde$export$22e2d15eaa4d2377 = /*#__PURE__*/ (0, $iJp6C$react.forwardRef)($3f539f26b167ddde$var$CalendarGridHeader);
239
248
  function $3f539f26b167ddde$var$CalendarHeaderCell(props, ref) {
240
249
  let { children: children, style: style, className: className } = props;
250
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
251
+ global: true
252
+ });
241
253
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("th", {
242
- ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
254
+ ...DOMProps,
243
255
  ref: ref,
244
256
  style: style,
245
257
  className: className || 'react-aria-CalendarHeaderCell'
@@ -254,8 +266,11 @@ function $3f539f26b167ddde$var$CalendarGridBody(props, ref) {
254
266
  let rangeCalendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$5e0fc348c00f87a0);
255
267
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
256
268
  let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
269
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
270
+ global: true
271
+ });
257
272
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("tbody", {
258
- ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
273
+ ...DOMProps,
259
274
  ref: ref,
260
275
  style: style,
261
276
  className: className || 'react-aria-CalendarGridBody'
@@ -280,9 +295,12 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
280
295
  let { startDate: currentMonth } = (_useContext = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext)) !== null && _useContext !== void 0 ? _useContext : {
281
296
  startDate: state.visibleRange.start
282
297
  };
298
+ let isOutsideMonth = !(0, $iJp6C$internationalizeddate.isSameMonth)(currentMonth, date);
299
+ let istoday = (0, $iJp6C$internationalizeddate.isToday)(date, state.timeZone);
283
300
  let buttonRef = (0, $iJp6C$react.useRef)(null);
284
301
  let { cellProps: cellProps, buttonProps: buttonProps, ...states } = (0, $iJp6C$reactaria.useCalendarCell)({
285
- date: date
302
+ date: date,
303
+ isOutsideMonth: isOutsideMonth
286
304
  }, state, buttonRef);
287
305
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $iJp6C$reactaria.useHover)({
288
306
  ...otherProps,
@@ -290,7 +308,6 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
290
308
  });
291
309
  let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $iJp6C$reactaria.useFocusRing)();
292
310
  isFocusVisible && (isFocusVisible = states.isFocused);
293
- let isOutsideMonth = !(0, $iJp6C$internationalizeddate.isSameMonth)(currentMonth, date);
294
311
  let isSelectionStart = false;
295
312
  let isSelectionEnd = false;
296
313
  if ('highlightedRange' in state && state.highlightedRange) {
@@ -308,6 +325,7 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
308
325
  isFocusVisible: isFocusVisible,
309
326
  isSelectionStart: isSelectionStart,
310
327
  isSelectionEnd: isSelectionEnd,
328
+ isToday: istoday,
311
329
  ...states
312
330
  }
313
331
  });
@@ -323,13 +341,17 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
323
341
  'data-selected': states.isSelected || undefined,
324
342
  'data-selection-start': isSelectionStart || undefined,
325
343
  'data-selection-end': isSelectionEnd || undefined,
326
- 'data-invalid': states.isInvalid || undefined
344
+ 'data-invalid': states.isInvalid || undefined,
345
+ 'data-today': istoday || undefined
327
346
  };
347
+ let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(otherProps, {
348
+ global: true
349
+ });
328
350
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("td", {
329
351
  ...cellProps,
330
352
  ref: ref
331
353
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("div", {
332
- ...(0, $iJp6C$reactaria.mergeProps)((0, $iJp6C$reactariautils.filterDOMProps)(otherProps), buttonProps, focusProps, hoverProps, dataAttrs, renderProps),
354
+ ...(0, $iJp6C$reactaria.mergeProps)(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps),
333
355
  ref: buttonRef
334
356
  }));
335
357
  });