react-aria-components 1.7.0 → 1.8.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 (127) hide show
  1. package/dist/Autocomplete.main.js.map +1 -1
  2. package/dist/Autocomplete.module.js.map +1 -1
  3. package/dist/Calendar.main.js +5 -7
  4. package/dist/Calendar.main.js.map +1 -1
  5. package/dist/Calendar.mjs +6 -8
  6. package/dist/Calendar.module.js +6 -8
  7. package/dist/Calendar.module.js.map +1 -1
  8. package/dist/Collection.main.js +1 -1
  9. package/dist/Collection.main.js.map +1 -1
  10. package/dist/Collection.mjs +1 -1
  11. package/dist/Collection.module.js +1 -1
  12. package/dist/Collection.module.js.map +1 -1
  13. package/dist/ColorPicker.main.js.map +1 -1
  14. package/dist/ColorPicker.module.js.map +1 -1
  15. package/dist/ColorWheel.main.js +3 -1
  16. package/dist/ColorWheel.main.js.map +1 -1
  17. package/dist/ColorWheel.mjs +3 -1
  18. package/dist/ColorWheel.module.js +3 -1
  19. package/dist/ColorWheel.module.js.map +1 -1
  20. package/dist/DateField.main.js +16 -9
  21. package/dist/DateField.main.js.map +1 -1
  22. package/dist/DateField.mjs +16 -9
  23. package/dist/DateField.module.js +16 -9
  24. package/dist/DateField.module.js.map +1 -1
  25. package/dist/Dialog.main.js +1 -1
  26. package/dist/Dialog.main.js.map +1 -1
  27. package/dist/Dialog.mjs +1 -1
  28. package/dist/Dialog.module.js +1 -1
  29. package/dist/Dialog.module.js.map +1 -1
  30. package/dist/DragAndDrop.main.js.map +1 -1
  31. package/dist/DragAndDrop.module.js.map +1 -1
  32. package/dist/GridList.main.js +2 -1
  33. package/dist/GridList.main.js.map +1 -1
  34. package/dist/GridList.mjs +2 -1
  35. package/dist/GridList.module.js +2 -1
  36. package/dist/GridList.module.js.map +1 -1
  37. package/dist/ListBox.main.js +2 -1
  38. package/dist/ListBox.main.js.map +1 -1
  39. package/dist/ListBox.mjs +2 -1
  40. package/dist/ListBox.module.js +2 -1
  41. package/dist/ListBox.module.js.map +1 -1
  42. package/dist/Menu.main.js.map +1 -1
  43. package/dist/Menu.module.js.map +1 -1
  44. package/dist/Modal.main.js.map +1 -1
  45. package/dist/Modal.module.js.map +1 -1
  46. package/dist/OverlayArrow.main.js +4 -1
  47. package/dist/OverlayArrow.main.js.map +1 -1
  48. package/dist/OverlayArrow.mjs +4 -1
  49. package/dist/OverlayArrow.module.js +4 -1
  50. package/dist/OverlayArrow.module.js.map +1 -1
  51. package/dist/Popover.main.js +1 -1
  52. package/dist/Popover.main.js.map +1 -1
  53. package/dist/Popover.mjs +1 -1
  54. package/dist/Popover.module.js +1 -1
  55. package/dist/Popover.module.js.map +1 -1
  56. package/dist/Separator.main.js +3 -2
  57. package/dist/Separator.main.js.map +1 -1
  58. package/dist/Separator.mjs +3 -2
  59. package/dist/Separator.module.js +3 -2
  60. package/dist/Separator.module.js.map +1 -1
  61. package/dist/Table.main.js +3 -2
  62. package/dist/Table.main.js.map +1 -1
  63. package/dist/Table.mjs +3 -2
  64. package/dist/Table.module.js +3 -2
  65. package/dist/Table.module.js.map +1 -1
  66. package/dist/TableLayout.main.js.map +1 -1
  67. package/dist/TableLayout.module.js.map +1 -1
  68. package/dist/TagGroup.main.js +1 -1
  69. package/dist/TagGroup.main.js.map +1 -1
  70. package/dist/TagGroup.mjs +1 -1
  71. package/dist/TagGroup.module.js +1 -1
  72. package/dist/TagGroup.module.js.map +1 -1
  73. package/dist/TextArea.main.js.map +1 -1
  74. package/dist/TextArea.module.js.map +1 -1
  75. package/dist/Toast.main.js +45 -16
  76. package/dist/Toast.main.js.map +1 -1
  77. package/dist/Toast.mjs +45 -18
  78. package/dist/Toast.module.js +45 -18
  79. package/dist/Toast.module.js.map +1 -1
  80. package/dist/Tooltip.main.js.map +1 -1
  81. package/dist/Tooltip.module.js.map +1 -1
  82. package/dist/Tree.main.js +2 -2
  83. package/dist/Tree.main.js.map +1 -1
  84. package/dist/Tree.mjs +2 -2
  85. package/dist/Tree.module.js +2 -2
  86. package/dist/Tree.module.js.map +1 -1
  87. package/dist/Virtualizer.main.js.map +1 -1
  88. package/dist/Virtualizer.module.js.map +1 -1
  89. package/dist/import.mjs +2 -2
  90. package/dist/main.js +2 -0
  91. package/dist/main.js.map +1 -1
  92. package/dist/module.js +2 -2
  93. package/dist/module.js.map +1 -1
  94. package/dist/types.d.ts +67 -39
  95. package/dist/types.d.ts.map +1 -1
  96. package/dist/utils.main.js.map +1 -1
  97. package/dist/utils.module.js.map +1 -1
  98. package/i18n/es-ES.js +1 -1
  99. package/i18n/es-ES.mjs +1 -1
  100. package/i18n/index.js +1 -1
  101. package/i18n/index.mjs +1 -1
  102. package/package.json +27 -25
  103. package/src/Autocomplete.tsx +2 -2
  104. package/src/Calendar.tsx +23 -11
  105. package/src/Collection.tsx +5 -2
  106. package/src/ColorPicker.tsx +2 -2
  107. package/src/ColorWheel.tsx +3 -1
  108. package/src/DateField.tsx +13 -9
  109. package/src/Dialog.tsx +2 -2
  110. package/src/DragAndDrop.tsx +4 -2
  111. package/src/GridList.tsx +4 -1
  112. package/src/ListBox.tsx +4 -1
  113. package/src/Menu.tsx +1 -1
  114. package/src/Modal.tsx +1 -0
  115. package/src/OverlayArrow.tsx +6 -3
  116. package/src/Popover.tsx +2 -1
  117. package/src/Separator.tsx +3 -2
  118. package/src/Table.tsx +8 -3
  119. package/src/TableLayout.ts +1 -1
  120. package/src/TagGroup.tsx +1 -1
  121. package/src/TextArea.tsx +1 -1
  122. package/src/Toast.tsx +51 -13
  123. package/src/Tooltip.tsx +2 -1
  124. package/src/Tree.tsx +2 -2
  125. package/src/Virtualizer.tsx +3 -3
  126. package/src/index.ts +3 -3
  127. package/src/utils.tsx +8 -1
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAmD;AAC3F,MAAM,0DAA2B,CAAA,GAAA,0BAAY,EAA4B;AAGzE,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,SAAS,0CAAa,KAAwB;IACnD,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,yBAAE,qBAAqB,EAAC,GAAG;IACtC,IAAI,QAAQ,CAAA,GAAA,oDAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IACxC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,EAClC,QAAQ,QAAQ,EACjB,GAAG,CAAA,GAAA,4CAAc,EAAE;QAClB,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;+BACA;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,4CAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,0CAAe;gBAAG;aAAe;YAClC;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,KAAK;gBAAQ;aAAE;YAC/B;gBAAC;gBAAsC;oBACrC,QAAQ;qCACR;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {InputContext} from './Input';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filter?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.\n */\nexport function Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter, disableAutoFocusFirst} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filter: filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n disableAutoFocusFirst,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [InputContext, {ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filter: filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAmD;AAC3F,MAAM,0DAA2B,CAAA,GAAA,0BAAY,EAA4B;AAGzE,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,SAAS,0CAAa,KAAwB;IACnD,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,yBAAE,qBAAqB,EAAC,GAAG;IACtC,IAAI,QAAQ,CAAA,GAAA,oDAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IACxC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,EAClC,QAAQ,QAAQ,EACjB,GAAG,CAAA,GAAA,4CAAc,EAAE;QAClB,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;+BACA;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,4CAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,0CAAe;gBAAG;aAAe;YAClC;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,KAAK;gBAAQ;aAAE;YAC/B;gBAAC;gBAAsC;oBACrC,QAAQ;qCACR;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {InputContext} from './Input';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, ReactNode, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filter?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.\n */\nexport function Autocomplete(props: AutocompleteProps): ReactNode {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter, disableAutoFocusFirst} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filter: filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n disableAutoFocusFirst,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [InputContext, {ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filter: filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAmD;AAC3F,MAAM,0DAA2B,CAAA,GAAA,oBAAY,EAA4B;AAGzE,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,SAAS,0CAAa,KAAwB;IACnD,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,yBAAE,qBAAqB,EAAC,GAAG;IACtC,IAAI,QAAQ,CAAA,GAAA,2BAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IACxC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,EAClC,QAAQ,QAAQ,EACjB,GAAG,CAAA,GAAA,sBAAc,EAAE;QAClB,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;+BACA;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,yCAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,yCAAe;gBAAG;aAAe;YAClC;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,KAAK;gBAAQ;aAAE;YAC/B;gBAAC;gBAAsC;oBACrC,QAAQ;qCACR;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {InputContext} from './Input';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filter?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.\n */\nexport function Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter, disableAutoFocusFirst} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filter: filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n disableAutoFocusFirst,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [InputContext, {ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filter: filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAmD;AAC3F,MAAM,0DAA2B,CAAA,GAAA,oBAAY,EAA4B;AAGzE,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,SAAS,0CAAa,KAAwB;IACnD,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,yBAAE,qBAAqB,EAAC,GAAG;IACtC,IAAI,QAAQ,CAAA,GAAA,2BAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IACxC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,EAClC,QAAQ,QAAQ,EACjB,GAAG,CAAA,GAAA,sBAAc,EAAE;QAClB,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;+BACA;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,yCAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,yCAAe;gBAAG;aAAe;YAClC;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,KAAK;gBAAQ;aAAE;YAC/B;gBAAC;gBAAsC;oBACrC,QAAQ;qCACR;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {InputContext} from './Input';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, ReactNode, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filter?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.\n */\nexport function Autocomplete(props: AutocompleteProps): ReactNode {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter, disableAutoFocusFirst} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filter: filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n disableAutoFocusFirst,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [InputContext, {ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filter: filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
@@ -57,7 +57,7 @@ const $3f539f26b167ddde$export$e1aef45b828286de = /*#__PURE__*/ (0, $iJp6C$react
57
57
  let state = (0, $iJp6C$reactstately.useCalendarState)({
58
58
  ...props,
59
59
  locale: locale,
60
- createCalendar: $iJp6C$internationalizeddate.createCalendar
60
+ createCalendar: props.createCalendar || (0, $iJp6C$internationalizeddate.createCalendar)
61
61
  });
62
62
  let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps, title: title } = (0, $iJp6C$reactaria.useCalendar)(props, state);
63
63
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
@@ -125,7 +125,7 @@ const $3f539f26b167ddde$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $iJp6C$react
125
125
  let state = (0, $iJp6C$reactstately.useRangeCalendarState)({
126
126
  ...props,
127
127
  locale: locale,
128
- createCalendar: $iJp6C$internationalizeddate.createCalendar
128
+ createCalendar: props.createCalendar || (0, $iJp6C$internationalizeddate.createCalendar)
129
129
  });
130
130
  let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps, title: title } = (0, $iJp6C$reactaria.useRangeCalendar)(props, state, ref);
131
131
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
@@ -198,7 +198,7 @@ const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react
198
198
  if (props.offset) startDate = startDate.add(props.offset);
199
199
  var _calenderProps_firstDayOfWeek;
200
200
  let firstDayOfWeek = (_calenderProps_firstDayOfWeek = calenderProps === null || calenderProps === void 0 ? void 0 : calenderProps.firstDayOfWeek) !== null && _calenderProps_firstDayOfWeek !== void 0 ? _calenderProps_firstDayOfWeek : rangeCalenderProps === null || rangeCalenderProps === void 0 ? void 0 : rangeCalenderProps.firstDayOfWeek;
201
- let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $iJp6C$reactaria.useCalendarGrid)({
201
+ let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays, weeksInMonth: weeksInMonth } = (0, $iJp6C$reactaria.useCalendarGrid)({
202
202
  startDate: startDate,
203
203
  endDate: (0, $iJp6C$internationalizeddate.endOfMonth)(startDate),
204
204
  weekdayStyle: props.weekdayStyle,
@@ -210,7 +210,7 @@ const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react
210
210
  headerProps: headerProps,
211
211
  weekDays: weekDays,
212
212
  startDate: startDate,
213
- firstDayOfWeek: firstDayOfWeek
213
+ weeksInMonth: weeksInMonth
214
214
  }
215
215
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("table", {
216
216
  ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
@@ -253,9 +253,7 @@ function $3f539f26b167ddde$var$CalendarGridBody(props, ref) {
253
253
  let calendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$9e31dcedda1dadc7);
254
254
  let rangeCalendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$5e0fc348c00f87a0);
255
255
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
256
- let { startDate: startDate, firstDayOfWeek: firstDayOfWeek } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
257
- let { locale: locale } = (0, $iJp6C$reactaria.useLocale)();
258
- let weeksInMonth = (0, $iJp6C$internationalizeddate.getWeeksInMonth)(startDate, locale, firstDayOfWeek);
256
+ let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
259
257
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("tbody", {
260
258
  ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
261
259
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,0BAAQ;IACvB,IAAI,QAAQ,CAAA,GAA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AAc;IAChD,IAAI,mBAAmB;IACvB,IAAI,iBAAiB;IACrB,IAAI,sBAAsB,SAAS,MAAM,gBAAgB,EAAE;QACzD,mBAAmB,CAAA,GAAA,sCAAQ,EAAE,MAAM,MAAM,gBAAgB,CAAC,KAAK;QAC/D,iBAAiB,CAAA,GAAA,sCAAQ,EAAE,MAAM,MAAM,gBAAgB,CAAC,GAAG;IAC7D;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,iBAAiB,OAAO,aAAa;QACrC,kBAAkB;QAClB,QAAQ;kBACN;uBACA;4BACA;4BACA;8BACA;4BACA;YACA,GAAG,MAAM;QACX;IACF;IAEA,IAAI,YAAY;QACd,gBAAgB,OAAO,SAAS,IAAI;QACpC,gBAAgB,aAAa;QAC7B,gBAAgB,OAAO,SAAS,IAAI;QACpC,oBAAoB,OAAO,aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;IACtC;IAEA,qBACE,0DAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,0DAAC;QAAK,GAAG,CAAA,GAAA,2BAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,aAAoB,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGhI","sources":["packages/react-aria-components/src/Calendar.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 {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, createCalendar, DateDuration, endOfMonth, getWeeksInMonth, isSameDay, isSameMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n firstDayOfWeek: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | undefined\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, firstDayOfWeek}}>\n <table\n {...filterDOMProps(props as any)}\n {...gridProps}\n ref={ref}\n style={props.style}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n\n return (\n <thead\n {...filterDOMProps(props as any)}\n {...headerProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n return (\n <th\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, firstDayOfWeek} = useContext(InternalCalendarGridContext)!;\n let {locale} = useLocale();\n let weeksInMonth = getWeeksInMonth(startDate, locale, firstDayOfWeek);\n\n return (\n <tbody\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined\n };\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(filterDOMProps(otherProps as any), buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA8B,K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;IAAA;IACpF,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IAC9C,mBAAA,iBAAmB,OAAO,SAAS;IACnC,IAAI,iBAAiB,CAAC,CAAA,GAAA,wCAAU,EAAE,cAAc;IAChD,IAAI,mBAAmB;IACvB,IAAI,iBAAiB;IACrB,IAAI,sBAAsB,SAAS,MAAM,gBAAgB,EAAE;QACzD,mBAAmB,CAAA,GAAA,sCAAQ,EAAE,MAAM,MAAM,gBAAgB,CAAC,KAAK;QAC/D,iBAAiB,CAAA,GAAA,sCAAQ,EAAE,MAAM,MAAM,gBAAgB,CAAC,GAAG;IAC7D;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,iBAAiB,OAAO,aAAa;QACrC,kBAAkB;QAClB,QAAQ;kBACN;uBACA;4BACA;4BACA;8BACA;4BACA;YACA,GAAG,MAAM;QACX;IACF;IAEA,IAAI,YAAY;QACd,gBAAgB,OAAO,SAAS,IAAI;QACpC,gBAAgB,aAAa;QAC7B,gBAAgB,OAAO,SAAS,IAAI;QACpC,oBAAoB,OAAO,aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;IACtC;IAEA,qBACE,0DAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,0DAAC;QAAK,GAAG,CAAA,GAAA,2BAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,aAAoB,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGhI","sources":["packages/react-aria-components/src/Calendar.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 {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...filterDOMProps(props as any)}\n {...gridProps}\n ref={ref}\n style={props.style}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n\n return (\n <thead\n {...filterDOMProps(props as any)}\n {...headerProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n return (\n <th\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n\n return (\n <tbody\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined\n };\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(filterDOMProps(otherProps as any), buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
package/dist/Calendar.mjs CHANGED
@@ -3,7 +3,7 @@ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps a
3
3
  import {HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.mjs";
4
4
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
5
5
  import {useLocale as $dCiKx$useLocale, useCalendar as $dCiKx$useCalendar, VisuallyHidden as $dCiKx$VisuallyHidden, useRangeCalendar as $dCiKx$useRangeCalendar, useCalendarGrid as $dCiKx$useCalendarGrid, useCalendarCell as $dCiKx$useCalendarCell, useHover as $dCiKx$useHover, useFocusRing as $dCiKx$useFocusRing, mergeProps as $dCiKx$mergeProps} from "react-aria";
6
- import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, getWeeksInMonth as $dCiKx$getWeeksInMonth, isSameMonth as $dCiKx$isSameMonth, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
6
+ import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, isSameMonth as $dCiKx$isSameMonth, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
7
7
  import {useCalendarState as $dCiKx$useCalendarState, useRangeCalendarState as $dCiKx$useRangeCalendarState} from "react-stately";
8
8
  import {filterDOMProps as $dCiKx$filterDOMProps} from "@react-aria/utils";
9
9
  import $dCiKx$react, {createContext as $dCiKx$createContext, forwardRef as $dCiKx$forwardRef, useContext as $dCiKx$useContext, useRef as $dCiKx$useRef} from "react";
@@ -37,7 +37,7 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwa
37
37
  let state = (0, $dCiKx$useCalendarState)({
38
38
  ...props,
39
39
  locale: locale,
40
- createCalendar: $dCiKx$createCalendar
40
+ createCalendar: props.createCalendar || (0, $dCiKx$createCalendar)
41
41
  });
42
42
  let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps, title: title } = (0, $dCiKx$useCalendar)(props, state);
43
43
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
@@ -105,7 +105,7 @@ const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $dCiKx$forwa
105
105
  let state = (0, $dCiKx$useRangeCalendarState)({
106
106
  ...props,
107
107
  locale: locale,
108
- createCalendar: $dCiKx$createCalendar
108
+ createCalendar: props.createCalendar || (0, $dCiKx$createCalendar)
109
109
  });
110
110
  let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps, title: title } = (0, $dCiKx$useRangeCalendar)(props, state, ref);
111
111
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
@@ -178,7 +178,7 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
178
178
  if (props.offset) startDate = startDate.add(props.offset);
179
179
  var _calenderProps_firstDayOfWeek;
180
180
  let firstDayOfWeek = (_calenderProps_firstDayOfWeek = calenderProps === null || calenderProps === void 0 ? void 0 : calenderProps.firstDayOfWeek) !== null && _calenderProps_firstDayOfWeek !== void 0 ? _calenderProps_firstDayOfWeek : rangeCalenderProps === null || rangeCalenderProps === void 0 ? void 0 : rangeCalenderProps.firstDayOfWeek;
181
- let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $dCiKx$useCalendarGrid)({
181
+ let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays, weeksInMonth: weeksInMonth } = (0, $dCiKx$useCalendarGrid)({
182
182
  startDate: startDate,
183
183
  endDate: (0, $dCiKx$endOfMonth)(startDate),
184
184
  weekdayStyle: props.weekdayStyle,
@@ -190,7 +190,7 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
190
190
  headerProps: headerProps,
191
191
  weekDays: weekDays,
192
192
  startDate: startDate,
193
- firstDayOfWeek: firstDayOfWeek
193
+ weeksInMonth: weeksInMonth
194
194
  }
195
195
  }, /*#__PURE__*/ (0, $dCiKx$react).createElement("table", {
196
196
  ...(0, $dCiKx$filterDOMProps)(props),
@@ -233,9 +233,7 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
233
233
  let calendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$9e31dcedda1dadc7);
234
234
  let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
235
235
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
236
- let { startDate: startDate, firstDayOfWeek: firstDayOfWeek } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
237
- let { locale: locale } = (0, $dCiKx$useLocale)();
238
- let weeksInMonth = (0, $dCiKx$getWeeksInMonth)(startDate, locale, firstDayOfWeek);
236
+ let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
239
237
  return /*#__PURE__*/ (0, $dCiKx$react).createElement("tbody", {
240
238
  ...(0, $dCiKx$filterDOMProps)(props),
241
239
  ref: ref,
@@ -3,7 +3,7 @@ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps a
3
3
  import {HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.module.js";
4
4
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
5
5
  import {useLocale as $dCiKx$useLocale, useCalendar as $dCiKx$useCalendar, VisuallyHidden as $dCiKx$VisuallyHidden, useRangeCalendar as $dCiKx$useRangeCalendar, useCalendarGrid as $dCiKx$useCalendarGrid, useCalendarCell as $dCiKx$useCalendarCell, useHover as $dCiKx$useHover, useFocusRing as $dCiKx$useFocusRing, mergeProps as $dCiKx$mergeProps} from "react-aria";
6
- import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, getWeeksInMonth as $dCiKx$getWeeksInMonth, isSameMonth as $dCiKx$isSameMonth, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
6
+ import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, isSameMonth as $dCiKx$isSameMonth, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
7
7
  import {useCalendarState as $dCiKx$useCalendarState, useRangeCalendarState as $dCiKx$useRangeCalendarState} from "react-stately";
8
8
  import {filterDOMProps as $dCiKx$filterDOMProps} from "@react-aria/utils";
9
9
  import $dCiKx$react, {createContext as $dCiKx$createContext, forwardRef as $dCiKx$forwardRef, useContext as $dCiKx$useContext, useRef as $dCiKx$useRef} from "react";
@@ -37,7 +37,7 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwa
37
37
  let state = (0, $dCiKx$useCalendarState)({
38
38
  ...props,
39
39
  locale: locale,
40
- createCalendar: $dCiKx$createCalendar
40
+ createCalendar: props.createCalendar || (0, $dCiKx$createCalendar)
41
41
  });
42
42
  let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps, title: title } = (0, $dCiKx$useCalendar)(props, state);
43
43
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
@@ -105,7 +105,7 @@ const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $dCiKx$forwa
105
105
  let state = (0, $dCiKx$useRangeCalendarState)({
106
106
  ...props,
107
107
  locale: locale,
108
- createCalendar: $dCiKx$createCalendar
108
+ createCalendar: props.createCalendar || (0, $dCiKx$createCalendar)
109
109
  });
110
110
  let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps, title: title } = (0, $dCiKx$useRangeCalendar)(props, state, ref);
111
111
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
@@ -178,7 +178,7 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
178
178
  if (props.offset) startDate = startDate.add(props.offset);
179
179
  var _calenderProps_firstDayOfWeek;
180
180
  let firstDayOfWeek = (_calenderProps_firstDayOfWeek = calenderProps === null || calenderProps === void 0 ? void 0 : calenderProps.firstDayOfWeek) !== null && _calenderProps_firstDayOfWeek !== void 0 ? _calenderProps_firstDayOfWeek : rangeCalenderProps === null || rangeCalenderProps === void 0 ? void 0 : rangeCalenderProps.firstDayOfWeek;
181
- let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $dCiKx$useCalendarGrid)({
181
+ let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays, weeksInMonth: weeksInMonth } = (0, $dCiKx$useCalendarGrid)({
182
182
  startDate: startDate,
183
183
  endDate: (0, $dCiKx$endOfMonth)(startDate),
184
184
  weekdayStyle: props.weekdayStyle,
@@ -190,7 +190,7 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
190
190
  headerProps: headerProps,
191
191
  weekDays: weekDays,
192
192
  startDate: startDate,
193
- firstDayOfWeek: firstDayOfWeek
193
+ weeksInMonth: weeksInMonth
194
194
  }
195
195
  }, /*#__PURE__*/ (0, $dCiKx$react).createElement("table", {
196
196
  ...(0, $dCiKx$filterDOMProps)(props),
@@ -233,9 +233,7 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
233
233
  let calendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$9e31dcedda1dadc7);
234
234
  let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
235
235
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
236
- let { startDate: startDate, firstDayOfWeek: firstDayOfWeek } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
237
- let { locale: locale } = (0, $dCiKx$useLocale)();
238
- let weeksInMonth = (0, $dCiKx$getWeeksInMonth)(startDate, locale, firstDayOfWeek);
236
+ let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
239
237
  return /*#__PURE__*/ (0, $dCiKx$react).createElement("tbody", {
240
238
  ...(0, $dCiKx$filterDOMProps)(props),
241
239
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiEM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE,OAAO;IAErG,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;mBACN;YACA,YAAY,MAAM,UAAU,IAAI;YAChC,WAAW,MAAM,cAAc;QACjC;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,WAAW;QACd,GAAG,aAAa;QACjB,KAAK;QACL,MAAM,MAAM,I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IACF;IAEA,IAAI,YAAY;QACd,gBAAgB,OAAO,SAAS,IAAI;QACpC,gBAAgB,aAAa;QAC7B,gBAAgB,OAAO,SAAS,IAAI;QACpC,oBAAoB,OAAO,aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;IACtC;IAEA,qBACE,gCAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,gCAAC;QAAK,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,aAAoB,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGhI","sources":["packages/react-aria-components/src/Calendar.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 {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, createCalendar, DateDuration, endOfMonth, getWeeksInMonth, isSameDay, isSameMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n firstDayOfWeek: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | undefined\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, firstDayOfWeek}}>\n <table\n {...filterDOMProps(props as any)}\n {...gridProps}\n ref={ref}\n style={props.style}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n\n return (\n <thead\n {...filterDOMProps(props as any)}\n {...headerProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n return (\n <th\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, firstDayOfWeek} = useContext(InternalCalendarGridContext)!;\n let {locale} = useLocale();\n let weeksInMonth = getWeeksInMonth(startDate, locale, firstDayOfWeek);\n\n return (\n <tbody\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined\n };\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(filterDOMProps(otherProps as any), buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,qBAAa;IACvD;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE,OAAO;IAErG,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,G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AAE;QAC/B,GAAG,UAAU;QACb,iBAAiB,OAAO,aAAa;QACrC,kBAAkB;QAClB,QAAQ;kBACN;uBACA;4BACA;4BACA;8BACA;4BACA;YACA,GAAG,MAAM;QACX;IACF;IAEA,IAAI,YAAY;QACd,gBAAgB,OAAO,SAAS,IAAI;QACpC,gBAAgB,aAAa;QAC7B,gBAAgB,OAAO,SAAS,IAAI;QACpC,oBAAoB,OAAO,aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;IACtC;IAEA,qBACE,gCAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,gCAAC;QAAK,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,aAAoB,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGhI","sources":["packages/react-aria-components/src/Calendar.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 {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...filterDOMProps(props as any)}\n {...gridProps}\n ref={ref}\n style={props.style}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n\n return (\n <thead\n {...filterDOMProps(props as any)}\n {...headerProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n return (\n <th\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n\n return (\n <tbody\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined\n };\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(filterDOMProps(otherProps as any), buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
@@ -30,7 +30,7 @@ $parcel$export(module.exports, "usePersistedKeys", () => $3114c2382242bdc0$expor
30
30
  const $3114c2382242bdc0$export$d40e14dec8b060a8 = /*#__PURE__*/ (0, $leb1U$react.createContext)(null);
31
31
  const $3114c2382242bdc0$export$6e2c8f0811a474ce = /*#__PURE__*/ (0, $leb1U$reactariacollections.createBranchComponent)('section', (props, ref, section)=>{
32
32
  let { name: name, render: render } = (0, $leb1U$react.useContext)($3114c2382242bdc0$export$d40e14dec8b060a8);
33
- console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
33
+ if (process.env.NODE_ENV !== 'production') console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
34
34
  return render(props, ref, section, 'react-aria-Section');
35
35
  });
36
36
  const $3114c2382242bdc0$export$a164736487e3f0ae = {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAyFM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8B;AAGjE,MAAM,4CAAU,WAAW,GAAG,CAAA,GAAA,iDAAoB,EAAE,WAAW,CAAmB,OAAwB,KAAgC;IAC/I,IAAI,QAAC,IAAI,UAAE,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAChC,QAAQ,IAAI,CAAC,CAAC,qCAAqC,EAAE,KAAK,UAAU,CAAC;IACrE,OAAO,OAAO,OAAO,KAAK,SAAS;AACrC;AAmCO,MAAM,4CAAgD;IAC3D,gBAAe,cAAC,UAAU,uBAAE,mBAAmB,EAAC;QAC9C,OAAO,0CAAoB,YAAY,MAAM;IAC/C;IACA,kBAAiB,cAAC,UAAU,UAAE,MAAM,uBAAE,mBAAmB,EAAC;QACxD,OAAO,0CAAoB,YAAY,QAAQ;IACjD;AACF;AAEA,SAAS,0CACP,UAAsC,EACtC,MAA4B,EAC5B,mBAA2D;IAE3D,OAAO,CAAA,GAAA,6CAAgB,EAAE;QACvB,OAAO,SAAS,WAAW,WAAW,CAAE,OAAO,GAAG,IAAI;QACtD,cAAc;YAAC;SAAoB;QACnC,UAAS,IAAI;gBAYgB;YAX3B,IAAI,WAAW,KAAK,MAAM,CAAE;YAC5B,IAAI,CAAC,uBAAuB,KAAK,IAAI,KAAK,QACxC,OAAO;YAGT,IAAI,MAAM,KAAK,GAAG;YAClB,IAAI,WAAW,WAAW,WAAW,CAAC;YACtC,qBACE,sHACG,oBAAoB;gBAAC,MAAM;qBAAQ;gBAAK,cAAc;YAAQ,IAC9D,UACA,AAAE,CAAA,YAAY,QAAQ,EAAA,sBAAA,WAAW,OAAO,CAAC,uBAAnB,0CAAA,oBAA8B,IAAI,MAAK,MAAK,KAAO,oBAAoB;gBAAC,MAAM;qBAAQ;gBAAK,cAAc;YAAO;QAG7I;IACF;AACF;AAEO,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAAsB;AAEpE,SAAS,0CAAiB,UAAsB;IACrD,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,cAAc,OAAO,IAAI,IAAI;YAAC;SAAW,IAAI,MAAM;QAAC;KAAW;AACtF","sources":["packages/react-aria-components/src/Collection.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 {CollectionBase, DropTargetDelegate, ItemDropTarget, Key, LayoutDelegate, RefObject} from '@react-types/shared';\nimport {createBranchComponent, useCachedChildren} from '@react-aria/collections';\nimport {Collection as ICollection, Node, SelectionBehavior, SelectionMode, SectionProps as SharedSectionProps} from 'react-stately';\nimport React, {createContext, ForwardedRef, HTMLAttributes, JSX, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {StyleProps} from './utils';\n\nexport interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\nexport interface ItemRenderProps {\n /**\n * Whether the item is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the item is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the item is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the item is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the item is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may\n * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * The type of selection that is allowed in the collection.\n * @selector [data-selection-mode=\"single | multiple\"]\n */\n selectionMode: SelectionMode,\n /** The selection behavior for the collection. */\n selectionBehavior: SelectionBehavior,\n /**\n * Whether the item allows dragging.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-allows-dragging]\n */\n allowsDragging?: boolean,\n /**\n * Whether the item is currently being dragged.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-dragging]\n */\n isDragging?: boolean,\n /**\n * Whether the item is currently an active drop target.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-drop-target]\n */\n isDropTarget?: boolean\n}\n\nexport interface SectionProps<T> extends Omit<SharedSectionProps<T>, 'children' | 'title'>, StyleProps {\n /** The unique id of the section. */\n id?: Key,\n /** The object value that this section represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** Static child items or a function to render children. */\n children?: ReactNode | ((item: T) => ReactElement),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\ninterface SectionContextValue {\n name: string,\n render: (props: SectionProps<any>, ref: ForwardedRef<HTMLElement>, section: Node<any>, className?: string) => ReactElement\n}\n\nexport const SectionContext = createContext<SectionContextValue | null>(null);\n\n/** @deprecated */\nexport const Section = /*#__PURE__*/ createBranchComponent('section', <T extends object>(props: SectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>): JSX.Element => {\n let {name, render} = useContext(SectionContext)!;\n console.warn(`<Section> is deprecated. Please use <${name}> instead.`);\n return render(props, ref, section, 'react-aria-Section');\n});\n\nexport interface CollectionBranchProps {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** The parent node of the items to render. */\n parent: Node<unknown>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRootProps extends HTMLAttributes<HTMLElement> {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** A set of keys for items that should always be persisted in the DOM. */\n persistedKeys?: Set<Key> | null,\n /** A ref to the scroll container for the collection. */\n scrollRef?: RefObject<HTMLElement | null>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRenderer {\n /** Whether this is a virtualized collection. */\n isVirtualized?: boolean,\n /** A delegate object that provides layout information for items in the collection. */\n layoutDelegate?: LayoutDelegate,\n /** A delegate object that provides drop targets for pointer coordinates within the collection. */\n dropTargetDelegate?: DropTargetDelegate,\n /** A component that renders the root collection items. */\n CollectionRoot: React.ComponentType<CollectionRootProps>,\n /** A component that renders the child collection items. */\n CollectionBranch: React.ComponentType<CollectionBranchProps>\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection, renderDropIndicator}) {\n return useCollectionRender(collection, null, renderDropIndicator);\n },\n CollectionBranch({collection, parent, renderDropIndicator}) {\n return useCollectionRender(collection, parent, renderDropIndicator);\n }\n};\n\nfunction useCollectionRender(\n collection: ICollection<Node<unknown>>,\n parent: Node<unknown> | null,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n) {\n return useCachedChildren({\n items: parent ? collection.getChildren!(parent.key) : collection,\n dependencies: [renderDropIndicator],\n children(node) {\n let rendered = node.render!(node);\n if (!renderDropIndicator || node.type !== 'item') {\n return rendered;\n }\n\n let key = node.key;\n let keyAfter = collection.getKeyAfter(key);\n return (\n <>\n {renderDropIndicator({type: 'item', key, dropPosition: 'before'})}\n {rendered}\n {((keyAfter == null || collection.getItem(keyAfter)?.type !== 'item')) && renderDropIndicator({type: 'item', key, dropPosition: 'after'})}\n </>\n );\n }\n });\n}\n\nexport const CollectionRendererContext = createContext<CollectionRenderer>(DefaultCollectionRenderer);\n\nexport function usePersistedKeys(focusedKey: Key | null) {\n return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);\n}\n"],"names":[],"version":3,"file":"Collection.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAyFM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8B;AAGjE,MAAM,4CAAU,WAAW,GAAG,CAAA,GAAA,iDAAoB,EAAE,WAAW,CAAmB,OAAwB,KAAgC;IAC/I,IAAI,QAAC,IAAI,UAAE,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAChC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC3B,QAAQ,IAAI,CAAC,CAAC,qCAAqC,EAAE,KAAK,UAAU,CAAC;IAEvE,OAAO,OAAO,OAAO,KAAK,SAAS;AACrC;AAmCO,MAAM,4CAAgD;IAC3D,gBAAe,cAAC,UAAU,uBAAE,mBAAmB,EAAC;QAC9C,OAAO,0CAAoB,YAAY,MAAM;IAC/C;IACA,kBAAiB,cAAC,UAAU,UAAE,MAAM,uBAAE,mBAAmB,EAAC;QACxD,OAAO,0CAAoB,YAAY,QAAQ;IACjD;AACF;AAEA,SAAS,0CACP,UAAsC,EACtC,MAA4B,EAC5B,mBAA2D;IAE3D,OAAO,CAAA,GAAA,6CAAgB,EAAE;QACvB,OAAO,SAAS,WAAW,WAAW,CAAE,OAAO,GAAG,IAAI;QACtD,cAAc;YAAC;SAAoB;QACnC,UAAS,IAAI;gBAYgB;YAX3B,IAAI,WAAW,KAAK,MAAM,CAAE;YAC5B,IAAI,CAAC,uBAAuB,KAAK,IAAI,KAAK,QACxC,OAAO;YAGT,IAAI,MAAM,KAAK,GAAG;YAClB,IAAI,WAAW,WAAW,WAAW,CAAC;YACtC,qBACE,sHACG,oBAAoB;gBAAC,MAAM;qBAAQ;gBAAK,cAAc;YAAQ,IAC9D,UACA,AAAE,CAAA,YAAY,QAAQ,EAAA,sBAAA,WAAW,OAAO,CAAC,uBAAnB,0CAAA,oBAA8B,IAAI,MAAK,MAAK,KAAO,oBAAoB;gBAAC,MAAM;qBAAQ;gBAAK,cAAc;YAAO;QAG7I;IACF;AACF;AAEO,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAAsB;AAGpE,SAAS,0CAAiB,UAAsB;IACrD,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,cAAc,OAAO,IAAI,IAAI;YAAC;SAAW,IAAI,MAAM;QAAC;KAAW;AACtF","sources":["packages/react-aria-components/src/Collection.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 {CollectionBase, DropTargetDelegate, ItemDropTarget, Key, LayoutDelegate, RefObject} from '@react-types/shared';\nimport {createBranchComponent, useCachedChildren} from '@react-aria/collections';\nimport {Collection as ICollection, Node, SelectionBehavior, SelectionMode, SectionProps as SharedSectionProps} from 'react-stately';\nimport React, {createContext, ForwardedRef, HTMLAttributes, JSX, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {StyleProps} from './utils';\n\nexport interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\nexport interface ItemRenderProps {\n /**\n * Whether the item is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the item is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the item is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the item is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the item is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may\n * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * The type of selection that is allowed in the collection.\n * @selector [data-selection-mode=\"single | multiple\"]\n */\n selectionMode: SelectionMode,\n /** The selection behavior for the collection. */\n selectionBehavior: SelectionBehavior,\n /**\n * Whether the item allows dragging.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-allows-dragging]\n */\n allowsDragging?: boolean,\n /**\n * Whether the item is currently being dragged.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-dragging]\n */\n isDragging?: boolean,\n /**\n * Whether the item is currently an active drop target.\n * @note This property is only available in collection components that support drag and drop.\n * @selector [data-drop-target]\n */\n isDropTarget?: boolean\n}\n\nexport interface SectionProps<T> extends Omit<SharedSectionProps<T>, 'children' | 'title'>, StyleProps {\n /** The unique id of the section. */\n id?: Key,\n /** The object value that this section represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** Static child items or a function to render children. */\n children?: ReactNode | ((item: T) => ReactElement),\n /** Values that should invalidate the item cache when using dynamic collections. */\n dependencies?: ReadonlyArray<any>\n}\n\ninterface SectionContextValue {\n name: string,\n render: (props: SectionProps<any>, ref: ForwardedRef<HTMLElement>, section: Node<any>, className?: string) => ReactElement\n}\n\nexport const SectionContext = createContext<SectionContextValue | null>(null);\n\n/** @deprecated */\nexport const Section = /*#__PURE__*/ createBranchComponent('section', <T extends object>(props: SectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>): JSX.Element => {\n let {name, render} = useContext(SectionContext)!;\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`<Section> is deprecated. Please use <${name}> instead.`);\n }\n return render(props, ref, section, 'react-aria-Section');\n});\n\nexport interface CollectionBranchProps {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** The parent node of the items to render. */\n parent: Node<unknown>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRootProps extends HTMLAttributes<HTMLElement> {\n /** The collection of items to render. */\n collection: ICollection<Node<unknown>>,\n /** A set of keys for items that should always be persisted in the DOM. */\n persistedKeys?: Set<Key> | null,\n /** A ref to the scroll container for the collection. */\n scrollRef?: RefObject<HTMLElement | null>,\n /** A function that renders a drop indicator between items. */\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n}\n\nexport interface CollectionRenderer {\n /** Whether this is a virtualized collection. */\n isVirtualized?: boolean,\n /** A delegate object that provides layout information for items in the collection. */\n layoutDelegate?: LayoutDelegate,\n /** A delegate object that provides drop targets for pointer coordinates within the collection. */\n dropTargetDelegate?: DropTargetDelegate,\n /** A component that renders the root collection items. */\n CollectionRoot: React.ComponentType<CollectionRootProps>,\n /** A component that renders the child collection items. */\n CollectionBranch: React.ComponentType<CollectionBranchProps>\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection, renderDropIndicator}) {\n return useCollectionRender(collection, null, renderDropIndicator);\n },\n CollectionBranch({collection, parent, renderDropIndicator}) {\n return useCollectionRender(collection, parent, renderDropIndicator);\n }\n};\n\nfunction useCollectionRender(\n collection: ICollection<Node<unknown>>,\n parent: Node<unknown> | null,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n) {\n return useCachedChildren({\n items: parent ? collection.getChildren!(parent.key) : collection,\n dependencies: [renderDropIndicator],\n children(node) {\n let rendered = node.render!(node);\n if (!renderDropIndicator || node.type !== 'item') {\n return rendered;\n }\n\n let key = node.key;\n let keyAfter = collection.getKeyAfter(key);\n return (\n <>\n {renderDropIndicator({type: 'item', key, dropPosition: 'before'})}\n {rendered}\n {((keyAfter == null || collection.getItem(keyAfter)?.type !== 'item')) && renderDropIndicator({type: 'item', key, dropPosition: 'after'})}\n </>\n );\n }\n });\n}\n\nexport const CollectionRendererContext = createContext<CollectionRenderer>(DefaultCollectionRenderer);\n\ntype PersistedKeysReturnValue = Set<Key> | null;\nexport function usePersistedKeys(focusedKey: Key | null): PersistedKeysReturnValue {\n return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);\n}\n"],"names":[],"version":3,"file":"Collection.main.js.map"}
@@ -16,7 +16,7 @@ import $18I52$react, {createContext as $18I52$createContext, useContext as $18I5
16
16
  const $7135fc7d473fd974$export$d40e14dec8b060a8 = /*#__PURE__*/ (0, $18I52$createContext)(null);
17
17
  const $7135fc7d473fd974$export$6e2c8f0811a474ce = /*#__PURE__*/ (0, $18I52$createBranchComponent)('section', (props, ref, section)=>{
18
18
  let { name: name, render: render } = (0, $18I52$useContext)($7135fc7d473fd974$export$d40e14dec8b060a8);
19
- console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
19
+ if (process.env.NODE_ENV !== 'production') console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
20
20
  return render(props, ref, section, 'react-aria-Section');
21
21
  });
22
22
  const $7135fc7d473fd974$export$a164736487e3f0ae = {
@@ -16,7 +16,7 @@ import $18I52$react, {createContext as $18I52$createContext, useContext as $18I5
16
16
  const $7135fc7d473fd974$export$d40e14dec8b060a8 = /*#__PURE__*/ (0, $18I52$createContext)(null);
17
17
  const $7135fc7d473fd974$export$6e2c8f0811a474ce = /*#__PURE__*/ (0, $18I52$createBranchComponent)('section', (props, ref, section)=>{
18
18
  let { name: name, render: render } = (0, $18I52$useContext)($7135fc7d473fd974$export$d40e14dec8b060a8);
19
- console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
19
+ if (process.env.NODE_ENV !== 'production') console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
20
20
  return render(props, ref, section, 'react-aria-Section');
21
21
  });
22
22
  const $7135fc7d473fd974$export$a164736487e3f0ae = {