@react-spectrum/accordion 3.0.0-nightly.3698 → 3.0.0-nightly.3709

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.
Files changed (2) hide show
  1. package/dist/import.mjs +152 -0
  2. package/package.json +19 -14
@@ -0,0 +1,152 @@
1
+ import "./main.css";
2
+ import {Item as $8ae4d4d1aa0c5e03$re_export$Item} from "@react-stately/collections";
3
+ import $3Uu4R$spectrumiconsuiChevronLeftMedium from "@spectrum-icons/ui/ChevronLeftMedium";
4
+ import $3Uu4R$spectrumiconsuiChevronRightMedium from "@spectrum-icons/ui/ChevronRightMedium";
5
+ import {useStyleProps as $3Uu4R$useStyleProps, useDOMRef as $3Uu4R$useDOMRef, classNames as $3Uu4R$classNames} from "@react-spectrum/utils";
6
+ import {filterDOMProps as $3Uu4R$filterDOMProps, mergeProps as $3Uu4R$mergeProps} from "@react-aria/utils";
7
+ import {FocusRing as $3Uu4R$FocusRing} from "@react-aria/focus";
8
+ import $3Uu4R$react, {useRef as $3Uu4R$useRef, forwardRef as $3Uu4R$forwardRef} from "react";
9
+ import {useTreeState as $3Uu4R$useTreeState} from "@react-stately/tree";
10
+ import {useAccordion as $3Uu4R$useAccordion, useAccordionItem as $3Uu4R$useAccordionItem} from "@react-aria/accordion";
11
+ import {useHover as $3Uu4R$useHover} from "@react-aria/interactions";
12
+ import {useLocale as $3Uu4R$useLocale} from "@react-aria/i18n";
13
+ import {useProviderProps as $3Uu4R$useProviderProps} from "@react-spectrum/provider";
14
+
15
+ function $parcel$interopDefault(a) {
16
+ return a && a.__esModule ? a.default : a;
17
+ }
18
+ function $parcel$export(e, n, v, s) {
19
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
20
+ }
21
+ /*
22
+ * Copyright 2020 Adobe. All rights reserved.
23
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License. You may obtain a copy
25
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software distributed under
28
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
+ * OF ANY KIND, either express or implied. See the License for the specific language
30
+ * governing permissions and limitations under the License.
31
+ */ /// <reference types="css-module-types" />
32
+ /*
33
+ * Copyright 2020 Adobe. All rights reserved.
34
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
35
+ * you may not use this file except in compliance with the License. You may obtain a copy
36
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
37
+ *
38
+ * Unless required by applicable law or agreed to in writing, software distributed under
39
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40
+ * OF ANY KIND, either express or implied. See the License for the specific language
41
+ * governing permissions and limitations under the License.
42
+ */
43
+
44
+
45
+
46
+
47
+
48
+ var $cd9bb50514faf076$exports = {};
49
+
50
+ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion", () => $cd9bb50514faf076$export$bed6cbae852b32f0, (v) => $cd9bb50514faf076$export$bed6cbae852b32f0 = v);
51
+ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemIndicator", () => $cd9bb50514faf076$export$35196e2132b47abd, (v) => $cd9bb50514faf076$export$35196e2132b47abd = v);
52
+ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-item", () => $cd9bb50514faf076$export$a1947cb8adf67515, (v) => $cd9bb50514faf076$export$a1947cb8adf67515 = v);
53
+ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemHeading", () => $cd9bb50514faf076$export$36876b8193439034, (v) => $cd9bb50514faf076$export$36876b8193439034 = v);
54
+ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemHeader", () => $cd9bb50514faf076$export$4da8efb546c03356, (v) => $cd9bb50514faf076$export$4da8efb546c03356 = v);
55
+ $parcel$export($cd9bb50514faf076$exports, "spectrum-Accordion-itemContent", () => $cd9bb50514faf076$export$951cb9dc63743241, (v) => $cd9bb50514faf076$export$951cb9dc63743241 = v);
56
+ $parcel$export($cd9bb50514faf076$exports, "is-open", () => $cd9bb50514faf076$export$a9781837241c946d, (v) => $cd9bb50514faf076$export$a9781837241c946d = v);
57
+ $parcel$export($cd9bb50514faf076$exports, "is-disabled", () => $cd9bb50514faf076$export$d35bc1e505d1ebbf, (v) => $cd9bb50514faf076$export$d35bc1e505d1ebbf = v);
58
+ $parcel$export($cd9bb50514faf076$exports, "is-hovered", () => $cd9bb50514faf076$export$b8813cd5d7824ce7, (v) => $cd9bb50514faf076$export$b8813cd5d7824ce7 = v);
59
+ $parcel$export($cd9bb50514faf076$exports, "focus-ring", () => $cd9bb50514faf076$export$f39a09f249340e2a, (v) => $cd9bb50514faf076$export$f39a09f249340e2a = v);
60
+ var $cd9bb50514faf076$export$bed6cbae852b32f0;
61
+ var $cd9bb50514faf076$export$35196e2132b47abd;
62
+ var $cd9bb50514faf076$export$a1947cb8adf67515;
63
+ var $cd9bb50514faf076$export$36876b8193439034;
64
+ var $cd9bb50514faf076$export$4da8efb546c03356;
65
+ var $cd9bb50514faf076$export$951cb9dc63743241;
66
+ var $cd9bb50514faf076$export$a9781837241c946d;
67
+ var $cd9bb50514faf076$export$d35bc1e505d1ebbf;
68
+ var $cd9bb50514faf076$export$b8813cd5d7824ce7;
69
+ var $cd9bb50514faf076$export$f39a09f249340e2a;
70
+ $cd9bb50514faf076$export$bed6cbae852b32f0 = "spectrum-Accordion_b4e47f";
71
+ $cd9bb50514faf076$export$35196e2132b47abd = "spectrum-Accordion-itemIndicator_b4e47f";
72
+ $cd9bb50514faf076$export$a1947cb8adf67515 = "spectrum-Accordion-item_b4e47f";
73
+ $cd9bb50514faf076$export$36876b8193439034 = "spectrum-Accordion-itemHeading_b4e47f";
74
+ $cd9bb50514faf076$export$4da8efb546c03356 = "spectrum-Accordion-itemHeader_b4e47f";
75
+ $cd9bb50514faf076$export$951cb9dc63743241 = "spectrum-Accordion-itemContent_b4e47f";
76
+ $cd9bb50514faf076$export$a9781837241c946d = "is-open_b4e47f";
77
+ $cd9bb50514faf076$export$d35bc1e505d1ebbf = "is-disabled_b4e47f";
78
+ $cd9bb50514faf076$export$b8813cd5d7824ce7 = "is-hovered_b4e47f";
79
+ $cd9bb50514faf076$export$f39a09f249340e2a = "focus-ring_b4e47f";
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+ function $2a5a5b7faca81754$var$Accordion(props, ref) {
88
+ props = (0, $3Uu4R$useProviderProps)(props);
89
+ let state = (0, $3Uu4R$useTreeState)(props);
90
+ let { styleProps: styleProps } = (0, $3Uu4R$useStyleProps)(props);
91
+ let domRef = (0, $3Uu4R$useDOMRef)(ref);
92
+ let { accordionProps: accordionProps } = (0, $3Uu4R$useAccordion)(props, state, domRef);
93
+ return /*#__PURE__*/ (0, $3Uu4R$react).createElement("div", {
94
+ ...(0, $3Uu4R$filterDOMProps)(props),
95
+ ...accordionProps,
96
+ ...styleProps,
97
+ ref: domRef,
98
+ className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion", styleProps.className)
99
+ }, [
100
+ ...state.collection
101
+ ].map((item)=>/*#__PURE__*/ (0, $3Uu4R$react).createElement($2a5a5b7faca81754$var$AccordionItem, {
102
+ key: item.key,
103
+ item: item,
104
+ state: state
105
+ })));
106
+ }
107
+ function $2a5a5b7faca81754$var$AccordionItem(props) {
108
+ props = (0, $3Uu4R$useProviderProps)(props);
109
+ let ref = (0, $3Uu4R$useRef)(null);
110
+ let { state: state , item: item } = props;
111
+ let { buttonProps: buttonProps , regionProps: regionProps } = (0, $3Uu4R$useAccordionItem)(props, state, ref);
112
+ let isOpen = state.expandedKeys.has(item.key);
113
+ let isDisabled = state.disabledKeys.has(item.key);
114
+ let { isHovered: isHovered , hoverProps: hoverProps } = (0, $3Uu4R$useHover)({
115
+ isDisabled: isDisabled
116
+ });
117
+ let { direction: direction } = (0, $3Uu4R$useLocale)();
118
+ return /*#__PURE__*/ (0, $3Uu4R$react).createElement("div", {
119
+ className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion-item", {
120
+ "is-open": isOpen,
121
+ "is-disabled": isDisabled
122
+ })
123
+ }, /*#__PURE__*/ (0, $3Uu4R$react).createElement("h3", {
124
+ className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion-itemHeading")
125
+ }, /*#__PURE__*/ (0, $3Uu4R$react).createElement((0, $3Uu4R$FocusRing), {
126
+ within: true,
127
+ focusRingClass: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "focus-ring")
128
+ }, /*#__PURE__*/ (0, $3Uu4R$react).createElement("button", {
129
+ ...(0, $3Uu4R$mergeProps)(buttonProps, hoverProps),
130
+ ref: ref,
131
+ className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion-itemHeader", {
132
+ "is-hovered": isHovered
133
+ })
134
+ }, direction === "ltr" ? /*#__PURE__*/ (0, $3Uu4R$react).createElement((0, $3Uu4R$spectrumiconsuiChevronRightMedium), {
135
+ "aria-hidden": "true",
136
+ UNSAFE_className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion-itemIndicator")
137
+ }) : /*#__PURE__*/ (0, $3Uu4R$react).createElement((0, $3Uu4R$spectrumiconsuiChevronLeftMedium), {
138
+ "aria-hidden": "true",
139
+ UNSAFE_className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion-itemIndicator")
140
+ }), item.props.title))), /*#__PURE__*/ (0, $3Uu4R$react).createElement("div", {
141
+ ...regionProps,
142
+ className: (0, $3Uu4R$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd9bb50514faf076$exports))), "spectrum-Accordion-itemContent")
143
+ }, item.props.children));
144
+ }
145
+ const $2a5a5b7faca81754$export$a766cd26d0d69044 = /*#__PURE__*/ (0, $3Uu4R$forwardRef)($2a5a5b7faca81754$var$Accordion);
146
+
147
+
148
+
149
+
150
+
151
+ export {$2a5a5b7faca81754$export$a766cd26d0d69044 as Accordion, $8ae4d4d1aa0c5e03$re_export$Item as Item};
152
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-spectrum/accordion",
3
- "version": "3.0.0-nightly.3698+72ee92f6d",
3
+ "version": "3.0.0-nightly.3709+0f953cac8",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -31,21 +36,21 @@
31
36
  "url": "https://github.com/adobe/react-spectrum"
32
37
  },
33
38
  "dependencies": {
34
- "@react-aria/accordion": "3.0.0-nightly.3698+72ee92f6d",
35
- "@react-aria/focus": "3.0.0-nightly.1998+72ee92f6d",
36
- "@react-aria/i18n": "3.0.0-nightly.1998+72ee92f6d",
37
- "@react-aria/interactions": "3.0.0-nightly.1998+72ee92f6d",
38
- "@react-aria/utils": "3.0.0-nightly.1998+72ee92f6d",
39
- "@react-spectrum/utils": "3.0.0-nightly.1998+72ee92f6d",
40
- "@react-stately/collections": "3.0.0-nightly.1998+72ee92f6d",
41
- "@react-stately/tree": "3.0.0-nightly.1998+72ee92f6d",
42
- "@react-types/accordion": "3.0.0-nightly.3698+72ee92f6d",
43
- "@react-types/shared": "3.0.0-nightly.1998+72ee92f6d",
44
- "@spectrum-icons/ui": "3.0.0-nightly.1998+72ee92f6d",
39
+ "@react-aria/accordion": "3.0.0-nightly.3709+0f953cac8",
40
+ "@react-aria/focus": "3.0.0-nightly.2009+0f953cac8",
41
+ "@react-aria/i18n": "3.0.0-nightly.2009+0f953cac8",
42
+ "@react-aria/interactions": "3.0.0-nightly.2009+0f953cac8",
43
+ "@react-aria/utils": "3.0.0-nightly.2009+0f953cac8",
44
+ "@react-spectrum/utils": "3.0.0-nightly.2009+0f953cac8",
45
+ "@react-stately/collections": "3.0.0-nightly.2009+0f953cac8",
46
+ "@react-stately/tree": "3.0.0-nightly.2009+0f953cac8",
47
+ "@react-types/accordion": "3.0.0-nightly.3709+0f953cac8",
48
+ "@react-types/shared": "3.0.0-nightly.2009+0f953cac8",
49
+ "@spectrum-icons/ui": "3.0.0-nightly.2009+0f953cac8",
45
50
  "@swc/helpers": "^0.4.14"
46
51
  },
47
52
  "devDependencies": {
48
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1998+72ee92f6d"
53
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2009+0f953cac8"
49
54
  },
50
55
  "peerDependencies": {
51
56
  "@react-spectrum/provider": "^3.0.0",
@@ -54,5 +59,5 @@
54
59
  "publishConfig": {
55
60
  "access": "public"
56
61
  },
57
- "gitHead": "72ee92f6d497163468a80642ccb96576f822f365"
62
+ "gitHead": "0f953cac84f98cdff29f2348c120ce541ebb6da8"
58
63
  }