@react-spectrum/utils 3.11.5 → 3.11.7
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.
- package/dist/BreakpointProvider.main.js +75 -0
- package/dist/BreakpointProvider.main.js.map +1 -0
- package/dist/BreakpointProvider.mjs +64 -0
- package/dist/BreakpointProvider.module.js +64 -0
- package/dist/BreakpointProvider.module.js.map +1 -0
- package/dist/Slots.main.js +73 -0
- package/dist/Slots.main.js.map +1 -0
- package/dist/Slots.mjs +61 -0
- package/dist/Slots.module.js +61 -0
- package/dist/Slots.module.js.map +1 -0
- package/dist/classNames.main.js +50 -0
- package/dist/classNames.main.js.map +1 -0
- package/dist/classNames.mjs +39 -0
- package/dist/classNames.module.js +39 -0
- package/dist/classNames.module.js.map +1 -0
- package/dist/getWrappedElement.main.js +32 -0
- package/dist/getWrappedElement.main.js.map +1 -0
- package/dist/getWrappedElement.mjs +23 -0
- package/dist/getWrappedElement.module.js +23 -0
- package/dist/getWrappedElement.module.js.map +1 -0
- package/dist/import.mjs +10 -742
- package/dist/main.js +37 -773
- package/dist/main.js.map +1 -1
- package/dist/module.js +10 -742
- package/dist/module.js.map +1 -1
- package/dist/styleProps.main.js +468 -0
- package/dist/styleProps.main.js.map +1 -0
- package/dist/styleProps.mjs +456 -0
- package/dist/styleProps.module.js +456 -0
- package/dist/styleProps.module.js.map +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/useDOMRef.main.js +64 -0
- package/dist/useDOMRef.main.js.map +1 -0
- package/dist/useDOMRef.mjs +54 -0
- package/dist/useDOMRef.module.js +54 -0
- package/dist/useDOMRef.module.js.map +1 -0
- package/dist/useHasChild.main.js +35 -0
- package/dist/useHasChild.main.js.map +1 -0
- package/dist/useHasChild.mjs +30 -0
- package/dist/useHasChild.module.js +30 -0
- package/dist/useHasChild.module.js.map +1 -0
- package/dist/useIsMobileDevice.main.js +28 -0
- package/dist/useIsMobileDevice.main.js.map +1 -0
- package/dist/useIsMobileDevice.mjs +23 -0
- package/dist/useIsMobileDevice.module.js +23 -0
- package/dist/useIsMobileDevice.module.js.map +1 -0
- package/dist/useMediaQuery.main.js +46 -0
- package/dist/useMediaQuery.main.js.map +1 -0
- package/dist/useMediaQuery.mjs +41 -0
- package/dist/useMediaQuery.module.js +41 -0
- package/dist/useMediaQuery.module.js.map +1 -0
- package/package.json +6 -6
- package/src/styleProps.ts +16 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var $OaNl0$react = require("react");
|
|
2
|
+
var $OaNl0$reactariassr = require("@react-aria/ssr");
|
|
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, "BreakpointProvider", () => $893a66ba513f4a66$export$8214320346cf5104);
|
|
14
|
+
$parcel$export(module.exports, "useMatchedBreakpoints", () => $893a66ba513f4a66$export$140ae7baa51cca23);
|
|
15
|
+
$parcel$export(module.exports, "useBreakpoint", () => $893a66ba513f4a66$export$199d6754bdf4e1e3);
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const $893a66ba513f4a66$var$Context = /*#__PURE__*/ (0, ($parcel$interopDefault($OaNl0$react))).createContext(null);
|
|
19
|
+
$893a66ba513f4a66$var$Context.displayName = 'BreakpointContext';
|
|
20
|
+
function $893a66ba513f4a66$export$8214320346cf5104(props) {
|
|
21
|
+
let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
|
|
22
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($OaNl0$react))).createElement($893a66ba513f4a66$var$Context.Provider, {
|
|
23
|
+
value: {
|
|
24
|
+
matchedBreakpoints: matchedBreakpoints
|
|
25
|
+
}
|
|
26
|
+
}, children);
|
|
27
|
+
}
|
|
28
|
+
function $893a66ba513f4a66$export$140ae7baa51cca23(breakpoints) {
|
|
29
|
+
let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
|
|
30
|
+
let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
|
|
31
|
+
let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
32
|
+
let getBreakpointHandler = ()=>{
|
|
33
|
+
let matched = [];
|
|
34
|
+
for(let i in breakpointQueries){
|
|
35
|
+
let query = breakpointQueries[i];
|
|
36
|
+
if (window.matchMedia(query).matches) matched.push(entries[i][0]);
|
|
37
|
+
}
|
|
38
|
+
matched.push('base');
|
|
39
|
+
return matched;
|
|
40
|
+
};
|
|
41
|
+
let [breakpoint, setBreakpoint] = (0, $OaNl0$react.useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
|
|
42
|
+
'base'
|
|
43
|
+
]);
|
|
44
|
+
(0, $OaNl0$react.useEffect)(()=>{
|
|
45
|
+
if (!supportsMatchMedia) return;
|
|
46
|
+
let onResize = ()=>{
|
|
47
|
+
const breakpointHandler = getBreakpointHandler();
|
|
48
|
+
setBreakpoint((previousBreakpointHandler)=>{
|
|
49
|
+
if (previousBreakpointHandler.length !== breakpointHandler.length || previousBreakpointHandler.some((breakpoint, idx)=>breakpoint !== breakpointHandler[idx])) return [
|
|
50
|
+
...breakpointHandler
|
|
51
|
+
]; // Return a new array to force state change
|
|
52
|
+
return previousBreakpointHandler;
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
window.addEventListener('resize', onResize);
|
|
56
|
+
return ()=>{
|
|
57
|
+
window.removeEventListener('resize', onResize);
|
|
58
|
+
};
|
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
+
}, [
|
|
61
|
+
supportsMatchMedia
|
|
62
|
+
]);
|
|
63
|
+
// If in SSR, the media query should never match. Once the page hydrates,
|
|
64
|
+
// this will update and the real value will be returned.
|
|
65
|
+
let isSSR = (0, $OaNl0$reactariassr.useIsSSR)();
|
|
66
|
+
return isSSR ? [
|
|
67
|
+
'base'
|
|
68
|
+
] : breakpoint;
|
|
69
|
+
}
|
|
70
|
+
function $893a66ba513f4a66$export$199d6754bdf4e1e3() {
|
|
71
|
+
return (0, $OaNl0$react.useContext)($893a66ba513f4a66$var$Context);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=BreakpointProvider.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAM,8CAAU,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAoB;AACvD,8BAAQ,WAAW,GAAG;AAOf,SAAS,0CAAmB,KAA8B;IAC/D,IAAI,YACF,QAAQ,sBACR,kBAAkB,EACnB,GAAG;IACJ,qBACE,0DAAC,8BAAQ,QAAQ;QACf,OAAO;gCAAC;QAAkB;OACzB;AAGP;AAEO,SAAS,0CAAsB,WAAwB;IAC5D,IAAI,UAAU,OAAO,OAAO,CAAC,aAAa,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,GAAK,SAAS;IACpF,IAAI,oBAAoB,QAAQ,GAAG,CAAC,CAAC,GAAG,MAAM,GAAK,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC;IAE5E,IAAI,qBAAqB,OAAO,WAAW,eAAe,OAAO,OAAO,UAAU,KAAK;IACvF,IAAI,uBAAuB;QACzB,IAAI,UAAU,EAAE;QAChB,IAAK,IAAI,KAAK,kBAAmB;YAC/B,IAAI,QAAQ,iBAAiB,CAAC,EAAE;YAChC,IAAI,OAAO,UAAU,CAAC,OAAO,OAAO,EAClC,QAAQ,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QAE9B;QACA,QAAQ,IAAI,CAAC;QACb,OAAO;IACT;IAEA,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,qBAAO,EAAE,IACzC,qBACI,yBACA;YAAC;SAAO;IAGd,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,CAAC,oBACH;QAGF,IAAI,WAAW;YACb,MAAM,oBAAoB;YAE1B,cAAc,CAAA;gBACZ,IAAI,0BAA0B,MAAM,KAAK,kBAAkB,MAAM,IAC/D,0BAA0B,IAAI,CAAC,CAAC,YAAY,MAAQ,eAAe,iBAAiB,CAAC,IAAI,GACzF,OAAO;uBAAI;iBAAkB,EAAE,2CAA2C;gBAG5E,OAAO;YACT;QACF;QAEA,OAAO,gBAAgB,CAAC,UAAU;QAClC,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU;QACvC;IACF,uDAAuD;IACvD,GAAG;QAAC;KAAmB;IAEvB,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,OAAO,QAAQ;QAAC;KAAO,GAAG;AAC5B;AAEO,SAAS;IACd,OAAO,CAAA,GAAA,uBAAS,EAAE;AACpB","sources":["packages/@react-spectrum/utils/src/BreakpointProvider.tsx"],"sourcesContent":["import React, {ReactNode, useContext, useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\ninterface Breakpoints {\n S?: number,\n M?: number,\n L?: number,\n [custom: string]: number | undefined\n}\n\ninterface BreakpointContext {\n matchedBreakpoints: string[]\n}\n\nconst Context = React.createContext<BreakpointContext>(null);\nContext.displayName = 'BreakpointContext';\n\ninterface BreakpointProviderProps {\n children?: ReactNode,\n matchedBreakpoints: string[]\n}\n\nexport function BreakpointProvider(props: BreakpointProviderProps) {\n let {\n children,\n matchedBreakpoints\n } = props;\n return (\n <Context.Provider\n value={{matchedBreakpoints}} >\n {children}\n </Context.Provider>\n );\n}\n\nexport function useMatchedBreakpoints(breakpoints: Breakpoints): string[] {\n let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB]) => valueB - valueA);\n let breakpointQueries = entries.map(([, value]) => `(min-width: ${value}px)`);\n\n let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n let getBreakpointHandler = () => {\n let matched = [];\n for (let i in breakpointQueries) {\n let query = breakpointQueries[i];\n if (window.matchMedia(query).matches) {\n matched.push(entries[i][0]);\n }\n }\n matched.push('base');\n return matched;\n };\n\n let [breakpoint, setBreakpoint] = useState(() =>\n supportsMatchMedia\n ? getBreakpointHandler()\n : ['base']\n );\n\n useEffect(() => {\n if (!supportsMatchMedia) {\n return;\n }\n\n let onResize = () => {\n const breakpointHandler = getBreakpointHandler();\n\n setBreakpoint(previousBreakpointHandler => {\n if (previousBreakpointHandler.length !== breakpointHandler.length ||\n previousBreakpointHandler.some((breakpoint, idx) => breakpoint !== breakpointHandler[idx])) {\n return [...breakpointHandler]; // Return a new array to force state change\n }\n\n return previousBreakpointHandler;\n });\n };\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [supportsMatchMedia]);\n\n // If in SSR, the media query should never match. Once the page hydrates,\n // this will update and the real value will be returned.\n let isSSR = useIsSSR();\n return isSSR ? ['base'] : breakpoint;\n}\n\nexport function useBreakpoint(): BreakpointContext {\n return useContext(Context);\n}\n"],"names":[],"version":3,"file":"BreakpointProvider.main.js.map"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import $9wJsi$react, {useState as $9wJsi$useState, useEffect as $9wJsi$useEffect, useContext as $9wJsi$useContext} from "react";
|
|
2
|
+
import {useIsSSR as $9wJsi$useIsSSR} from "@react-aria/ssr";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const $1051245f87c5981d$var$Context = /*#__PURE__*/ (0, $9wJsi$react).createContext(null);
|
|
7
|
+
$1051245f87c5981d$var$Context.displayName = 'BreakpointContext';
|
|
8
|
+
function $1051245f87c5981d$export$8214320346cf5104(props) {
|
|
9
|
+
let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
|
|
10
|
+
return /*#__PURE__*/ (0, $9wJsi$react).createElement($1051245f87c5981d$var$Context.Provider, {
|
|
11
|
+
value: {
|
|
12
|
+
matchedBreakpoints: matchedBreakpoints
|
|
13
|
+
}
|
|
14
|
+
}, children);
|
|
15
|
+
}
|
|
16
|
+
function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
17
|
+
let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
|
|
18
|
+
let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
|
|
19
|
+
let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
20
|
+
let getBreakpointHandler = ()=>{
|
|
21
|
+
let matched = [];
|
|
22
|
+
for(let i in breakpointQueries){
|
|
23
|
+
let query = breakpointQueries[i];
|
|
24
|
+
if (window.matchMedia(query).matches) matched.push(entries[i][0]);
|
|
25
|
+
}
|
|
26
|
+
matched.push('base');
|
|
27
|
+
return matched;
|
|
28
|
+
};
|
|
29
|
+
let [breakpoint, setBreakpoint] = (0, $9wJsi$useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
|
|
30
|
+
'base'
|
|
31
|
+
]);
|
|
32
|
+
(0, $9wJsi$useEffect)(()=>{
|
|
33
|
+
if (!supportsMatchMedia) return;
|
|
34
|
+
let onResize = ()=>{
|
|
35
|
+
const breakpointHandler = getBreakpointHandler();
|
|
36
|
+
setBreakpoint((previousBreakpointHandler)=>{
|
|
37
|
+
if (previousBreakpointHandler.length !== breakpointHandler.length || previousBreakpointHandler.some((breakpoint, idx)=>breakpoint !== breakpointHandler[idx])) return [
|
|
38
|
+
...breakpointHandler
|
|
39
|
+
]; // Return a new array to force state change
|
|
40
|
+
return previousBreakpointHandler;
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
window.addEventListener('resize', onResize);
|
|
44
|
+
return ()=>{
|
|
45
|
+
window.removeEventListener('resize', onResize);
|
|
46
|
+
};
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [
|
|
49
|
+
supportsMatchMedia
|
|
50
|
+
]);
|
|
51
|
+
// If in SSR, the media query should never match. Once the page hydrates,
|
|
52
|
+
// this will update and the real value will be returned.
|
|
53
|
+
let isSSR = (0, $9wJsi$useIsSSR)();
|
|
54
|
+
return isSSR ? [
|
|
55
|
+
'base'
|
|
56
|
+
] : breakpoint;
|
|
57
|
+
}
|
|
58
|
+
function $1051245f87c5981d$export$199d6754bdf4e1e3() {
|
|
59
|
+
return (0, $9wJsi$useContext)($1051245f87c5981d$var$Context);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export {$1051245f87c5981d$export$8214320346cf5104 as BreakpointProvider, $1051245f87c5981d$export$140ae7baa51cca23 as useMatchedBreakpoints, $1051245f87c5981d$export$199d6754bdf4e1e3 as useBreakpoint};
|
|
64
|
+
//# sourceMappingURL=BreakpointProvider.module.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import $9wJsi$react, {useState as $9wJsi$useState, useEffect as $9wJsi$useEffect, useContext as $9wJsi$useContext} from "react";
|
|
2
|
+
import {useIsSSR as $9wJsi$useIsSSR} from "@react-aria/ssr";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const $1051245f87c5981d$var$Context = /*#__PURE__*/ (0, $9wJsi$react).createContext(null);
|
|
7
|
+
$1051245f87c5981d$var$Context.displayName = 'BreakpointContext';
|
|
8
|
+
function $1051245f87c5981d$export$8214320346cf5104(props) {
|
|
9
|
+
let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
|
|
10
|
+
return /*#__PURE__*/ (0, $9wJsi$react).createElement($1051245f87c5981d$var$Context.Provider, {
|
|
11
|
+
value: {
|
|
12
|
+
matchedBreakpoints: matchedBreakpoints
|
|
13
|
+
}
|
|
14
|
+
}, children);
|
|
15
|
+
}
|
|
16
|
+
function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
17
|
+
let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
|
|
18
|
+
let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
|
|
19
|
+
let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
20
|
+
let getBreakpointHandler = ()=>{
|
|
21
|
+
let matched = [];
|
|
22
|
+
for(let i in breakpointQueries){
|
|
23
|
+
let query = breakpointQueries[i];
|
|
24
|
+
if (window.matchMedia(query).matches) matched.push(entries[i][0]);
|
|
25
|
+
}
|
|
26
|
+
matched.push('base');
|
|
27
|
+
return matched;
|
|
28
|
+
};
|
|
29
|
+
let [breakpoint, setBreakpoint] = (0, $9wJsi$useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
|
|
30
|
+
'base'
|
|
31
|
+
]);
|
|
32
|
+
(0, $9wJsi$useEffect)(()=>{
|
|
33
|
+
if (!supportsMatchMedia) return;
|
|
34
|
+
let onResize = ()=>{
|
|
35
|
+
const breakpointHandler = getBreakpointHandler();
|
|
36
|
+
setBreakpoint((previousBreakpointHandler)=>{
|
|
37
|
+
if (previousBreakpointHandler.length !== breakpointHandler.length || previousBreakpointHandler.some((breakpoint, idx)=>breakpoint !== breakpointHandler[idx])) return [
|
|
38
|
+
...breakpointHandler
|
|
39
|
+
]; // Return a new array to force state change
|
|
40
|
+
return previousBreakpointHandler;
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
window.addEventListener('resize', onResize);
|
|
44
|
+
return ()=>{
|
|
45
|
+
window.removeEventListener('resize', onResize);
|
|
46
|
+
};
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [
|
|
49
|
+
supportsMatchMedia
|
|
50
|
+
]);
|
|
51
|
+
// If in SSR, the media query should never match. Once the page hydrates,
|
|
52
|
+
// this will update and the real value will be returned.
|
|
53
|
+
let isSSR = (0, $9wJsi$useIsSSR)();
|
|
54
|
+
return isSSR ? [
|
|
55
|
+
'base'
|
|
56
|
+
] : breakpoint;
|
|
57
|
+
}
|
|
58
|
+
function $1051245f87c5981d$export$199d6754bdf4e1e3() {
|
|
59
|
+
return (0, $9wJsi$useContext)($1051245f87c5981d$var$Context);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export {$1051245f87c5981d$export$8214320346cf5104 as BreakpointProvider, $1051245f87c5981d$export$140ae7baa51cca23 as useMatchedBreakpoints, $1051245f87c5981d$export$199d6754bdf4e1e3 as useBreakpoint};
|
|
64
|
+
//# sourceMappingURL=BreakpointProvider.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;AAcA,MAAM,8CAAU,CAAA,GAAA,YAAI,EAAE,aAAa,CAAoB;AACvD,8BAAQ,WAAW,GAAG;AAOf,SAAS,0CAAmB,KAA8B;IAC/D,IAAI,YACF,QAAQ,sBACR,kBAAkB,EACnB,GAAG;IACJ,qBACE,gCAAC,8BAAQ,QAAQ;QACf,OAAO;gCAAC;QAAkB;OACzB;AAGP;AAEO,SAAS,0CAAsB,WAAwB;IAC5D,IAAI,UAAU,OAAO,OAAO,CAAC,aAAa,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,GAAK,SAAS;IACpF,IAAI,oBAAoB,QAAQ,GAAG,CAAC,CAAC,GAAG,MAAM,GAAK,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC;IAE5E,IAAI,qBAAqB,OAAO,WAAW,eAAe,OAAO,OAAO,UAAU,KAAK;IACvF,IAAI,uBAAuB;QACzB,IAAI,UAAU,EAAE;QAChB,IAAK,IAAI,KAAK,kBAAmB;YAC/B,IAAI,QAAQ,iBAAiB,CAAC,EAAE;YAChC,IAAI,OAAO,UAAU,CAAC,OAAO,OAAO,EAClC,QAAQ,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QAE9B;QACA,QAAQ,IAAI,CAAC;QACb,OAAO;IACT;IAEA,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,eAAO,EAAE,IACzC,qBACI,yBACA;YAAC;SAAO;IAGd,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAC,oBACH;QAGF,IAAI,WAAW;YACb,MAAM,oBAAoB;YAE1B,cAAc,CAAA;gBACZ,IAAI,0BAA0B,MAAM,KAAK,kBAAkB,MAAM,IAC/D,0BAA0B,IAAI,CAAC,CAAC,YAAY,MAAQ,eAAe,iBAAiB,CAAC,IAAI,GACzF,OAAO;uBAAI;iBAAkB,EAAE,2CAA2C;gBAG5E,OAAO;YACT;QACF;QAEA,OAAO,gBAAgB,CAAC,UAAU;QAClC,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU;QACvC;IACF,uDAAuD;IACvD,GAAG;QAAC;KAAmB;IAEvB,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,OAAO,QAAQ;QAAC;KAAO,GAAG;AAC5B;AAEO,SAAS;IACd,OAAO,CAAA,GAAA,iBAAS,EAAE;AACpB","sources":["packages/@react-spectrum/utils/src/BreakpointProvider.tsx"],"sourcesContent":["import React, {ReactNode, useContext, useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\ninterface Breakpoints {\n S?: number,\n M?: number,\n L?: number,\n [custom: string]: number | undefined\n}\n\ninterface BreakpointContext {\n matchedBreakpoints: string[]\n}\n\nconst Context = React.createContext<BreakpointContext>(null);\nContext.displayName = 'BreakpointContext';\n\ninterface BreakpointProviderProps {\n children?: ReactNode,\n matchedBreakpoints: string[]\n}\n\nexport function BreakpointProvider(props: BreakpointProviderProps) {\n let {\n children,\n matchedBreakpoints\n } = props;\n return (\n <Context.Provider\n value={{matchedBreakpoints}} >\n {children}\n </Context.Provider>\n );\n}\n\nexport function useMatchedBreakpoints(breakpoints: Breakpoints): string[] {\n let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB]) => valueB - valueA);\n let breakpointQueries = entries.map(([, value]) => `(min-width: ${value}px)`);\n\n let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n let getBreakpointHandler = () => {\n let matched = [];\n for (let i in breakpointQueries) {\n let query = breakpointQueries[i];\n if (window.matchMedia(query).matches) {\n matched.push(entries[i][0]);\n }\n }\n matched.push('base');\n return matched;\n };\n\n let [breakpoint, setBreakpoint] = useState(() =>\n supportsMatchMedia\n ? getBreakpointHandler()\n : ['base']\n );\n\n useEffect(() => {\n if (!supportsMatchMedia) {\n return;\n }\n\n let onResize = () => {\n const breakpointHandler = getBreakpointHandler();\n\n setBreakpoint(previousBreakpointHandler => {\n if (previousBreakpointHandler.length !== breakpointHandler.length ||\n previousBreakpointHandler.some((breakpoint, idx) => breakpoint !== breakpointHandler[idx])) {\n return [...breakpointHandler]; // Return a new array to force state change\n }\n\n return previousBreakpointHandler;\n });\n };\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [supportsMatchMedia]);\n\n // If in SSR, the media query should never match. Once the page hydrates,\n // this will update and the real value will be returned.\n let isSSR = useIsSSR();\n return isSSR ? ['base'] : breakpoint;\n}\n\nexport function useBreakpoint(): BreakpointContext {\n return useContext(Context);\n}\n"],"names":[],"version":3,"file":"BreakpointProvider.module.js.map"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
let { [slot]: slotProps = {} } = (0, $iTRw5$react.useContext)($e81916440cf6fd84$var$SlotContext) || {};
|
|
33
|
+
return (0, $iTRw5$reactariautils.mergeProps)(props, (0, $iTRw5$reactariautils.mergeProps)(slotProps, {
|
|
34
|
+
id: props.id
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
function $e81916440cf6fd84$export$365cf34cda9978e2(cssModule) {
|
|
38
|
+
return Object.keys(cssModule).reduce((acc, slot)=>{
|
|
39
|
+
acc[slot] = {
|
|
40
|
+
UNSAFE_className: cssModule[slot]
|
|
41
|
+
};
|
|
42
|
+
return acc;
|
|
43
|
+
}, {});
|
|
44
|
+
}
|
|
45
|
+
function $e81916440cf6fd84$export$8107b24b91795686(props) {
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
+
let parentSlots = (0, $iTRw5$react.useContext)($e81916440cf6fd84$var$SlotContext) || {};
|
|
48
|
+
let { slots: slots = {}, children: children } = props;
|
|
49
|
+
// Merge props for each slot from parent context and props
|
|
50
|
+
let value = (0, $iTRw5$react.useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
|
|
51
|
+
...o,
|
|
52
|
+
[p]: (0, $iTRw5$reactariautils.mergeProps)(parentSlots[p] || {}, slots[p] || {})
|
|
53
|
+
}), {}), [
|
|
54
|
+
parentSlots,
|
|
55
|
+
slots
|
|
56
|
+
]);
|
|
57
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
|
|
58
|
+
value: value
|
|
59
|
+
}, children);
|
|
60
|
+
}
|
|
61
|
+
function $e81916440cf6fd84$export$ceb145244332b7a2(props) {
|
|
62
|
+
let { children: children, ...otherProps } = props;
|
|
63
|
+
let content = children;
|
|
64
|
+
if ((0, ($parcel$interopDefault($iTRw5$react))).Children.toArray(children).length <= 1) {
|
|
65
|
+
if (typeof children === 'function') content = /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).cloneElement((0, ($parcel$interopDefault($iTRw5$react))).Children.only(children), otherProps);
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
|
|
68
|
+
value: {}
|
|
69
|
+
}, content);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=Slots.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AASD,IAAI,kDAAc,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAC;AAE/B,SAAS,0CAAgB,KAAwB,EAAE,WAAoB;IAC5E,IAAI,OAAO,AAAC,MAAoB,IAAI,IAAI;IACxC,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,SAAS;IACxC,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,KAAK;IAChC,uDAAuD;IACvD,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,sCAAgB,CAAC;IAC9C,IAAI,SAAC,QAAQ,CAAC,aAAG,QAAQ,EAAC,GAAG;IAE7B,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,KAAK;IAC9B,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAChC,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,CAAC;OAC3B;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, {useContext, useMemo} from 'react';\n\ninterface SlotProps {\n slot?: string\n}\n\nlet SlotContext = React.createContext(null);\n\nexport function useSlotProps<T>(props: T & {id?: string}, defaultSlot?: string): T {\n let slot = (props as SlotProps).slot || defaultSlot;\n let {[slot]: slotProps = {}} = useContext(SlotContext) || {};\n\n return mergeProps(props, mergeProps(slotProps, {id: props.id}));\n}\n\nexport function cssModuleToSlots(cssModule) {\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) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n let parentSlots = useContext(SlotContext) || {};\n let {slots = {}, 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) {\n let {children, ...otherProps} = props;\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={{}}>\n {content}\n </SlotContext.Provider>\n );\n}\n"],"names":[],"version":3,"file":"Slots.main.js.map"}
|
package/dist/Slots.mjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
let { [slot]: slotProps = {} } = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {};
|
|
20
|
+
return (0, $doF98$mergeProps)(props, (0, $doF98$mergeProps)(slotProps, {
|
|
21
|
+
id: props.id
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
function $59d09bcc83651bf9$export$365cf34cda9978e2(cssModule) {
|
|
25
|
+
return Object.keys(cssModule).reduce((acc, slot)=>{
|
|
26
|
+
acc[slot] = {
|
|
27
|
+
UNSAFE_className: cssModule[slot]
|
|
28
|
+
};
|
|
29
|
+
return acc;
|
|
30
|
+
}, {});
|
|
31
|
+
}
|
|
32
|
+
function $59d09bcc83651bf9$export$8107b24b91795686(props) {
|
|
33
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
+
let parentSlots = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {};
|
|
35
|
+
let { slots: slots = {}, children: children } = props;
|
|
36
|
+
// Merge props for each slot from parent context and props
|
|
37
|
+
let value = (0, $doF98$useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
|
|
38
|
+
...o,
|
|
39
|
+
[p]: (0, $doF98$mergeProps)(parentSlots[p] || {}, slots[p] || {})
|
|
40
|
+
}), {}), [
|
|
41
|
+
parentSlots,
|
|
42
|
+
slots
|
|
43
|
+
]);
|
|
44
|
+
return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
|
|
45
|
+
value: value
|
|
46
|
+
}, children);
|
|
47
|
+
}
|
|
48
|
+
function $59d09bcc83651bf9$export$ceb145244332b7a2(props) {
|
|
49
|
+
let { children: children, ...otherProps } = props;
|
|
50
|
+
let content = children;
|
|
51
|
+
if ((0, $doF98$react).Children.toArray(children).length <= 1) {
|
|
52
|
+
if (typeof children === 'function') content = /*#__PURE__*/ (0, $doF98$react).cloneElement((0, $doF98$react).Children.only(children), otherProps);
|
|
53
|
+
}
|
|
54
|
+
return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
|
|
55
|
+
value: {}
|
|
56
|
+
}, content);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export {$59d09bcc83651bf9$export$1e5c9e6e4e15efe3 as useSlotProps, $59d09bcc83651bf9$export$365cf34cda9978e2 as cssModuleToSlots, $59d09bcc83651bf9$export$8107b24b91795686 as SlotProvider, $59d09bcc83651bf9$export$ceb145244332b7a2 as ClearSlots};
|
|
61
|
+
//# sourceMappingURL=Slots.module.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
let { [slot]: slotProps = {} } = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {};
|
|
20
|
+
return (0, $doF98$mergeProps)(props, (0, $doF98$mergeProps)(slotProps, {
|
|
21
|
+
id: props.id
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
function $59d09bcc83651bf9$export$365cf34cda9978e2(cssModule) {
|
|
25
|
+
return Object.keys(cssModule).reduce((acc, slot)=>{
|
|
26
|
+
acc[slot] = {
|
|
27
|
+
UNSAFE_className: cssModule[slot]
|
|
28
|
+
};
|
|
29
|
+
return acc;
|
|
30
|
+
}, {});
|
|
31
|
+
}
|
|
32
|
+
function $59d09bcc83651bf9$export$8107b24b91795686(props) {
|
|
33
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
+
let parentSlots = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {};
|
|
35
|
+
let { slots: slots = {}, children: children } = props;
|
|
36
|
+
// Merge props for each slot from parent context and props
|
|
37
|
+
let value = (0, $doF98$useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
|
|
38
|
+
...o,
|
|
39
|
+
[p]: (0, $doF98$mergeProps)(parentSlots[p] || {}, slots[p] || {})
|
|
40
|
+
}), {}), [
|
|
41
|
+
parentSlots,
|
|
42
|
+
slots
|
|
43
|
+
]);
|
|
44
|
+
return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
|
|
45
|
+
value: value
|
|
46
|
+
}, children);
|
|
47
|
+
}
|
|
48
|
+
function $59d09bcc83651bf9$export$ceb145244332b7a2(props) {
|
|
49
|
+
let { children: children, ...otherProps } = props;
|
|
50
|
+
let content = children;
|
|
51
|
+
if ((0, $doF98$react).Children.toArray(children).length <= 1) {
|
|
52
|
+
if (typeof children === 'function') content = /*#__PURE__*/ (0, $doF98$react).cloneElement((0, $doF98$react).Children.only(children), otherProps);
|
|
53
|
+
}
|
|
54
|
+
return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
|
|
55
|
+
value: {}
|
|
56
|
+
}, content);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export {$59d09bcc83651bf9$export$1e5c9e6e4e15efe3 as useSlotProps, $59d09bcc83651bf9$export$365cf34cda9978e2 as cssModuleToSlots, $59d09bcc83651bf9$export$8107b24b91795686 as SlotProvider, $59d09bcc83651bf9$export$ceb145244332b7a2 as ClearSlots};
|
|
61
|
+
//# sourceMappingURL=Slots.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AASD,IAAI,kDAAc,CAAA,GAAA,YAAI,EAAE,aAAa,CAAC;AAE/B,SAAS,0CAAgB,KAAwB,EAAE,WAAoB;IAC5E,IAAI,OAAO,AAAC,MAAoB,IAAI,IAAI;IACxC,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,SAAS;IACxC,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,KAAK;IAChC,uDAAuD;IACvD,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,sCAAgB,CAAC;IAC9C,IAAI,SAAC,QAAQ,CAAC,aAAG,QAAQ,EAAC,GAAG;IAE7B,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,KAAK;IAC9B,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAChC,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,CAAC;OAC3B;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, {useContext, useMemo} from 'react';\n\ninterface SlotProps {\n slot?: string\n}\n\nlet SlotContext = React.createContext(null);\n\nexport function useSlotProps<T>(props: T & {id?: string}, defaultSlot?: string): T {\n let slot = (props as SlotProps).slot || defaultSlot;\n let {[slot]: slotProps = {}} = useContext(SlotContext) || {};\n\n return mergeProps(props, mergeProps(slotProps, {id: props.id}));\n}\n\nexport function cssModuleToSlots(cssModule) {\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) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n let parentSlots = useContext(SlotContext) || {};\n let {slots = {}, 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) {\n let {children, ...otherProps} = props;\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={{}}>\n {content}\n </SlotContext.Provider>\n );\n}\n"],"names":[],"version":3,"file":"Slots.module.js.map"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,IAAI,4CAA+B;AAEnC,SAAS;IACd,4CAA+B;IAC/B,QAAQ,IAAI,CACV;AAIJ;AAEO,SAAS,0CAAW,SAAkC,EAAE,GAAG,MAA0C;IAC1G,IAAI,UAAU,EAAE;IAChB,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() {\n shouldKeepSpectrumClassNames = true;\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\nexport function classNames(cssModule: {[key: string]: string}, ...values: Array<string | Object | undefined>): string {\n let classes = [];\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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
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
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,IAAI,4CAA+B;AAEnC,SAAS;IACd,4CAA+B;IAC/B,QAAQ,IAAI,CACV;AAIJ;AAEO,SAAS,0CAAW,SAAkC,EAAE,GAAG,MAA0C;IAC1G,IAAI,UAAU,EAAE;IAChB,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() {\n shouldKeepSpectrumClassNames = true;\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\nexport function classNames(cssModule: {[key: string]: string}, ...values: Array<string | Object | undefined>): string {\n let classes = [];\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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|