@react-stately/select 3.3.4-nightly.3596 → 3.3.4-nightly.3598

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.
@@ -34,4 +34,4 @@ function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
34
34
 
35
35
 
36
36
  export {$2bc3a590c5373a4e$export$5159ec8b34d4ec12 as useSelectState};
37
- //# sourceMappingURL=module.js.map
37
+ //# sourceMappingURL=module.mjs.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;SC8BgB,yCAAc,CAAmB,KAAqB,EAAmB,CAAC;IACxF,GAAG,CAAC,YAAY,GAAG,0BAAmB,CAAC,KAAK;IAC5C,GAAG,CAAC,SAAS,GAAG,+BAAwB,CAAC,CAAC;WACrC,KAAK;QACR,iBAAiB,GAAG,GAAG,GAAK,CAAC;YAC3B,EAAE,EAAE,KAAK,CAAC,iBAAiB,IAAI,IAAI,EACjC,KAAK,CAAC,iBAAiB,CAAC,GAAG;YAG7B,YAAY,CAAC,KAAK;QACpB,CAAC;IACH,CAAC;IAED,GAAG,EAAE,SAAS,EAAE,UAAU,IAAI,eAAQ,CAAC,KAAK;IAE5C,MAAM,CAAC,CAAC;WACH,SAAS;WACT,YAAY;QACf,IAAI,IAAG,CAAC;YACN,EAAyC,AAAzC,uCAAyC;YACzC,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EACjC,YAAY,CAAC,IAAI;QAErB,CAAC;QACD,MAAM,EAAC,aAAa,EAAE,CAAC;YACrB,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EACjC,YAAY,CAAC,MAAM,CAAC,aAAa;QAErC,CAAC;mBACD,SAAS;oBACT,UAAU;IACZ,CAAC;AACH,CAAC","sources":["packages/@react-stately/select/src/index.ts","packages/@react-stately/select/src/useSelectState.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 {useSelectState} from './useSelectState';\n\nexport type {SelectProps} from '@react-types/select';\nexport type {SelectState} from './useSelectState';\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 {MenuTriggerState, useMenuTriggerState} from '@react-stately/menu';\nimport {SelectProps} from '@react-types/select';\nimport {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {useState} from 'react';\n\nexport interface SelectState<T> extends SingleSelectListState<T>, MenuTriggerState {\n /** Whether the select is currently focused. */\n readonly isFocused: boolean,\n\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void\n}\n\n/**\n * Provides state management for a select component. Handles building a collection\n * of items from props, handles the open state for the popup menu, and manages\n * multiple selection state.\n */\nexport function useSelectState<T extends object>(props: SelectProps<T>): SelectState<T> {\n let triggerState = useMenuTriggerState(props);\n let listState = useSingleSelectListState({\n ...props,\n onSelectionChange: (key) => {\n if (props.onSelectionChange != null) {\n props.onSelectionChange(key);\n }\n\n triggerState.close();\n }\n });\n\n let [isFocused, setFocused] = useState(false);\n\n return {\n ...listState,\n ...triggerState,\n open() {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0) {\n triggerState.open();\n }\n },\n toggle(focusStrategy) {\n if (listState.collection.size !== 0) {\n triggerState.toggle(focusStrategy);\n }\n },\n isFocused,\n setFocused\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;SC8BgB,yCAAc,CAAmB,KAAqB,EAAmB,CAAC;IACxF,GAAG,CAAC,YAAY,GAAG,0BAAmB,CAAC,KAAK;IAC5C,GAAG,CAAC,SAAS,GAAG,+BAAwB,CAAC,CAAC;WACrC,KAAK;QACR,iBAAiB,GAAG,GAAG,GAAK,CAAC;YAC3B,EAAE,EAAE,KAAK,CAAC,iBAAiB,IAAI,IAAI,EACjC,KAAK,CAAC,iBAAiB,CAAC,GAAG;YAG7B,YAAY,CAAC,KAAK;QACpB,CAAC;IACH,CAAC;IAED,GAAG,EAAE,SAAS,EAAE,UAAU,IAAI,eAAQ,CAAC,KAAK;IAE5C,MAAM,CAAC,CAAC;WACH,SAAS;WACT,YAAY;QACf,IAAI,IAAG,CAAC;YACN,EAAyC,AAAzC,uCAAyC;YACzC,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EACjC,YAAY,CAAC,IAAI;QAErB,CAAC;QACD,MAAM,EAAC,aAAa,EAAE,CAAC;YACrB,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EACjC,YAAY,CAAC,MAAM,CAAC,aAAa;QAErC,CAAC;mBACD,SAAS;oBACT,UAAU;IACZ,CAAC;AACH,CAAC","sources":["packages/@react-stately/select/src/index.ts","packages/@react-stately/select/src/useSelectState.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 {useSelectState} from './useSelectState';\n\nexport type {SelectProps} from '@react-types/select';\nexport type {SelectState} from './useSelectState';\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 {MenuTriggerState, useMenuTriggerState} from '@react-stately/menu';\nimport {SelectProps} from '@react-types/select';\nimport {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {useState} from 'react';\n\nexport interface SelectState<T> extends SingleSelectListState<T>, MenuTriggerState {\n /** Whether the select is currently focused. */\n readonly isFocused: boolean,\n\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void\n}\n\n/**\n * Provides state management for a select component. Handles building a collection\n * of items from props, handles the open state for the popup menu, and manages\n * multiple selection state.\n */\nexport function useSelectState<T extends object>(props: SelectProps<T>): SelectState<T> {\n let triggerState = useMenuTriggerState(props);\n let listState = useSingleSelectListState({\n ...props,\n onSelectionChange: (key) => {\n if (props.onSelectionChange != null) {\n props.onSelectionChange(key);\n }\n\n triggerState.close();\n }\n });\n\n let [isFocused, setFocused] = useState(false);\n\n return {\n ...listState,\n ...triggerState,\n open() {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0) {\n triggerState.open();\n }\n },\n toggle(focusStrategy) {\n if (listState.collection.size !== 0) {\n triggerState.toggle(focusStrategy);\n }\n },\n isFocused,\n setFocused\n };\n}\n"],"names":[],"version":3,"file":"module.mjs.map"}
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-stately/select",
3
- "version": "3.3.4-nightly.3596+09c71dd74",
3
+ "version": "3.3.4-nightly.3598+810579b67",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
- "module": "dist/module.js",
7
+ "module": "dist/module.mjs",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/module.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -18,13 +23,13 @@
18
23
  },
19
24
  "dependencies": {
20
25
  "@babel/runtime": "^7.6.2",
21
- "@react-stately/collections": "3.0.0-nightly.1896+09c71dd74",
22
- "@react-stately/list": "3.6.1-nightly.3596+09c71dd74",
23
- "@react-stately/menu": "3.4.4-nightly.3596+09c71dd74",
24
- "@react-stately/selection": "3.0.0-nightly.1896+09c71dd74",
25
- "@react-stately/utils": "3.0.0-nightly.1896+09c71dd74",
26
- "@react-types/select": "3.6.6-nightly.3596+09c71dd74",
27
- "@react-types/shared": "3.0.0-nightly.1896+09c71dd74"
26
+ "@react-stately/collections": "3.0.0-nightly.1898+810579b67",
27
+ "@react-stately/list": "3.6.1-nightly.3598+810579b67",
28
+ "@react-stately/menu": "3.4.4-nightly.3598+810579b67",
29
+ "@react-stately/selection": "3.0.0-nightly.1898+810579b67",
30
+ "@react-stately/utils": "3.0.0-nightly.1898+810579b67",
31
+ "@react-types/select": "3.6.6-nightly.3598+810579b67",
32
+ "@react-types/shared": "3.0.0-nightly.1898+810579b67"
28
33
  },
29
34
  "peerDependencies": {
30
35
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
@@ -32,5 +37,5 @@
32
37
  "publishConfig": {
33
38
  "access": "public"
34
39
  },
35
- "gitHead": "09c71dd74a438b918a35eeecd307ae1fbaa28784"
40
+ "gitHead": "810579b671791f1593108f62cdc1893de3a220e3"
36
41
  }