react-aria-components 3.0.0-nightly-d87cc4422-250109 → 3.0.0-nightly-101d0772b-250111

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.
@@ -1,7 +1,8 @@
1
- var $c5ccf687772c0422$exports = require("./utils.main.js");
2
1
  var $1bcfcef5af644e13$exports = require("./Input.main.js");
2
+ var $c5ccf687772c0422$exports = require("./utils.main.js");
3
3
  var $5lGAV$reactariaautocomplete = require("@react-aria/autocomplete");
4
4
  var $5lGAV$reactstatelyautocomplete = require("@react-stately/autocomplete");
5
+ var $5lGAV$reactariautils = require("@react-aria/utils");
5
6
  var $5lGAV$react = require("react");
6
7
 
7
8
 
@@ -18,7 +19,7 @@ $parcel$export(module.exports, "UNSTABLE_AutocompleteStateContext", () => $33f48
18
19
  $parcel$export(module.exports, "UNSTABLE_InternalAutocompleteContext", () => $33f48720060787fa$export$65d2a03b8800d6e3);
19
20
  $parcel$export(module.exports, "UNSTABLE_Autocomplete", () => $33f48720060787fa$export$d834fde4e1147cd8);
20
21
  /*
21
- * Copyright 2022 Adobe. All rights reserved.
22
+ * Copyright 2024 Adobe. All rights reserved.
22
23
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
24
  * you may not use this file except in compliance with the License. You may obtain a copy
24
25
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -32,11 +33,13 @@ $parcel$export(module.exports, "UNSTABLE_Autocomplete", () => $33f48720060787fa$
32
33
 
33
34
 
34
35
 
36
+
35
37
  const $33f48720060787fa$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
36
38
  const $33f48720060787fa$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
37
39
  const $33f48720060787fa$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
38
- const $33f48720060787fa$export$d834fde4e1147cd8 = /*#__PURE__*/ (0, $5lGAV$react.forwardRef)(function Autocomplete(props, ref) {
39
- [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $33f48720060787fa$export$4581e569cc48eb6b);
40
+ function $33f48720060787fa$export$d834fde4e1147cd8(props) {
41
+ let ctx = (0, $c5ccf687772c0422$exports.useSlottedContext)($33f48720060787fa$export$4581e569cc48eb6b, props.slot);
42
+ props = (0, $5lGAV$reactariautils.mergeProps)(ctx, props);
40
43
  let { filter: filter } = props;
41
44
  let state = (0, $5lGAV$reactstatelyautocomplete.UNSTABLE_useAutocompleteState)(props);
42
45
  let collectionRef = (0, $5lGAV$react.useRef)(null);
@@ -70,7 +73,7 @@ const $33f48720060787fa$export$d834fde4e1147cd8 = /*#__PURE__*/ (0, $5lGAV$react
70
73
  ]
71
74
  ]
72
75
  }, props.children);
73
- });
76
+ }
74
77
 
75
78
 
76
79
  //# sourceMappingURL=Autocomplete.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAgBM,MAAM,0DAA+B,CAAA,GAAA,0BAAY,EAAqD;AACtG,MAAM,yDAAoC,CAAA,GAAA,0BAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,MAAM,0DAAwB,CAAA,GAAA,uBAAS,EAAE,SAAS,aAAa,KAAwB,EAAE,GAAmC;IACjI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,6DAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IACxC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IAExC,IAAI,cACF,UAAU,mBACV,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,qDAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;uBACA;kBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_useAutocompleteState} from '@react-stately/autocomplete';\nimport {ContextValue, Provider, removeDataAttributes, SlotProps, useContextProps} from './utils';\nimport {InputContext} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, RefObject, useRef} from 'react';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<ContextValue<AutocompleteProps, HTMLInputElement>>(null);\nexport const UNSTABLE_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 * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport const UNSTABLE_Autocomplete = forwardRef(function Autocomplete(props: AutocompleteProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, UNSTABLE_AutocompleteContext);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n inputProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef,\n inputRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n 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;;;;;;AAiBM,MAAM,0DAA+B,CAAA,GAAA,0BAAY,EAA0C;AAC3F,MAAM,yDAAoC,CAAA,GAAA,0BAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,SAAS,0CAAsB,KAAwB;IAC5D,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAA8B,MAAM,IAAI;IACpE,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,6DAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IACxC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IAExC,IAAI,cACF,UAAU,mBACV,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,qDAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;uBACA;kBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC;gBAAsC;8BACrC;qCACA;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, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_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';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<SlottedContextValue<AutocompleteProps>>(null);\nexport const UNSTABLE_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 * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function UNSTABLE_Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(UNSTABLE_AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n inputProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef,\n inputRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n 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,11 +1,12 @@
1
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.mjs";
2
1
  import {InputContext as $3985021b0ad6602f$export$37fb8590cf2c088c} from "./Input.mjs";
2
+ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
3
3
  import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
4
4
  import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
5
- import $llkzs$react, {createContext as $llkzs$createContext, forwardRef as $llkzs$forwardRef, useRef as $llkzs$useRef} from "react";
5
+ import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
6
+ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
6
7
 
7
8
  /*
8
- * Copyright 2022 Adobe. All rights reserved.
9
+ * Copyright 2024 Adobe. All rights reserved.
9
10
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
11
  * you may not use this file except in compliance with the License. You may obtain a copy
11
12
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -19,11 +20,13 @@ import $llkzs$react, {createContext as $llkzs$createContext, forwardRef as $llkz
19
20
 
20
21
 
21
22
 
23
+
22
24
  const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
23
25
  const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
24
26
  const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
25
- const $d2f53cda644affe3$export$d834fde4e1147cd8 = /*#__PURE__*/ (0, $llkzs$forwardRef)(function Autocomplete(props, ref) {
26
- [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2f53cda644affe3$export$4581e569cc48eb6b);
27
+ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
28
+ let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
29
+ props = (0, $llkzs$mergeProps)(ctx, props);
27
30
  let { filter: filter } = props;
28
31
  let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
29
32
  let collectionRef = (0, $llkzs$useRef)(null);
@@ -57,7 +60,7 @@ const $d2f53cda644affe3$export$d834fde4e1147cd8 = /*#__PURE__*/ (0, $llkzs$forwa
57
60
  ]
58
61
  ]
59
62
  }, props.children);
60
- });
63
+ }
61
64
 
62
65
 
63
66
  export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
@@ -1,11 +1,12 @@
1
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.module.js";
2
1
  import {InputContext as $3985021b0ad6602f$export$37fb8590cf2c088c} from "./Input.module.js";
2
+ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
3
3
  import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
4
4
  import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
5
- import $llkzs$react, {createContext as $llkzs$createContext, forwardRef as $llkzs$forwardRef, useRef as $llkzs$useRef} from "react";
5
+ import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
6
+ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
6
7
 
7
8
  /*
8
- * Copyright 2022 Adobe. All rights reserved.
9
+ * Copyright 2024 Adobe. All rights reserved.
9
10
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
11
  * you may not use this file except in compliance with the License. You may obtain a copy
11
12
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -19,11 +20,13 @@ import $llkzs$react, {createContext as $llkzs$createContext, forwardRef as $llkz
19
20
 
20
21
 
21
22
 
23
+
22
24
  const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
23
25
  const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
24
26
  const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
25
- const $d2f53cda644affe3$export$d834fde4e1147cd8 = /*#__PURE__*/ (0, $llkzs$forwardRef)(function Autocomplete(props, ref) {
26
- [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2f53cda644affe3$export$4581e569cc48eb6b);
27
+ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
28
+ let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
29
+ props = (0, $llkzs$mergeProps)(ctx, props);
27
30
  let { filter: filter } = props;
28
31
  let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
29
32
  let collectionRef = (0, $llkzs$useRef)(null);
@@ -57,7 +60,7 @@ const $d2f53cda644affe3$export$d834fde4e1147cd8 = /*#__PURE__*/ (0, $llkzs$forwa
57
60
  ]
58
61
  ]
59
62
  }, props.children);
60
- });
63
+ }
61
64
 
62
65
 
63
66
  export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAgBM,MAAM,0DAA+B,CAAA,GAAA,oBAAY,EAAqD;AACtG,MAAM,yDAAoC,CAAA,GAAA,oBAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,MAAM,0DAAwB,CAAA,GAAA,iBAAS,EAAE,SAAS,aAAa,KAAwB,EAAE,GAAmC;IACjI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,oCAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IACxC,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IAExC,IAAI,cACF,UAAU,mBACV,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,+BAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;uBACA;kBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_useAutocompleteState} from '@react-stately/autocomplete';\nimport {ContextValue, Provider, removeDataAttributes, SlotProps, useContextProps} from './utils';\nimport {InputContext} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, RefObject, useRef} from 'react';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<ContextValue<AutocompleteProps, HTMLInputElement>>(null);\nexport const UNSTABLE_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 * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport const UNSTABLE_Autocomplete = forwardRef(function Autocomplete(props: AutocompleteProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, UNSTABLE_AutocompleteContext);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n inputProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef,\n inputRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n 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;;;;;;AAiBM,MAAM,0DAA+B,CAAA,GAAA,oBAAY,EAA0C;AAC3F,MAAM,yDAAoC,CAAA,GAAA,oBAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,SAAS,0CAAsB,KAAwB;IAC5D,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAA8B,MAAM,IAAI;IACpE,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,oCAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IACxC,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IAExC,IAAI,cACF,UAAU,mBACV,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,+BAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;uBACA;kBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC;gBAAsC;8BACrC;qCACA;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, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_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';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<SlottedContextValue<AutocompleteProps>>(null);\nexport const UNSTABLE_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 * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function UNSTABLE_Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(UNSTABLE_AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n inputProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef,\n inputRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
@@ -47,8 +47,8 @@ $parcel$export(module.exports, "CalendarCell", () => $3f539f26b167ddde$export$5d
47
47
 
48
48
 
49
49
 
50
- const $3f539f26b167ddde$export$3b805cea1f178355 = /*#__PURE__*/ (0, $iJp6C$react.createContext)({});
51
- const $3f539f26b167ddde$export$233dd9682e1ad64b = /*#__PURE__*/ (0, $iJp6C$react.createContext)({});
50
+ const $3f539f26b167ddde$export$3b805cea1f178355 = /*#__PURE__*/ (0, $iJp6C$react.createContext)(null);
51
+ const $3f539f26b167ddde$export$233dd9682e1ad64b = /*#__PURE__*/ (0, $iJp6C$react.createContext)(null);
52
52
  const $3f539f26b167ddde$export$9e31dcedda1dadc7 = /*#__PURE__*/ (0, $iJp6C$react.createContext)(null);
53
53
  const $3f539f26b167ddde$export$5e0fc348c00f87a0 = /*#__PURE__*/ (0, $iJp6C$react.createContext)(null);
54
54
  const $3f539f26b167ddde$export$e1aef45b828286de = /*#__PURE__*/ (0, $iJp6C$react.forwardRef)(function Calendar(props, ref) {
@@ -99,6 +99,10 @@ const $3f539f26b167ddde$export$e1aef45b828286de = /*#__PURE__*/ (0, $iJp6C$react
99
99
  $3f539f26b167ddde$export$9e31dcedda1dadc7,
100
100
  state
101
101
  ],
102
+ [
103
+ $3f539f26b167ddde$export$3b805cea1f178355,
104
+ props
105
+ ],
102
106
  [
103
107
  (0, $a8a589c28affdc40$exports.TextContext),
104
108
  {
@@ -163,6 +167,10 @@ const $3f539f26b167ddde$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $iJp6C$react
163
167
  $3f539f26b167ddde$export$5e0fc348c00f87a0,
164
168
  state
165
169
  ],
170
+ [
171
+ $3f539f26b167ddde$export$233dd9682e1ad64b,
172
+ props
173
+ ],
166
174
  [
167
175
  (0, $a8a589c28affdc40$exports.TextContext),
168
176
  {
@@ -183,20 +191,26 @@ const $3f539f26b167ddde$var$InternalCalendarGridContext = /*#__PURE__*/ (0, $iJp
183
191
  const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react.forwardRef)(function CalendarGrid(props, ref) {
184
192
  let calendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$9e31dcedda1dadc7);
185
193
  let rangeCalendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$5e0fc348c00f87a0);
194
+ let calenderProps = (0, $c5ccf687772c0422$exports.useSlottedContext)($3f539f26b167ddde$export$3b805cea1f178355);
195
+ let rangeCalenderProps = (0, $c5ccf687772c0422$exports.useSlottedContext)($3f539f26b167ddde$export$233dd9682e1ad64b);
186
196
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
187
197
  let startDate = state.visibleRange.start;
188
198
  if (props.offset) startDate = startDate.add(props.offset);
199
+ var _calenderProps_firstDayOfWeek;
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;
189
201
  let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $iJp6C$reactaria.useCalendarGrid)({
190
202
  startDate: startDate,
191
203
  endDate: (0, $iJp6C$internationalizeddate.endOfMonth)(startDate),
192
- weekdayStyle: props.weekdayStyle
204
+ weekdayStyle: props.weekdayStyle,
205
+ firstDayOfWeek: firstDayOfWeek
193
206
  }, state);
194
207
  var _props_className;
195
208
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$var$InternalCalendarGridContext.Provider, {
196
209
  value: {
197
210
  headerProps: headerProps,
198
211
  weekDays: weekDays,
199
- startDate: startDate
212
+ startDate: startDate,
213
+ firstDayOfWeek: firstDayOfWeek
200
214
  }
201
215
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("table", {
202
216
  ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
@@ -239,9 +253,9 @@ function $3f539f26b167ddde$var$CalendarGridBody(props, ref) {
239
253
  let calendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$9e31dcedda1dadc7);
240
254
  let rangeCalendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$5e0fc348c00f87a0);
241
255
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
242
- let { startDate: startDate } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
256
+ let { startDate: startDate, firstDayOfWeek: firstDayOfWeek } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
243
257
  let { locale: locale } = (0, $iJp6C$reactaria.useLocale)();
244
- let weeksInMonth = (0, $iJp6C$internationalizeddate.getWeeksInMonth)(startDate, locale);
258
+ let weeksInMonth = (0, $iJp6C$internationalizeddate.getWeeksInMonth)(startDate, locale, firstDayOfWeek);
245
259
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("tbody", {
246
260
  ...(0, $iJp6C$reactariautils.filterDOMProps)(props),
247
261
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD,CAAC;AACzF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD,CAAC;AACnG,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,GAAA,oCAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBA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AM;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} 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>>({});\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>({});\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 [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 [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}\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 state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let {gridProps, headerProps, weekDays} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate}}>\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} = useContext(InternalCalendarGridContext)!;\n let {locale} = useLocale();\n let weeksInMonth = getWeeksInMonth(startDate, locale);\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;;;;;;;;;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,GAAA,oCAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,4BAAU,EAAE,OAAO;IAErG,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;mBACN;YACA,YAAY,MAAM,UAAU,IAAI;YAChC,WAAW,MAAM,cAAc;QACjC;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,WAAW;QACd,GAAG,aAAa;QACjB,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,cAAc,IAAI;qBACtC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gB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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"}
package/dist/Calendar.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
2
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
2
+ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
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";
@@ -27,8 +27,8 @@ import $dCiKx$react, {createContext as $dCiKx$createContext, forwardRef as $dCiK
27
27
 
28
28
 
29
29
 
30
- const $dfd62f934fc76fed$export$3b805cea1f178355 = /*#__PURE__*/ (0, $dCiKx$createContext)({});
31
- const $dfd62f934fc76fed$export$233dd9682e1ad64b = /*#__PURE__*/ (0, $dCiKx$createContext)({});
30
+ const $dfd62f934fc76fed$export$3b805cea1f178355 = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
31
+ const $dfd62f934fc76fed$export$233dd9682e1ad64b = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
32
32
  const $dfd62f934fc76fed$export$9e31dcedda1dadc7 = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
33
33
  const $dfd62f934fc76fed$export$5e0fc348c00f87a0 = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
34
34
  const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwardRef)(function Calendar(props, ref) {
@@ -79,6 +79,10 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwa
79
79
  $dfd62f934fc76fed$export$9e31dcedda1dadc7,
80
80
  state
81
81
  ],
82
+ [
83
+ $dfd62f934fc76fed$export$3b805cea1f178355,
84
+ props
85
+ ],
82
86
  [
83
87
  (0, $514c0188e459b4c0$export$9afb8bc826b033ea),
84
88
  {
@@ -143,6 +147,10 @@ const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $dCiKx$forwa
143
147
  $dfd62f934fc76fed$export$5e0fc348c00f87a0,
144
148
  state
145
149
  ],
150
+ [
151
+ $dfd62f934fc76fed$export$233dd9682e1ad64b,
152
+ props
153
+ ],
146
154
  [
147
155
  (0, $514c0188e459b4c0$export$9afb8bc826b033ea),
148
156
  {
@@ -163,20 +171,26 @@ const $dfd62f934fc76fed$var$InternalCalendarGridContext = /*#__PURE__*/ (0, $dCi
163
171
  const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwardRef)(function CalendarGrid(props, ref) {
164
172
  let calendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$9e31dcedda1dadc7);
165
173
  let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
174
+ let calenderProps = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($dfd62f934fc76fed$export$3b805cea1f178355);
175
+ let rangeCalenderProps = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($dfd62f934fc76fed$export$233dd9682e1ad64b);
166
176
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
167
177
  let startDate = state.visibleRange.start;
168
178
  if (props.offset) startDate = startDate.add(props.offset);
179
+ var _calenderProps_firstDayOfWeek;
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;
169
181
  let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $dCiKx$useCalendarGrid)({
170
182
  startDate: startDate,
171
183
  endDate: (0, $dCiKx$endOfMonth)(startDate),
172
- weekdayStyle: props.weekdayStyle
184
+ weekdayStyle: props.weekdayStyle,
185
+ firstDayOfWeek: firstDayOfWeek
173
186
  }, state);
174
187
  var _props_className;
175
188
  return /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$var$InternalCalendarGridContext.Provider, {
176
189
  value: {
177
190
  headerProps: headerProps,
178
191
  weekDays: weekDays,
179
- startDate: startDate
192
+ startDate: startDate,
193
+ firstDayOfWeek: firstDayOfWeek
180
194
  }
181
195
  }, /*#__PURE__*/ (0, $dCiKx$react).createElement("table", {
182
196
  ...(0, $dCiKx$filterDOMProps)(props),
@@ -219,9 +233,9 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
219
233
  let calendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$9e31dcedda1dadc7);
220
234
  let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
221
235
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
222
- let { startDate: startDate } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
236
+ let { startDate: startDate, firstDayOfWeek: firstDayOfWeek } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
223
237
  let { locale: locale } = (0, $dCiKx$useLocale)();
224
- let weeksInMonth = (0, $dCiKx$getWeeksInMonth)(startDate, locale);
238
+ let weeksInMonth = (0, $dCiKx$getWeeksInMonth)(startDate, locale, firstDayOfWeek);
225
239
  return /*#__PURE__*/ (0, $dCiKx$react).createElement("tbody", {
226
240
  ...(0, $dCiKx$filterDOMProps)(props),
227
241
  ref: ref,
@@ -1,5 +1,5 @@
1
1
  import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.module.js";
2
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
2
+ import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
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";
@@ -27,8 +27,8 @@ import $dCiKx$react, {createContext as $dCiKx$createContext, forwardRef as $dCiK
27
27
 
28
28
 
29
29
 
30
- const $dfd62f934fc76fed$export$3b805cea1f178355 = /*#__PURE__*/ (0, $dCiKx$createContext)({});
31
- const $dfd62f934fc76fed$export$233dd9682e1ad64b = /*#__PURE__*/ (0, $dCiKx$createContext)({});
30
+ const $dfd62f934fc76fed$export$3b805cea1f178355 = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
31
+ const $dfd62f934fc76fed$export$233dd9682e1ad64b = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
32
32
  const $dfd62f934fc76fed$export$9e31dcedda1dadc7 = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
33
33
  const $dfd62f934fc76fed$export$5e0fc348c00f87a0 = /*#__PURE__*/ (0, $dCiKx$createContext)(null);
34
34
  const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwardRef)(function Calendar(props, ref) {
@@ -79,6 +79,10 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwa
79
79
  $dfd62f934fc76fed$export$9e31dcedda1dadc7,
80
80
  state
81
81
  ],
82
+ [
83
+ $dfd62f934fc76fed$export$3b805cea1f178355,
84
+ props
85
+ ],
82
86
  [
83
87
  (0, $514c0188e459b4c0$export$9afb8bc826b033ea),
84
88
  {
@@ -143,6 +147,10 @@ const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $dCiKx$forwa
143
147
  $dfd62f934fc76fed$export$5e0fc348c00f87a0,
144
148
  state
145
149
  ],
150
+ [
151
+ $dfd62f934fc76fed$export$233dd9682e1ad64b,
152
+ props
153
+ ],
146
154
  [
147
155
  (0, $514c0188e459b4c0$export$9afb8bc826b033ea),
148
156
  {
@@ -163,20 +171,26 @@ const $dfd62f934fc76fed$var$InternalCalendarGridContext = /*#__PURE__*/ (0, $dCi
163
171
  const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwardRef)(function CalendarGrid(props, ref) {
164
172
  let calendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$9e31dcedda1dadc7);
165
173
  let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
174
+ let calenderProps = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($dfd62f934fc76fed$export$3b805cea1f178355);
175
+ let rangeCalenderProps = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($dfd62f934fc76fed$export$233dd9682e1ad64b);
166
176
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
167
177
  let startDate = state.visibleRange.start;
168
178
  if (props.offset) startDate = startDate.add(props.offset);
179
+ var _calenderProps_firstDayOfWeek;
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;
169
181
  let { gridProps: gridProps, headerProps: headerProps, weekDays: weekDays } = (0, $dCiKx$useCalendarGrid)({
170
182
  startDate: startDate,
171
183
  endDate: (0, $dCiKx$endOfMonth)(startDate),
172
- weekdayStyle: props.weekdayStyle
184
+ weekdayStyle: props.weekdayStyle,
185
+ firstDayOfWeek: firstDayOfWeek
173
186
  }, state);
174
187
  var _props_className;
175
188
  return /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$var$InternalCalendarGridContext.Provider, {
176
189
  value: {
177
190
  headerProps: headerProps,
178
191
  weekDays: weekDays,
179
- startDate: startDate
192
+ startDate: startDate,
193
+ firstDayOfWeek: firstDayOfWeek
180
194
  }
181
195
  }, /*#__PURE__*/ (0, $dCiKx$react).createElement("table", {
182
196
  ...(0, $dCiKx$filterDOMProps)(props),
@@ -219,9 +233,9 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
219
233
  let calendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$9e31dcedda1dadc7);
220
234
  let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
221
235
  let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
222
- let { startDate: startDate } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
236
+ let { startDate: startDate, firstDayOfWeek: firstDayOfWeek } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
223
237
  let { locale: locale } = (0, $dCiKx$useLocale)();
224
- let weeksInMonth = (0, $dCiKx$getWeeksInMonth)(startDate, locale);
238
+ let weeksInMonth = (0, $dCiKx$getWeeksInMonth)(startDate, locale, firstDayOfWeek);
225
239
  return /*#__PURE__*/ (0, $dCiKx$react).createElement("tbody", {
226
240
  ...(0, $dCiKx$filterDOMProps)(props),
227
241
  ref: ref,