@react-spectrum/tree 3.1.11 → 3.2.0

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/import.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import {TreeView as $48b8113347121625$export$6940b0d9c820eca7, TreeViewItem as $48b8113347121625$export$6e77ea6719814e9c, TreeViewItemContent as $48b8113347121625$export$9a5779ed3fade674} from "./TreeView.mjs";
2
- import {Collection as $da02c2e17f72ffe6$re_export$Collection} from "react-aria-components";
1
+ import {TreeViewItem as $5ac558a2c017af70$re_export$TreeViewItem, TreeView as $5ac558a2c017af70$re_export$TreeView, TreeViewItemContent as $5ac558a2c017af70$re_export$TreeViewItemContent} from "@adobe/react-spectrum/TreeView";
2
+ import {Collection as $5ac558a2c017af70$re_export$Collection} from "react-aria/Collection";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {Collection as $da02c2e17f72ffe6$re_export$Collection} from "react-aria-c
16
16
 
17
17
 
18
18
 
19
- export {$48b8113347121625$export$6e77ea6719814e9c as TreeViewItem, $48b8113347121625$export$6940b0d9c820eca7 as TreeView, $48b8113347121625$export$9a5779ed3fade674 as TreeViewItemContent, $da02c2e17f72ffe6$re_export$Collection as Collection};
19
+ export {$5ac558a2c017af70$re_export$TreeViewItem as TreeViewItem, $5ac558a2c017af70$re_export$TreeView as TreeView, $5ac558a2c017af70$re_export$TreeViewItemContent as TreeViewItemContent, $5ac558a2c017af70$re_export$Collection as Collection};
20
20
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,15 +1,15 @@
1
- var $9b0dbe0a88ecfa3f$exports = require("./TreeView.main.js");
2
- var $b4yIO$reactariacomponents = require("react-aria-components");
1
+ var $e79FW$adobereactspectrumTreeView = require("@adobe/react-spectrum/TreeView");
2
+ var $e79FW$reactariaCollection = require("react-aria/Collection");
3
3
 
4
4
 
5
5
  function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
8
 
9
- $parcel$export(module.exports, "TreeViewItem", () => $9b0dbe0a88ecfa3f$exports.TreeViewItem);
10
- $parcel$export(module.exports, "TreeView", () => $9b0dbe0a88ecfa3f$exports.TreeView);
11
- $parcel$export(module.exports, "TreeViewItemContent", () => $9b0dbe0a88ecfa3f$exports.TreeViewItemContent);
12
- $parcel$export(module.exports, "Collection", () => $b4yIO$reactariacomponents.Collection);
9
+ $parcel$export(module.exports, "TreeViewItem", function () { return $e79FW$adobereactspectrumTreeView.TreeViewItem; });
10
+ $parcel$export(module.exports, "TreeView", function () { return $e79FW$adobereactspectrumTreeView.TreeView; });
11
+ $parcel$export(module.exports, "TreeViewItemContent", function () { return $e79FW$adobereactspectrumTreeView.TreeViewItemContent; });
12
+ $parcel$export(module.exports, "Collection", function () { return $e79FW$reactariaCollection.Collection; });
13
13
  /*
14
14
  * Copyright 2020 Adobe. All rights reserved.
15
15
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/tree/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\n/// <reference types=\"css-module-types\" />\n\nexport {TreeViewItem, TreeView, TreeViewItemContent} from './TreeView';\nexport {Collection} from 'react-aria-components';\nexport type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from './TreeView';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/tree/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\n/// <reference types=\"css-module-types\" />\n\nexport {TreeViewItem, TreeView, TreeViewItemContent} from '@adobe/react-spectrum/TreeView';\n\nexport type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from '@adobe/react-spectrum/TreeView';\nexport {Collection} from 'react-aria/Collection';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
- import {TreeView as $48b8113347121625$export$6940b0d9c820eca7, TreeViewItem as $48b8113347121625$export$6e77ea6719814e9c, TreeViewItemContent as $48b8113347121625$export$9a5779ed3fade674} from "./TreeView.module.js";
2
- import {Collection as $da02c2e17f72ffe6$re_export$Collection} from "react-aria-components";
1
+ import {TreeViewItem as $5ac558a2c017af70$re_export$TreeViewItem, TreeView as $5ac558a2c017af70$re_export$TreeView, TreeViewItemContent as $5ac558a2c017af70$re_export$TreeViewItemContent} from "@adobe/react-spectrum/TreeView";
2
+ import {Collection as $5ac558a2c017af70$re_export$Collection} from "react-aria/Collection";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {Collection as $da02c2e17f72ffe6$re_export$Collection} from "react-aria-c
16
16
 
17
17
 
18
18
 
19
- export {$48b8113347121625$export$6e77ea6719814e9c as TreeViewItem, $48b8113347121625$export$6940b0d9c820eca7 as TreeView, $48b8113347121625$export$9a5779ed3fade674 as TreeViewItemContent, $da02c2e17f72ffe6$re_export$Collection as Collection};
19
+ export {$5ac558a2c017af70$re_export$TreeViewItem as TreeViewItem, $5ac558a2c017af70$re_export$TreeView as TreeView, $5ac558a2c017af70$re_export$TreeViewItemContent as TreeViewItemContent, $5ac558a2c017af70$re_export$Collection as Collection};
20
20
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/tree/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\n/// <reference types=\"css-module-types\" />\n\nexport {TreeViewItem, TreeView, TreeViewItemContent} from './TreeView';\nexport {Collection} from 'react-aria-components';\nexport type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from './TreeView';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/tree/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\n/// <reference types=\"css-module-types\" />\n\nexport {TreeViewItem, TreeView, TreeViewItemContent} from '@adobe/react-spectrum/TreeView';\n\nexport type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from '@adobe/react-spectrum/TreeView';\nexport {Collection} from 'react-aria/Collection';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,3 @@
1
+ export { TreeViewItem, TreeView, TreeViewItemContent } from '@adobe/react-spectrum/TreeView';
2
+ export type { SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps } from '@adobe/react-spectrum/TreeView';
3
+ export { Collection } from 'react-aria/Collection';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/tree",
3
- "version": "3.1.11",
3
+ "version": "3.2.0",
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
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,45 +24,23 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/button": "^3.14.5",
44
- "@react-aria/i18n": "^3.12.16",
45
- "@react-aria/tree": "^3.1.7",
46
- "@react-aria/utils": "^3.33.1",
47
- "@react-spectrum/checkbox": "^3.10.7",
48
- "@react-spectrum/text": "^3.5.25",
49
- "@react-spectrum/utils": "^3.12.12",
50
- "@react-types/shared": "^3.33.1",
51
- "@spectrum-icons/ui": "^3.6.23",
34
+ "@adobe/react-spectrum": "3.47.0",
52
35
  "@swc/helpers": "^0.5.0",
53
- "react-aria-components": "^1.16.0"
36
+ "react-aria": "3.48.0"
54
37
  },
55
38
  "peerDependencies": {
56
- "@react-spectrum/provider": "^3.0.0",
57
39
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
58
40
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
59
41
  },
60
- "devDependencies": {
61
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
62
- "@react-spectrum/style-macro-s1": "3.0.0-alpha.5"
63
- },
64
42
  "publishConfig": {
65
43
  "access": "public"
66
44
  },
67
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
45
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
68
46
  }
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {TreeViewItem, TreeView, TreeViewItemContent} from './TreeView';
16
- export {Collection} from 'react-aria-components';
17
- export type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from './TreeView';
15
+ export {TreeViewItem, TreeView, TreeViewItemContent} from '@adobe/react-spectrum/TreeView';
16
+
17
+ export type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from '@adobe/react-spectrum/TreeView';
18
+ export {Collection} from 'react-aria/Collection';
@@ -1,310 +0,0 @@
1
- require("./tree.961568f2.css");
2
- var $6Q8R1$reactariacomponents = require("react-aria-components");
3
- var $6Q8R1$reactspectrumcheckbox = require("@react-spectrum/checkbox");
4
- var $6Q8R1$spectrumiconsuiChevronLeftMedium = require("@spectrum-icons/ui/ChevronLeftMedium");
5
- var $6Q8R1$spectrumiconsuiChevronRightMedium = require("@spectrum-icons/ui/ChevronRightMedium");
6
- var $6Q8R1$reactariautils = require("@react-aria/utils");
7
- var $6Q8R1$react = require("react");
8
- var $6Q8R1$reactspectrumutils = require("@react-spectrum/utils");
9
- var $6Q8R1$reactariabutton = require("@react-aria/button");
10
- var $6Q8R1$reactariai18n = require("@react-aria/i18n");
11
-
12
-
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
-
17
- function $parcel$export(e, n, v, s) {
18
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
- }
20
-
21
- $parcel$export(module.exports, "TreeView", () => $9b0dbe0a88ecfa3f$export$6940b0d9c820eca7);
22
- $parcel$export(module.exports, "TreeViewItem", () => $9b0dbe0a88ecfa3f$export$6e77ea6719814e9c);
23
- $parcel$export(module.exports, "TreeViewItemContent", () => $9b0dbe0a88ecfa3f$export$9a5779ed3fade674);
24
- /*
25
- * Copyright 2024 Adobe. All rights reserved.
26
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
- * you may not use this file except in compliance with the License. You may obtain a copy
28
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
- *
30
- * Unless required by applicable law or agreed to in writing, software distributed under
31
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
- * OF ANY KIND, either express or implied. See the License for the specific language
33
- * governing permissions and limitations under the License.
34
- */
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
- const $9b0dbe0a88ecfa3f$var$TreeRendererContext = /*#__PURE__*/ (0, $6Q8R1$react.createContext)({});
44
- // TODO: add animations for rows appearing and disappearing
45
- // TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the
46
- // keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't
47
- // scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview
48
- const $9b0dbe0a88ecfa3f$var$tree = function anonymous(props) {
49
- let rules = "";
50
- if (props.isFocusVisible) rules += ' s1-_Fs1-b';
51
- else rules += ' s1-_Fs1-a';
52
- rules += ' s1-ds1-as1-___D';
53
- rules += ' s1-ds1-___I';
54
- rules += ' s1-_Hs1-c';
55
- rules += ' s1-_G-yj8a3w';
56
- rules += ' s1-ns1-Y';
57
- rules += ' s1-os1-Y';
58
- rules += ' s1-ws1-c';
59
- rules += ' s1-xs1-c';
60
- rules += ' s1-us1-a';
61
- rules += ' s1-vs1-a';
62
- rules += ' s1-__ls1-a';
63
- rules += ' s1-As1-a';
64
- rules += ' s1-cs1-as1-___y';
65
- rules += ' s1-cs1-a';
66
- if (props.isEmpty) rules += ' s1-_Ws1-d';
67
- if (props.isEmpty) rules += ' s1-_Vs1-c';
68
- if (props.isEmpty) rules += ' s1-_Ts1-d';
69
- rules += ' s1-__ts1-a';
70
- rules += ' s1-__us1-a';
71
- return rules;
72
- };
73
- const $9b0dbe0a88ecfa3f$export$6940b0d9c820eca7 = /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).forwardRef(function TreeView(props, ref) {
74
- let { children: children, selectionStyle: selectionStyle, UNSAFE_className: UNSAFE_className } = props;
75
- let renderer;
76
- if (typeof children === 'function') renderer = children;
77
- let { styleProps: styleProps } = (0, $6Q8R1$reactspectrumutils.useStyleProps)(props);
78
- let domRef = (0, $6Q8R1$reactspectrumutils.useDOMRef)(ref);
79
- let selectionBehavior = selectionStyle === 'highlight' ? 'replace' : 'toggle';
80
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement($9b0dbe0a88ecfa3f$var$TreeRendererContext.Provider, {
81
- value: {
82
- renderer: renderer
83
- }
84
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, $6Q8R1$reactariacomponents.Tree), {
85
- ...props,
86
- ...styleProps,
87
- className: (renderProps)=>(UNSAFE_className !== null && UNSAFE_className !== void 0 ? UNSAFE_className : '') + $9b0dbe0a88ecfa3f$var$tree(renderProps),
88
- selectionBehavior: selectionBehavior,
89
- ref: domRef
90
- }, props.children));
91
- });
92
- const $9b0dbe0a88ecfa3f$var$treeRow = function anonymous(props) {
93
- let rules = "";
94
- rules += ' s1-Xs1-c';
95
- rules += ' s1-_Ts1-d';
96
- rules += ' s1-ns1-k';
97
- rules += ' s1-os1-Y';
98
- rules += ' s1-__ls1-a';
99
- rules += ' s1-6s1-c';
100
- rules += ' s1-7s1-d';
101
- rules += ' s1-9s1-b';
102
- rules += ' s1-as1-___K';
103
- rules += ' s1-_Fs1-a';
104
- if (props.isLink) rules += ' s1-__Fs1-c';
105
- else rules += ' s1-__Fs1-b';
106
- if (props.isSelected) rules += ' s1-b-7vr0l1';
107
- else if (props.isPressed) rules += ' s1-b-1t6gvb8';
108
- else if (props.isFocusVisibleWithin) rules += ' s1-b-ml9cvk';
109
- else if (props.isHovered) rules += ' s1-b-ml9cvk';
110
- return rules;
111
- };
112
- const $9b0dbe0a88ecfa3f$var$treeCellGrid = function anonymous(props) {
113
- let rules = "";
114
- rules += ' s1-_Ts1-f';
115
- rules += ' s1-os1-Y';
116
- rules += ' s1-_Vs1-c';
117
- rules += ' s1-__e-1nxidkl-1nxidkl-1nxidkl-3hmti-1nxidkl-375yi6-1nxidkl-ykdwf2';
118
- rules += ' s1-__f-375yi6';
119
- rules += ' s1-__g-1qk85yo';
120
- if (props.isDisabled) {
121
- rules += ' s1-as1-as1-___F';
122
- rules += ' s1-as1-i';
123
- }
124
- return rules;
125
- };
126
- // TODO: These styles lose against the spectrum class names, so I've did unsafe for the ones that get overridden
127
- const $9b0dbe0a88ecfa3f$var$treeCheckbox = function anonymous(props) {
128
- let rules = "";
129
- rules += ' s1-__h-4wahvw';
130
- rules += ' s1-_K-37nn5o';
131
- rules += ' s1-Cs1-d';
132
- rules += ' s1-Ds1-a';
133
- return rules;
134
- };
135
- const $9b0dbe0a88ecfa3f$var$treeIcon = function anonymous(props) {
136
- let rules = "";
137
- rules += ' s1-__h-ykjmzy';
138
- rules += ' s1-Ds1-c';
139
- return rules;
140
- };
141
- const $9b0dbe0a88ecfa3f$var$treeContent = function anonymous(props) {
142
- let rules = "";
143
- rules += ' s1-__h-1mod4sg';
144
- rules += ' s1-_gs1-a';
145
- rules += ' s1-_ks1-b';
146
- rules += ' s1-__ts1-b';
147
- rules += ' s1-__us1-b';
148
- return rules;
149
- };
150
- const $9b0dbe0a88ecfa3f$var$treeActions = function anonymous(props) {
151
- let rules = "";
152
- rules += ' s1-__h-8ayfo6';
153
- rules += ' s1-_4-3t1x';
154
- rules += ' s1-_3-3t1x';
155
- rules += ' s1-Cs1-F';
156
- rules += ' s1-Ds1-b';
157
- return rules;
158
- };
159
- const $9b0dbe0a88ecfa3f$var$treeActionMenu = function anonymous(props) {
160
- let rules = "";
161
- rules += ' s1-__h-wit6hk';
162
- rules += ' s1-os1-i';
163
- return rules;
164
- };
165
- const $9b0dbe0a88ecfa3f$var$treeRowOutline = function anonymous(props) {
166
- let rules = "";
167
- rules += ' s1-_Ts1-a';
168
- rules += ' s1-Xs1-a';
169
- rules += ' s1-Ys1-a';
170
- rules += ' s1-Zs1-a';
171
- if (props.isFirst) rules += ' s1-0s1-a';
172
- else if (props.isSelected) {
173
- if (props.isFocusVisible) rules += ' s1-0-yj8a3w';
174
- else rules += ' s1-0-yj899n';
175
- } else if (props.isFocusVisible) rules += ' s1-0-yj8a3w';
176
- else rules += ' s1-0s1-a';
177
- rules += ' s1-2s1-a';
178
- rules += ' s1-__zs1-a';
179
- rules += ' s1-_us1-b';
180
- if (props.isSelected) {
181
- if (props.isFocusVisible) rules += ' s1-_ps1-a-4bhpmf';
182
- else rules += ' s1-_ps1-a-zlnqab';
183
- } else if (props.isFocusVisible) rules += ' s1-_ps1-a-4bhpmf';
184
- if (props.isSelected) {
185
- if (props.isFocusVisible) rules += ' s1-_p-ba5uxf';
186
- else rules += ' s1-_p-1ytnijz';
187
- } else if (props.isFocusVisible) rules += ' s1-_p-ba5uxf';
188
- return rules;
189
- };
190
- const $9b0dbe0a88ecfa3f$export$6e77ea6719814e9c = (props)=>{
191
- let { href: href } = props;
192
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, $6Q8R1$reactariacomponents.TreeItem), {
193
- ...props,
194
- className: (renderProps)=>$9b0dbe0a88ecfa3f$var$treeRow({
195
- ...renderProps,
196
- isLink: !!href
197
- })
198
- });
199
- };
200
- const $9b0dbe0a88ecfa3f$export$9a5779ed3fade674 = (props)=>{
201
- let { children: children } = props;
202
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, $6Q8R1$reactariacomponents.TreeItemContent), null, ({ isExpanded: isExpanded, hasChildItems: hasChildItems, level: level, selectionMode: selectionMode, selectionBehavior: selectionBehavior, isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible, state: state, id: id })=>{
203
- let isFirst = state.collection.getFirstKey() === id;
204
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement("div", {
205
- className: $9b0dbe0a88ecfa3f$var$treeCellGrid({
206
- isDisabled: isDisabled
207
- })
208
- }, selectionMode !== 'none' && selectionBehavior === 'toggle' && // TODO: add transition?
209
- /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, $6Q8R1$reactspectrumcheckbox.Checkbox), {
210
- isEmphasized: true,
211
- UNSAFE_className: $9b0dbe0a88ecfa3f$var$treeCheckbox(),
212
- UNSAFE_style: {
213
- paddingInlineEnd: '0px'
214
- },
215
- slot: "selection"
216
- }), /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement("div", {
217
- style: {
218
- gridArea: 'level-padding',
219
- marginInlineEnd: `calc(${level - 1} * var(--spectrum-global-dimension-size-200))`
220
- }
221
- }), hasChildItems && /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement($9b0dbe0a88ecfa3f$var$ExpandableRowChevron, {
222
- isDisabled: isDisabled,
223
- isExpanded: isExpanded
224
- }), /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, $6Q8R1$reactspectrumutils.SlotProvider), {
225
- slots: {
226
- text: {
227
- UNSAFE_className: $9b0dbe0a88ecfa3f$var$treeContent({
228
- isDisabled: isDisabled
229
- })
230
- },
231
- // Note there is also an issue here where these icon props are making into the action menu's icon. Resolved by 8ab0ffb276ff437a65b365c9a3be0323a1b24656
232
- // but could crop up later for other components
233
- icon: {
234
- UNSAFE_className: $9b0dbe0a88ecfa3f$var$treeIcon(),
235
- size: 'S'
236
- },
237
- actionButton: {
238
- UNSAFE_className: $9b0dbe0a88ecfa3f$var$treeActions(),
239
- isQuiet: true
240
- },
241
- actionGroup: {
242
- UNSAFE_className: $9b0dbe0a88ecfa3f$var$treeActions(),
243
- isQuiet: true,
244
- density: 'compact',
245
- buttonLabelBehavior: 'hide',
246
- isDisabled: isDisabled,
247
- overflowMode: 'collapse'
248
- },
249
- actionMenu: {
250
- UNSAFE_className: $9b0dbe0a88ecfa3f$var$treeActionMenu(),
251
- UNSAFE_style: {
252
- marginInlineEnd: '.5rem'
253
- },
254
- isQuiet: true
255
- }
256
- }
257
- }, children), /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement("div", {
258
- className: $9b0dbe0a88ecfa3f$var$treeRowOutline({
259
- isFocusVisible: isFocusVisible,
260
- isSelected: isSelected,
261
- isFirst: isFirst
262
- })
263
- }));
264
- });
265
- };
266
- const $9b0dbe0a88ecfa3f$var$expandButton = function anonymous(props) {
267
- let rules = "";
268
- rules += ' s1-__h-pn4rxq';
269
- rules += ' s1-ns1-Y';
270
- rules += ' s1-4s1-b';
271
- rules += ' s1-_Ts1-d';
272
- rules += ' s1-_1s1-a';
273
- rules += ' s1-_Us1-b';
274
- rules += ' s1-_Ws1-d';
275
- rules += ' s1-_Fs1-a';
276
- if (props.isExpanded) {
277
- if (props.isRTL) rules += ' s1-W-negfvv';
278
- else rules += ' s1-W-10b8jr2';
279
- }
280
- rules += ' s1-_I-1o2fh9e';
281
- return rules;
282
- };
283
- function $9b0dbe0a88ecfa3f$var$ExpandableRowChevron(props) {
284
- let expandButtonRef = (0, $6Q8R1$react.useRef)(null);
285
- let [fullProps, ref] = (0, $6Q8R1$reactariacomponents.useContextProps)({
286
- ...props,
287
- slot: 'chevron'
288
- }, expandButtonRef, (0, $6Q8R1$reactariacomponents.ButtonContext));
289
- let { isExpanded: isExpanded, isDisabled: isDisabled } = fullProps;
290
- let { direction: direction } = (0, $6Q8R1$reactariai18n.useLocale)();
291
- // Will need to keep the chevron as a button for iOS VO at all times since VO doesn't focus the cell. Also keep as button if cellAction is defined by the user in the future
292
- let { buttonProps: buttonProps } = (0, $6Q8R1$reactariabutton.useButton)({
293
- ...fullProps,
294
- elementType: 'span'
295
- }, ref);
296
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement("span", {
297
- ...buttonProps,
298
- ref: ref,
299
- // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually "focus" it
300
- tabIndex: (0, $6Q8R1$reactariautils.isAndroid)() && !isDisabled ? -1 : undefined,
301
- className: $9b0dbe0a88ecfa3f$var$expandButton({
302
- isExpanded: isExpanded,
303
- isDisabled: isDisabled,
304
- isRTL: direction === 'rtl'
305
- })
306
- }, direction === 'ltr' ? /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, ($parcel$interopDefault($6Q8R1$spectrumiconsuiChevronRightMedium))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($6Q8R1$react))).createElement((0, ($parcel$interopDefault($6Q8R1$spectrumiconsuiChevronLeftMedium))), null));
307
- }
308
-
309
-
310
- //# sourceMappingURL=TreeView.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"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","sources":["packages/@react-spectrum/tree/src/TreeView.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaTreeProps} from '@react-aria/tree';\nimport {\n ButtonContext,\n Tree,\n TreeItem,\n TreeItemContent,\n TreeItemContentProps,\n TreeItemContentRenderProps,\n TreeItemProps,\n TreeItemRenderProps,\n TreeRenderProps,\n useContextProps\n} from 'react-aria-components';\nimport {Checkbox} from '@react-spectrum/checkbox';\nimport ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {DOMRef, Expandable, Key, SelectionBehavior, SpectrumSelectionProps, StyleProps} from '@react-types/shared';\nimport {focusRing, style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {isAndroid} from '@react-aria/utils';\nimport React, {createContext, JSX, JSXElementConstructor, ReactElement, ReactNode, useRef} from 'react';\nimport {SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {useButton} from '@react-aria/button';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface SpectrumTreeViewProps<T> extends Omit<AriaTreeProps<T>, 'children' | 'render'>, StyleProps, SpectrumSelectionProps, Expandable {\n /** Provides content to display when there are no items in the tree. */\n renderEmptyState?: () => JSX.Element,\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionStyle` prop and the interaction modality.\n */\n onAction?: (key: Key) => void,\n /**\n * The contents of the tree.\n */\n children?: ReactNode | ((item: T) => ReactNode)\n}\n\nexport interface SpectrumTreeViewItemProps extends Omit<TreeItemProps, 'className' | 'style' | 'render' | 'value' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'onClick'> {\n /** Rendered contents of the tree item or child items. */\n children: ReactNode\n}\n\ninterface TreeRendererContextValue {\n renderer?: (item) => ReactElement<any, string | JSXElementConstructor<any>>\n}\nconst TreeRendererContext = createContext<TreeRendererContextValue>({});\n\n// TODO: add animations for rows appearing and disappearing\n\n// TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the\n// keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't\n// scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview\nconst tree = style<Pick<TreeRenderProps, 'isEmpty'>>({\n ...focusRing(),\n outlineOffset: '[-2px]', // make certain we are visible inside overflow hidden containers\n height: 'full',\n width: 'full',\n borderWidth: 2,\n boxSizing: 'border-box',\n borderXWidth: 0,\n borderStyle: 'solid',\n borderColor: {\n default: 'transparent',\n forcedColors: 'Background'\n },\n justifyContent: {\n isEmpty: 'center'\n },\n alignItems: {\n isEmpty: 'center'\n },\n display: {\n isEmpty: 'flex'\n },\n overflow: 'auto'\n});\n\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nexport const TreeView = React.forwardRef(function TreeView<T extends object>(props: SpectrumTreeViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {children, selectionStyle, UNSAFE_className} = props;\n\n let renderer;\n if (typeof children === 'function') {\n renderer = children;\n }\n\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let selectionBehavior = selectionStyle === 'highlight' ? 'replace' : 'toggle';\n\n return (\n <TreeRendererContext.Provider value={{renderer}}>\n <Tree {...props} {...styleProps} className={renderProps => (UNSAFE_className ?? '') + tree(renderProps)} selectionBehavior={selectionBehavior as SelectionBehavior} ref={domRef}>\n {props.children}\n </Tree>\n </TreeRendererContext.Provider>\n );\n}) as <T>(props: SpectrumTreeViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface TreeRowRenderProps extends TreeItemRenderProps {\n isLink?: boolean\n}\n\nconst treeRow = style<TreeRowRenderProps>({\n position: 'relative',\n display: 'flex',\n height: 10,\n width: 'full',\n boxSizing: 'border-box',\n fontSize: 'base',\n fontWeight: 'normal',\n lineHeight: 200,\n color: 'body',\n outlineStyle: 'none',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n // TODO: not sure where to get the equivalent colors here, for instance isHovered is spectrum 600 with 10% opacity but I don't think that exists in the theme\n backgroundColor: {\n isHovered: '[var(--spectrum-table-row-background-color-hover)]',\n isFocusVisibleWithin: '[var(--spectrum-table-row-background-color-hover)]',\n isPressed: '[var(--spectrum-table-row-background-color-down)]',\n isSelected: '[var(--spectrum-table-row-background-color-selected)]'\n }\n});\n\nconst treeCellGrid = style({\n display: 'grid',\n width: 'full',\n alignItems: 'center',\n gridTemplateColumns: ['minmax(0, auto)', 'minmax(0, auto)', 'minmax(0, auto)', 10, 'minmax(0, auto)', '1fr', 'minmax(0, auto)', 'auto'],\n gridTemplateRows: '1fr',\n gridTemplateAreas: [\n 'drag-handle checkbox level-padding expand-button icon content actions actionmenu'\n ],\n color: {\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n});\n\n// TODO: These styles lose against the spectrum class names, so I've did unsafe for the ones that get overridden\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n transitionDuration: '160ms',\n marginStart: 3,\n marginEnd: 0\n});\n\nconst treeIcon = style({\n gridArea: 'icon',\n marginEnd: 2\n});\n\nconst treeContent = style<Pick<TreeItemContentRenderProps, 'isDisabled'>>({\n gridArea: 'content',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n});\n\nconst treeActions = style({\n gridArea: 'actions',\n flexGrow: 0,\n flexShrink: 0,\n /* TODO: I made this one up, confirm desired behavior. These paddings are to make sure the action group has enough padding for the focus ring */\n marginStart: .5,\n marginEnd: 1\n});\n\nconst treeActionMenu = style({\n gridArea: 'actionmenu',\n width: 8\n});\n\nconst treeRowOutline = style({\n content: '',\n display: 'block',\n position: 'absolute',\n insetStart: 0,\n insetEnd: 0,\n top: {\n default: 0,\n isFocusVisible: '[-2px]',\n isSelected: {\n default: '[-1px]',\n isFocusVisible: '[-2px]'\n },\n isFirst: 0\n },\n bottom: 0,\n pointerEvents: 'none',\n forcedColorAdjust: 'none',\n\n boxShadow: {\n isFocusVisible: '[inset 2px 0 0 0 var(--spectrum-alias-focus-color), inset -2px 0 0 0 var(--spectrum-alias-focus-color), inset 0 -2px 0 0 var(--spectrum-alias-focus-color), inset 0 2px 0 0 var(--spectrum-alias-focus-color)]',\n isSelected: {\n default: '[inset 1px 0 0 0 var(--spectrum-alias-focus-color), inset -1px 0 0 0 var(--spectrum-alias-focus-color), inset 0 -1px 0 0 var(--spectrum-alias-focus-color), inset 0 1px 0 0 var(--spectrum-alias-focus-color)]',\n isFocusVisible: '[inset 2px 0 0 0 var(--spectrum-alias-focus-color), inset -2px 0 0 0 var(--spectrum-alias-focus-color), inset 0 -2px 0 0 var(--spectrum-alias-focus-color), inset 0 2px 0 0 var(--spectrum-alias-focus-color)]'\n },\n forcedColors: {\n isFocusVisible: '[inset 2px 0 0 0 Highlight, inset -2px 0 0 0 Highlight, inset 0 -2px 0 0 Highlight, inset 0 2px 0 0 Highlight]',\n isSelected: {\n default: '[inset 1px 0 0 0 Highlight, inset -1px 0 0 0 Highlight, inset 0 -1px 0 0 Highlight, inset 0 1px 0 0 Highlight]',\n isFocusVisible: '[inset 2px 0 0 0 Highlight, inset -2px 0 0 0 Highlight, inset 0 -2px 0 0 Highlight, inset 0 2px 0 0 Highlight]'\n }\n }\n }\n});\n\nexport const TreeViewItem = (props: SpectrumTreeViewItemProps): ReactNode => {\n let {\n href\n } = props;\n\n return (\n <TreeItem\n {...props}\n className={renderProps => treeRow({\n ...renderProps,\n isLink: !!href\n })} />\n );\n};\n\nexport interface SpectrumTreeViewItemContentProps extends Omit<TreeItemContentProps, 'children'> {\n /** Rendered contents of the tree item or child items. */\n children: ReactNode\n}\n\n\nexport const TreeViewItemContent = (props: SpectrumTreeViewItemContentProps): ReactNode => {\n let {\n children\n } = props;\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, level, selectionMode, selectionBehavior, isDisabled, isSelected, isFocusVisible, state, id}) => {\n let isFirst = state.collection.getFirstKey() === id;\n return (\n <div className={treeCellGrid({isDisabled})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <Checkbox\n isEmphasized\n UNSAFE_className={treeCheckbox()}\n UNSAFE_style={{paddingInlineEnd: '0px'}}\n slot=\"selection\" />\n )}\n <div style={{gridArea: 'level-padding', marginInlineEnd: `calc(${level - 1} * var(--spectrum-global-dimension-size-200))`}} />\n {/* TODO: revisit when we do async loading, at the moment hasChildItems will only cause the chevron to be rendered, no aria/data attributes indicating the row's expandability are added */}\n {hasChildItems && <ExpandableRowChevron isDisabled={isDisabled} isExpanded={isExpanded} />}\n <SlotProvider\n slots={{\n text: {UNSAFE_className: treeContent({isDisabled})},\n // Note there is also an issue here where these icon props are making into the action menu's icon. Resolved by 8ab0ffb276ff437a65b365c9a3be0323a1b24656\n // but could crop up later for other components\n icon: {UNSAFE_className: treeIcon(), size: 'S'},\n actionButton: {UNSAFE_className: treeActions(), isQuiet: true},\n actionGroup: {\n UNSAFE_className: treeActions(),\n isQuiet: true,\n density: 'compact',\n buttonLabelBehavior: 'hide',\n isDisabled,\n overflowMode: 'collapse'\n },\n actionMenu: {UNSAFE_className: treeActionMenu(), UNSAFE_style: {marginInlineEnd: '.5rem'}, isQuiet: true}\n }}>\n {children}\n </SlotProvider>\n <div className={treeRowOutline({isFocusVisible, isSelected, isFirst})} />\n </div>\n );\n }}\n </TreeItemContent>\n );\n};\n\ninterface ExpandableRowChevronProps {\n isExpanded?: boolean,\n isDisabled?: boolean,\n isRTL?: boolean\n}\n\nconst expandButton = style<ExpandableRowChevronProps>({\n gridArea: 'expand-button',\n height: 'full',\n aspectRatio: 'square',\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'center',\n justifyContent: 'center',\n outlineStyle: 'none',\n transform: {\n isExpanded: {\n default: 'rotate(90deg)',\n isRTL: 'rotate(-90deg)'\n }\n },\n transition: '[transform ease var(--spectrum-global-animation-duration-100)]'\n});\n\nfunction ExpandableRowChevron(props: ExpandableRowChevronProps) {\n let expandButtonRef = useRef(null);\n let [fullProps, ref] = useContextProps({...props, slot: 'chevron'}, expandButtonRef, ButtonContext);\n let {isExpanded, isDisabled} = fullProps;\n let {direction} = useLocale();\n\n // Will need to keep the chevron as a button for iOS VO at all times since VO doesn't focus the cell. Also keep as button if cellAction is defined by the user in the future\n let {buttonProps} = useButton({\n ...fullProps,\n elementType: 'span'\n }, ref);\n\n return (\n <span\n {...buttonProps}\n ref={ref}\n // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually \"focus\" it\n tabIndex={isAndroid() && !isDisabled ? -1 : undefined}\n className={expandButton({isExpanded, isDisabled, isRTL: direction === 'rtl'})}>\n {direction === 'ltr' ? <ChevronRightMedium /> : <ChevronLeftMedium />}\n </span>\n );\n}\n"],"names":[],"version":3,"file":"TreeView.main.js.map"}