@react-stately/tabs 3.0.0-rc.0 → 3.0.3

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/main.js CHANGED
@@ -1,36 +1,53 @@
1
- var {
2
- useEffect
3
- } = require("react");
1
+ var $2jh56$reactstatelylist = require("@react-stately/list");
2
+ var $2jh56$react = require("react");
4
3
 
5
- var {
6
- useSingleSelectListState
7
- } = require("@react-stately/list");
4
+ function $parcel$exportWildcard(dest, source) {
5
+ Object.keys(source).forEach(function(key) {
6
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
7
+ return;
8
+ }
8
9
 
9
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
10
+ Object.defineProperty(dest, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return source[key];
14
+ }
15
+ });
16
+ });
10
17
 
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
18
+ return dest;
19
+ }
20
+ function $parcel$export(e, n, v, s) {
21
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
22
  }
23
+ var $c990352501f33d9e$exports = {};
14
24
 
15
- function useTabListState(props) {
16
- let state = useSingleSelectListState(_babelRuntimeHelpersExtends({}, props, {
17
- suppressTextValueWarning: true
18
- }));
19
- useEffect(() => {
20
- // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)
21
- let selectedKey = state.selectedKey;
22
-
23
- if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {
24
- selectedKey = state.collection.getFirstKey();
25
- state.selectionManager.replaceSelection(selectedKey);
26
- }
25
+ $parcel$export($c990352501f33d9e$exports, "useTabListState", () => $c990352501f33d9e$export$4ba071daf4e486);
27
26
 
28
- if (state.selectionManager.focusedKey == null) {
29
- state.selectionManager.setFocusedKey(selectedKey);
30
- }
31
- }, [state.selectionManager, state.selectedKey, state.collection]);
32
- return state;
27
+
28
+ function $c990352501f33d9e$export$4ba071daf4e486(props) {
29
+ let state = $2jh56$reactstatelylist.useSingleSelectListState({
30
+ ...props,
31
+ suppressTextValueWarning: true
32
+ });
33
+ $2jh56$react.useEffect(()=>{
34
+ // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)
35
+ let selectedKey = state.selectedKey;
36
+ if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {
37
+ selectedKey = state.collection.getFirstKey();
38
+ state.selectionManager.replaceSelection(selectedKey);
39
+ }
40
+ if (state.selectionManager.focusedKey == null) state.selectionManager.setFocusedKey(selectedKey);
41
+ }, [
42
+ state.selectionManager,
43
+ state.selectedKey,
44
+ state.collection
45
+ ]);
46
+ return state;
33
47
  }
34
48
 
35
- exports.useTabListState = useTabListState;
49
+
50
+ $parcel$exportWildcard(module.exports, $c990352501f33d9e$exports);
51
+
52
+
36
53
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;ACgBM,SAASG,eAAT,CAA2CC,KAA3C,EAAoF;AACzF,MAAIC,KAAK,GAAGC,wBAAwB,iCAC/BF,KAD+B;AAElCG,IAAAA,wBAAwB,EAAE;AAFQ,KAApC;AAKAC,EAAAA,SAAS,CAAC,MAAM;AACd;AACA,QAAIC,WAAW,GAAGJ,KAAK,CAACI,WAAxB;;AACA,QAAIJ,KAAK,CAACK,gBAAN,CAAuBC,OAAvB,IAAkC,CAACN,KAAK,CAACO,UAAN,CAAiBC,OAAjB,CAAyBJ,WAAzB,CAAvC,EAA8E;AAC5EA,MAAAA,WAAW,GAAGJ,KAAK,CAACO,UAAN,CAAiBE,WAAjB,EAAd;AACAT,MAAAA,KAAK,CAACK,gBAAN,CAAuBK,gBAAvB,CAAwCN,WAAxC;AACD;;AAED,QAAIJ,KAAK,CAACK,gBAAN,CAAuBM,UAAvB,IAAqC,IAAzC,EAA+C;AAC7CX,MAAAA,KAAK,CAACK,gBAAN,CAAuBO,aAAvB,CAAqCR,WAArC;AACD;AACF,GAXQ,EAWN,CAACJ,KAAK,CAACK,gBAAP,EAAyBL,KAAK,CAACI,WAA/B,EAA4CJ,KAAK,CAACO,UAAlD,CAXM,CAAT;AAaA,SAAOP,KAAP;AACD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-stately/tabs/src/useTabsState.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","/*\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 {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {TabListProps} from '@react-types/tabs';\nimport {useEffect} from 'react';\n\nexport interface TabListState<T> extends SingleSelectListState<T> {}\n\nexport function useTabListState<T extends object>(props: TabListProps<T>): TabListState<T> {\n let state = useSingleSelectListState<T>({\n ...props,\n suppressTextValueWarning: true\n });\n\n useEffect(() => {\n // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)\n let selectedKey = state.selectedKey;\n if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {\n selectedKey = state.collection.getFirstKey();\n state.selectionManager.replaceSelection(selectedKey);\n }\n\n if (state.selectionManager.focusedKey == null) {\n state.selectionManager.setFocusedKey(selectedKey);\n }\n }, [state.selectionManager, state.selectedKey, state.collection]);\n\n return state;\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","useTabListState","props","state","useSingleSelectListState","suppressTextValueWarning","useEffect","selectedKey","selectionManager","isEmpty","collection","getItem","getFirstKey","replaceSelection","focusedKey","setFocusedKey"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;SCuBgB,uCAAe,CAAmB,KAAsB,EAAmB,CAAC;IAC1F,GAAG,CAAC,KAAK,GAAG,gDAAwB,CAAI,CAAC;WACpC,KAAK;QACR,wBAAwB,EAAE,IAAI;IAChC,CAAC;IAED,sBAAS,KAAO,CAAC;QACf,EAA0H,AAA1H,wHAA0H;QAC1H,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW;QACnC,EAAE,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,KAAK,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,CAAC;YAC7E,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW;YAC1C,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,WAAW;QACrD,CAAC;QAED,EAAE,EAAE,KAAK,CAAC,gBAAgB,CAAC,UAAU,IAAI,IAAI,EAC3C,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,WAAW;IAEpD,CAAC,EAAE,CAAC;QAAA,KAAK,CAAC,gBAAgB;QAAE,KAAK,CAAC,WAAW;QAAE,KAAK,CAAC,UAAU;IAAA,CAAC;IAEhE,MAAM,CAAC,KAAK;AACd,CAAC","sources":["packages/@react-stately/tabs/src/index.ts","packages/@react-stately/tabs/src/useTabListState.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\nexport * from './useTabListState';\n","/*\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 {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {TabListProps} from '@react-types/tabs';\nimport {useEffect} from 'react';\n\n\nexport interface TabListState<T> extends SingleSelectListState<T> {}\n\n/**\n * Provides state management for a Tabs component. Tabs include a TabList which tracks\n * which tab is currently selected and displays the content associated with that Tab in a TabPanel.\n */\nexport function useTabListState<T extends object>(props: TabListProps<T>): TabListState<T> {\n let state = useSingleSelectListState<T>({\n ...props,\n suppressTextValueWarning: true\n });\n\n useEffect(() => {\n // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)\n let selectedKey = state.selectedKey;\n if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {\n selectedKey = state.collection.getFirstKey();\n state.selectionManager.replaceSelection(selectedKey);\n }\n\n if (state.selectionManager.focusedKey == null) {\n state.selectionManager.setFocusedKey(selectedKey);\n }\n }, [state.selectionManager, state.selectedKey, state.collection]);\n\n return state;\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,23 +1,37 @@
1
- import { useEffect } from "react";
2
- import { useSingleSelectListState } from "@react-stately/list";
3
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
4
- export function useTabListState(props) {
5
- let state = useSingleSelectListState(_babelRuntimeHelpersEsmExtends({}, props, {
6
- suppressTextValueWarning: true
7
- }));
8
- useEffect(() => {
9
- // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)
10
- let selectedKey = state.selectedKey;
11
-
12
- if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {
13
- selectedKey = state.collection.getFirstKey();
14
- state.selectionManager.replaceSelection(selectedKey);
15
- }
16
-
17
- if (state.selectionManager.focusedKey == null) {
18
- state.selectionManager.setFocusedKey(selectedKey);
19
- }
20
- }, [state.selectionManager, state.selectedKey, state.collection]);
21
- return state;
1
+ import {useSingleSelectListState as $a9c3b$useSingleSelectListState} from "@react-stately/list";
2
+ import {useEffect as $a9c3b$useEffect} from "react";
3
+
4
+ function $parcel$export(e, n, v, s) {
5
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
+ }
7
+ var $ead76093e5740fb6$exports = {};
8
+
9
+ $parcel$export($ead76093e5740fb6$exports, "useTabListState", () => $ead76093e5740fb6$export$4ba071daf4e486);
10
+
11
+
12
+ function $ead76093e5740fb6$export$4ba071daf4e486(props) {
13
+ let state = $a9c3b$useSingleSelectListState({
14
+ ...props,
15
+ suppressTextValueWarning: true
16
+ });
17
+ $a9c3b$useEffect(()=>{
18
+ // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)
19
+ let selectedKey = state.selectedKey;
20
+ if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {
21
+ selectedKey = state.collection.getFirstKey();
22
+ state.selectionManager.replaceSelection(selectedKey);
23
+ }
24
+ if (state.selectionManager.focusedKey == null) state.selectionManager.setFocusedKey(selectedKey);
25
+ }, [
26
+ state.selectionManager,
27
+ state.selectedKey,
28
+ state.collection
29
+ ]);
30
+ return state;
22
31
  }
32
+
33
+
34
+
35
+
36
+ export {$ead76093e5740fb6$export$4ba071daf4e486 as useTabListState};
23
37
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;OAkBO,SAASA,eAAT,CAA2CC,KAA3C,EAAoF;AACzF,MAAIC,KAAK,GAAGC,wBAAwB,oCAC/BF,KAD+B;AAElCG,IAAAA,wBAAwB,EAAE;AAFQ,KAApC;AAKAC,EAAAA,SAAS,CAAC,MAAM;AACd;AACA,QAAIC,WAAW,GAAGJ,KAAK,CAACI,WAAxB;;AACA,QAAIJ,KAAK,CAACK,gBAAN,CAAuBC,OAAvB,IAAkC,CAACN,KAAK,CAACO,UAAN,CAAiBC,OAAjB,CAAyBJ,WAAzB,CAAvC,EAA8E;AAC5EA,MAAAA,WAAW,GAAGJ,KAAK,CAACO,UAAN,CAAiBE,WAAjB,EAAd;AACAT,MAAAA,KAAK,CAACK,gBAAN,CAAuBK,gBAAvB,CAAwCN,WAAxC;AACD;;AAED,QAAIJ,KAAK,CAACK,gBAAN,CAAuBM,UAAvB,IAAqC,IAAzC,EAA+C;AAC7CX,MAAAA,KAAK,CAACK,gBAAN,CAAuBO,aAAvB,CAAqCR,WAArC;AACD;AACF,GAXQ,EAWN,CAACJ,KAAK,CAACK,gBAAP,EAAyBL,KAAK,CAACI,WAA/B,EAA4CJ,KAAK,CAACO,UAAlD,CAXM,CAAT;AAaA,SAAOP,KAAP;AACD","sources":["./packages/@react-stately/tabs/src/useTabsState.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 {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {TabListProps} from '@react-types/tabs';\nimport {useEffect} from 'react';\n\nexport interface TabListState<T> extends SingleSelectListState<T> {}\n\nexport function useTabListState<T extends object>(props: TabListProps<T>): TabListState<T> {\n let state = useSingleSelectListState<T>({\n ...props,\n suppressTextValueWarning: true\n });\n\n useEffect(() => {\n // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)\n let selectedKey = state.selectedKey;\n if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {\n selectedKey = state.collection.getFirstKey();\n state.selectionManager.replaceSelection(selectedKey);\n }\n\n if (state.selectionManager.focusedKey == null) {\n state.selectionManager.setFocusedKey(selectedKey);\n }\n }, [state.selectionManager, state.selectedKey, state.collection]);\n\n return state;\n}\n"],"names":["useTabListState","props","state","useSingleSelectListState","suppressTextValueWarning","useEffect","selectedKey","selectionManager","isEmpty","collection","getItem","getFirstKey","replaceSelection","focusedKey","setFocusedKey"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;SCuBgB,uCAAe,CAAmB,KAAsB,EAAmB,CAAC;IAC1F,GAAG,CAAC,KAAK,GAAG,+BAAwB,CAAI,CAAC;WACpC,KAAK;QACR,wBAAwB,EAAE,IAAI;IAChC,CAAC;IAED,gBAAS,KAAO,CAAC;QACf,EAA0H,AAA1H,wHAA0H;QAC1H,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW;QACnC,EAAE,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,KAAK,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,CAAC;YAC7E,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW;YAC1C,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,WAAW;QACrD,CAAC;QAED,EAAE,EAAE,KAAK,CAAC,gBAAgB,CAAC,UAAU,IAAI,IAAI,EAC3C,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,WAAW;IAEpD,CAAC,EAAE,CAAC;QAAA,KAAK,CAAC,gBAAgB;QAAE,KAAK,CAAC,WAAW;QAAE,KAAK,CAAC,UAAU;IAAA,CAAC;IAEhE,MAAM,CAAC,KAAK;AACd,CAAC","sources":["packages/@react-stately/tabs/src/index.ts","packages/@react-stately/tabs/src/useTabListState.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\nexport * from './useTabListState';\n","/*\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 {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {TabListProps} from '@react-types/tabs';\nimport {useEffect} from 'react';\n\n\nexport interface TabListState<T> extends SingleSelectListState<T> {}\n\n/**\n * Provides state management for a Tabs component. Tabs include a TabList which tracks\n * which tab is currently selected and displays the content associated with that Tab in a TabPanel.\n */\nexport function useTabListState<T extends object>(props: TabListProps<T>): TabListState<T> {\n let state = useSingleSelectListState<T>({\n ...props,\n suppressTextValueWarning: true\n });\n\n useEffect(() => {\n // Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)\n let selectedKey = state.selectedKey;\n if (state.selectionManager.isEmpty || !state.collection.getItem(selectedKey)) {\n selectedKey = state.collection.getFirstKey();\n state.selectionManager.replaceSelection(selectedKey);\n }\n\n if (state.selectionManager.focusedKey == null) {\n state.selectionManager.setFocusedKey(selectedKey);\n }\n }, [state.selectionManager, state.selectedKey, state.collection]);\n\n return state;\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -2,6 +2,10 @@ import { SingleSelectListState } from "@react-stately/list";
2
2
  import { TabListProps } from "@react-types/tabs";
3
3
  export interface TabListState<T> extends SingleSelectListState<T> {
4
4
  }
5
+ /**
6
+ * Provides state management for a Tabs component. Tabs include a TabList which tracks
7
+ * which tab is currently selected and displays the content associated with that Tab in a TabPanel.
8
+ */
5
9
  export function useTabListState<T extends object>(props: TabListProps<T>): TabListState<T>;
6
10
 
7
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":"A;A;AAgBA,8BAA8B,CAAC,CAAE,SAAQ,sBAAsB,CAAC,CAAC;CAAG;AAEpE,gCAAgC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAoBzF","sources":["./packages/@react-stately/tabs/src/packages/@react-stately/tabs/src/useTabsState.ts","./packages/@react-stately/tabs/src/packages/@react-stately/tabs/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAiBA,8BAA8B,CAAC,CAAE,SAAQ,sBAAsB,CAAC,CAAC;CAAG;AAEpE;;;GAGG;AACH,gCAAgC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAoBzF","sources":["packages/@react-stately/tabs/src/packages/@react-stately/tabs/src/useTabListState.ts","packages/@react-stately/tabs/src/packages/@react-stately/tabs/src/index.ts","packages/@react-stately/tabs/src/index.ts"],"sourcesContent":[null,null,"/*\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\nexport * from './useTabListState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/tabs",
3
- "version": "3.0.0-rc.0",
3
+ "version": "3.0.3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-stately/list": "^3.2.3",
22
- "@react-stately/utils": "^3.2.1",
23
- "@react-types/tabs": "3.0.0-rc.0"
21
+ "@react-stately/list": "^3.4.3",
22
+ "@react-stately/utils": "^3.4.1",
23
+ "@react-types/tabs": "^3.0.3"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -28,5 +28,5 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "3aae08e7d8a75382bedcddac7c86107e40db9296"
31
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
32
32
  }
package/src/index.ts CHANGED
@@ -3,11 +3,11 @@
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
6
+ *
7
7
  * Unless required by applicable law or agreed to in writing, software distributed under
8
8
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export * from './useTabsState';
13
+ export * from './useTabListState';
@@ -14,8 +14,13 @@ import {SingleSelectListState, useSingleSelectListState} from '@react-stately/li
14
14
  import {TabListProps} from '@react-types/tabs';
15
15
  import {useEffect} from 'react';
16
16
 
17
+
17
18
  export interface TabListState<T> extends SingleSelectListState<T> {}
18
19
 
20
+ /**
21
+ * Provides state management for a Tabs component. Tabs include a TabList which tracks
22
+ * which tab is currently selected and displays the content associated with that Tab in a TabPanel.
23
+ */
19
24
  export function useTabListState<T extends object>(props: TabListProps<T>): TabListState<T> {
20
25
  let state = useSingleSelectListState<T>({
21
26
  ...props,