@react-spectrum/accordion 3.0.0-alpha.32 → 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.
- package/dist/Accordion.main.js +44 -51
- package/dist/Accordion.main.js.map +1 -1
- package/dist/Accordion.mjs +43 -53
- package/dist/Accordion.module.js +43 -53
- package/dist/Accordion.module.js.map +1 -1
- package/dist/accordion_vars_css.main.js +12 -12
- package/dist/accordion_vars_css.main.js.map +1 -1
- package/dist/accordion_vars_css.mjs +12 -12
- package/dist/accordion_vars_css.module.js +12 -12
- package/dist/accordion_vars_css.module.js.map +1 -1
- package/dist/import.mjs +2 -4
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -4
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +41 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/vars.77b903e1.css +145 -0
- package/dist/vars.77b903e1.css.map +1 -0
- package/package.json +15 -16
- package/src/Accordion.tsx +84 -55
- package/src/index.ts +2 -3
- package/LICENSE +0 -201
- package/dist/vars.1361683a.css +0 -144
- package/dist/vars.1361683a.css.map +0 -1
|
@@ -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 = `
|
|
28
|
-
$cd9bb50514faf076$export$d35bc1e505d1ebbf = `
|
|
29
|
-
$cd9bb50514faf076$export$
|
|
30
|
-
$cd9bb50514faf076$export$
|
|
31
|
-
$cd9bb50514faf076$export$bed6cbae852b32f0 = `
|
|
32
|
-
$cd9bb50514faf076$export$a1947cb8adf67515 = `
|
|
33
|
-
$cd9bb50514faf076$export$951cb9dc63743241 = `
|
|
34
|
-
$cd9bb50514faf076$export$4da8efb546c03356 = `
|
|
35
|
-
$cd9bb50514faf076$export$36876b8193439034 = `
|
|
36
|
-
$cd9bb50514faf076$export$35196e2132b47abd = `
|
|
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,
|
|
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, "
|
|
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":"
|
|
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
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
9
|
-
export
|
|
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
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;
|
|
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.
|
|
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.
|
|
40
|
-
"@react-aria/focus": "^3.18.
|
|
41
|
-
"@react-aria/i18n": "^3.12.
|
|
42
|
-
"@react-aria/interactions": "^3.22.
|
|
43
|
-
"@react-aria/utils": "^3.25.
|
|
44
|
-
"@react-spectrum/utils": "^3.11.
|
|
45
|
-
"@react-stately/collections": "^3.
|
|
46
|
-
"@react-stately/tree": "^3.8.
|
|
47
|
-
"@react-types/
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
<
|
|
38
|
-
{...
|
|
39
|
-
{...accordionProps}
|
|
33
|
+
<DisclosureGroup
|
|
34
|
+
{...props}
|
|
40
35
|
{...styleProps}
|
|
41
36
|
ref={domRef}
|
|
42
37
|
className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
))}
|
|
46
|
-
</div>
|
|
38
|
+
{props.children}
|
|
39
|
+
</DisclosureGroup>
|
|
47
40
|
);
|
|
48
41
|
}
|
|
49
42
|
|
|
50
|
-
interface
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
48
|
+
function Disclosure(props: SpectrumDisclosureProps, ref: DOMRef<HTMLDivElement>) {
|
|
56
49
|
props = useProviderProps(props);
|
|
57
|
-
let
|
|
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
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
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 {
|
|
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';
|