@react-spectrum/accordion 3.0.0-alpha.2 → 3.0.0-alpha.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
@@ -24,6 +24,7 @@ var _react2 = require("react");
24
24
  var _react = $parcel$interopDefault(_react2);
25
25
 
26
26
  var {
27
+ forwardRef,
27
28
  useRef
28
29
  } = _react2;
29
30
 
@@ -144,7 +145,6 @@ function $be7b8672a8bbdf8d3fdb2b9fe3226e$var$AccordionItem(props) {
144
145
  }), item.props.children));
145
146
  }
146
147
 
147
- const Accordion = /*#__PURE__*/_react.forwardRef($be7b8672a8bbdf8d3fdb2b9fe3226e$var$Accordion);
148
-
148
+ const Accordion = /*#__PURE__*/forwardRef($be7b8672a8bbdf8d3fdb2b9fe3226e$var$Accordion);
149
149
  exports.Accordion = Accordion;
150
150
  //# 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;;;;ACFD,4CAAiB;AACf,wBAAsB,2BADP;AAEf,sCAAoC,yCAFrB;AAGf,6BAA2B,gCAHZ;AAIf,oCAAkC,uCAJnB;AAKf,mCAAiC,sCALlB;AAMf,oCAAkC,uCANnB;AAOf,aAAW,gBAPI;AAQf,iBAAe,oBARA;AASf,gBAAc,mBATC;AAUf,gBAAc;AAVC,CAAjB;;;AC4BA,SAASG,6CAAT,CAAqCC,KAArC,EAAuEC,GAAvE,EAAoG;AAClGD,EAAAA,KAAK,GAAGE,gBAAgB,CAACF,KAAD,CAAxB;AACA,MAAIG,KAAK,GAAGC,YAAY,CAAIJ,KAAJ,CAAxB;AACA,MAA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AAI;AAACK,IAAAA;AAAD,MAAcC,SAAS,EAA3B;AAEA,sBACE;AACE,IAAA,SAAS,EAAEpB,UAAU,qDAAS,yBAAT,EAAoC;AACvD,iBAAWW,MAD4C;AAEvD,qBAAeG;AAFwC,KAApC;AADvB,kBAKE;AAAI,IAAA,SAAS,EAAEd,UAAU,qDAAS,gCAAT;AAAzB,kBACE,qBAAC,SAAD;AAAW,IAAA,MAAM,MAAjB;AAAkB,IAAA,cAAc,EAAEA,UAAU,qDAAS,YAAT;AAA5C,kBACE,+DACMqB,UAAU,CAACb,WAAD,EAAcS,UAAd,CADhB;AAEE,IAAA,GAAG,EAAE5B,GAFP;AAGE,IAAA,SAAS,EAAEW,UAAU,qDAAS,+BAAT,EAA0C;AAC7D,oBAAcgB;AAD+C,KAA1C;AAHvB,MAMGG,SAAS,KAAK,KAAd,gBACC,qBAAC,kCAAD;AACE,mBAAY,MADd;AAEE,IAAA,gBAAgB,EAAEnB,UAAU,qDAAS,kCAAT;AAF9B,IADD,gBAKG,qBAAC,iCAAD;AACE,mBAAY,MADd;AAEE,IAAA,gBAAgB,EAAEA,UAAU,qDAAS,kCAAT;AAF9B,IAXN,EAeGI,IAAI,CAAChB,KAAL,CAAWkC,KAfd,CADF,CADF,CALF,eA0BE,4DAASb,WAAT;AAAsB,IAAA,SAAS,EAAET,UAAU,qDAAS,gCAAT;AAA3C,MACGI,IAAI,CAAChB,KAAL,CAAWmC,QADd,CA1BF,CADF;AAgCD;;AAED,MAAMC,SAAU,gBAAGC,MAAK,CAACC,UAAN,CAAiBvC,6CAAjB,CAAnB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/accordion/vars.css","./packages/@react-spectrum/accordion/src/Accordion.tsx"],"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\n@import './index.css';\n@import './skin.css';\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 ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {useRef} from 'react';\nimport {SpectrumAccordionProps} from '@react-types/accordion';\nimport styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';\nimport {TreeState, useTreeState} from '@react-stately/tree';\nimport {useAccordion, useAccordionItem} from '@react-aria/accordion';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Accordion<T extends object>(props: SpectrumAccordionProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let state = useTreeState<T>(props);\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let {accordionProps} = useAccordion(props, state, domRef);\n\n return (\n <div\n {...filterDOMProps(props)}\n {...accordionProps}\n {...styleProps}\n ref={domRef}\n className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>\n {[...state.collection].map(item => (\n <AccordionItem<T> key={item.key} item={item} state={state} />\n ))}\n </div>\n );\n}\n\ninterface AccordionItemProps<T> {\n item: Node<T>,\n state: TreeState<T>\n}\n\nfunction AccordionItem<T>(props: AccordionItemProps<T>) {\n props = useProviderProps(props);\n let ref = useRef<HTMLButtonElement>();\n let {state, item} = props;\n let {buttonProps, regionProps} = useAccordionItem<T>(props, state, ref);\n let isOpen = state.expandedKeys.has(item.key);\n let isDisabled = state.disabledKeys.has(item.key);\n let {isHovered, hoverProps} = useHover({isDisabled});\n let {direction} = useLocale();\n\n return (\n <div\n className={classNames(styles, 'spectrum-Accordion-item', {\n 'is-open': isOpen,\n 'is-disabled': isDisabled\n })}>\n <h3 className={classNames(styles, 'spectrum-Accordion-itemHeading')}>\n <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>\n <button\n {...mergeProps(buttonProps, hoverProps)}\n ref={ref}\n className={classNames(styles, 'spectrum-Accordion-itemHeader', {\n 'is-hovered': isHovered\n })}>\n {direction === 'ltr' ? (\n <ChevronRightMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n ) : (\n <ChevronLeftMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n )}\n {item.props.title}\n </button>\n </FocusRing>\n </h3>\n <div {...regionProps} className={classNames(styles, 'spectrum-Accordion-itemContent')}>\n {item.props.children}\n </div>\n </div>\n );\n}\n\nconst _Accordion = React.forwardRef(Accordion);\nexport {_Accordion as Accordion};\n"],"names":["$parcel$interopDefault","a","__esModule","default","Accordion","props","ref","useProviderProps","state","useTreeState","styleProps","useStyleProps","domRef","useDOMRef","accordionProps","useAccordion","filterDOMProps","classNames","className","collection","map","item","key","AccordionItem","useRef","buttonProps","regionProps","useAccordionItem","isOpen","expandedKeys","has","isDisabled","disabledKeys","isHovered","hoverProps","useHover","direction","useLocale","mergeProps","title","children","_Accordion","React","forwardRef"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,4CAAiB;AACf,wBAAsB,2BADP;AAEf,sCAAoC,yCAFrB;AAGf,6BAA2B,gCAHZ;AAIf,oCAAkC,uCAJnB;AAKf,mCAAiC,sCALlB;AAMf,oCAAkC,uCANnB;AAOf,aAAW,gBAPI;AAQf,iBAAe,oBARA;AASf,gBAAc,mBATC;AAUf,gBAAc;AAVC,CAAjB;;;AC4BA,SAASG,6CAAT,CAAqCC,KAArC,EAAuEC,GAAvE,EAAoG;AAClGD,EAAAA,KAAK,GAAGE,gBAAgB,CAACF,KAAD,CAAxB;AACA,MAAIG,KAAK,GAAGC,YAAY,CAAIJ,KAAJ,CAAxB;AACA,MAAI;AAACK,IAAAA;AAAD,MAAeC,aAAa,CAACN,KAAD,CAAhC;AACA,MAAIO,MAAM,GAAGC,SAAS,CAACP,GAAD,CAAtB;AAC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C;AACvD,iBAAWW,MAD4C;AAEvD,qBAAeG;AAFwC,KAApC;AADvB,kBAKE;AAAI,IAAA,SAAS,EAAEd,UAAU,qDAAS,gCAAT;AAAzB,kBACE,qBAAC,SAAD;AAAW,IAAA,MAAM,MAAjB;AAAkB,IAAA,cAAc,EAAEA,UAAU,qDAAS,YAAT;AAA5C,kBACE,+DACMqB,UAAU,CAACb,WAAD,EAAcS,UAAd,CADhB;AAEE,IAAA,GAAG,EAAE5B,GAFP;AAGE,IAAA,SAAS,EAAEW,UAAU,qDAAS,+BAAT,EAA0C;AAC7D,oBAAcgB;AAD+C,KAA1C;AAHvB,MAMGG,SAAS,KAAK,KAAd,gBACC,qBAAC,kCAAD;AACE,mBAAY,MADd;AAEE,IAAA,gBAAgB,EAAEnB,UAAU,qDAAS,kCAAT;AAF9B,IADD,gBAKG,qBAAC,iCAAD;AACE,mBAAY,MADd;AAEE,IAAA,gBAAgB,EAAEA,UAAU,qDAAS,kCAAT;AAF9B,IAXN,EAeGI,IAAI,CAAChB,KAAL,CAAWkC,KAfd,CADF,CADF,CALF,eA0BE,4DAASb,WAAT;AAAsB,IAAA,SAAS,EAAET,UAAU,qDAAS,gCAAT;AAA3C,MACGI,IAAI,CAAChB,KAAL,CAAWmC,QADd,CA1BF,CADF;AAgCD;;AAED,MAAMC,SAAU,gBAAGC,UAAU,CAACtC,6CAAD,CAA7B","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/accordion/vars.css","./packages/@react-spectrum/accordion/src/Accordion.tsx"],"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\n@import './index.css';\n@import './skin.css';\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 ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumAccordionProps} from '@react-types/accordion';\nimport styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';\nimport {TreeState, useTreeState} from '@react-stately/tree';\nimport {useAccordion, useAccordionItem} from '@react-aria/accordion';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Accordion<T extends object>(props: SpectrumAccordionProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let state = useTreeState<T>(props);\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let {accordionProps} = useAccordion(props, state, domRef);\n\n return (\n <div\n {...filterDOMProps(props)}\n {...accordionProps}\n {...styleProps}\n ref={domRef}\n className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>\n {[...state.collection].map(item => (\n <AccordionItem<T> key={item.key} item={item} state={state} />\n ))}\n </div>\n );\n}\n\ninterface AccordionItemProps<T> {\n item: Node<T>,\n state: TreeState<T>\n}\n\nfunction AccordionItem<T>(props: AccordionItemProps<T>) {\n props = useProviderProps(props);\n let ref = useRef<HTMLButtonElement>();\n let {state, item} = props;\n let {buttonProps, regionProps} = useAccordionItem<T>(props, state, ref);\n let isOpen = state.expandedKeys.has(item.key);\n let isDisabled = state.disabledKeys.has(item.key);\n let {isHovered, hoverProps} = useHover({isDisabled});\n let {direction} = useLocale();\n\n return (\n <div\n className={classNames(styles, 'spectrum-Accordion-item', {\n 'is-open': isOpen,\n 'is-disabled': isDisabled\n })}>\n <h3 className={classNames(styles, 'spectrum-Accordion-itemHeading')}>\n <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>\n <button\n {...mergeProps(buttonProps, hoverProps)}\n ref={ref}\n className={classNames(styles, 'spectrum-Accordion-itemHeader', {\n 'is-hovered': isHovered\n })}>\n {direction === 'ltr' ? (\n <ChevronRightMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n ) : (\n <ChevronLeftMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n )}\n {item.props.title}\n </button>\n </FocusRing>\n </h3>\n <div {...regionProps} className={classNames(styles, 'spectrum-Accordion-itemContent')}>\n {item.props.children}\n </div>\n </div>\n );\n}\n\nconst _Accordion = forwardRef(Accordion) as <T>(props: SpectrumAccordionProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof Accordion>;\nexport {_Accordion as Accordion};\n"],"names":["$parcel$interopDefault","a","__esModule","default","Accordion","props","ref","useProviderProps","state","useTreeState","styleProps","useStyleProps","domRef","useDOMRef","accordionProps","useAccordion","filterDOMProps","classNames","className","collection","map","item","key","AccordionItem","useRef","buttonProps","regionProps","useAccordionItem","isOpen","expandedKeys","has","isDisabled","disabledKeys","isHovered","hoverProps","useHover","direction","useLocale","mergeProps","title","children","_Accordion","forwardRef"],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -3,7 +3,7 @@ import { useLocale } from "@react-aria/i18n";
3
3
  import { useHover } from "@react-aria/interactions";
4
4
  import { useAccordion, useAccordionItem } from "@react-aria/accordion";
5
5
  import { useTreeState } from "@react-stately/tree";
6
- import _react, { useRef } from "react";
6
+ import _react, { forwardRef, useRef } from "react";
7
7
  import { FocusRing } from "@react-aria/focus";
8
8
  import { filterDOMProps, mergeProps } from "@react-aria/utils";
9
9
  import { classNames, useDOMRef, useStyleProps } from "@react-spectrum/utils";
@@ -102,5 +102,5 @@ function $f180b8b9e9903ea16cbb02a00974$var$AccordionItem(props) {
102
102
  }), item.props.children));
103
103
  }
104
104
 
105
- export const Accordion = /*#__PURE__*/_react.forwardRef($f180b8b9e9903ea16cbb02a00974$var$Accordion);
105
+ export const Accordion = /*#__PURE__*/forwardRef($f180b8b9e9903ea16cbb02a00974$var$Accordion);
106
106
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,2CAAiB;AACf,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AAA3C,MACGI,IAAI,CAAChB,KAAL,CAAWmC,QADd,CA1BF,CADF;AAgCD;;OAED,MAAMC,SAAU,gBAAGC,MAAK,CAACC,UAAN,CAAiBvC,2CAAjB,CAAnB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/accordion/vars.css","./packages/@react-spectrum/accordion/src/Accordion.tsx"],"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\n@import './index.css';\n@import './skin.css';\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 ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {useRef} from 'react';\nimport {SpectrumAccordionProps} from '@react-types/accordion';\nimport styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';\nimport {TreeState, useTreeState} from '@react-stately/tree';\nimport {useAccordion, useAccordionItem} from '@react-aria/accordion';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Accordion<T extends object>(props: SpectrumAccordionProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let state = useTreeState<T>(props);\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let {accordionProps} = useAccordion(props, state, domRef);\n\n return (\n <div\n {...filterDOMProps(props)}\n {...accordionProps}\n {...styleProps}\n ref={domRef}\n className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>\n {[...state.collection].map(item => (\n <AccordionItem<T> key={item.key} item={item} state={state} />\n ))}\n </div>\n );\n}\n\ninterface AccordionItemProps<T> {\n item: Node<T>,\n state: TreeState<T>\n}\n\nfunction AccordionItem<T>(props: AccordionItemProps<T>) {\n props = useProviderProps(props);\n let ref = useRef<HTMLButtonElement>();\n let {state, item} = props;\n let {buttonProps, regionProps} = useAccordionItem<T>(props, state, ref);\n let isOpen = state.expandedKeys.has(item.key);\n let isDisabled = state.disabledKeys.has(item.key);\n let {isHovered, hoverProps} = useHover({isDisabled});\n let {direction} = useLocale();\n\n return (\n <div\n className={classNames(styles, 'spectrum-Accordion-item', {\n 'is-open': isOpen,\n 'is-disabled': isDisabled\n })}>\n <h3 className={classNames(styles, 'spectrum-Accordion-itemHeading')}>\n <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>\n <button\n {...mergeProps(buttonProps, hoverProps)}\n ref={ref}\n className={classNames(styles, 'spectrum-Accordion-itemHeader', {\n 'is-hovered': isHovered\n })}>\n {direction === 'ltr' ? (\n <ChevronRightMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n ) : (\n <ChevronLeftMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n )}\n {item.props.title}\n </button>\n </FocusRing>\n </h3>\n <div {...regionProps} className={classNames(styles, 'spectrum-Accordion-itemContent')}>\n {item.props.children}\n </div>\n </div>\n );\n}\n\nconst _Accordion = React.forwardRef(Accordion);\nexport {_Accordion as Accordion};\n"],"names":["$parcel$interopDefault","a","__esModule","default","Accordion","props","ref","useProviderProps","state","useTreeState","styleProps","useStyleProps","domRef","useDOMRef","accordionProps","useAccordion","filterDOMProps","classNames","className","collection","map","item","key","AccordionItem","useRef","buttonProps","regionProps","useAccordionItem","isOpen","expandedKeys","has","isDisabled","disabledKeys","isHovered","hoverProps","useHover","direction","useLocale","mergeProps","title","children","_Accordion","React","forwardRef"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,2CAAiB;AACf,wBAAsB,2BADP;AAEf,sCAAoC,yCAFrB;AAGf,6BAA2B,gCAHZ;AAIf,oCAAkC,uCAJnB;AAKf,mCAAiC,sCALlB;AAMf,oCAAkC,uCANnB;AAOf,aAAW,gBAPI;AAQf,iBAAe,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./node_modules/@adobe/spectrum-css-temp/components/accordion/vars.css","./packages/@react-spectrum/accordion/src/Accordion.tsx"],"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\n@import './index.css';\n@import './skin.css';\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 ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumAccordionProps} from '@react-types/accordion';\nimport styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';\nimport {TreeState, useTreeState} from '@react-stately/tree';\nimport {useAccordion, useAccordionItem} from '@react-aria/accordion';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Accordion<T extends object>(props: SpectrumAccordionProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let state = useTreeState<T>(props);\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let {accordionProps} = useAccordion(props, state, domRef);\n\n return (\n <div\n {...filterDOMProps(props)}\n {...accordionProps}\n {...styleProps}\n ref={domRef}\n className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>\n {[...state.collection].map(item => (\n <AccordionItem<T> key={item.key} item={item} state={state} />\n ))}\n </div>\n );\n}\n\ninterface AccordionItemProps<T> {\n item: Node<T>,\n state: TreeState<T>\n}\n\nfunction AccordionItem<T>(props: AccordionItemProps<T>) {\n props = useProviderProps(props);\n let ref = useRef<HTMLButtonElement>();\n let {state, item} = props;\n let {buttonProps, regionProps} = useAccordionItem<T>(props, state, ref);\n let isOpen = state.expandedKeys.has(item.key);\n let isDisabled = state.disabledKeys.has(item.key);\n let {isHovered, hoverProps} = useHover({isDisabled});\n let {direction} = useLocale();\n\n return (\n <div\n className={classNames(styles, 'spectrum-Accordion-item', {\n 'is-open': isOpen,\n 'is-disabled': isDisabled\n })}>\n <h3 className={classNames(styles, 'spectrum-Accordion-itemHeading')}>\n <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>\n <button\n {...mergeProps(buttonProps, hoverProps)}\n ref={ref}\n className={classNames(styles, 'spectrum-Accordion-itemHeader', {\n 'is-hovered': isHovered\n })}>\n {direction === 'ltr' ? (\n <ChevronRightMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n ) : (\n <ChevronLeftMedium\n aria-hidden=\"true\"\n UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n )}\n {item.props.title}\n </button>\n </FocusRing>\n </h3>\n <div {...regionProps} className={classNames(styles, 'spectrum-Accordion-itemContent')}>\n {item.props.children}\n </div>\n </div>\n );\n}\n\nconst _Accordion = forwardRef(Accordion) as <T>(props: SpectrumAccordionProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof Accordion>;\nexport {_Accordion as Accordion};\n"],"names":["$parcel$interopDefault","a","__esModule","default","Accordion","props","ref","useProviderProps","state","useTreeState","styleProps","useStyleProps","domRef","useDOMRef","accordionProps","useAccordion","filterDOMProps","classNames","className","collection","map","item","key","AccordionItem","useRef","buttonProps","regionProps","useAccordionItem","isOpen","expandedKeys","has","isDisabled","disabledKeys","isHovered","hoverProps","useHover","direction","useLocale","mergeProps","title","children","_Accordion","forwardRef"],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
2
  import { SpectrumAccordionProps } from "@react-types/accordion";
3
- export const Accordion: React.ForwardRefExoticComponent<SpectrumAccordionProps<object> & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
3
+ export const Accordion: <T>(props: SpectrumAccordionProps<T> & {
4
+ ref?: React.Ref<import("@react-types/shared").DOMRefValue<HTMLDivElement>>;
5
+ }) => JSX.Element;
4
6
  export { Item } from '@react-stately/collections';
5
7
 
6
8
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":"A;A;AAkGA,OAAA,MAAM,2JAAwC,CAAC;ACnF/C,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC","sources":["./packages/@react-spectrum/accordion/src/packages/@react-spectrum/accordion/src/Accordion.tsx","./packages/@react-spectrum/accordion/src/packages/@react-spectrum/accordion/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":"A;A;AAkGA,OAAA,MAAM;A;iBAA4I,CAAC;ACnFnJ,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC","sources":["./packages/@react-spectrum/accordion/src/packages/@react-spectrum/accordion/src/Accordion.tsx","./packages/@react-spectrum/accordion/src/packages/@react-spectrum/accordion/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/accordion",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -34,14 +34,14 @@
34
34
  "@babel/runtime": "^7.6.2",
35
35
  "@react-aria/accordion": "3.0.0-alpha.2",
36
36
  "@react-aria/focus": "^3.4.1",
37
- "@react-aria/i18n": "^3.3.2",
38
- "@react-aria/interactions": "^3.5.1",
39
- "@react-aria/utils": "^3.8.2",
40
- "@react-spectrum/utils": "^3.6.2",
37
+ "@react-aria/i18n": "^3.3.3",
38
+ "@react-aria/interactions": "^3.7.0",
39
+ "@react-aria/utils": "^3.10.0",
40
+ "@react-spectrum/utils": "^3.6.3",
41
41
  "@react-stately/collections": "^3.3.3",
42
42
  "@react-stately/tree": "^3.2.0",
43
43
  "@react-types/accordion": "3.0.0-alpha.1",
44
- "@react-types/shared": "^3.8.0",
44
+ "@react-types/shared": "^3.10.0",
45
45
  "@spectrum-icons/ui": "^3.2.1"
46
46
  },
47
47
  "devDependencies": {
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "9204e1b8cb61dac767e91087fb16203611dc67c5"
57
+ "gitHead": "896eabe5521a0349a675c4773ed7629addd4b8c4"
58
58
  }
package/src/Accordion.tsx CHANGED
@@ -16,7 +16,7 @@ import {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';
16
16
  import {DOMRef, Node} from '@react-types/shared';
17
17
  import {filterDOMProps, mergeProps} from '@react-aria/utils';
18
18
  import {FocusRing} from '@react-aria/focus';
19
- import React, {useRef} from 'react';
19
+ import React, {forwardRef, useRef} from 'react';
20
20
  import {SpectrumAccordionProps} from '@react-types/accordion';
21
21
  import styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';
22
22
  import {TreeState, useTreeState} from '@react-stately/tree';
@@ -96,5 +96,5 @@ function AccordionItem<T>(props: AccordionItemProps<T>) {
96
96
  );
97
97
  }
98
98
 
99
- const _Accordion = React.forwardRef(Accordion);
99
+ const _Accordion = forwardRef(Accordion) as <T>(props: SpectrumAccordionProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof Accordion>;
100
100
  export {_Accordion as Accordion};