@instructure/ui-toggle-details 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 (37) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/ToggleDetails/v1/index.js +143 -163
  3. package/es/ToggleDetails/v1/props.js +14 -26
  4. package/es/ToggleDetails/v1/styles.js +149 -189
  5. package/es/ToggleDetails/v1/theme.js +39 -74
  6. package/es/ToggleDetails/v2/index.js +148 -168
  7. package/es/ToggleDetails/v2/props.js +14 -26
  8. package/es/ToggleDetails/v2/styles.js +140 -181
  9. package/es/ToggleGroup/v1/index.js +127 -155
  10. package/es/ToggleGroup/v1/props.js +16 -26
  11. package/es/ToggleGroup/v1/styles.js +5 -39
  12. package/es/ToggleGroup/v1/theme.js +9 -40
  13. package/es/ToggleGroup/v2/index.js +132 -160
  14. package/es/ToggleGroup/v2/props.js +16 -26
  15. package/es/ToggleGroup/v2/styles.js +5 -39
  16. package/es/exports/a.js +1 -25
  17. package/es/exports/b.js +1 -25
  18. package/package.json +18 -24
  19. package/tsconfig.build.json +0 -1
  20. package/tsconfig.build.tsbuildinfo +1 -1
  21. package/lib/ToggleDetails/v1/index.js +0 -184
  22. package/lib/ToggleDetails/v1/props.js +0 -31
  23. package/lib/ToggleDetails/v1/styles.js +0 -202
  24. package/lib/ToggleDetails/v1/theme.js +0 -81
  25. package/lib/ToggleDetails/v2/index.js +0 -187
  26. package/lib/ToggleDetails/v2/props.js +0 -31
  27. package/lib/ToggleDetails/v2/styles.js +0 -194
  28. package/lib/ToggleGroup/v1/index.js +0 -180
  29. package/lib/ToggleGroup/v1/props.js +0 -31
  30. package/lib/ToggleGroup/v1/styles.js +0 -46
  31. package/lib/ToggleGroup/v1/theme.js +0 -47
  32. package/lib/ToggleGroup/v2/index.js +0 -185
  33. package/lib/ToggleGroup/v2/props.js +0 -31
  34. package/lib/ToggleGroup/v2/styles.js +0 -46
  35. package/lib/exports/a.js +0 -19
  36. package/lib/exports/b.js +0 -19
  37. 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-toggle-details
@@ -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, createRef } from 'react';
27
4
  import { Button } from '@instructure/ui-buttons/v11_6';
28
5
  import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
@@ -33,145 +10,148 @@ import { withStyle } from '@instructure/emotion';
33
10
  import generateStyle from './styles.js';
34
11
  import generateComponentTheme from './theme.js';
35
12
  import { allowedProps } from './props.js';
36
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
37
- /**
38
- ---
39
- category: components
40
- ---
41
- **/
42
- let ToggleDetails = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ToggleDetails extends Component {
43
- static displayName = 'ToggleDetails';
44
- static componentId = 'ToggleDetails';
45
- static allowedProps = allowedProps;
46
- static defaultProps = {
47
- variant: 'default',
48
- size: 'medium',
49
- fluidWidth: false,
50
- icon: IconArrowOpenEndSolid,
51
- iconExpanded: IconArrowOpenDownSolid,
52
- iconPosition: 'start',
53
- defaultExpanded: false,
54
- children: null
55
- };
56
- _buttonNode = null;
57
- ref = /*#__PURE__*/createRef();
58
-
59
- // TODO this solution was generated with Gemini, should be tested if it works as fine as before
60
- setButtonRef = node => {
61
- this._buttonNode = node;
62
- };
63
- get focused() {
64
- return isActiveElement(this._buttonNode);
65
- }
66
- focus() {
67
- this._buttonNode?.focus();
68
- }
69
- componentDidMount() {
70
- this.props.makeStyles?.();
71
- }
72
- componentDidUpdate() {
73
- this.props.makeStyles?.();
74
- }
75
- renderSummary(expanded) {
76
- const {
77
- summary,
78
- iconPosition
79
- } = this.props;
80
- return _jsxs("span", {
81
- css: this.props.styles?.summary,
82
- children: [iconPosition === 'start' && this.renderIcon(expanded), _jsx("span", {
83
- css: this.props.styles?.summaryText,
84
- children: summary
85
- }), iconPosition === 'end' && this.renderIcon(expanded)]
86
- });
87
- }
88
- renderToggle(toggleProps, expanded) {
89
- const {
90
- variant
91
- } = this.props;
92
- const tProps = this.props.children ? toggleProps : {
93
- onClick: toggleProps.onClick
94
- };
95
- const props = {
96
- ...omitProps(this.props, ToggleDetails.allowedProps),
97
- ...tProps,
98
- children: this.renderSummary(expanded)
99
- };
100
- const summary = this.renderSummary(expanded);
101
- if (variant === 'filled') {
102
- return _jsx(Button, {
103
- ...props,
104
- display: "block",
105
- textAlign: "start",
106
- elementRef: this.setButtonRef,
107
- children: summary
108
- });
109
- } else if (props.href) {
110
- return _jsx("a", {
111
- ...props,
112
- css: this.props.styles?.toggle,
113
- ref: this.setButtonRef,
114
- children: summary
115
- });
116
- } else {
117
- return _jsx("button", {
118
- ...props,
119
- type: "button",
120
- css: this.props.styles?.toggle,
121
- ref: this.setButtonRef,
122
- children: summary
123
- });
13
+ class ToggleDetails extends Component {
14
+ static{
15
+ this.displayName = 'ToggleDetails';
16
+ }
17
+ static{
18
+ this.componentId = 'ToggleDetails';
19
+ }
20
+ static{
21
+ this.allowedProps = allowedProps;
22
+ }
23
+ static{
24
+ this.defaultProps = {
25
+ variant: 'default',
26
+ size: 'medium',
27
+ fluidWidth: false,
28
+ icon: IconArrowOpenEndSolid,
29
+ iconExpanded: IconArrowOpenDownSolid,
30
+ iconPosition: 'start',
31
+ defaultExpanded: false,
32
+ children: null
33
+ };
34
+ }
35
+ get focused() {
36
+ return isActiveElement(this._buttonNode);
37
+ }
38
+ focus() {
39
+ this._buttonNode?.focus();
40
+ }
41
+ componentDidMount() {
42
+ this.props.makeStyles?.();
43
+ }
44
+ componentDidUpdate() {
45
+ this.props.makeStyles?.();
124
46
  }
125
- }
126
- renderIcon(expanded) {
127
- const Icon = expanded ? this.props.iconExpanded : this.props.icon;
128
- return this.props.children && Icon ? _jsx("span", {
129
- css: this.props.styles?.icon,
130
- children: _jsx(Icon, {})
131
- }) : null;
132
- }
133
- renderDetails(expanded, detailsProps) {
134
- if (!this.props.children) return null;
135
- const expandedStyles = expanded ? {
136
- display: 'block'
137
- } : {
138
- display: 'none'
139
- };
140
- return _jsx("div", {
141
- ...detailsProps,
142
- css: [this.props.styles?.details, expandedStyles],
143
- children: expanded && this.renderContent()
144
- });
145
- }
146
- renderContent() {
147
- return _jsx("div", {
148
- css: this.props.styles?.content,
149
- children: this.props.children
150
- });
151
- }
152
- handleToggle = (event, expanded) => {
153
- if (typeof this.props.onToggle === 'function') {
154
- this.props.onToggle(event, expanded);
47
+ renderSummary(expanded) {
48
+ const { summary, iconPosition } = this.props;
49
+ return /*#__PURE__*/ _jsxs("span", {
50
+ css: this.props.styles?.summary,
51
+ children: [
52
+ iconPosition === 'start' && this.renderIcon(expanded),
53
+ /*#__PURE__*/ _jsx("span", {
54
+ css: this.props.styles?.summaryText,
55
+ children: summary
56
+ }),
57
+ iconPosition === 'end' && this.renderIcon(expanded)
58
+ ]
59
+ });
60
+ }
61
+ renderToggle(toggleProps, expanded) {
62
+ const { variant } = this.props;
63
+ const tProps = this.props.children ? toggleProps : {
64
+ onClick: toggleProps.onClick
65
+ };
66
+ const props = {
67
+ ...omitProps(this.props, ToggleDetails.allowedProps),
68
+ ...tProps,
69
+ children: this.renderSummary(expanded)
70
+ };
71
+ const summary = this.renderSummary(expanded);
72
+ if (variant === 'filled') {
73
+ return /*#__PURE__*/ _jsx(Button, {
74
+ ...props,
75
+ display: "block",
76
+ textAlign: "start",
77
+ elementRef: this.setButtonRef,
78
+ children: summary
79
+ });
80
+ } else if (props.href) {
81
+ return /*#__PURE__*/ _jsx("a", {
82
+ ...props,
83
+ css: this.props.styles?.toggle,
84
+ ref: this.setButtonRef,
85
+ children: summary
86
+ });
87
+ } else {
88
+ return /*#__PURE__*/ _jsx("button", {
89
+ ...props,
90
+ type: "button",
91
+ css: this.props.styles?.toggle,
92
+ ref: this.setButtonRef,
93
+ children: summary
94
+ });
95
+ }
96
+ }
97
+ renderIcon(expanded) {
98
+ const Icon = expanded ? this.props.iconExpanded : this.props.icon;
99
+ return this.props.children && Icon ? /*#__PURE__*/ _jsx("span", {
100
+ css: this.props.styles?.icon,
101
+ children: /*#__PURE__*/ _jsx(Icon, {})
102
+ }) : null;
103
+ }
104
+ renderDetails(expanded, detailsProps) {
105
+ if (!this.props.children) return null;
106
+ const expandedStyles = expanded ? {
107
+ display: 'block'
108
+ } : {
109
+ display: 'none'
110
+ };
111
+ return /*#__PURE__*/ _jsx("div", {
112
+ ...detailsProps,
113
+ css: [
114
+ this.props.styles?.details,
115
+ expandedStyles
116
+ ],
117
+ children: expanded && this.renderContent()
118
+ });
155
119
  }
156
- };
157
- render() {
158
- return _jsx(Expandable, {
159
- ...pickProps(this.props, Expandable.allowedProps),
160
- onToggle: this.handleToggle,
161
- children: ({
162
- expanded,
163
- getToggleProps,
164
- getDetailsProps
165
- }) => {
166
- return _jsxs("div", {
167
- css: this.props.styles?.toggleDetails,
168
- ref: this.ref,
169
- "data-cid": "ToggleDetails",
170
- children: [this.renderToggle(getToggleProps(), expanded), this.renderDetails(expanded, getDetailsProps())]
120
+ renderContent() {
121
+ return /*#__PURE__*/ _jsx("div", {
122
+ css: this.props.styles?.content,
123
+ children: this.props.children
171
124
  });
172
- }
173
- });
174
- }
175
- }) || _class);
125
+ }
126
+ render() {
127
+ return /*#__PURE__*/ _jsx(Expandable, {
128
+ ...pickProps(this.props, Expandable.allowedProps),
129
+ onToggle: this.handleToggle,
130
+ children: ({ expanded, getToggleProps, getDetailsProps })=>{
131
+ return /*#__PURE__*/ _jsxs("div", {
132
+ css: this.props.styles?.toggleDetails,
133
+ ref: this.ref,
134
+ "data-cid": "ToggleDetails",
135
+ children: [
136
+ this.renderToggle(getToggleProps(), expanded),
137
+ this.renderDetails(expanded, getDetailsProps())
138
+ ]
139
+ });
140
+ }
141
+ });
142
+ }
143
+ constructor(...args){
144
+ super(...args), this._buttonNode = null, this.ref = /*#__PURE__*/ createRef(), this.setButtonRef = (node)=>{
145
+ this._buttonNode = node;
146
+ }, this.handleToggle = (event, expanded)=>{
147
+ if (typeof this.props.onToggle === 'function') {
148
+ this.props.onToggle(event, expanded);
149
+ }
150
+ };
151
+ }
152
+ }
153
+ ToggleDetails = _ts_decorate([
154
+ withStyle(generateStyle, generateComponentTheme)
155
+ ], ToggleDetails);
176
156
  export default ToggleDetails;
177
- export { ToggleDetails };
157
+ export { ToggleDetails };
@@ -1,26 +1,14 @@
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 = ['variant', 'summary', 'expanded', 'defaultExpanded', 'onToggle', 'icon', 'iconExpanded', 'iconPosition', 'fluidWidth', 'children', 'size'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'variant',
3
+ 'summary',
4
+ 'expanded',
5
+ 'defaultExpanded',
6
+ 'onToggle',
7
+ 'icon',
8
+ 'iconExpanded',
9
+ 'iconPosition',
10
+ 'fluidWidth',
11
+ 'children',
12
+ 'size'
13
+ ];
14
+ export { allowedProps };