@react-spectrum/accordion 3.0.0-alpha.10 → 3.0.0-alpha.11
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 +1 -20
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -4
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/index.ts +2 -3
package/dist/main.js
CHANGED
|
@@ -15,30 +15,12 @@ var $6boyC$reactspectrumprovider = require("@react-spectrum/provider");
|
|
|
15
15
|
function $parcel$export(e, n, v, s) {
|
|
16
16
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
17
17
|
}
|
|
18
|
-
function $parcel$exportWildcard(dest, source) {
|
|
19
|
-
Object.keys(source).forEach(function(key) {
|
|
20
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Object.defineProperty(dest, key, {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return source[key];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return dest;
|
|
33
|
-
}
|
|
34
18
|
function $parcel$interopDefault(a) {
|
|
35
19
|
return a && a.__esModule ? a.default : a;
|
|
36
20
|
}
|
|
37
21
|
|
|
22
|
+
$parcel$export(module.exports, "Accordion", () => $d8f45715b3ce327a$export$a766cd26d0d69044);
|
|
38
23
|
$parcel$export(module.exports, "Item", () => $6boyC$reactstatelycollections.Item);
|
|
39
|
-
var $d8f45715b3ce327a$exports = {};
|
|
40
|
-
|
|
41
|
-
$parcel$export($d8f45715b3ce327a$exports, "Accordion", () => $d8f45715b3ce327a$export$a766cd26d0d69044);
|
|
42
24
|
|
|
43
25
|
|
|
44
26
|
|
|
@@ -147,7 +129,6 @@ const $d8f45715b3ce327a$export$a766cd26d0d69044 = /*#__PURE__*/ $6boyC$react.for
|
|
|
147
129
|
|
|
148
130
|
|
|
149
131
|
|
|
150
|
-
$parcel$exportWildcard(module.exports, $d8f45715b3ce327a$exports);
|
|
151
132
|
|
|
152
133
|
|
|
153
134
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAoC;AACpC,GAAkD;AAClD,GAAyC;AACzC,GAAgD;AAChD,GAA+C;AAC/C,GAAgD;AAChD,GAAyB;AACzB,GAA6B;AAC7B,GAA4B;AAC5B,GAA4B;AAT5B,yCAAoC,GAAG,CAA2B;AAClE,yCAAkD,GAAG,CAAyC;AAC9F,yCAAyC,GAAG,CAAgC;AAC5E,yCAAgD,GAAG,CAAuC;AAC1F,yCAA+C,GAAG,CAAsC;AACxF,yCAAgD,GAAG,CAAuC;AAC1F,yCAAyB,GAAG,CAAgB;AAC5C,yCAA6B,GAAG,CAAoB;AACpD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;;;;;;;;SDmBzC,+BAAS,CAAmB,KAAgC,EAAE,GAA2B,EAAE,CAAC;IACnG,KAAK,GAAG,6CAAgB,CAAC,KAAK;IAC9B,GAAG,CAAC,KAAK,GAAG,oCAAY,CAAI,KAAK;IACjC,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,uCAAa,CAAC,KAAK;IACtC,GAAG,CAAC,MAAM,GAAG,mCAAS,CAAC,GAAG;IAC1B,GAAG,CAAC,CAAC,iBAAA,cAAc,EAAA,CAAC,GAAG,sCAAY,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM;IAExD,MAAM,oEACH,CAAG;WACE,oCAAc,CAAC,KAAK;WACpB,cAAc;WACd,UAAU;QACd,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,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,EAAE,UAAU;QACtC,GAAG,EAAE,GAAG;QACR,SAAS,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAA+B,gCAAE,CAAC;YAC9D,CAAY,aAAE,SAAS;QACzB,CAAC;OACA,SAAS,KAAK,CAAK,0EACjB,kEAAkB;QACjB,CAAW,cAAC,CAAM;QAClB,gBAAgB,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAkC;4EAEtE,iEAAiB;QAChB,CAAW,cAAC,CAAM;QAClB,gBAAgB,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAkC;QAE5E,IAAI,CAAC,KAAK,CAAC,KAAK,wEAItB,CAAG;WAAK,WAAW;QAAE,SAAS,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAgC;OACjF,IAAI,CAAC,KAAK,CAAC,QAAQ;AAI5B,CAAC;AAED,KAAK,CAAC,yCAAU,iBAAG,uBAAU,CAAC,+BAAS","sources":["packages/@react-spectrum/accordion/src/index.ts","packages/@react-spectrum/accordion/src/Accordion.tsx","packages/@adobe/spectrum-css-temp/components/accordion/vars.css"],"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/// <reference types=\"css-module-types\" />\nexport {Accordion} from './Accordion';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumAccordionProps} from '@react-types/accordion';\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","/*\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"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -18,9 +18,6 @@ function $parcel$interopDefault(a) {
|
|
|
18
18
|
function $parcel$export(e, n, v, s) {
|
|
19
19
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
20
20
|
}
|
|
21
|
-
var $2a5a5b7faca81754$exports = {};
|
|
22
|
-
|
|
23
|
-
$parcel$export($2a5a5b7faca81754$exports, "Accordion", () => $2a5a5b7faca81754$export$a766cd26d0d69044);
|
|
24
21
|
|
|
25
22
|
|
|
26
23
|
|
|
@@ -131,5 +128,5 @@ const $2a5a5b7faca81754$export$a766cd26d0d69044 = /*#__PURE__*/ $3Uu4R$forwardRe
|
|
|
131
128
|
|
|
132
129
|
|
|
133
130
|
|
|
134
|
-
export {$
|
|
131
|
+
export {$2a5a5b7faca81754$export$a766cd26d0d69044 as Accordion, $8ae4d4d1aa0c5e03$re_export$Item as Item};
|
|
135
132
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAoC;AACpC,GAAkD;AAClD,GAAyC;AACzC,GAAgD;AAChD,GAA+C;AAC/C,GAAgD;AAChD,GAAyB;AACzB,GAA6B;AAC7B,GAA4B;AAC5B,GAA4B;AAT5B,yCAAoC,GAAG,CAA2B;AAClE,yCAAkD,GAAG,CAAyC;AAC9F,yCAAyC,GAAG,CAAgC;AAC5E,yCAAgD,GAAG,CAAuC;AAC1F,yCAA+C,GAAG,CAAsC;AACxF,yCAAgD,GAAG,CAAuC;AAC1F,yCAAyB,GAAG,CAAgB;AAC5C,yCAA6B,GAAG,CAAoB;AACpD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;;;;;;;;SDmBzC,+BAAS,CAAmB,KAAgC,EAAE,GAA2B,EAAE,CAAC;IACnG,KAAK,GAAG,uBAAgB,CAAC,KAAK;IAC9B,GAAG,CAAC,KAAK,GAAG,mBAAY,CAAI,KAAK;IACjC,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,oBAAa,CAAC,KAAK;IACtC,GAAG,CAAC,MAAM,GAAG,gBAAS,CAAC,GAAG;IAC1B,GAAG,CAA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gDACA,CAAE;QAAC,SAAS,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAgC;gDAC/D,gBAAS;QAAC,MAAM,EAAN,IAAM;QAAC,cAAc,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAY;gDAC9D,CAAM;WACD,iBAAU,CAAC,WAAW,EAAE,UAAU;QACtC,GAAG,EAAE,GAAG;QACR,SAAS,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAA+B,gCAAE,CAAC;YAC9D,CAAY,aAAE,SAAS;QACzB,CAAC;OACA,SAAS,KAAK,CAAK,gDACjB,wCAAkB;QACjB,CAAW,cAAC,CAAM;QAClB,gBAAgB,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAkC;kDAEtE,uCAAiB;QAChB,CAAW,cAAC,CAAM;QAClB,gBAAgB,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAkC;QAE5E,IAAI,CAAC,KAAK,CAAC,KAAK,8CAItB,CAAG;WAAK,WAAW;QAAE,SAAS,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAgC;OACjF,IAAI,CAAC,KAAK,CAAC,QAAQ;AAI5B,CAAC;AAED,KAAK,CAAC,yCAAU,iBAAG,iBAAU,CAAC,+BAAS","sources":["packages/@react-spectrum/accordion/src/index.ts","packages/@react-spectrum/accordion/src/Accordion.tsx","packages/@adobe/spectrum-css-temp/components/accordion/vars.css"],"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/// <reference types=\"css-module-types\" />\nexport {Accordion} from './Accordion';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumAccordionProps} from '@react-types/accordion';\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","/*\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"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export const Accordion: <T>(props: SpectrumAccordionProps<T> & {
|
|
|
5
5
|
ref?: DOMRef<HTMLDivElement>;
|
|
6
6
|
}) => ReturnType<typeof Accordion>;
|
|
7
7
|
export { Item } from '@react-stately/collections';
|
|
8
|
+
export type { SpectrumAccordionProps } from '@react-types/accordion';
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AA4BA,0BAAmB,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,cAAc,CAAC,eAmBjG;AAmDD,OAAA,MAAM;UAAoF,OAAO,cAAc,CAAC;MAAM,WAAW,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"mappings":";;AA4BA,0BAAmB,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,cAAc,CAAC,eAmBjG;AAmDD,OAAA,MAAM;UAAoF,OAAO,cAAc,CAAC;MAAM,WAAW,gBAAgB,CAAC,CAAC;ACrFnJ,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAChD,YAAY,EAAC,sBAAsB,EAAC,MAAM,wBAAwB,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","packages/@react-spectrum/accordion/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/// <reference types=\"css-module-types\" />\nexport {Accordion} from './Accordion';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumAccordionProps} from '@react-types/accordion';\n"],"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.
|
|
3
|
+
"version": "3.0.0-alpha.11",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.6.2",
|
|
35
|
-
"@react-aria/accordion": "3.0.0-alpha.
|
|
36
|
-
"@react-aria/focus": "^3.
|
|
37
|
-
"@react-aria/i18n": "^3.
|
|
38
|
-
"@react-aria/interactions": "^3.
|
|
39
|
-
"@react-aria/utils": "^3.13.
|
|
40
|
-
"@react-spectrum/utils": "^3.7.
|
|
41
|
-
"@react-stately/collections": "^3.4.
|
|
42
|
-
"@react-stately/tree": "^3.3.
|
|
43
|
-
"@react-types/accordion": "3.0.0-alpha.
|
|
44
|
-
"@react-types/shared": "^3.
|
|
45
|
-
"@spectrum-icons/ui": "^3.3.
|
|
35
|
+
"@react-aria/accordion": "3.0.0-alpha.10",
|
|
36
|
+
"@react-aria/focus": "^3.7.0",
|
|
37
|
+
"@react-aria/i18n": "^3.5.0",
|
|
38
|
+
"@react-aria/interactions": "^3.10.0",
|
|
39
|
+
"@react-aria/utils": "^3.13.2",
|
|
40
|
+
"@react-spectrum/utils": "^3.7.2",
|
|
41
|
+
"@react-stately/collections": "^3.4.2",
|
|
42
|
+
"@react-stately/tree": "^3.3.2",
|
|
43
|
+
"@react-types/accordion": "3.0.0-alpha.8",
|
|
44
|
+
"@react-types/shared": "^3.14.0",
|
|
45
|
+
"@spectrum-icons/ui": "^3.3.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "cd7c0ec917122c7612f653c22f8ed558f8b66ecd"
|
|
58
58
|
}
|
package/src/index.ts
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
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
|
-
|
|
13
12
|
/// <reference types="css-module-types" />
|
|
14
|
-
|
|
15
|
-
export * from './Accordion';
|
|
13
|
+
export {Accordion} from './Accordion';
|
|
16
14
|
export {Item} from '@react-stately/collections';
|
|
15
|
+
export type {SpectrumAccordionProps} from '@react-types/accordion';
|