@react-native-aria/focus 0.2.5 → 0.2.6
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/lib/commonjs/FocusScope.js.map +1 -1
- package/lib/commonjs/FocusScope.web.js +21 -6
- package/lib/commonjs/FocusScope.web.js.map +1 -1
- package/lib/module/FocusScope.js.map +1 -1
- package/lib/module/FocusScope.web.js +18 -1
- package/lib/module/FocusScope.web.js.map +1 -1
- package/lib/typescript/FocusScope.d.ts +1 -2
- package/lib/typescript/FocusScope.web.d.ts +4 -1
- package/package.json +1 -1
- package/src/FocusScope.tsx +1 -1
- package/src/FocusScope.web.tsx +18 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["FocusScope.tsx"],"names":["FocusScope","props","children","useFocusManager"],"mappings":";;;;;;;;AAAA;;;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAT,CAAoBC,KAApB,EAA4C;AACjD,sBAAO,6BAAC,cAAD,CAAO,QAAP,QAAiBA,KAAK,CAACC,QAAvB,CAAP;AACD,C,CAED;;;AACO,MAAMC,eAAe,GAAG,MAAM,CAAE,CAAhC","sourcesContent":["import React, { ReactNode } from 'react';\n\
|
1
|
+
{"version":3,"sources":["FocusScope.tsx"],"names":["FocusScope","props","children","useFocusManager"],"mappings":";;;;;;;;AAAA;;;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAT,CAAoBC,KAApB,EAA4C;AACjD,sBAAO,6BAAC,cAAD,CAAO,QAAP,QAAiBA,KAAK,CAACC,QAAvB,CAAP;AACD,C,CAED;;;AACO,MAAMC,eAAe,GAAG,MAAM,CAAE,CAAhC","sourcesContent":["import React, { ReactNode } from 'react';\n\nexport interface FocusScopeProps {\n /** The contents of the focus scope. */\n children: ReactNode;\n\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean;\n\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean;\n\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean;\n}\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport function FocusScope(props: FocusScopeProps) {\n return <React.Fragment>{props.children}</React.Fragment>;\n}\n\n// Noop - Implement this for mac and windows\nexport const useFocusManager = () => {};\n"]}
|
@@ -3,18 +3,33 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "FocusScope", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _focus.FocusScope;
|
10
|
-
}
|
11
|
-
});
|
12
6
|
Object.defineProperty(exports, "useFocusManager", {
|
13
7
|
enumerable: true,
|
14
8
|
get: function () {
|
15
9
|
return _focus.useFocusManager;
|
16
10
|
}
|
17
11
|
});
|
12
|
+
exports.FocusScope = void 0;
|
13
|
+
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
18
15
|
|
19
16
|
var _focus = require("@react-aria/focus");
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
21
|
+
|
22
|
+
const FocusScope = ({
|
23
|
+
children,
|
24
|
+
contain,
|
25
|
+
...props
|
26
|
+
}) => {
|
27
|
+
/* Todo: stoping mounted and unMounted everytime contain is change */
|
28
|
+
if (contain === false) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_focus.FocusScope, _extends({
|
30
|
+
contain: contain
|
31
|
+
}, props), children);
|
32
|
+
};
|
33
|
+
|
34
|
+
exports.FocusScope = FocusScope;
|
20
35
|
//# sourceMappingURL=FocusScope.web.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["FocusScope.web.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["FocusScope.web.tsx"],"names":["FocusScope","children","contain","props"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;;;;;AAKA,MAAMA,UAAU,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,OAAZ;AAAqB,KAAGC;AAAxB,CAAD,KAAsD;AACvE;AACA,MAAID,OAAO,KAAK,KAAhB,EAAuB,oBAAO,2DAAP;AAEvB,sBACE,6BAAC,iBAAD;AAAgB,IAAA,OAAO,EAAEA;AAAzB,KAAsCC,KAAtC,GACGF,QADH,CADF;AAKD,CATD","sourcesContent":["import React from 'react';\nimport {\n FocusScope as AriaFocusScope,\n useFocusManager,\n} from '@react-aria/focus';\nimport type { FocusScopeProps } from './FocusScope';\nconst FocusScope = ({ children, contain, ...props }: FocusScopeProps) => {\n /* Todo: stoping mounted and unMounted everytime contain is change */\n if (contain === false) return <></>;\n\n return (\n <AriaFocusScope contain={contain} {...props}>\n {children}\n </AriaFocusScope>\n );\n};\n\nexport { FocusScope, useFocusManager };\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["FocusScope.tsx"],"names":["React","FocusScope","props","children","useFocusManager"],"mappings":"AAAA,OAAOA,KAAP,MAAiC,OAAjC;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAT,CAAoBC,KAApB,EAA4C;AACjD,sBAAO,oBAAC,KAAD,CAAO,QAAP,QAAiBA,KAAK,CAACC,QAAvB,CAAP;AACD,C,CAED;;AACA,OAAO,MAAMC,eAAe,GAAG,MAAM,CAAE,CAAhC","sourcesContent":["import React, { ReactNode } from 'react';\n\
|
1
|
+
{"version":3,"sources":["FocusScope.tsx"],"names":["React","FocusScope","props","children","useFocusManager"],"mappings":"AAAA,OAAOA,KAAP,MAAiC,OAAjC;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAT,CAAoBC,KAApB,EAA4C;AACjD,sBAAO,oBAAC,KAAD,CAAO,QAAP,QAAiBA,KAAK,CAACC,QAAvB,CAAP;AACD,C,CAED;;AACA,OAAO,MAAMC,eAAe,GAAG,MAAM,CAAE,CAAhC","sourcesContent":["import React, { ReactNode } from 'react';\n\nexport interface FocusScopeProps {\n /** The contents of the focus scope. */\n children: ReactNode;\n\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean;\n\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean;\n\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean;\n}\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport function FocusScope(props: FocusScopeProps) {\n return <React.Fragment>{props.children}</React.Fragment>;\n}\n\n// Noop - Implement this for mac and windows\nexport const useFocusManager = () => {};\n"]}
|
@@ -1,2 +1,19 @@
|
|
1
|
-
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
import React from 'react';
|
4
|
+
import { FocusScope as AriaFocusScope, useFocusManager } from '@react-aria/focus';
|
5
|
+
|
6
|
+
const FocusScope = ({
|
7
|
+
children,
|
8
|
+
contain,
|
9
|
+
...props
|
10
|
+
}) => {
|
11
|
+
/* Todo: stoping mounted and unMounted everytime contain is change */
|
12
|
+
if (contain === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
13
|
+
return /*#__PURE__*/React.createElement(AriaFocusScope, _extends({
|
14
|
+
contain: contain
|
15
|
+
}, props), children);
|
16
|
+
};
|
17
|
+
|
18
|
+
export { FocusScope, useFocusManager };
|
2
19
|
//# sourceMappingURL=FocusScope.web.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["FocusScope.web.tsx"],"names":["FocusScope","useFocusManager"],"mappings":"AAAA,
|
1
|
+
{"version":3,"sources":["FocusScope.web.tsx"],"names":["React","FocusScope","AriaFocusScope","useFocusManager","children","contain","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,UAAU,IAAIC,cADhB,EAEEC,eAFF,QAGO,mBAHP;;AAKA,MAAMF,UAAU,GAAG,CAAC;AAAEG,EAAAA,QAAF;AAAYC,EAAAA,OAAZ;AAAqB,KAAGC;AAAxB,CAAD,KAAsD;AACvE;AACA,MAAID,OAAO,KAAK,KAAhB,EAAuB,oBAAO,yCAAP;AAEvB,sBACE,oBAAC,cAAD;AAAgB,IAAA,OAAO,EAAEA;AAAzB,KAAsCC,KAAtC,GACGF,QADH,CADF;AAKD,CATD;;AAWA,SAASH,UAAT,EAAqBE,eAArB","sourcesContent":["import React from 'react';\nimport {\n FocusScope as AriaFocusScope,\n useFocusManager,\n} from '@react-aria/focus';\nimport type { FocusScopeProps } from './FocusScope';\nconst FocusScope = ({ children, contain, ...props }: FocusScopeProps) => {\n /* Todo: stoping mounted and unMounted everytime contain is change */\n if (contain === false) return <></>;\n\n return (\n <AriaFocusScope contain={contain} {...props}>\n {children}\n </AriaFocusScope>\n );\n};\n\nexport { FocusScope, useFocusManager };\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
interface FocusScopeProps {
|
2
|
+
export interface FocusScopeProps {
|
3
3
|
/** The contents of the focus scope. */
|
4
4
|
children: ReactNode;
|
5
5
|
/**
|
@@ -24,4 +24,3 @@ interface FocusScopeProps {
|
|
24
24
|
*/
|
25
25
|
export declare function FocusScope(props: FocusScopeProps): JSX.Element;
|
26
26
|
export declare const useFocusManager: () => void;
|
27
|
-
export {};
|
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
import { useFocusManager } from '@react-aria/focus';
|
2
|
+
import type { FocusScopeProps } from './FocusScope';
|
3
|
+
declare const FocusScope: ({ children, contain, ...props }: FocusScopeProps) => JSX.Element;
|
4
|
+
export { FocusScope, useFocusManager };
|
package/package.json
CHANGED
package/src/FocusScope.tsx
CHANGED
package/src/FocusScope.web.tsx
CHANGED
@@ -1 +1,18 @@
|
|
1
|
-
|
1
|
+
import React from 'react';
|
2
|
+
import {
|
3
|
+
FocusScope as AriaFocusScope,
|
4
|
+
useFocusManager,
|
5
|
+
} from '@react-aria/focus';
|
6
|
+
import type { FocusScopeProps } from './FocusScope';
|
7
|
+
const FocusScope = ({ children, contain, ...props }: FocusScopeProps) => {
|
8
|
+
/* Todo: stoping mounted and unMounted everytime contain is change */
|
9
|
+
if (contain === false) return <></>;
|
10
|
+
|
11
|
+
return (
|
12
|
+
<AriaFocusScope contain={contain} {...props}>
|
13
|
+
{children}
|
14
|
+
</AriaFocusScope>
|
15
|
+
);
|
16
|
+
};
|
17
|
+
|
18
|
+
export { FocusScope, useFocusManager };
|