@react-native-aria/focus 0.2.7 → 0.2.8-alpha.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.
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  FocusScope: true,
8
- useFocusManager: true
8
+ useFocusManager: true,
9
+ useFocus: true
9
10
  };
10
11
  Object.defineProperty(exports, "FocusScope", {
11
12
  enumerable: true,
@@ -19,6 +20,12 @@ Object.defineProperty(exports, "useFocusManager", {
19
20
  return _FocusScope.useFocusManager;
20
21
  }
21
22
  });
23
+ Object.defineProperty(exports, "useFocus", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return _useFocus.useFocus;
27
+ }
28
+ });
22
29
 
23
30
  var _useFocusRing = require("./useFocusRing");
24
31
 
@@ -35,4 +42,6 @@ Object.keys(_useFocusRing).forEach(function (key) {
35
42
  });
36
43
 
37
44
  var _FocusScope = require("./FocusScope");
45
+
46
+ var _useFocus = require("./useFocus");
38
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA","sourcesContent":["export * from './useFocusRing';\nexport { FocusScope, useFocusManager } from './FocusScope';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA","sourcesContent":["export * from './useFocusRing';\nexport { FocusScope, useFocusManager } from './FocusScope';\nexport { useFocus } from './useFocus';\n"]}
@@ -21,8 +21,16 @@ Object.defineProperty(exports, "useFocusManager", {
21
21
  return _FocusScope.useFocusManager;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "useFocus", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _useFocus.useFocus;
28
+ }
29
+ });
24
30
 
25
31
  var _useFocusRing = require("./useFocusRing.web");
26
32
 
27
33
  var _FocusScope = require("./FocusScope.web");
34
+
35
+ var _useFocus = require("./useFocus");
28
36
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { useFocusRing } from './useFocusRing.web';\nexport { FocusScope } from './FocusScope.web';\nexport { useFocusManager } from './FocusScope.web';\n"]}
1
+ {"version":3,"sources":["index.web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA","sourcesContent":["export { useFocusRing } from './useFocusRing.web';\nexport { FocusScope } from './FocusScope.web';\nexport { useFocusManager } from './FocusScope.web';\nexport { useFocus } from './useFocus';\n"]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useFocus = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ const useFocus = () => {
11
+ const [isFocused, setFocused] = (0, _react.useState)(false);
12
+ return {
13
+ focusProps: {
14
+ onFocus: () => setFocused(true),
15
+ onBlur: () => setFocused(false)
16
+ },
17
+ isFocused
18
+ };
19
+ };
20
+
21
+ exports.useFocus = useFocus;
22
+ //# sourceMappingURL=useFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useFocus.ts"],"names":["useFocus","isFocused","setFocused","focusProps","onFocus","onBlur"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,QAAQ,GAAG,MAAM;AAC5B,QAAM,CAACC,SAAD,EAAYC,UAAZ,IAA0B,qBAAS,KAAT,CAAhC;AACA,SAAO;AACLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,OAAO,EAAE,MAAMF,UAAU,CAAC,IAAD,CADf;AAEVG,MAAAA,MAAM,EAAE,MAAMH,UAAU,CAAC,KAAD;AAFd,KADP;AAKLD,IAAAA;AALK,GAAP;AAOD,CATM","sourcesContent":["import { useState } from 'react';\n\nexport const useFocus = () => {\n const [isFocused, setFocused] = useState(false);\n return {\n focusProps: {\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n },\n isFocused,\n };\n};\n"]}
@@ -1,3 +1,4 @@
1
1
  export * from './useFocusRing';
2
2
  export { FocusScope, useFocusManager } from './FocusScope';
3
+ export { useFocus } from './useFocus';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["FocusScope","useFocusManager"],"mappings":"AAAA,cAAc,gBAAd;AACA,SAASA,UAAT,EAAqBC,eAArB,QAA4C,cAA5C","sourcesContent":["export * from './useFocusRing';\nexport { FocusScope, useFocusManager } from './FocusScope';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["FocusScope","useFocusManager","useFocus"],"mappings":"AAAA,cAAc,gBAAd;AACA,SAASA,UAAT,EAAqBC,eAArB,QAA4C,cAA5C;AACA,SAASC,QAAT,QAAyB,YAAzB","sourcesContent":["export * from './useFocusRing';\nexport { FocusScope, useFocusManager } from './FocusScope';\nexport { useFocus } from './useFocus';\n"]}
@@ -1,4 +1,5 @@
1
1
  export { useFocusRing } from './useFocusRing.web';
2
2
  export { FocusScope } from './FocusScope.web';
3
3
  export { useFocusManager } from './FocusScope.web';
4
+ export { useFocus } from './useFocus';
4
5
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.web.ts"],"names":["useFocusRing","FocusScope","useFocusManager"],"mappings":"AAAA,SAASA,YAAT,QAA6B,oBAA7B;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,eAAT,QAAgC,kBAAhC","sourcesContent":["export { useFocusRing } from './useFocusRing.web';\nexport { FocusScope } from './FocusScope.web';\nexport { useFocusManager } from './FocusScope.web';\n"]}
1
+ {"version":3,"sources":["index.web.ts"],"names":["useFocusRing","FocusScope","useFocusManager","useFocus"],"mappings":"AAAA,SAASA,YAAT,QAA6B,oBAA7B;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,eAAT,QAAgC,kBAAhC;AACA,SAASC,QAAT,QAAyB,YAAzB","sourcesContent":["export { useFocusRing } from './useFocusRing.web';\nexport { FocusScope } from './FocusScope.web';\nexport { useFocusManager } from './FocusScope.web';\nexport { useFocus } from './useFocus';\n"]}
@@ -0,0 +1,12 @@
1
+ import { useState } from 'react';
2
+ export const useFocus = () => {
3
+ const [isFocused, setFocused] = useState(false);
4
+ return {
5
+ focusProps: {
6
+ onFocus: () => setFocused(true),
7
+ onBlur: () => setFocused(false)
8
+ },
9
+ isFocused
10
+ };
11
+ };
12
+ //# sourceMappingURL=useFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useFocus.ts"],"names":["useState","useFocus","isFocused","setFocused","focusProps","onFocus","onBlur"],"mappings":"AAAA,SAASA,QAAT,QAAyB,OAAzB;AAEA,OAAO,MAAMC,QAAQ,GAAG,MAAM;AAC5B,QAAM,CAACC,SAAD,EAAYC,UAAZ,IAA0BH,QAAQ,CAAC,KAAD,CAAxC;AACA,SAAO;AACLI,IAAAA,UAAU,EAAE;AACVC,MAAAA,OAAO,EAAE,MAAMF,UAAU,CAAC,IAAD,CADf;AAEVG,MAAAA,MAAM,EAAE,MAAMH,UAAU,CAAC,KAAD;AAFd,KADP;AAKLD,IAAAA;AALK,GAAP;AAOD,CATM","sourcesContent":["import { useState } from 'react';\n\nexport const useFocus = () => {\n const [isFocused, setFocused] = useState(false);\n return {\n focusProps: {\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n },\n isFocused,\n };\n};\n"]}
@@ -1,2 +1,3 @@
1
1
  export * from './useFocusRing';
2
2
  export { FocusScope, useFocusManager } from './FocusScope';
3
+ export { useFocus } from './useFocus';
@@ -1,3 +1,4 @@
1
1
  export { useFocusRing } from './useFocusRing.web';
2
2
  export { FocusScope } from './FocusScope.web';
3
3
  export { useFocusManager } from './FocusScope.web';
4
+ export { useFocus } from './useFocus';
@@ -0,0 +1,7 @@
1
+ export declare const useFocus: () => {
2
+ focusProps: {
3
+ onFocus: () => void;
4
+ onBlur: () => void;
5
+ };
6
+ isFocused: boolean;
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-aria/focus",
3
- "version": "0.2.7",
3
+ "version": "0.2.8-alpha.0",
4
4
  "description": "mono repo setup with bob",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './useFocusRing';
2
2
  export { FocusScope, useFocusManager } from './FocusScope';
3
+ export { useFocus } from './useFocus';
package/src/index.web.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { useFocusRing } from './useFocusRing.web';
2
2
  export { FocusScope } from './FocusScope.web';
3
3
  export { useFocusManager } from './FocusScope.web';
4
+ export { useFocus } from './useFocus';
@@ -0,0 +1,12 @@
1
+ import { useState } from 'react';
2
+
3
+ export const useFocus = () => {
4
+ const [isFocused, setFocused] = useState(false);
5
+ return {
6
+ focusProps: {
7
+ onFocus: () => setFocused(true),
8
+ onBlur: () => setFocused(false),
9
+ },
10
+ isFocused,
11
+ };
12
+ };