@react-spectrum/utils 3.12.12 → 3.13.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 (64) hide show
  1. package/dist/import.mjs +13 -11
  2. package/dist/main.js +42 -40
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +13 -11
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +12 -0
  7. package/package.json +15 -15
  8. package/src/index.ts +13 -21
  9. package/dist/BreakpointProvider.main.js +0 -75
  10. package/dist/BreakpointProvider.main.js.map +0 -1
  11. package/dist/BreakpointProvider.mjs +0 -64
  12. package/dist/BreakpointProvider.module.js +0 -64
  13. package/dist/BreakpointProvider.module.js.map +0 -1
  14. package/dist/Slots.main.js +0 -75
  15. package/dist/Slots.main.js.map +0 -1
  16. package/dist/Slots.mjs +0 -63
  17. package/dist/Slots.module.js +0 -63
  18. package/dist/Slots.module.js.map +0 -1
  19. package/dist/classNames.main.js +0 -50
  20. package/dist/classNames.main.js.map +0 -1
  21. package/dist/classNames.mjs +0 -39
  22. package/dist/classNames.module.js +0 -39
  23. package/dist/classNames.module.js.map +0 -1
  24. package/dist/getWrappedElement.main.js +0 -32
  25. package/dist/getWrappedElement.main.js.map +0 -1
  26. package/dist/getWrappedElement.mjs +0 -23
  27. package/dist/getWrappedElement.module.js +0 -23
  28. package/dist/getWrappedElement.module.js.map +0 -1
  29. package/dist/styleProps.main.js +0 -468
  30. package/dist/styleProps.main.js.map +0 -1
  31. package/dist/styleProps.mjs +0 -456
  32. package/dist/styleProps.module.js +0 -456
  33. package/dist/styleProps.module.js.map +0 -1
  34. package/dist/types.d.ts +0 -75
  35. package/dist/types.d.ts.map +0 -1
  36. package/dist/useDOMRef.main.js +0 -64
  37. package/dist/useDOMRef.main.js.map +0 -1
  38. package/dist/useDOMRef.mjs +0 -54
  39. package/dist/useDOMRef.module.js +0 -54
  40. package/dist/useDOMRef.module.js.map +0 -1
  41. package/dist/useHasChild.main.js +0 -35
  42. package/dist/useHasChild.main.js.map +0 -1
  43. package/dist/useHasChild.mjs +0 -30
  44. package/dist/useHasChild.module.js +0 -30
  45. package/dist/useHasChild.module.js.map +0 -1
  46. package/dist/useIsMobileDevice.main.js +0 -28
  47. package/dist/useIsMobileDevice.main.js.map +0 -1
  48. package/dist/useIsMobileDevice.mjs +0 -23
  49. package/dist/useIsMobileDevice.module.js +0 -23
  50. package/dist/useIsMobileDevice.module.js.map +0 -1
  51. package/dist/useMediaQuery.main.js +0 -46
  52. package/dist/useMediaQuery.main.js.map +0 -1
  53. package/dist/useMediaQuery.mjs +0 -41
  54. package/dist/useMediaQuery.module.js +0 -41
  55. package/dist/useMediaQuery.module.js.map +0 -1
  56. package/src/BreakpointProvider.tsx +0 -92
  57. package/src/Slots.tsx +0 -75
  58. package/src/classNames.ts +0 -58
  59. package/src/getWrappedElement.tsx +0 -23
  60. package/src/styleProps.ts +0 -315
  61. package/src/useDOMRef.ts +0 -57
  62. package/src/useHasChild.ts +0 -23
  63. package/src/useIsMobileDevice.ts +0 -24
  64. package/src/useMediaQuery.ts +0 -44
@@ -1,75 +0,0 @@
1
- var $iTRw5$reactariautils = require("@react-aria/utils");
2
- var $iTRw5$react = require("react");
3
-
4
-
5
- function $parcel$interopDefault(a) {
6
- return a && a.__esModule ? a.default : a;
7
- }
8
-
9
- function $parcel$export(e, n, v, s) {
10
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
11
- }
12
-
13
- $parcel$export(module.exports, "useSlotProps", () => $e81916440cf6fd84$export$1e5c9e6e4e15efe3);
14
- $parcel$export(module.exports, "cssModuleToSlots", () => $e81916440cf6fd84$export$365cf34cda9978e2);
15
- $parcel$export(module.exports, "SlotProvider", () => $e81916440cf6fd84$export$8107b24b91795686);
16
- $parcel$export(module.exports, "ClearSlots", () => $e81916440cf6fd84$export$ceb145244332b7a2);
17
- /*
18
- * Copyright 2020 Adobe. All rights reserved.
19
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
- * you may not use this file except in compliance with the License. You may obtain a copy
21
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software distributed under
24
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
- * OF ANY KIND, either express or implied. See the License for the specific language
26
- * governing permissions and limitations under the License.
27
- */
28
-
29
- let $e81916440cf6fd84$var$SlotContext = /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).createContext(null);
30
- function $e81916440cf6fd84$export$1e5c9e6e4e15efe3(props, defaultSlot) {
31
- let slot = props.slot || defaultSlot;
32
- // @ts-ignore TODO why is slot an object and not just string or undefined?
33
- let { [slot]: slotProps = {} } = (0, $iTRw5$react.useContext)($e81916440cf6fd84$var$SlotContext) || {};
34
- return (0, $iTRw5$reactariautils.mergeProps)(props, (0, $iTRw5$reactariautils.mergeProps)(slotProps, {
35
- id: props.id
36
- }));
37
- }
38
- function $e81916440cf6fd84$export$365cf34cda9978e2(cssModule) {
39
- return Object.keys(cssModule).reduce((acc, slot)=>{
40
- acc[slot] = {
41
- UNSAFE_className: cssModule[slot]
42
- };
43
- return acc;
44
- }, {});
45
- }
46
- function $e81916440cf6fd84$export$8107b24b91795686(props) {
47
- const emptyObj = (0, $iTRw5$react.useMemo)(()=>({}), []);
48
- let parentSlots = (0, $iTRw5$react.useContext)($e81916440cf6fd84$var$SlotContext) || emptyObj;
49
- let { slots: slots = emptyObj, children: children } = props;
50
- // Merge props for each slot from parent context and props
51
- let value = (0, $iTRw5$react.useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
52
- ...o,
53
- [p]: (0, $iTRw5$reactariautils.mergeProps)(parentSlots[p] || {}, slots[p] || {})
54
- }), {}), [
55
- parentSlots,
56
- slots
57
- ]);
58
- return /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
59
- value: value
60
- }, children);
61
- }
62
- function $e81916440cf6fd84$export$ceb145244332b7a2(props) {
63
- let { children: children, ...otherProps } = props;
64
- const emptyObj = (0, $iTRw5$react.useMemo)(()=>({}), []);
65
- let content = children;
66
- if ((0, ($parcel$interopDefault($iTRw5$react))).Children.toArray(children).length <= 1) {
67
- if (typeof children === 'function') content = /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).cloneElement((0, ($parcel$interopDefault($iTRw5$react))).Children.only(children), otherProps);
68
- }
69
- return /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
70
- value: emptyObj
71
- }, content);
72
- }
73
-
74
-
75
- //# sourceMappingURL=Slots.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AASD,IAAI,kDAAc,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAY;AAE1C,SAAS,0CAAgB,KAAwB,EAAE,WAAoB;IAC5E,IAAI,OAAO,AAAC,MAAoB,IAAI,IAAI;IACxC,0EAA0E;IAC1E,IAAI,EAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,sCAAgB,CAAC;IAE3D,OAAO,CAAA,GAAA,gCAAS,EAAE,OAAO,CAAA,GAAA,gCAAS,EAAE,WAAW;QAAC,IAAI,MAAM,EAAE;IAAA;AAC9D;AAEO,SAAS,0CAAiB,SAAwC;IACvE,OAAO,OAAO,IAAI,CAAC,WAAW,MAAM,CAAC,CAAC,KAAK;QACzC,GAAG,CAAC,KAAK,GAAG;YAAC,kBAAkB,SAAS,CAAC,KAAK;QAAA;QAC9C,OAAO;IACT,GAAG,CAAC;AACN;AAEO,SAAS,0CAAa,KAA+D;IAC1F,MAAM,WAAW,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA,CAAC,CAAA,GAAI,EAAE;IAEvC,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,sCAAgB;IAC7C,IAAI,SAAC,QAAQ,oBAAU,QAAQ,EAAC,GAAG;IAEnC,0DAA0D;IAC1D,IAAI,QAAQ,CAAA,GAAA,oBAAM,EAAE,IAClB,OAAO,IAAI,CAAC,aACT,MAAM,CAAC,OAAO,IAAI,CAAC,QACnB,MAAM,CAAC,CAAC,GAAG,IAAO,CAAA;gBACjB,GAAG,CAAC;gBACJ,CAAC,EAAE,EAAE,CAAA,GAAA,gCAAS,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC;YAAE,CAAA,GAAI,CAAC,IAC1D;QAAC;QAAa;KAAM;IAE1B,qBACE,0DAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP;AAEO,SAAS,0CAAW,KAA6B;IACtD,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAEhC,MAAM,WAAW,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA,CAAC,CAAA,GAAI,EAAE;IAEvC,IAAI,UAAU;IACd,IAAI,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,MAAM,IAAI,GAC7C;QAAA,IAAI,OAAO,aAAa,YACtB,wBAAU,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW;IAC9D;IAEF,qBACE,0DAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP","sources":["packages/@react-spectrum/utils/src/Slots.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {mergeProps} from '@react-aria/utils';\nimport React, {ReactNode, useContext, useMemo} from 'react';\n\ninterface SlotProps {\n slot?: string\n}\n\nlet SlotContext = React.createContext<{} | null>(null);\n\nexport function useSlotProps<T>(props: T & {id?: string}, defaultSlot?: string): T {\n let slot = (props as SlotProps).slot || defaultSlot;\n // @ts-ignore TODO why is slot an object and not just string or undefined?\n let {[slot]: slotProps = {}} = useContext(SlotContext) || {};\n\n return mergeProps(props, mergeProps(slotProps, {id: props.id})) as T;\n}\n\nexport function cssModuleToSlots(cssModule: {[cssmodule: string]: string}): {[slot: string]: {UNSAFE_className: string}} {\n return Object.keys(cssModule).reduce((acc, slot) => {\n acc[slot] = {UNSAFE_className: cssModule[slot]};\n return acc;\n }, {});\n}\n\nexport function SlotProvider(props: {slots?: {[slot: string]: object}, children?: ReactNode}): ReactNode {\n const emptyObj = useMemo(() => ({}), []);\n\n let parentSlots = useContext(SlotContext) || emptyObj;\n let {slots = emptyObj, children} = props;\n\n // Merge props for each slot from parent context and props\n let value = useMemo(() =>\n Object.keys(parentSlots)\n .concat(Object.keys(slots))\n .reduce((o, p) => ({\n ...o,\n [p]: mergeProps(parentSlots[p] || {}, slots[p] || {})}), {})\n , [parentSlots, slots]);\n\n return (\n <SlotContext.Provider value={value}>\n {children}\n </SlotContext.Provider>\n );\n}\n\nexport function ClearSlots(props: {children?: ReactNode}): ReactNode {\n let {children, ...otherProps} = props;\n\n const emptyObj = useMemo(() => ({}), []);\n\n let content = children;\n if (React.Children.toArray(children).length <= 1) {\n if (typeof children === 'function') { // need to know if the node is a string or something else that react can render that doesn't get props\n content = React.cloneElement(React.Children.only(children), otherProps);\n }\n }\n return (\n <SlotContext.Provider value={emptyObj}>\n {content}\n </SlotContext.Provider>\n );\n}\n"],"names":[],"version":3,"file":"Slots.main.js.map"}
package/dist/Slots.mjs DELETED
@@ -1,63 +0,0 @@
1
- import {mergeProps as $doF98$mergeProps} from "@react-aria/utils";
2
- import $doF98$react, {useContext as $doF98$useContext, useMemo as $doF98$useMemo} from "react";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- let $59d09bcc83651bf9$var$SlotContext = /*#__PURE__*/ (0, $doF98$react).createContext(null);
17
- function $59d09bcc83651bf9$export$1e5c9e6e4e15efe3(props, defaultSlot) {
18
- let slot = props.slot || defaultSlot;
19
- // @ts-ignore TODO why is slot an object and not just string or undefined?
20
- let { [slot]: slotProps = {} } = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {};
21
- return (0, $doF98$mergeProps)(props, (0, $doF98$mergeProps)(slotProps, {
22
- id: props.id
23
- }));
24
- }
25
- function $59d09bcc83651bf9$export$365cf34cda9978e2(cssModule) {
26
- return Object.keys(cssModule).reduce((acc, slot)=>{
27
- acc[slot] = {
28
- UNSAFE_className: cssModule[slot]
29
- };
30
- return acc;
31
- }, {});
32
- }
33
- function $59d09bcc83651bf9$export$8107b24b91795686(props) {
34
- const emptyObj = (0, $doF98$useMemo)(()=>({}), []);
35
- let parentSlots = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || emptyObj;
36
- let { slots: slots = emptyObj, children: children } = props;
37
- // Merge props for each slot from parent context and props
38
- let value = (0, $doF98$useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
39
- ...o,
40
- [p]: (0, $doF98$mergeProps)(parentSlots[p] || {}, slots[p] || {})
41
- }), {}), [
42
- parentSlots,
43
- slots
44
- ]);
45
- return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
46
- value: value
47
- }, children);
48
- }
49
- function $59d09bcc83651bf9$export$ceb145244332b7a2(props) {
50
- let { children: children, ...otherProps } = props;
51
- const emptyObj = (0, $doF98$useMemo)(()=>({}), []);
52
- let content = children;
53
- if ((0, $doF98$react).Children.toArray(children).length <= 1) {
54
- if (typeof children === 'function') content = /*#__PURE__*/ (0, $doF98$react).cloneElement((0, $doF98$react).Children.only(children), otherProps);
55
- }
56
- return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
57
- value: emptyObj
58
- }, content);
59
- }
60
-
61
-
62
- export {$59d09bcc83651bf9$export$1e5c9e6e4e15efe3 as useSlotProps, $59d09bcc83651bf9$export$365cf34cda9978e2 as cssModuleToSlots, $59d09bcc83651bf9$export$8107b24b91795686 as SlotProvider, $59d09bcc83651bf9$export$ceb145244332b7a2 as ClearSlots};
63
- //# sourceMappingURL=Slots.module.js.map
@@ -1,63 +0,0 @@
1
- import {mergeProps as $doF98$mergeProps} from "@react-aria/utils";
2
- import $doF98$react, {useContext as $doF98$useContext, useMemo as $doF98$useMemo} from "react";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- let $59d09bcc83651bf9$var$SlotContext = /*#__PURE__*/ (0, $doF98$react).createContext(null);
17
- function $59d09bcc83651bf9$export$1e5c9e6e4e15efe3(props, defaultSlot) {
18
- let slot = props.slot || defaultSlot;
19
- // @ts-ignore TODO why is slot an object and not just string or undefined?
20
- let { [slot]: slotProps = {} } = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {};
21
- return (0, $doF98$mergeProps)(props, (0, $doF98$mergeProps)(slotProps, {
22
- id: props.id
23
- }));
24
- }
25
- function $59d09bcc83651bf9$export$365cf34cda9978e2(cssModule) {
26
- return Object.keys(cssModule).reduce((acc, slot)=>{
27
- acc[slot] = {
28
- UNSAFE_className: cssModule[slot]
29
- };
30
- return acc;
31
- }, {});
32
- }
33
- function $59d09bcc83651bf9$export$8107b24b91795686(props) {
34
- const emptyObj = (0, $doF98$useMemo)(()=>({}), []);
35
- let parentSlots = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || emptyObj;
36
- let { slots: slots = emptyObj, children: children } = props;
37
- // Merge props for each slot from parent context and props
38
- let value = (0, $doF98$useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
39
- ...o,
40
- [p]: (0, $doF98$mergeProps)(parentSlots[p] || {}, slots[p] || {})
41
- }), {}), [
42
- parentSlots,
43
- slots
44
- ]);
45
- return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
46
- value: value
47
- }, children);
48
- }
49
- function $59d09bcc83651bf9$export$ceb145244332b7a2(props) {
50
- let { children: children, ...otherProps } = props;
51
- const emptyObj = (0, $doF98$useMemo)(()=>({}), []);
52
- let content = children;
53
- if ((0, $doF98$react).Children.toArray(children).length <= 1) {
54
- if (typeof children === 'function') content = /*#__PURE__*/ (0, $doF98$react).cloneElement((0, $doF98$react).Children.only(children), otherProps);
55
- }
56
- return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
57
- value: emptyObj
58
- }, content);
59
- }
60
-
61
-
62
- export {$59d09bcc83651bf9$export$1e5c9e6e4e15efe3 as useSlotProps, $59d09bcc83651bf9$export$365cf34cda9978e2 as cssModuleToSlots, $59d09bcc83651bf9$export$8107b24b91795686 as SlotProvider, $59d09bcc83651bf9$export$ceb145244332b7a2 as ClearSlots};
63
- //# sourceMappingURL=Slots.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AASD,IAAI,kDAAc,CAAA,GAAA,YAAI,EAAE,aAAa,CAAY;AAE1C,SAAS,0CAAgB,KAAwB,EAAE,WAAoB;IAC5E,IAAI,OAAO,AAAC,MAAoB,IAAI,IAAI;IACxC,0EAA0E;IAC1E,IAAI,EAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,sCAAgB,CAAC;IAE3D,OAAO,CAAA,GAAA,iBAAS,EAAE,OAAO,CAAA,GAAA,iBAAS,EAAE,WAAW;QAAC,IAAI,MAAM,EAAE;IAAA;AAC9D;AAEO,SAAS,0CAAiB,SAAwC;IACvE,OAAO,OAAO,IAAI,CAAC,WAAW,MAAM,CAAC,CAAC,KAAK;QACzC,GAAG,CAAC,KAAK,GAAG;YAAC,kBAAkB,SAAS,CAAC,KAAK;QAAA;QAC9C,OAAO;IACT,GAAG,CAAC;AACN;AAEO,SAAS,0CAAa,KAA+D;IAC1F,MAAM,WAAW,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA,CAAC,CAAA,GAAI,EAAE;IAEvC,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,sCAAgB;IAC7C,IAAI,SAAC,QAAQ,oBAAU,QAAQ,EAAC,GAAG;IAEnC,0DAA0D;IAC1D,IAAI,QAAQ,CAAA,GAAA,cAAM,EAAE,IAClB,OAAO,IAAI,CAAC,aACT,MAAM,CAAC,OAAO,IAAI,CAAC,QACnB,MAAM,CAAC,CAAC,GAAG,IAAO,CAAA;gBACjB,GAAG,CAAC;gBACJ,CAAC,EAAE,EAAE,CAAA,GAAA,iBAAS,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC;YAAE,CAAA,GAAI,CAAC,IAC1D;QAAC;QAAa;KAAM;IAE1B,qBACE,gCAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP;AAEO,SAAS,0CAAW,KAA6B;IACtD,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAEhC,MAAM,WAAW,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA,CAAC,CAAA,GAAI,EAAE;IAEvC,IAAI,UAAU;IACd,IAAI,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,MAAM,IAAI,GAC7C;QAAA,IAAI,OAAO,aAAa,YACtB,wBAAU,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW;IAC9D;IAEF,qBACE,gCAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP","sources":["packages/@react-spectrum/utils/src/Slots.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {mergeProps} from '@react-aria/utils';\nimport React, {ReactNode, useContext, useMemo} from 'react';\n\ninterface SlotProps {\n slot?: string\n}\n\nlet SlotContext = React.createContext<{} | null>(null);\n\nexport function useSlotProps<T>(props: T & {id?: string}, defaultSlot?: string): T {\n let slot = (props as SlotProps).slot || defaultSlot;\n // @ts-ignore TODO why is slot an object and not just string or undefined?\n let {[slot]: slotProps = {}} = useContext(SlotContext) || {};\n\n return mergeProps(props, mergeProps(slotProps, {id: props.id})) as T;\n}\n\nexport function cssModuleToSlots(cssModule: {[cssmodule: string]: string}): {[slot: string]: {UNSAFE_className: string}} {\n return Object.keys(cssModule).reduce((acc, slot) => {\n acc[slot] = {UNSAFE_className: cssModule[slot]};\n return acc;\n }, {});\n}\n\nexport function SlotProvider(props: {slots?: {[slot: string]: object}, children?: ReactNode}): ReactNode {\n const emptyObj = useMemo(() => ({}), []);\n\n let parentSlots = useContext(SlotContext) || emptyObj;\n let {slots = emptyObj, children} = props;\n\n // Merge props for each slot from parent context and props\n let value = useMemo(() =>\n Object.keys(parentSlots)\n .concat(Object.keys(slots))\n .reduce((o, p) => ({\n ...o,\n [p]: mergeProps(parentSlots[p] || {}, slots[p] || {})}), {})\n , [parentSlots, slots]);\n\n return (\n <SlotContext.Provider value={value}>\n {children}\n </SlotContext.Provider>\n );\n}\n\nexport function ClearSlots(props: {children?: ReactNode}): ReactNode {\n let {children, ...otherProps} = props;\n\n const emptyObj = useMemo(() => ({}), []);\n\n let content = children;\n if (React.Children.toArray(children).length <= 1) {\n if (typeof children === 'function') { // need to know if the node is a string or something else that react can render that doesn't get props\n content = React.cloneElement(React.Children.only(children), otherProps);\n }\n }\n return (\n <SlotContext.Provider value={emptyObj}>\n {content}\n </SlotContext.Provider>\n );\n}\n"],"names":[],"version":3,"file":"Slots.module.js.map"}
@@ -1,50 +0,0 @@
1
- var $9bLOP$clsx = require("clsx");
2
-
3
-
4
- function $parcel$interopDefault(a) {
5
- return a && a.__esModule ? a.default : a;
6
- }
7
-
8
- function $parcel$export(e, n, v, s) {
9
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
- }
11
-
12
- $parcel$export(module.exports, "shouldKeepSpectrumClassNames", () => $e720495fead531ee$export$46d604dce8bf8724);
13
- $parcel$export(module.exports, "keepSpectrumClassNames", () => $e720495fead531ee$export$f9d3bfd10703eb31);
14
- $parcel$export(module.exports, "classNames", () => $e720495fead531ee$export$ce4ab0c55987d1ff);
15
- /*
16
- * Copyright 2020 Adobe. All rights reserved.
17
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
- * you may not use this file except in compliance with the License. You may obtain a copy
19
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software distributed under
22
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
- * OF ANY KIND, either express or implied. See the License for the specific language
24
- * governing permissions and limitations under the License.
25
- */
26
- let $e720495fead531ee$export$46d604dce8bf8724 = false;
27
- function $e720495fead531ee$export$f9d3bfd10703eb31() {
28
- $e720495fead531ee$export$46d604dce8bf8724 = true;
29
- if (process.env.NODE_ENV !== 'production') console.warn("Legacy spectrum-prefixed class names enabled for backward compatibility. We recommend replacing instances of CSS overrides targeting spectrum selectors in your app with custom class names of your own, and disabling this flag.");
30
- }
31
- function $e720495fead531ee$export$ce4ab0c55987d1ff(cssModule, ...values) {
32
- let classes = [];
33
- for (let value of values){
34
- if (typeof value === 'object' && value) {
35
- let mapped = {};
36
- for(let key in value){
37
- if (cssModule[key]) mapped[cssModule[key]] = value[key];
38
- if ($e720495fead531ee$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
39
- }
40
- classes.push(mapped);
41
- } else if (typeof value === 'string') {
42
- if (cssModule[value]) classes.push(cssModule[value]);
43
- if ($e720495fead531ee$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
44
- } else classes.push(value);
45
- }
46
- return (0, ($parcel$interopDefault($9bLOP$clsx)))(...classes);
47
- }
48
-
49
-
50
- //# sourceMappingURL=classNames.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,IAAI,4CAA+B;AAEnC,SAAS;IACd,4CAA+B;IAC/B,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC3B,QAAQ,IAAI,CACV;AAKN;AAEO,SAAS,0CAAW,SAAkC,EAAE,GAAG,MAA0C;IAC1G,IAAI,UAAiC,EAAE;IACvC,KAAK,IAAI,SAAS,OAAQ;QACxB,IAAI,OAAO,UAAU,YAAY,OAAO;YACtC,IAAI,SAAS,CAAC;YACd,IAAK,IAAI,OAAO,MAAO;gBACrB,IAAI,SAAS,CAAC,IAAI,EAChB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI;gBAGrC,IAAI,6CAAgC,CAAC,SAAS,CAAC,IAAI,EACjD,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAE5B;YAEA,QAAQ,IAAI,CAAC;QACf,OAAO,IAAI,OAAO,UAAU,UAAU;YACpC,IAAI,SAAS,CAAC,MAAM,EAClB,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM;YAG/B,IAAI,6CAAgC,CAAC,SAAS,CAAC,MAAM,EACnD,QAAQ,IAAI,CAAC;QAEjB,OACE,QAAQ,IAAI,CAAC;IAEjB;IAEA,OAAO,CAAA,GAAA,qCAAI,KAAK;AAClB","sources":["packages/@react-spectrum/utils/src/classNames.ts"],"sourcesContent":["/*\n * Copyright 2020 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 _clsx from 'clsx';\n\nexport let shouldKeepSpectrumClassNames = false;\n\nexport function keepSpectrumClassNames(): void {\n shouldKeepSpectrumClassNames = true;\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Legacy spectrum-prefixed class names enabled for backward compatibility. ' +\n 'We recommend replacing instances of CSS overrides targeting spectrum selectors ' +\n 'in your app with custom class names of your own, and disabling this flag.'\n );\n }\n}\n\nexport function classNames(cssModule: {[key: string]: string}, ...values: Array<string | Object | undefined>): string {\n let classes: Array<{} | undefined> = [];\n for (let value of values) {\n if (typeof value === 'object' && value) {\n let mapped = {};\n for (let key in value) {\n if (cssModule[key]) {\n mapped[cssModule[key]] = value[key];\n }\n\n if (shouldKeepSpectrumClassNames || !cssModule[key]) {\n mapped[key] = value[key];\n }\n }\n\n classes.push(mapped);\n } else if (typeof value === 'string') {\n if (cssModule[value]) {\n classes.push(cssModule[value]);\n }\n\n if (shouldKeepSpectrumClassNames || !cssModule[value]) {\n classes.push(value);\n }\n } else {\n classes.push(value);\n }\n }\n\n return _clsx(...classes);\n}\n"],"names":[],"version":3,"file":"classNames.main.js.map"}
@@ -1,39 +0,0 @@
1
- import $jPV9R$clsx from "clsx";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- let $fd933927dbac1f15$export$46d604dce8bf8724 = false;
15
- function $fd933927dbac1f15$export$f9d3bfd10703eb31() {
16
- $fd933927dbac1f15$export$46d604dce8bf8724 = true;
17
- if (process.env.NODE_ENV !== 'production') console.warn("Legacy spectrum-prefixed class names enabled for backward compatibility. We recommend replacing instances of CSS overrides targeting spectrum selectors in your app with custom class names of your own, and disabling this flag.");
18
- }
19
- function $fd933927dbac1f15$export$ce4ab0c55987d1ff(cssModule, ...values) {
20
- let classes = [];
21
- for (let value of values){
22
- if (typeof value === 'object' && value) {
23
- let mapped = {};
24
- for(let key in value){
25
- if (cssModule[key]) mapped[cssModule[key]] = value[key];
26
- if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
27
- }
28
- classes.push(mapped);
29
- } else if (typeof value === 'string') {
30
- if (cssModule[value]) classes.push(cssModule[value]);
31
- if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
32
- } else classes.push(value);
33
- }
34
- return (0, $jPV9R$clsx)(...classes);
35
- }
36
-
37
-
38
- export {$fd933927dbac1f15$export$46d604dce8bf8724 as shouldKeepSpectrumClassNames, $fd933927dbac1f15$export$f9d3bfd10703eb31 as keepSpectrumClassNames, $fd933927dbac1f15$export$ce4ab0c55987d1ff as classNames};
39
- //# sourceMappingURL=classNames.module.js.map
@@ -1,39 +0,0 @@
1
- import $jPV9R$clsx from "clsx";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- let $fd933927dbac1f15$export$46d604dce8bf8724 = false;
15
- function $fd933927dbac1f15$export$f9d3bfd10703eb31() {
16
- $fd933927dbac1f15$export$46d604dce8bf8724 = true;
17
- if (process.env.NODE_ENV !== 'production') console.warn("Legacy spectrum-prefixed class names enabled for backward compatibility. We recommend replacing instances of CSS overrides targeting spectrum selectors in your app with custom class names of your own, and disabling this flag.");
18
- }
19
- function $fd933927dbac1f15$export$ce4ab0c55987d1ff(cssModule, ...values) {
20
- let classes = [];
21
- for (let value of values){
22
- if (typeof value === 'object' && value) {
23
- let mapped = {};
24
- for(let key in value){
25
- if (cssModule[key]) mapped[cssModule[key]] = value[key];
26
- if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
27
- }
28
- classes.push(mapped);
29
- } else if (typeof value === 'string') {
30
- if (cssModule[value]) classes.push(cssModule[value]);
31
- if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
32
- } else classes.push(value);
33
- }
34
- return (0, $jPV9R$clsx)(...classes);
35
- }
36
-
37
-
38
- export {$fd933927dbac1f15$export$46d604dce8bf8724 as shouldKeepSpectrumClassNames, $fd933927dbac1f15$export$f9d3bfd10703eb31 as keepSpectrumClassNames, $fd933927dbac1f15$export$ce4ab0c55987d1ff as classNames};
39
- //# sourceMappingURL=classNames.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,IAAI,4CAA+B;AAEnC,SAAS;IACd,4CAA+B;IAC/B,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC3B,QAAQ,IAAI,CACV;AAKN;AAEO,SAAS,0CAAW,SAAkC,EAAE,GAAG,MAA0C;IAC1G,IAAI,UAAiC,EAAE;IACvC,KAAK,IAAI,SAAS,OAAQ;QACxB,IAAI,OAAO,UAAU,YAAY,OAAO;YACtC,IAAI,SAAS,CAAC;YACd,IAAK,IAAI,OAAO,MAAO;gBACrB,IAAI,SAAS,CAAC,IAAI,EAChB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI;gBAGrC,IAAI,6CAAgC,CAAC,SAAS,CAAC,IAAI,EACjD,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAE5B;YAEA,QAAQ,IAAI,CAAC;QACf,OAAO,IAAI,OAAO,UAAU,UAAU;YACpC,IAAI,SAAS,CAAC,MAAM,EAClB,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM;YAG/B,IAAI,6CAAgC,CAAC,SAAS,CAAC,MAAM,EACnD,QAAQ,IAAI,CAAC;QAEjB,OACE,QAAQ,IAAI,CAAC;IAEjB;IAEA,OAAO,CAAA,GAAA,WAAI,KAAK;AAClB","sources":["packages/@react-spectrum/utils/src/classNames.ts"],"sourcesContent":["/*\n * Copyright 2020 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 _clsx from 'clsx';\n\nexport let shouldKeepSpectrumClassNames = false;\n\nexport function keepSpectrumClassNames(): void {\n shouldKeepSpectrumClassNames = true;\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Legacy spectrum-prefixed class names enabled for backward compatibility. ' +\n 'We recommend replacing instances of CSS overrides targeting spectrum selectors ' +\n 'in your app with custom class names of your own, and disabling this flag.'\n );\n }\n}\n\nexport function classNames(cssModule: {[key: string]: string}, ...values: Array<string | Object | undefined>): string {\n let classes: Array<{} | undefined> = [];\n for (let value of values) {\n if (typeof value === 'object' && value) {\n let mapped = {};\n for (let key in value) {\n if (cssModule[key]) {\n mapped[cssModule[key]] = value[key];\n }\n\n if (shouldKeepSpectrumClassNames || !cssModule[key]) {\n mapped[key] = value[key];\n }\n }\n\n classes.push(mapped);\n } else if (typeof value === 'string') {\n if (cssModule[value]) {\n classes.push(cssModule[value]);\n }\n\n if (shouldKeepSpectrumClassNames || !cssModule[value]) {\n classes.push(value);\n }\n } else {\n classes.push(value);\n }\n }\n\n return _clsx(...classes);\n}\n"],"names":[],"version":3,"file":"classNames.module.js.map"}
@@ -1,32 +0,0 @@
1
- var $8XE5P$react = require("react");
2
-
3
-
4
- function $parcel$interopDefault(a) {
5
- return a && a.__esModule ? a.default : a;
6
- }
7
-
8
- function $parcel$export(e, n, v, s) {
9
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
- }
11
-
12
- $parcel$export(module.exports, "getWrappedElement", () => $c588c81c05dac184$export$a5f5a6912b18861c);
13
- /*
14
- * Copyright 2020 Adobe. All rights reserved.
15
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License. You may obtain a copy
17
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
- *
19
- * Unless required by applicable law or agreed to in writing, software distributed under
20
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
- * OF ANY KIND, either express or implied. See the License for the specific language
22
- * governing permissions and limitations under the License.
23
- */
24
- function $c588c81c05dac184$export$a5f5a6912b18861c(children) {
25
- let element;
26
- if (typeof children === 'string') element = /*#__PURE__*/ (0, ($parcel$interopDefault($8XE5P$react))).createElement("span", null, children);
27
- else element = (0, ($parcel$interopDefault($8XE5P$react))).Children.only(children);
28
- return element;
29
- }
30
-
31
-
32
- //# sourceMappingURL=getWrappedElement.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAkB,QAA2C;IAC3E,IAAI;IACJ,IAAI,OAAO,aAAa,UACtB,wBAAU,0DAAC,cAAM;SAEjB,UAAU,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEhC,OAAO;AACT","sources":["packages/@react-spectrum/utils/src/getWrappedElement.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 React, {JSXElementConstructor, ReactElement, ReactNode} from 'react';\n\nexport function getWrappedElement(children: string | ReactElement | ReactNode): ReactElement<any, JSXElementConstructor<any>> {\n let element;\n if (typeof children === 'string') {\n element = <span>{children}</span>;\n } else {\n element = React.Children.only(children);\n }\n return element;\n}\n"],"names":[],"version":3,"file":"getWrappedElement.main.js.map"}
@@ -1,23 +0,0 @@
1
- import $kaboj$react from "react";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $bde65b0159e7c06e$export$a5f5a6912b18861c(children) {
15
- let element;
16
- if (typeof children === 'string') element = /*#__PURE__*/ (0, $kaboj$react).createElement("span", null, children);
17
- else element = (0, $kaboj$react).Children.only(children);
18
- return element;
19
- }
20
-
21
-
22
- export {$bde65b0159e7c06e$export$a5f5a6912b18861c as getWrappedElement};
23
- //# sourceMappingURL=getWrappedElement.module.js.map
@@ -1,23 +0,0 @@
1
- import $kaboj$react from "react";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $bde65b0159e7c06e$export$a5f5a6912b18861c(children) {
15
- let element;
16
- if (typeof children === 'string') element = /*#__PURE__*/ (0, $kaboj$react).createElement("span", null, children);
17
- else element = (0, $kaboj$react).Children.only(children);
18
- return element;
19
- }
20
-
21
-
22
- export {$bde65b0159e7c06e$export$a5f5a6912b18861c as getWrappedElement};
23
- //# sourceMappingURL=getWrappedElement.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAkB,QAA2C;IAC3E,IAAI;IACJ,IAAI,OAAO,aAAa,UACtB,wBAAU,gCAAC,cAAM;SAEjB,UAAU,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEhC,OAAO;AACT","sources":["packages/@react-spectrum/utils/src/getWrappedElement.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 React, {JSXElementConstructor, ReactElement, ReactNode} from 'react';\n\nexport function getWrappedElement(children: string | ReactElement | ReactNode): ReactElement<any, JSXElementConstructor<any>> {\n let element;\n if (typeof children === 'string') {\n element = <span>{children}</span>;\n } else {\n element = React.Children.only(children);\n }\n return element;\n}\n"],"names":[],"version":3,"file":"getWrappedElement.module.js.map"}