@instructure/ui-tree-browser 11.7.8 → 11.7.9-pr-snapshot-1792147648392

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 (63) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/TreeBrowser/v1/TreeBrowserContext.js +3 -36
  3. package/es/TreeBrowser/v1/TreeButton/index.js +120 -152
  4. package/es/TreeBrowser/v1/TreeButton/props.js +20 -26
  5. package/es/TreeBrowser/v1/TreeButton/styles.js +264 -305
  6. package/es/TreeBrowser/v1/TreeButton/theme.js +44 -79
  7. package/es/TreeBrowser/v1/TreeCollection/index.js +301 -359
  8. package/es/TreeBrowser/v1/TreeCollection/props.js +28 -26
  9. package/es/TreeBrowser/v1/TreeCollection/styles.js +88 -127
  10. package/es/TreeBrowser/v1/TreeCollection/theme.js +14 -48
  11. package/es/TreeBrowser/v1/TreeNode/index.js +82 -107
  12. package/es/TreeBrowser/v1/TreeNode/props.js +15 -26
  13. package/es/TreeBrowser/v1/index.js +273 -294
  14. package/es/TreeBrowser/v1/props.js +24 -35
  15. package/es/TreeBrowser/v1/styles.js +33 -68
  16. package/es/TreeBrowser/v1/theme.js +12 -44
  17. package/es/TreeBrowser/v2/TreeBrowserContext.js +3 -36
  18. package/es/TreeBrowser/v2/TreeButton/index.js +157 -200
  19. package/es/TreeBrowser/v2/TreeButton/props.js +21 -26
  20. package/es/TreeBrowser/v2/TreeButton/styles.js +240 -281
  21. package/es/TreeBrowser/v2/TreeCollection/index.js +306 -362
  22. package/es/TreeBrowser/v2/TreeCollection/props.js +28 -26
  23. package/es/TreeBrowser/v2/TreeCollection/styles.js +97 -137
  24. package/es/TreeBrowser/v2/TreeNode/index.js +115 -150
  25. package/es/TreeBrowser/v2/TreeNode/props.js +16 -26
  26. package/es/TreeBrowser/v2/index.js +286 -324
  27. package/es/TreeBrowser/v2/props.js +27 -35
  28. package/es/TreeBrowser/v2/styles.js +33 -69
  29. package/es/exports/a.js +1 -25
  30. package/es/exports/b.js +1 -25
  31. package/package.json +13 -19
  32. package/tsconfig.build.json +0 -1
  33. package/tsconfig.build.tsbuildinfo +1 -1
  34. package/lib/TreeBrowser/v1/TreeBrowserContext.js +0 -44
  35. package/lib/TreeBrowser/v1/TreeButton/index.js +0 -169
  36. package/lib/TreeBrowser/v1/TreeButton/props.js +0 -31
  37. package/lib/TreeBrowser/v1/TreeButton/styles.js +0 -338
  38. package/lib/TreeBrowser/v1/TreeButton/theme.js +0 -86
  39. package/lib/TreeBrowser/v1/TreeCollection/index.js +0 -379
  40. package/lib/TreeBrowser/v1/TreeCollection/props.js +0 -31
  41. package/lib/TreeBrowser/v1/TreeCollection/styles.js +0 -140
  42. package/lib/TreeBrowser/v1/TreeCollection/theme.js +0 -55
  43. package/lib/TreeBrowser/v1/TreeNode/index.js +0 -122
  44. package/lib/TreeBrowser/v1/TreeNode/props.js +0 -31
  45. package/lib/TreeBrowser/v1/index.js +0 -328
  46. package/lib/TreeBrowser/v1/props.js +0 -40
  47. package/lib/TreeBrowser/v1/styles.js +0 -75
  48. package/lib/TreeBrowser/v1/theme.js +0 -51
  49. package/lib/TreeBrowser/v2/TreeBrowserContext.js +0 -44
  50. package/lib/TreeBrowser/v2/TreeButton/index.js +0 -220
  51. package/lib/TreeBrowser/v2/TreeButton/props.js +0 -31
  52. package/lib/TreeBrowser/v2/TreeButton/styles.js +0 -314
  53. package/lib/TreeBrowser/v2/TreeCollection/index.js +0 -381
  54. package/lib/TreeBrowser/v2/TreeCollection/props.js +0 -31
  55. package/lib/TreeBrowser/v2/TreeCollection/styles.js +0 -151
  56. package/lib/TreeBrowser/v2/TreeNode/index.js +0 -169
  57. package/lib/TreeBrowser/v2/TreeNode/props.js +0 -31
  58. package/lib/TreeBrowser/v2/index.js +0 -362
  59. package/lib/TreeBrowser/v2/props.js +0 -40
  60. package/lib/TreeBrowser/v2/styles.js +0 -77
  61. package/lib/exports/a.js +0 -33
  62. package/lib/exports/b.js +0 -33
  63. package/lib/package.json +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * **many:** `@instructure/ui-babel-preset` and
15
+ `@instructure/browserslist-config-instui` are removed and will no longer be
16
+ published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
17
+
18
+
6
19
  ## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
7
20
 
8
21
  **Note:** Version bump only for package @instructure/ui-tree-browser
@@ -1,39 +1,6 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
1
  import { createContext } from 'react';
26
- /**
27
- * ---
28
- * category: components/contexts
29
- * ---
30
- * React context created by the `TreeBrowser` component to hold its data which are
31
- * read by its children.
32
- *
33
- * @module
34
- */
35
- const TreeBrowserContext = /*#__PURE__*/createContext({
36
- animation: true
2
+ const TreeBrowserContext = createContext({
3
+ animation: true
37
4
  });
38
5
  export default TreeBrowserContext;
39
- export { TreeBrowserContext };
6
+ export { TreeBrowserContext };
@@ -1,28 +1,5 @@
1
- var _dec, _class;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
1
+ import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
3
  import { Component } from 'react';
27
4
  import { Img } from '@instructure/ui-img/v11_6';
28
5
  import { callRenderProp } from '@instructure/ui-react-utils';
@@ -31,136 +8,127 @@ import generateStyles from './styles.js';
31
8
  import generateComponentTheme from './theme.js';
32
9
  import { allowedProps } from './props.js';
33
10
  import TreeBrowserContext from '../TreeBrowserContext.js';
34
-
35
- // Todo: merge TreeButton and TreeNode: TreeButton should be a special type of TreeNode
36
-
37
- /**
38
- ---
39
- parent: TreeBrowser
40
- id: TreeBrowser.Button
41
- ---
42
- **/
43
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
44
- let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(_class = class TreeButton extends Component {
45
- static displayName = 'TreeButton';
46
- static componentId = 'TreeBrowser.Button';
47
- static allowedProps = allowedProps;
48
- static contextType = TreeBrowserContext;
49
- static defaultProps = {
50
- type: 'treeButton',
51
- size: 'medium',
52
- variant: 'folderTree',
53
- selected: false,
54
- focused: false,
55
- expanded: false
56
- };
57
- ref = null;
58
- componentDidMount() {
59
- this.props.makeStyles?.({
60
- animation: this.context?.animation
61
- });
62
- }
63
- componentDidUpdate() {
64
- this.props.makeStyles?.({
65
- animation: this.context?.animation
66
- });
67
- }
68
- defaultContentRenderer(props) {
69
- const {
70
- name,
71
- descriptor,
72
- styles
73
- } = props;
74
- return _jsxs("span", {
75
- css: styles.layout,
76
- children: [this.renderImage(), _jsxs("span", {
77
- css: styles.text,
78
- children: [_jsx("span", {
79
- css: styles.textName,
80
- children: name
81
- }), descriptor ? _jsx("span", {
82
- css: styles.textDescriptor,
83
- title: descriptor,
84
- children: descriptor
85
- }) : null]
86
- })]
87
- });
88
- }
89
- renderImage() {
90
- const {
91
- type
92
- } = this.props;
93
- switch (type) {
94
- case 'collection':
95
- return this.renderCollectionIcon();
96
- case 'item':
97
- return this.renderItemImage();
98
- default:
99
- break;
11
+ class TreeButton extends Component {
12
+ static{
13
+ this.displayName = 'TreeButton';
14
+ }
15
+ static{
16
+ this.componentId = 'TreeBrowser.Button';
17
+ }
18
+ static{
19
+ this.allowedProps = allowedProps;
20
+ }
21
+ static{
22
+ this.contextType = TreeBrowserContext;
23
+ }
24
+ static{
25
+ this.defaultProps = {
26
+ type: 'treeButton',
27
+ size: 'medium',
28
+ variant: 'folderTree',
29
+ selected: false,
30
+ focused: false,
31
+ expanded: false
32
+ };
33
+ }
34
+ componentDidMount() {
35
+ this.props.makeStyles?.({
36
+ animation: this.context?.animation
37
+ });
38
+ }
39
+ componentDidUpdate() {
40
+ this.props.makeStyles?.({
41
+ animation: this.context?.animation
42
+ });
43
+ }
44
+ defaultContentRenderer(props) {
45
+ const { name, descriptor, styles } = props;
46
+ return /*#__PURE__*/ _jsxs("span", {
47
+ css: styles.layout,
48
+ children: [
49
+ this.renderImage(),
50
+ /*#__PURE__*/ _jsxs("span", {
51
+ css: styles.text,
52
+ children: [
53
+ /*#__PURE__*/ _jsx("span", {
54
+ css: styles.textName,
55
+ children: name
56
+ }),
57
+ descriptor ? /*#__PURE__*/ _jsx("span", {
58
+ css: styles.textDescriptor,
59
+ title: descriptor,
60
+ children: descriptor
61
+ }) : null
62
+ ]
63
+ })
64
+ ]
65
+ });
66
+ }
67
+ renderImage() {
68
+ const { type } = this.props;
69
+ switch(type){
70
+ case 'collection':
71
+ return this.renderCollectionIcon();
72
+ case 'item':
73
+ return this.renderItemImage();
74
+ default:
75
+ break;
76
+ }
77
+ return undefined;
100
78
  }
101
- return undefined;
102
- }
103
- renderCollectionIcon() {
104
- const {
105
- expanded,
106
- collectionIcon,
107
- collectionIconExpanded,
108
- styles
109
- } = this.props;
110
- if (collectionIcon || collectionIconExpanded) {
111
- return _jsx("div", {
112
- css: styles?.icon,
113
- children: callRenderProp(expanded ? collectionIconExpanded : collectionIcon)
114
- });
79
+ renderCollectionIcon() {
80
+ const { expanded, collectionIcon, collectionIconExpanded, styles } = this.props;
81
+ if (collectionIcon || collectionIconExpanded) {
82
+ return /*#__PURE__*/ _jsx("div", {
83
+ css: styles?.icon,
84
+ children: callRenderProp(expanded ? collectionIconExpanded : collectionIcon)
85
+ });
86
+ }
87
+ return undefined;
115
88
  }
116
- return undefined;
117
- }
118
- renderItemImage() {
119
- const {
120
- thumbnail,
121
- itemIcon,
122
- styles
123
- } = this.props;
124
- if (thumbnail) {
125
- return _jsx("div", {
126
- css: styles?.thumbnail,
127
- children: _jsx(Img, {
128
- src: thumbnail,
129
- constrain: "cover",
130
- alt: ""
131
- })
132
- });
89
+ renderItemImage() {
90
+ const { thumbnail, itemIcon, styles } = this.props;
91
+ if (thumbnail) {
92
+ return /*#__PURE__*/ _jsx("div", {
93
+ css: styles?.thumbnail,
94
+ children: /*#__PURE__*/ _jsx(Img, {
95
+ src: thumbnail,
96
+ constrain: "cover",
97
+ alt: ""
98
+ })
99
+ });
100
+ }
101
+ if (itemIcon) {
102
+ return /*#__PURE__*/ _jsx("div", {
103
+ css: styles?.icon,
104
+ children: callRenderProp(itemIcon)
105
+ });
106
+ }
107
+ return undefined;
133
108
  }
134
- if (itemIcon) {
135
- return _jsx("div", {
136
- css: styles?.icon,
137
- children: callRenderProp(itemIcon)
138
- });
109
+ render() {
110
+ const { styles, renderContent } = this.props;
111
+ const buttonContent = renderContent ? renderContent(this.props) : this.defaultContentRenderer(this.props);
112
+ return /*#__PURE__*/ _jsx("button", {
113
+ ref: this.handleRef,
114
+ tabIndex: -1,
115
+ type: "button",
116
+ css: styles?.treeButton,
117
+ "data-cid": "TreeButton",
118
+ children: buttonContent
119
+ });
139
120
  }
140
- return undefined;
141
- }
142
- handleRef = el => {
143
- if (el && typeof this.props.containerRef === 'function') {
144
- this.props.containerRef(el.parentElement);
121
+ constructor(...args){
122
+ super(...args), this.ref = null, this.handleRef = (el)=>{
123
+ if (el && typeof this.props.containerRef === 'function') {
124
+ this.props.containerRef(el.parentElement);
125
+ }
126
+ this.ref = el;
127
+ };
145
128
  }
146
- this.ref = el;
147
- };
148
- render() {
149
- const {
150
- styles,
151
- renderContent
152
- } = this.props;
153
- const buttonContent = renderContent ? renderContent(this.props) : this.defaultContentRenderer(this.props);
154
- // VoiceOver can't navigate without the buttons, even though they don't do anything
155
- return _jsx("button", {
156
- ref: this.handleRef,
157
- tabIndex: -1,
158
- type: "button",
159
- css: styles?.treeButton,
160
- "data-cid": "TreeButton",
161
- children: buttonContent
162
- });
163
- }
164
- }) || _class);
129
+ }
130
+ TreeButton = _ts_decorate([
131
+ withStyle(generateStyles, generateComponentTheme)
132
+ ], TreeButton);
165
133
  export default TreeButton;
166
- export { TreeButton };
134
+ export { TreeButton };
@@ -1,26 +1,20 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- const allowedProps = ['id', 'name', 'descriptor', 'type', 'size', 'variant', 'collectionIcon', 'collectionIconExpanded', 'itemIcon', 'thumbnail', 'onClick', 'expanded', 'selected', 'focused', 'level', 'containerRef', 'renderContent'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'id',
3
+ 'name',
4
+ 'descriptor',
5
+ 'type',
6
+ 'size',
7
+ 'variant',
8
+ 'collectionIcon',
9
+ 'collectionIconExpanded',
10
+ 'itemIcon',
11
+ 'thumbnail',
12
+ 'onClick',
13
+ 'expanded',
14
+ 'selected',
15
+ 'focused',
16
+ 'level',
17
+ 'containerRef',
18
+ 'renderContent'
19
+ ];
20
+ export { allowedProps };