@react-spectrum/accordion 3.0.0-alpha.33 → 3.0.0-alpha.34

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.
@@ -6,8 +6,8 @@ var $cd9bb50514faf076$exports = {};
6
6
 
7
7
  $parcel$export($cd9bb50514faf076$exports, "focus-ring", () => $cd9bb50514faf076$export$f39a09f249340e2a, (v) => $cd9bb50514faf076$export$f39a09f249340e2a = v);
8
8
  $parcel$export($cd9bb50514faf076$exports, "is-disabled", () => $cd9bb50514faf076$export$d35bc1e505d1ebbf, (v) => $cd9bb50514faf076$export$d35bc1e505d1ebbf = v);
9
+ $parcel$export($cd9bb50514faf076$exports, "is-expanded", () => $cd9bb50514faf076$export$911ebb89bba4b634, (v) => $cd9bb50514faf076$export$911ebb89bba4b634 = v);
9
10
  $parcel$export($cd9bb50514faf076$exports, "is-hovered", () => $cd9bb50514faf076$export$b8813cd5d7824ce7, (v) => $cd9bb50514faf076$export$b8813cd5d7824ce7 = v);
10
- $parcel$export($cd9bb50514faf076$exports, "is-open", () => $cd9bb50514faf076$export$a9781837241c946d, (v) => $cd9bb50514faf076$export$a9781837241c946d = v);
11
11
  $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion", () => $cd9bb50514faf076$export$bed6cbae852b32f0, (v) => $cd9bb50514faf076$export$bed6cbae852b32f0 = v);
12
12
  $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-item", () => $cd9bb50514faf076$export$a1947cb8adf67515, (v) => $cd9bb50514faf076$export$a1947cb8adf67515 = v);
13
13
  $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemContent", () => $cd9bb50514faf076$export$951cb9dc63743241, (v) => $cd9bb50514faf076$export$951cb9dc63743241 = v);
@@ -16,24 +16,24 @@ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemHeading", () =
16
16
  $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemIndicator", () => $cd9bb50514faf076$export$35196e2132b47abd, (v) => $cd9bb50514faf076$export$35196e2132b47abd = v);
17
17
  var $cd9bb50514faf076$export$f39a09f249340e2a;
18
18
  var $cd9bb50514faf076$export$d35bc1e505d1ebbf;
19
+ var $cd9bb50514faf076$export$911ebb89bba4b634;
19
20
  var $cd9bb50514faf076$export$b8813cd5d7824ce7;
20
- var $cd9bb50514faf076$export$a9781837241c946d;
21
21
  var $cd9bb50514faf076$export$bed6cbae852b32f0;
22
22
  var $cd9bb50514faf076$export$a1947cb8adf67515;
23
23
  var $cd9bb50514faf076$export$951cb9dc63743241;
24
24
  var $cd9bb50514faf076$export$4da8efb546c03356;
25
25
  var $cd9bb50514faf076$export$36876b8193439034;
26
26
  var $cd9bb50514faf076$export$35196e2132b47abd;
27
- $cd9bb50514faf076$export$f39a09f249340e2a = `_7gO6Sq_focus-ring`;
28
- $cd9bb50514faf076$export$d35bc1e505d1ebbf = `_7gO6Sq_is-disabled`;
29
- $cd9bb50514faf076$export$b8813cd5d7824ce7 = `_7gO6Sq_is-hovered`;
30
- $cd9bb50514faf076$export$a9781837241c946d = `_7gO6Sq_is-open`;
31
- $cd9bb50514faf076$export$bed6cbae852b32f0 = `_7gO6Sq_spectrum-Accordion`;
32
- $cd9bb50514faf076$export$a1947cb8adf67515 = `_7gO6Sq_spectrum-Accordion-item`;
33
- $cd9bb50514faf076$export$951cb9dc63743241 = `_7gO6Sq_spectrum-Accordion-itemContent`;
34
- $cd9bb50514faf076$export$4da8efb546c03356 = `_7gO6Sq_spectrum-Accordion-itemHeader`;
35
- $cd9bb50514faf076$export$36876b8193439034 = `_7gO6Sq_spectrum-Accordion-itemHeading`;
36
- $cd9bb50514faf076$export$35196e2132b47abd = `_7gO6Sq_spectrum-Accordion-itemIndicator`;
27
+ $cd9bb50514faf076$export$f39a09f249340e2a = `spk0dG_focus-ring`;
28
+ $cd9bb50514faf076$export$d35bc1e505d1ebbf = `spk0dG_is-disabled`;
29
+ $cd9bb50514faf076$export$911ebb89bba4b634 = `spk0dG_is-expanded`;
30
+ $cd9bb50514faf076$export$b8813cd5d7824ce7 = `spk0dG_is-hovered`;
31
+ $cd9bb50514faf076$export$bed6cbae852b32f0 = `spk0dG_spectrum-Accordion`;
32
+ $cd9bb50514faf076$export$a1947cb8adf67515 = `spk0dG_spectrum-Accordion-item`;
33
+ $cd9bb50514faf076$export$951cb9dc63743241 = `spk0dG_spectrum-Accordion-itemContent`;
34
+ $cd9bb50514faf076$export$4da8efb546c03356 = `spk0dG_spectrum-Accordion-itemHeader`;
35
+ $cd9bb50514faf076$export$36876b8193439034 = `spk0dG_spectrum-Accordion-itemHeading`;
36
+ $cd9bb50514faf076$export$35196e2132b47abd = `spk0dG_spectrum-Accordion-itemIndicator`;
37
37
 
38
38
 
39
39
  export {$cd9bb50514faf076$exports as default};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAgC,CAAC,mBAAmB,CAAC;AACrD,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAA4B,CAAC,eAAe,CAAC;AAC7C,4CAAuC,CAAC,0BAA0B,CAAC;AACnE,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAmD,CAAC,sCAAsC,CAAC;AAC3F,4CAAkD,CAAC,qCAAqC,CAAC;AACzF,4CAAmD,CAAC,sCAAsC,CAAC;AAC3F,4CAAqD,CAAC,wCAAwC,CAAC","sources":["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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"accordion_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAuC,CAAC,yBAAyB,CAAC;AAClE,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAqD,CAAC,uCAAuC,CAAC","sources":["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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"accordion_vars_css.module.js.map"}
package/dist/import.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import {Accordion as $2a5a5b7faca81754$export$a766cd26d0d69044} from "./Accordion.mjs";
2
- import {Item as $8ae4d4d1aa0c5e03$re_export$Item} from "@react-stately/collections";
1
+ import {Accordion as $2a5a5b7faca81754$export$a766cd26d0d69044, Disclosure as $2a5a5b7faca81754$export$74a362b31437ec83, DisclosureHeader as $2a5a5b7faca81754$export$1e037ddd32f5b8ac, DisclosurePanel as $2a5a5b7faca81754$export$feabaa331e1d464c} from "./Accordion.mjs";
3
2
 
4
3
  /*
5
4
  * Copyright 2020 Adobe. All rights reserved.
@@ -15,6 +14,5 @@ import {Item as $8ae4d4d1aa0c5e03$re_export$Item} from "@react-stately/collectio
15
14
 
16
15
 
17
16
 
18
-
19
- export {$2a5a5b7faca81754$export$a766cd26d0d69044 as Accordion, $8ae4d4d1aa0c5e03$re_export$Item as Item};
17
+ export {$2a5a5b7faca81754$export$74a362b31437ec83 as Disclosure, $2a5a5b7faca81754$export$a766cd26d0d69044 as Accordion, $2a5a5b7faca81754$export$1e037ddd32f5b8ac as DisclosureHeader, $2a5a5b7faca81754$export$feabaa331e1d464c as DisclosurePanel};
20
18
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,13 +1,14 @@
1
1
  var $d8f45715b3ce327a$exports = require("./Accordion.main.js");
2
- var $6boyC$reactstatelycollections = require("@react-stately/collections");
3
2
 
4
3
 
5
4
  function $parcel$export(e, n, v, s) {
6
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
6
  }
8
7
 
8
+ $parcel$export(module.exports, "Disclosure", () => $d8f45715b3ce327a$exports.Disclosure);
9
9
  $parcel$export(module.exports, "Accordion", () => $d8f45715b3ce327a$exports.Accordion);
10
- $parcel$export(module.exports, "Item", () => $6boyC$reactstatelycollections.Item);
10
+ $parcel$export(module.exports, "DisclosureHeader", () => $d8f45715b3ce327a$exports.DisclosureHeader);
11
+ $parcel$export(module.exports, "DisclosurePanel", () => $d8f45715b3ce327a$exports.DisclosurePanel);
11
12
  /*
12
13
  * Copyright 2020 Adobe. All rights reserved.
13
14
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -22,5 +23,4 @@ $parcel$export(module.exports, "Item", () => $6boyC$reactstatelycollections.Item
22
23
 
23
24
 
24
25
 
25
-
26
26
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/accordion/src/index.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/// <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":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/accordion/src/index.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/// <reference types=\"css-module-types\" />\nexport {Disclosure, Accordion, DisclosureHeader, DisclosurePanel} from './Accordion';\nexport type {SpectrumAccordionProps, SpectrumDisclosureProps, SpectrumDisclosurePanelProps, SpectrumDisclosureHeaderProps} from './Accordion';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,4 @@
1
- import {Accordion as $2a5a5b7faca81754$export$a766cd26d0d69044} from "./Accordion.module.js";
2
- import {Item as $8ae4d4d1aa0c5e03$re_export$Item} from "@react-stately/collections";
1
+ import {Accordion as $2a5a5b7faca81754$export$a766cd26d0d69044, Disclosure as $2a5a5b7faca81754$export$74a362b31437ec83, DisclosureHeader as $2a5a5b7faca81754$export$1e037ddd32f5b8ac, DisclosurePanel as $2a5a5b7faca81754$export$feabaa331e1d464c} from "./Accordion.module.js";
3
2
 
4
3
  /*
5
4
  * Copyright 2020 Adobe. All rights reserved.
@@ -15,6 +14,5 @@ import {Item as $8ae4d4d1aa0c5e03$re_export$Item} from "@react-stately/collectio
15
14
 
16
15
 
17
16
 
18
-
19
- export {$2a5a5b7faca81754$export$a766cd26d0d69044 as Accordion, $8ae4d4d1aa0c5e03$re_export$Item as Item};
17
+ export {$2a5a5b7faca81754$export$74a362b31437ec83 as Disclosure, $2a5a5b7faca81754$export$a766cd26d0d69044 as Accordion, $2a5a5b7faca81754$export$1e037ddd32f5b8ac as DisclosureHeader, $2a5a5b7faca81754$export$feabaa331e1d464c as DisclosurePanel};
20
18
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/accordion/src/index.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/// <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":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/accordion/src/index.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/// <reference types=\"css-module-types\" />\nexport {Disclosure, Accordion, DisclosureHeader, DisclosurePanel} from './Accordion';\nexport type {SpectrumAccordionProps, SpectrumDisclosureProps, SpectrumDisclosurePanelProps, SpectrumDisclosureHeaderProps} from './Accordion';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,11 +1,46 @@
1
- import { DOMRef } from "@react-types/shared";
1
+ import { AriaLabelingProps, DOMProps, DOMRef, StyleProps } from "@react-types/shared";
2
+ import { DisclosureGroupProps, DisclosurePanelProps, DisclosureProps } from "react-aria-components";
2
3
  import React from "react";
3
- import { SpectrumAccordionProps } from "@react-types/accordion";
4
- export function Accordion<T extends object>(props: SpectrumAccordionProps<T>, ref: DOMRef<HTMLDivElement>): React.JSX.Element;
5
- export const Accordion: <T>(props: SpectrumAccordionProps<T> & {
4
+ export interface SpectrumAccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children'>, StyleProps, DOMProps {
5
+ /** The disclosures within the accordion group. */
6
+ children: React.ReactNode;
7
+ }
8
+ export function Accordion(props: SpectrumAccordionProps, ref: DOMRef<HTMLDivElement>): React.JSX.Element;
9
+ export interface SpectrumDisclosureProps extends Omit<DisclosureProps, 'className' | 'style' | 'children'>, AriaLabelingProps {
10
+ /** The contents of the disclosure. The first child should be the header, and the second child should be the panel. */
11
+ children: React.ReactNode;
12
+ }
13
+ export function Disclosure(props: SpectrumDisclosureProps, ref: DOMRef<HTMLDivElement>): React.JSX.Element;
14
+ export interface SpectrumDisclosurePanelProps extends Omit<DisclosurePanelProps, 'className' | 'style' | 'children'>, DOMProps, AriaLabelingProps {
15
+ /** The contents of the accordion panel. */
16
+ children: React.ReactNode;
17
+ }
18
+ export function DisclosurePanel(props: SpectrumDisclosurePanelProps, ref: DOMRef<HTMLDivElement>): React.JSX.Element;
19
+ export interface SpectrumDisclosureHeaderProps extends DOMProps, AriaLabelingProps {
20
+ /**
21
+ * The heading level of the disclosure header.
22
+ * @default 3
23
+ */
24
+ level?: number;
25
+ /** The contents of the disclosure header. */
26
+ children: React.ReactNode;
27
+ }
28
+ export function DisclosureHeader(props: SpectrumDisclosureHeaderProps, ref: DOMRef<HTMLHeadingElement>): React.JSX.Element;
29
+ /** A group of disclosures that can be expanded and collapsed. */
30
+ export const Accordion: (props: SpectrumAccordionProps & {
6
31
  ref?: DOMRef<HTMLDivElement>;
7
32
  }) => ReturnType<typeof Accordion>;
8
- export { Item } from '@react-stately/collections';
9
- export type { SpectrumAccordionProps } from '@react-types/accordion';
33
+ /** A collapsible section of content composed of a heading that expands and collapses a panel. */
34
+ export const Disclosure: (props: SpectrumDisclosureProps & {
35
+ ref?: DOMRef<HTMLDivElement>;
36
+ }) => ReturnType<typeof Disclosure>;
37
+ /** The panel that contains the content of an disclosure. */
38
+ export const DisclosurePanel: (props: SpectrumDisclosurePanelProps & {
39
+ ref?: DOMRef<HTMLDivElement>;
40
+ }) => ReturnType<typeof DisclosurePanel>;
41
+ /** The heading of the disclosure. */
42
+ export const DisclosureHeader: (props: SpectrumDisclosureHeaderProps & {
43
+ ref?: DOMRef<HTMLDivElement>;
44
+ }) => ReturnType<typeof DisclosureHeader>;
10
45
 
11
46
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;;AA4BA,0BAAmB,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,cAAc,CAAC,qBAmBjG;AAmDD,OAAA,MAAM,WAAsC,CAAC,CAAC,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,OAAO,cAAc,CAAC,CAAA;CAAC,KAAK,UAAU,CAAC,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"}
1
+ {"mappings":";;;AAsBA,uCAAwC,SAAQ,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC,EAAE,UAAU,EAAE,QAAQ;IAClI,kDAAkD;IAClD,QAAQ,EAAE,MAAM,SAAS,CAAA;CAC1B;AAED,0BAAmB,KAAK,EAAE,sBAAsB,EAAE,GAAG,EAAE,OAAO,cAAc,CAAC,qBAa5E;AAED,wCAAyC,SAAQ,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC,EAAE,iBAAiB;IAC3H,sHAAsH;IACtH,QAAQ,EAAE,MAAM,SAAS,CAAA;CAC1B;AAED,2BAAoB,KAAK,EAAE,uBAAuB,EAAE,GAAG,EAAE,OAAO,cAAc,CAAC,qBAc9E;AAED,6CAA8C,SAAQ,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC,EAAE,QAAQ,EAAE,iBAAiB;IAC/I,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,SAAS,CAAA;CAC1B;AAED,gCAAyB,KAAK,EAAE,4BAA4B,EAAE,GAAG,EAAE,OAAO,cAAc,CAAC,qBAOxF;AAED,8CAA+C,SAAQ,QAAQ,EAAE,iBAAiB;IAChF;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,SAAS,CAAA;CAC1B;AAED,iCAA0B,KAAK,EAAE,6BAA6B,EAAE,GAAG,EAAE,OAAO,kBAAkB,CAAC,qBAyB9F;AAED,iEAAiE;AACjE,OAAA,MAAM,WAAsC,CAAC,KAAK,EAAE,sBAAsB,GAAG;IAAC,GAAG,CAAC,EAAE,OAAO,cAAc,CAAC,CAAA;CAAC,KAAK,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAG7I,iGAAiG;AACjG,OAAA,MAAM,YAAwC,CAAC,KAAK,EAAE,uBAAuB,GAAG;IAAC,GAAG,CAAC,EAAE,OAAO,cAAc,CAAC,CAAA;CAAC,KAAK,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAGjJ,4DAA4D;AAC5D,OAAA,MAAM,iBAAkD,CAAC,KAAK,EAAE,4BAA4B,GAAG;IAAC,GAAG,CAAC,EAAE,OAAO,cAAc,CAAC,CAAA;CAAC,KAAK,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAGrK,qCAAqC;AACrC,OAAA,MAAM,kBAAoD,CAAC,KAAK,EAAE,6BAA6B,GAAG;IAAC,GAAG,CAAC,EAAE,OAAO,cAAc,CAAC,CAAA;CAAC,KAAK,UAAU,CAAC,uBAAuB,CAAC,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 {Disclosure, Accordion, DisclosureHeader, DisclosurePanel} from './Accordion';\nexport type {SpectrumAccordionProps, SpectrumDisclosureProps, SpectrumDisclosurePanelProps, SpectrumDisclosureHeaderProps} from './Accordion';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,145 @@
1
+ .spk0dG_spectrum-Accordion {
2
+ margin: 0;
3
+ padding: 0;
4
+ list-style: none;
5
+ display: block;
6
+ }
7
+
8
+ .spk0dG_spectrum-Accordion-itemIndicator {
9
+ transition: transform ease var(--spectrum-global-animation-duration-100, .13s);
10
+ padding-inline-start: var(--spectrum-accordion-icon-gap, var(--spectrum-global-dimension-size-100));
11
+ padding-inline-end: var(--spectrum-accordion-icon-gap, var(--spectrum-global-dimension-size-100));
12
+ display: block;
13
+ }
14
+
15
+ .spk0dG_spectrum-Accordion-item {
16
+ z-index: inherit;
17
+ border-bottom: var(--spectrum-accordion-item-border-size, var(--spectrum-alias-border-size-thin)) solid transparent;
18
+ margin: 0;
19
+ list-style: none;
20
+ display: list-item;
21
+ position: relative;
22
+ }
23
+
24
+ .spk0dG_spectrum-Accordion-item:first-of-type {
25
+ border-top: var(--spectrum-accordion-item-border-size, var(--spectrum-alias-border-size-thin)) solid transparent;
26
+ }
27
+
28
+ .spk0dG_spectrum-Accordion-itemHeading {
29
+ margin: 0;
30
+ }
31
+
32
+ .spk0dG_spectrum-Accordion-itemHeader {
33
+ box-sizing: border-box;
34
+ padding-block: var(--spectrum-global-dimension-size-150);
35
+ min-height: calc(var(--spectrum-accordion-item-height, 40px) - var(--spectrum-accordion-item-border-size, var(--spectrum-alias-border-size-thin)));
36
+ font-size: var(--spectrum-global-dimension-font-size-300);
37
+ text-overflow: ellipsis;
38
+ cursor: default;
39
+ line-height: 1.3;
40
+ font-weight: var(--spectrum-global-font-weight-bold, 700);
41
+ -webkit-appearance: none;
42
+ appearance: none;
43
+ background-color: inherit;
44
+ text-align: start;
45
+ border: 0;
46
+ justify-content: flex-start;
47
+ align-items: center;
48
+ width: 100%;
49
+ margin: 0;
50
+ padding-inline-start: var(--spectrum-accordion-icon-gap, var(--spectrum-global-dimension-size-100));
51
+ padding-inline-end: var(--spectrum-accordion-item-padding, 16px);
52
+ font-family: inherit;
53
+ display: flex;
54
+ position: relative;
55
+ }
56
+
57
+ .spk0dG_spectrum-Accordion-itemHeader:focus {
58
+ outline: none;
59
+ }
60
+
61
+ .spk0dG_spectrum-Accordion-itemHeader:focus:after {
62
+ content: "";
63
+ top: calc(var(--spectrum-accordion-item-border-size, var(--spectrum-alias-border-size-thin)) * -1);
64
+ bottom: calc(var(--spectrum-accordion-item-border-size, var(--spectrum-alias-border-size-thin)) * -1);
65
+ width: var(--spectrum-accordion-item-border-size-key-focus, 2px);
66
+ position: absolute;
67
+ }
68
+
69
+ .spk0dG_spectrum-Accordion-itemHeader:focus:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):after {
70
+ left: 0;
71
+ }
72
+
73
+ .spk0dG_spectrum-Accordion-itemHeader:focus:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):after {
74
+ left: 0;
75
+ }
76
+
77
+ .spk0dG_spectrum-Accordion-itemHeader:focus:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)):after {
78
+ right: 0;
79
+ }
80
+
81
+ .spk0dG_spectrum-Accordion-itemHeader:focus:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)):after {
82
+ right: 0;
83
+ }
84
+
85
+ .spk0dG_spectrum-Accordion-itemContent {
86
+ padding: 0 var(--spectrum-accordion-item-content-padding, var(--spectrum-global-dimension-size-200)) var(--spectrum-accordion-item-content-padding, var(--spectrum-global-dimension-size-200)) var(--spectrum-accordion-item-content-padding, var(--spectrum-global-dimension-size-200));
87
+ display: none;
88
+ }
89
+
90
+ [dir="ltr"] :is(.spk0dG_spectrum-Accordion-item.spk0dG_is-expanded > .spk0dG_spectrum-Accordion-itemHeading > .spk0dG_spectrum-Accordion-itemHeader > .spk0dG_spectrum-Accordion-itemIndicator) {
91
+ transform: rotate(90deg);
92
+ }
93
+
94
+ [dir="rtl"] :is(.spk0dG_spectrum-Accordion-item.spk0dG_is-expanded > .spk0dG_spectrum-Accordion-itemHeading > .spk0dG_spectrum-Accordion-itemHeader > .spk0dG_spectrum-Accordion-itemIndicator) {
95
+ transform: rotate(-90deg);
96
+ }
97
+
98
+ .spk0dG_spectrum-Accordion-item.spk0dG_is-expanded > .spk0dG_spectrum-Accordion-itemHeader:after {
99
+ height: calc(var(--spectrum-accordion-item-height, 40px) - var(--spectrum-accordion-item-border-size, var(--spectrum-alias-border-size-thin)));
100
+ }
101
+
102
+ .spk0dG_spectrum-Accordion-item.spk0dG_is-expanded > .spk0dG_spectrum-Accordion-itemContent {
103
+ display: block;
104
+ }
105
+
106
+ .spk0dG_spectrum-Accordion-item.spk0dG_is-disabled .spk0dG_spectrum-Accordion-itemHeader {
107
+ cursor: default;
108
+ }
109
+
110
+ .spk0dG_spectrum-Accordion-item {
111
+ border-color: var(--spectrum-accordion-border-color, var(--spectrum-global-color-gray-300));
112
+ }
113
+
114
+ .spk0dG_spectrum-Accordion-item:first-of-type {
115
+ border-top-color: var(--spectrum-accordion-border-color, var(--spectrum-global-color-gray-300));
116
+ }
117
+
118
+ .spk0dG_spectrum-Accordion-itemHeader {
119
+ color: var(--spectrum-alias-text-color, var(--spectrum-global-color-gray-800));
120
+ }
121
+
122
+ .spk0dG_spectrum-Accordion-itemHeader.spk0dG_is-hovered {
123
+ color: var(--spectrum-alias-text-color-hover, var(--spectrum-global-color-gray-900));
124
+ background-color: var(--spectrum-accordion-background-color-hover, var(--spectrum-global-color-gray-200));
125
+ }
126
+
127
+ .spk0dG_spectrum-Accordion-itemHeader.spk0dG_focus-ring:after {
128
+ background-color: var(--spectrum-accordion-border-left-color-key-focus, var(--spectrum-alias-border-color-focus));
129
+ }
130
+
131
+ .spk0dG_spectrum-Accordion-item.spk0dG_is-expanded .spk0dG_spectrum-Accordion-itemHeader.spk0dG_is-hovered {
132
+ background-color: #0000;
133
+ }
134
+
135
+ .spk0dG_spectrum-Accordion-item.spk0dG_is-disabled .spk0dG_spectrum-Accordion-itemHeader, .spk0dG_spectrum-Accordion-item.spk0dG_is-disabled .spk0dG_spectrum-Accordion-itemHeader.spk0dG_is-hovered, .spk0dG_spectrum-Accordion-item.spk0dG_is-disabled .spk0dG_spectrum-Accordion-itemHeader.spk0dG_focus-ring {
136
+ color: var(--spectrum-alias-text-color-disabled, var(--spectrum-global-color-gray-500));
137
+ background-color: #0000;
138
+ }
139
+
140
+ @media (forced-colors: active) {
141
+ .spk0dG_spectrum-Accordion-itemHeader.spk0dG_focus-ring {
142
+ outline: 3px solid canvastext;
143
+ }
144
+ }
145
+ /*# sourceMappingURL=vars.77b903e1.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AAwBA;;;;;;;AAOA;;;;;;;AASA;;;;;;;;;AAUE;;;;AAKF;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;AAiCE;;;;AAGE;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAaJ;;;;;AAUU;;;;AAGA;;;;AAON;;;;AAKA;;;;AAMA;;;;AAkBJ;;;;AAGE;;;;AAKF;;;;AAGE;;;;;AAOE;;;;AASE;;;;AASF;;;;;AASJ;EAEI","sources":["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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.77b903e1.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/accordion",
3
- "version": "3.0.0-alpha.33",
3
+ "version": "3.0.0-alpha.34",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,18 +36,18 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/accordion": "3.0.0-alpha.31",
40
- "@react-aria/focus": "^3.18.1",
41
- "@react-aria/i18n": "^3.12.1",
42
- "@react-aria/interactions": "^3.22.1",
43
- "@react-aria/utils": "^3.25.1",
44
- "@react-spectrum/utils": "^3.11.9",
45
- "@react-stately/collections": "^3.10.9",
46
- "@react-stately/tree": "^3.8.3",
47
- "@react-types/accordion": "3.0.0-alpha.23",
48
- "@react-types/shared": "^3.24.1",
49
- "@spectrum-icons/ui": "^3.6.9",
50
- "@swc/helpers": "^0.5.0"
39
+ "@react-aria/accordion": "3.0.0-alpha.34",
40
+ "@react-aria/focus": "^3.18.3",
41
+ "@react-aria/i18n": "^3.12.3",
42
+ "@react-aria/interactions": "^3.22.3",
43
+ "@react-aria/utils": "^3.25.3",
44
+ "@react-spectrum/utils": "^3.11.11",
45
+ "@react-stately/collections": "^3.11.0",
46
+ "@react-stately/tree": "^3.8.5",
47
+ "@react-types/shared": "^3.25.0",
48
+ "@spectrum-icons/ui": "^3.6.10",
49
+ "@swc/helpers": "^0.5.0",
50
+ "react-aria-components": "^1.4.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
@@ -59,6 +59,5 @@
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"
62
- },
63
- "gitHead": "f0aa6aacee60af265dc8994b9274ccf072a850aa"
64
- }
62
+ }
63
+ }
package/src/Accordion.tsx CHANGED
@@ -10,91 +10,120 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
+ import {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';
14
+ import {Button, UNSTABLE_DisclosureGroup as DisclosureGroup, DisclosureGroupProps, DisclosurePanelProps, DisclosureProps, Heading, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel} from 'react-aria-components';
13
15
  import ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';
14
16
  import ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';
15
17
  import {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';
16
- import {DOMRef, Node} from '@react-types/shared';
17
- import {filterDOMProps, mergeProps} from '@react-aria/utils';
18
- import {FocusRing} from '@react-aria/focus';
19
- import React, {forwardRef, useRef} from 'react';
20
- import {SpectrumAccordionProps} from '@react-types/accordion';
18
+ import React, {forwardRef} from 'react';
21
19
  import styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';
22
- import {TreeState, useTreeState} from '@react-stately/tree';
23
- import {useAccordion, useAccordionItem} from '@react-aria/accordion';
24
- import {useHover} from '@react-aria/interactions';
25
20
  import {useLocale} from '@react-aria/i18n';
26
21
  import {useProviderProps} from '@react-spectrum/provider';
27
22
 
23
+ export interface SpectrumAccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children'>, StyleProps, DOMProps {
24
+ /** The disclosures within the accordion group. */
25
+ children: React.ReactNode
26
+ }
28
27
 
29
- function Accordion<T extends object>(props: SpectrumAccordionProps<T>, ref: DOMRef<HTMLDivElement>) {
28
+ function Accordion(props: SpectrumAccordionProps, ref: DOMRef<HTMLDivElement>) {
30
29
  props = useProviderProps(props);
31
- let state = useTreeState<T>(props);
32
30
  let {styleProps} = useStyleProps(props);
33
31
  let domRef = useDOMRef(ref);
34
- let {accordionProps} = useAccordion(props, state, domRef);
35
-
36
32
  return (
37
- <div
38
- {...filterDOMProps(props)}
39
- {...accordionProps}
33
+ <DisclosureGroup
34
+ {...props}
40
35
  {...styleProps}
41
36
  ref={domRef}
42
37
  className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>
43
- {[...state.collection].map(item => (
44
- <AccordionItem<T> key={item.key} item={item} state={state} />
45
- ))}
46
- </div>
38
+ {props.children}
39
+ </DisclosureGroup>
47
40
  );
48
41
  }
49
42
 
50
- interface AccordionItemProps<T> {
51
- item: Node<T>,
52
- state: TreeState<T>
43
+ export interface SpectrumDisclosureProps extends Omit<DisclosureProps, 'className' | 'style' | 'children'>, AriaLabelingProps {
44
+ /** The contents of the disclosure. The first child should be the header, and the second child should be the panel. */
45
+ children: React.ReactNode
53
46
  }
54
47
 
55
- function AccordionItem<T>(props: AccordionItemProps<T>) {
48
+ function Disclosure(props: SpectrumDisclosureProps, ref: DOMRef<HTMLDivElement>) {
56
49
  props = useProviderProps(props);
57
- let ref = useRef<HTMLButtonElement>(null);
58
- let {state, item} = props;
59
- let {buttonProps, regionProps} = useAccordionItem<T>(props, state, ref);
60
- let isOpen = state.expandedKeys.has(item.key);
61
- let isDisabled = state.disabledKeys.has(item.key);
62
- let {isHovered, hoverProps} = useHover({isDisabled});
63
- let {direction} = useLocale();
64
-
50
+ let domRef = useDOMRef(ref);
65
51
  return (
66
- <div
67
- className={classNames(styles, 'spectrum-Accordion-item', {
68
- 'is-open': isOpen,
52
+ <RACDisclosure
53
+ {...props}
54
+ ref={domRef}
55
+ className={({isExpanded, isDisabled}) => classNames(styles, 'spectrum-Accordion-item', {
56
+ 'is-expanded': isExpanded,
69
57
  'is-disabled': isDisabled
70
58
  })}>
71
- <h3 className={classNames(styles, 'spectrum-Accordion-itemHeading')}>
72
- <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>
73
- <button
74
- {...mergeProps(buttonProps, hoverProps)}
75
- ref={ref}
76
- className={classNames(styles, 'spectrum-Accordion-itemHeader', {
77
- 'is-hovered': isHovered
78
- })}>
79
- {direction === 'ltr' ? (
80
- <ChevronRightMedium
81
- aria-hidden="true"
82
- UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />
59
+ {props.children}
60
+ </RACDisclosure>
61
+ );
62
+ }
63
+
64
+ export interface SpectrumDisclosurePanelProps extends Omit<DisclosurePanelProps, 'className' | 'style' | 'children'>, DOMProps, AriaLabelingProps {
65
+ /** The contents of the accordion panel. */
66
+ children: React.ReactNode
67
+ }
68
+
69
+ function DisclosurePanel(props: SpectrumDisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {
70
+ let domRef = useDOMRef(ref);
71
+ return (
72
+ <RACDisclosurePanel ref={domRef} className={classNames(styles, 'spectrum-Accordion-itemContent')} {...props}>
73
+ {props.children}
74
+ </RACDisclosurePanel>
75
+ );
76
+ }
77
+
78
+ export interface SpectrumDisclosureHeaderProps extends DOMProps, AriaLabelingProps {
79
+ /**
80
+ * The heading level of the disclosure header.
81
+ * @default 3
82
+ */
83
+ level?: number,
84
+ /** The contents of the disclosure header. */
85
+ children: React.ReactNode
86
+ }
87
+
88
+ function DisclosureHeader(props: SpectrumDisclosureHeaderProps, ref: DOMRef<HTMLHeadingElement>) {
89
+ let {level = 3} = props;
90
+ let {direction} = useLocale();
91
+ let domRef = useDOMRef(ref);
92
+ return (
93
+ <Heading ref={domRef} level={level} className={classNames(styles, 'spectrum-Accordion-itemHeading')}>
94
+ <Button
95
+ slot="trigger"
96
+ className={({isHovered, isFocusVisible}) => classNames(styles, 'spectrum-Accordion-itemHeader', {
97
+ 'is-hovered': isHovered,
98
+ 'focus-ring': isFocusVisible
99
+ })}>
100
+ {direction === 'ltr' ? (
101
+ <ChevronRightMedium
102
+ aria-hidden="true"
103
+ UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />
83
104
  ) : (
84
105
  <ChevronLeftMedium
85
106
  aria-hidden="true"
86
107
  UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />
87
108
  )}
88
- {item.props.title}
89
- </button>
90
- </FocusRing>
91
- </h3>
92
- <div {...regionProps} className={classNames(styles, 'spectrum-Accordion-itemContent')}>
93
- {item.props.children}
94
- </div>
95
- </div>
109
+ {props.children}
110
+ </Button>
111
+ </Heading>
96
112
  );
97
113
  }
98
114
 
99
- const _Accordion = forwardRef(Accordion) as <T>(props: SpectrumAccordionProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof Accordion>;
115
+ /** A group of disclosures that can be expanded and collapsed. */
116
+ const _Accordion = forwardRef(Accordion) as (props: SpectrumAccordionProps & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof Accordion>;
100
117
  export {_Accordion as Accordion};
118
+
119
+ /** A collapsible section of content composed of a heading that expands and collapses a panel. */
120
+ const _Disclosure = forwardRef(Disclosure) as (props: SpectrumDisclosureProps & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof Disclosure>;
121
+ export {_Disclosure as Disclosure};
122
+
123
+ /** The panel that contains the content of an disclosure. */
124
+ const _DisclosurePanel = forwardRef(DisclosurePanel) as (props: SpectrumDisclosurePanelProps & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof DisclosurePanel>;
125
+ export {_DisclosurePanel as DisclosurePanel};
126
+
127
+ /** The heading of the disclosure. */
128
+ const _DisclosureHeader = forwardRef(DisclosureHeader) as (props: SpectrumDisclosureHeaderProps & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof DisclosureHeader>;
129
+ export {_DisclosureHeader as DisclosureHeader};
package/src/index.ts CHANGED
@@ -10,6 +10,5 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  /// <reference types="css-module-types" />
13
- export {Accordion} from './Accordion';
14
- export {Item} from '@react-stately/collections';
15
- export type {SpectrumAccordionProps} from '@react-types/accordion';
13
+ export {Disclosure, Accordion, DisclosureHeader, DisclosurePanel} from './Accordion';
14
+ export type {SpectrumAccordionProps, SpectrumDisclosureProps, SpectrumDisclosurePanelProps, SpectrumDisclosureHeaderProps} from './Accordion';