@instructure/ui-toggle-details 11.6.0 → 11.6.1-snapshot-129

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 (97) hide show
  1. package/CHANGELOG.md +35 -289
  2. package/es/ToggleDetails/{index.js → v1/index.js} +2 -2
  3. package/es/ToggleDetails/v2/index.js +186 -0
  4. package/{src/index.ts → es/ToggleDetails/v2/props.js} +2 -5
  5. package/es/ToggleDetails/v2/styles.js +186 -0
  6. package/es/ToggleGroup/{index.js → v1/index.js} +4 -4
  7. package/es/ToggleGroup/v2/index.js +172 -0
  8. package/es/ToggleGroup/v2/props.js +26 -0
  9. package/es/ToggleGroup/v2/styles.js +40 -0
  10. package/es/{index.js → exports/a.js} +2 -2
  11. package/es/exports/b.js +25 -0
  12. package/lib/ToggleDetails/{index.js → v1/index.js} +5 -5
  13. package/lib/ToggleDetails/v2/index.js +192 -0
  14. package/lib/ToggleDetails/v2/props.js +31 -0
  15. package/lib/ToggleDetails/v2/styles.js +192 -0
  16. package/lib/ToggleGroup/{index.js → v1/index.js} +12 -12
  17. package/lib/ToggleGroup/v2/index.js +179 -0
  18. package/lib/ToggleGroup/v2/props.js +31 -0
  19. package/lib/ToggleGroup/v2/styles.js +46 -0
  20. package/lib/{index.js → exports/a.js} +4 -4
  21. package/lib/exports/b.js +19 -0
  22. package/package.json +45 -23
  23. package/src/ToggleDetails/{index.tsx → v1/index.tsx} +3 -3
  24. package/src/ToggleDetails/{props.ts → v1/props.ts} +1 -1
  25. package/src/ToggleDetails/v2/README.md +233 -0
  26. package/src/ToggleDetails/v2/index.tsx +205 -0
  27. package/src/ToggleDetails/v2/props.ts +114 -0
  28. package/src/ToggleDetails/v2/styles.ts +188 -0
  29. package/src/ToggleGroup/{index.tsx → v1/index.tsx} +4 -4
  30. package/src/ToggleGroup/v2/README.md +93 -0
  31. package/src/ToggleGroup/v2/index.tsx +213 -0
  32. package/src/ToggleGroup/v2/props.ts +115 -0
  33. package/src/ToggleGroup/v2/styles.ts +47 -0
  34. package/src/exports/a.ts +29 -0
  35. package/src/exports/b.ts +29 -0
  36. package/tsconfig.build.tsbuildinfo +1 -1
  37. package/types/ToggleDetails/{index.d.ts → v1/index.d.ts} +1 -1
  38. package/types/ToggleDetails/v1/index.d.ts.map +1 -0
  39. package/types/ToggleDetails/{props.d.ts → v1/props.d.ts} +1 -1
  40. package/types/ToggleDetails/v1/props.d.ts.map +1 -0
  41. package/types/ToggleDetails/v1/styles.d.ts.map +1 -0
  42. package/types/ToggleDetails/v1/theme.d.ts.map +1 -0
  43. package/types/ToggleDetails/v2/index.d.ts +54 -0
  44. package/types/ToggleDetails/v2/index.d.ts.map +1 -0
  45. package/types/ToggleDetails/v2/props.d.ts +55 -0
  46. package/types/ToggleDetails/v2/props.d.ts.map +1 -0
  47. package/types/ToggleDetails/v2/styles.d.ts +16 -0
  48. package/types/ToggleDetails/v2/styles.d.ts.map +1 -0
  49. package/types/ToggleGroup/v1/index.d.ts.map +1 -0
  50. package/types/ToggleGroup/v1/props.d.ts.map +1 -0
  51. package/types/ToggleGroup/v1/styles.d.ts.map +1 -0
  52. package/types/ToggleGroup/v1/theme.d.ts.map +1 -0
  53. package/types/ToggleGroup/v2/index.d.ts +53 -0
  54. package/types/ToggleGroup/v2/index.d.ts.map +1 -0
  55. package/types/ToggleGroup/v2/props.d.ts +65 -0
  56. package/types/ToggleGroup/v2/props.d.ts.map +1 -0
  57. package/types/ToggleGroup/v2/styles.d.ts +15 -0
  58. package/types/ToggleGroup/v2/styles.d.ts.map +1 -0
  59. package/types/exports/a.d.ts +5 -0
  60. package/types/exports/a.d.ts.map +1 -0
  61. package/types/exports/b.d.ts +5 -0
  62. package/types/exports/b.d.ts.map +1 -0
  63. package/types/ToggleDetails/index.d.ts.map +0 -1
  64. package/types/ToggleDetails/props.d.ts.map +0 -1
  65. package/types/ToggleDetails/styles.d.ts.map +0 -1
  66. package/types/ToggleDetails/theme.d.ts.map +0 -1
  67. package/types/ToggleGroup/index.d.ts.map +0 -1
  68. package/types/ToggleGroup/props.d.ts.map +0 -1
  69. package/types/ToggleGroup/styles.d.ts.map +0 -1
  70. package/types/ToggleGroup/theme.d.ts.map +0 -1
  71. package/types/index.d.ts +0 -5
  72. package/types/index.d.ts.map +0 -1
  73. /package/es/ToggleDetails/{props.js → v1/props.js} +0 -0
  74. /package/es/ToggleDetails/{styles.js → v1/styles.js} +0 -0
  75. /package/es/ToggleDetails/{theme.js → v1/theme.js} +0 -0
  76. /package/es/ToggleGroup/{props.js → v1/props.js} +0 -0
  77. /package/es/ToggleGroup/{styles.js → v1/styles.js} +0 -0
  78. /package/es/ToggleGroup/{theme.js → v1/theme.js} +0 -0
  79. /package/lib/ToggleDetails/{props.js → v1/props.js} +0 -0
  80. /package/lib/ToggleDetails/{styles.js → v1/styles.js} +0 -0
  81. /package/lib/ToggleDetails/{theme.js → v1/theme.js} +0 -0
  82. /package/lib/ToggleGroup/{props.js → v1/props.js} +0 -0
  83. /package/lib/ToggleGroup/{styles.js → v1/styles.js} +0 -0
  84. /package/lib/ToggleGroup/{theme.js → v1/theme.js} +0 -0
  85. /package/src/ToggleDetails/{README.md → v1/README.md} +0 -0
  86. /package/src/ToggleDetails/{styles.ts → v1/styles.ts} +0 -0
  87. /package/src/ToggleDetails/{theme.ts → v1/theme.ts} +0 -0
  88. /package/src/ToggleGroup/{README.md → v1/README.md} +0 -0
  89. /package/src/ToggleGroup/{props.ts → v1/props.ts} +0 -0
  90. /package/src/ToggleGroup/{styles.ts → v1/styles.ts} +0 -0
  91. /package/src/ToggleGroup/{theme.ts → v1/theme.ts} +0 -0
  92. /package/types/ToggleDetails/{styles.d.ts → v1/styles.d.ts} +0 -0
  93. /package/types/ToggleDetails/{theme.d.ts → v1/theme.d.ts} +0 -0
  94. /package/types/ToggleGroup/{index.d.ts → v1/index.d.ts} +0 -0
  95. /package/types/ToggleGroup/{props.d.ts → v1/props.d.ts} +0 -0
  96. /package/types/ToggleGroup/{styles.d.ts → v1/styles.d.ts} +0 -0
  97. /package/types/ToggleGroup/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.ToggleDetails = void 0;
8
8
  var _react = require("react");
9
- var _Button = require("@instructure/ui-buttons/lib/Button");
10
- var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEndSolid.js");
11
- var _IconArrowOpenDownSolid = require("@instructure/ui-icons/lib/IconArrowOpenDownSolid.js");
9
+ var _v11_ = require("@instructure/ui-buttons/v11_6");
10
+ var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/generated/IconArrowOpenEndSolid.js");
11
+ var _IconArrowOpenDownSolid = require("@instructure/ui-icons/lib/generated/IconArrowOpenDownSolid.js");
12
12
  var _Expandable = require("@instructure/ui-expandable/lib/Expandable");
13
13
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
14
14
  var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
@@ -47,7 +47,7 @@ var _dec, _class, _ToggleDetails;
47
47
  category: components
48
48
  ---
49
49
  **/
50
- let ToggleDetails = exports.ToggleDetails = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_ToggleDetails = class ToggleDetails extends _react.Component {
50
+ let ToggleDetails = exports.ToggleDetails = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_ToggleDetails = class ToggleDetails extends _react.Component {
51
51
  constructor(...args) {
52
52
  super(...args);
53
53
  this._buttonNode = null;
@@ -102,7 +102,7 @@ let ToggleDetails = exports.ToggleDetails = (_dec = (0, _emotion.withStyle)(_sty
102
102
  };
103
103
  const summary = this.renderSummary(expanded);
104
104
  if (variant === 'filled') {
105
- return (0, _jsxRuntime.jsx)(_Button.Button, {
105
+ return (0, _jsxRuntime.jsx)(_v11_.Button, {
106
106
  ...props,
107
107
  display: "block",
108
108
  textAlign: "start",
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.ToggleDetails = void 0;
8
+ var _react = require("react");
9
+ var _latest = require("@instructure/ui-buttons/latest");
10
+ var _uiIcons = require("@instructure/ui-icons");
11
+ var _Expandable = require("@instructure/ui-expandable/lib/Expandable");
12
+ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
13
+ var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
14
+ var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
15
+ var _emotion = require("@instructure/emotion");
16
+ var _styles = _interopRequireDefault(require("./styles"));
17
+ var _props = require("./props");
18
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
19
+ var _dec, _class, _ToggleDetails;
20
+ /*
21
+ * The MIT License (MIT)
22
+ *
23
+ * Copyright (c) 2015 - present Instructure, Inc.
24
+ *
25
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
26
+ * of this software and associated documentation files (the "Software"), to deal
27
+ * in the Software without restriction, including without limitation the rights
28
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
+ * copies of the Software, and to permit persons to whom the Software is
30
+ * furnished to do so, subject to the following conditions:
31
+ *
32
+ * The above copyright notice and this permission notice shall be included in all
33
+ * copies or substantial portions of the Software.
34
+ *
35
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
+ * SOFTWARE.
42
+ */
43
+ /**
44
+ ---
45
+ category: components
46
+ ---
47
+ **/
48
+ let ToggleDetails = exports.ToggleDetails = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_ToggleDetails = class ToggleDetails extends _react.Component {
49
+ constructor(...args) {
50
+ super(...args);
51
+ this._buttonNode = null;
52
+ this.ref = /*#__PURE__*/(0, _react.createRef)();
53
+ // TODO this solution was generated with Gemini, should be tested if it works as fine as before
54
+ this.setButtonRef = node => {
55
+ this._buttonNode = node;
56
+ };
57
+ this.handleToggle = (event, expanded) => {
58
+ if (typeof this.props.onToggle === 'function') {
59
+ this.props.onToggle(event, expanded);
60
+ }
61
+ };
62
+ }
63
+ get focused() {
64
+ return (0, _isActiveElement.isActiveElement)(this._buttonNode);
65
+ }
66
+ focus() {
67
+ var _this$_buttonNode;
68
+ (_this$_buttonNode = this._buttonNode) === null || _this$_buttonNode === void 0 ? void 0 : _this$_buttonNode.focus();
69
+ }
70
+ componentDidMount() {
71
+ var _this$props$makeStyle, _this$props;
72
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
73
+ }
74
+ componentDidUpdate() {
75
+ var _this$props$makeStyle2, _this$props2;
76
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
77
+ }
78
+ renderSummary(expanded) {
79
+ var _this$props$styles, _this$props$styles2;
80
+ const _this$props3 = this.props,
81
+ summary = _this$props3.summary,
82
+ iconPosition = _this$props3.iconPosition;
83
+ return (0, _jsxRuntime.jsxs)("span", {
84
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.summary,
85
+ children: [iconPosition === 'start' && this.renderIcon(expanded), (0, _jsxRuntime.jsx)("span", {
86
+ css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.summaryText,
87
+ children: summary
88
+ }), iconPosition === 'end' && this.renderIcon(expanded)]
89
+ });
90
+ }
91
+ renderToggle(toggleProps, expanded) {
92
+ const variant = this.props.variant;
93
+ const tProps = this.props.children ? toggleProps : {
94
+ onClick: toggleProps.onClick
95
+ };
96
+ const props = {
97
+ ...(0, _omitProps.omitProps)(this.props, ToggleDetails.allowedProps),
98
+ ...tProps,
99
+ children: this.renderSummary(expanded)
100
+ };
101
+ const summary = this.renderSummary(expanded);
102
+ if (variant === 'filled') {
103
+ return (0, _jsxRuntime.jsx)(_latest.Button, {
104
+ ...props,
105
+ display: "block",
106
+ textAlign: "start",
107
+ elementRef: this.setButtonRef,
108
+ children: summary
109
+ });
110
+ } else if (props.href) {
111
+ var _this$props$styles3;
112
+ return (0, _jsxRuntime.jsx)("a", {
113
+ ...props,
114
+ css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.toggle,
115
+ ref: this.setButtonRef,
116
+ children: summary
117
+ });
118
+ } else {
119
+ var _this$props$styles4;
120
+ return (0, _jsxRuntime.jsx)("button", {
121
+ ...props,
122
+ type: "button",
123
+ css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.toggle,
124
+ ref: this.setButtonRef,
125
+ children: summary
126
+ });
127
+ }
128
+ }
129
+ renderIcon(expanded) {
130
+ var _this$props$styles5;
131
+ const Icon = expanded ? this.props.iconExpanded : this.props.icon;
132
+ const iconSize = this.props.size === 'large' ? 'lg' : 'md';
133
+ const iconColor = this.props.variant === 'filled' ? 'actionSecondaryBaseColor' : 'baseColor';
134
+ return this.props.children && Icon ? (0, _jsxRuntime.jsx)("span", {
135
+ css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.icon,
136
+ children: (0, _jsxRuntime.jsx)(Icon, {
137
+ size: iconSize,
138
+ color: iconColor
139
+ })
140
+ }) : null;
141
+ }
142
+ renderDetails(expanded, detailsProps) {
143
+ var _this$props$styles6;
144
+ if (!this.props.children) return null;
145
+ const expandedStyles = expanded ? {
146
+ display: 'block'
147
+ } : {
148
+ display: 'none'
149
+ };
150
+ return (0, _jsxRuntime.jsx)("div", {
151
+ ...detailsProps,
152
+ css: [(_this$props$styles6 = this.props.styles) === null || _this$props$styles6 === void 0 ? void 0 : _this$props$styles6.details, expandedStyles],
153
+ children: expanded && this.renderContent()
154
+ });
155
+ }
156
+ renderContent() {
157
+ var _this$props$styles7;
158
+ return (0, _jsxRuntime.jsx)("div", {
159
+ css: (_this$props$styles7 = this.props.styles) === null || _this$props$styles7 === void 0 ? void 0 : _this$props$styles7.content,
160
+ children: this.props.children
161
+ });
162
+ }
163
+ render() {
164
+ return (0, _jsxRuntime.jsx)(_Expandable.Expandable, {
165
+ ...(0, _pickProps.pickProps)(this.props, _Expandable.Expandable.allowedProps),
166
+ onToggle: this.handleToggle,
167
+ children: ({
168
+ expanded,
169
+ getToggleProps,
170
+ getDetailsProps
171
+ }) => {
172
+ var _this$props$styles8;
173
+ return (0, _jsxRuntime.jsxs)("div", {
174
+ css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.toggleDetails,
175
+ ref: this.ref,
176
+ "data-cid": "ToggleDetails",
177
+ children: [this.renderToggle(getToggleProps(), expanded), this.renderDetails(expanded, getDetailsProps())]
178
+ });
179
+ }
180
+ });
181
+ }
182
+ }, _ToggleDetails.displayName = "ToggleDetails", _ToggleDetails.componentId = 'ToggleDetails', _ToggleDetails.allowedProps = _props.allowedProps, _ToggleDetails.defaultProps = {
183
+ variant: 'default',
184
+ size: 'medium',
185
+ fluidWidth: false,
186
+ icon: _uiIcons.ChevronRightInstUIIcon,
187
+ iconExpanded: _uiIcons.ChevronDownInstUIIcon,
188
+ iconPosition: 'start',
189
+ defaultExpanded: false,
190
+ children: null
191
+ }, _ToggleDetails)) || _class);
192
+ var _default = exports.default = ToggleDetails;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.allowedProps = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ const allowedProps = exports.allowedProps = ['variant', 'summary', 'expanded', 'defaultExpanded', 'onToggle', 'icon', 'iconExpanded', 'iconPosition', 'fluidWidth', 'children', 'size'];
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _emotion = require("@instructure/emotion");
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ const contentAnimation = (0, _emotion.keyframes)`
33
+ to {
34
+ opacity: 1;
35
+ }`;
36
+
37
+ /**
38
+ * ---
39
+ * private: true
40
+ * ---
41
+ * Generates the style object from the theme and provided additional information
42
+ * @param {Object} componentTheme The theme variable object.
43
+ * @param {Object} props the props of the component, the style is applied to
44
+ * @param {Object} sharedTokens the shared tokens of the component
45
+ * @param {Object} state the state of the component, the style is applied to
46
+ * @return {Object} The final style object, which will be used in the component
47
+ */
48
+ const generateStyle = (componentTheme, props, sharedTokens, _state) => {
49
+ const fluidWidth = props.fluidWidth,
50
+ iconPosition = props.iconPosition,
51
+ size = props.size,
52
+ variant = props.variant;
53
+ const positionIconAtEnd = iconPosition === 'end' && (variant === 'filled' || fluidWidth);
54
+ const fluidWidthStyles = fluidWidth ? {
55
+ display: 'block',
56
+ width: '100%'
57
+ } : {};
58
+ const iconPositionStyles = {
59
+ start: {
60
+ marginInlineEnd: componentTheme.iconMargin,
61
+ marginInlineStart: 0
62
+ },
63
+ end: {
64
+ marginInlineStart: componentTheme.iconMargin,
65
+ marginInlineEnd: 0
66
+ }
67
+ };
68
+ const fontSizeStyles = {
69
+ small: {
70
+ fontSize: componentTheme.fontSizeSmall
71
+ },
72
+ medium: {
73
+ fontSize: componentTheme.fontSizeMedium
74
+ },
75
+ large: {
76
+ fontSize: componentTheme.fontSizeLarge
77
+ }
78
+ };
79
+ const indentDetailsStyles = iconPosition === 'start' && !fluidWidth ? {
80
+ small: {
81
+ paddingInlineStart: `calc(${componentTheme.contentPaddingSmall} + ${componentTheme.togglePadding})`,
82
+ paddingInlineEnd: '0'
83
+ },
84
+ medium: {
85
+ paddingInlineStart: `calc(${componentTheme.contentPaddingMedium} + ${componentTheme.togglePadding})`,
86
+ paddingInlineEnd: '0'
87
+ },
88
+ large: {
89
+ paddingInlineStart: `calc(${componentTheme.contentPaddingLarge} + ${componentTheme.togglePadding})`,
90
+ paddingInlineEnd: '0'
91
+ }
92
+ } : {
93
+ small: {},
94
+ medium: {},
95
+ large: {}
96
+ };
97
+ return {
98
+ toggleDetails: {
99
+ label: 'toggleDetails',
100
+ fontFamily: componentTheme.fontFamily,
101
+ fontWeight: componentTheme.fontWeight
102
+ },
103
+ summary: {
104
+ label: 'toggleDetails__summary',
105
+ position: 'relative',
106
+ display: 'flex',
107
+ alignItems: 'center',
108
+ boxSizing: 'border-box',
109
+ textAlign: 'start'
110
+ },
111
+ summaryText: {
112
+ label: 'toggleDetails__summaryText',
113
+ minWidth: '0.0625rem',
114
+ flexGrow: 1,
115
+ ...(positionIconAtEnd ? {
116
+ flex: 1
117
+ } : {})
118
+ },
119
+ toggle: {
120
+ label: 'toggleDetails__toggle',
121
+ fontFamily: componentTheme.fontFamily,
122
+ lineHeight: componentTheme.lineHeight,
123
+ appearance: 'none',
124
+ cursor: 'pointer',
125
+ userSelect: 'none',
126
+ touchAction: 'manipulation',
127
+ position: 'relative',
128
+ overflow: 'visible',
129
+ boxSizing: 'border-box',
130
+ padding: '0',
131
+ margin: '0',
132
+ outline: 'none',
133
+ border: 'none',
134
+ background: 'transparent',
135
+ color: componentTheme.textColor,
136
+ '&::-moz-focus-inner': {
137
+ padding: '0',
138
+ margin: '0'
139
+ },
140
+ '&::before': {
141
+ content: '""',
142
+ position: 'absolute',
143
+ top: '-0.375rem',
144
+ left: '-0.375rem',
145
+ right: '-0.375rem',
146
+ bottom: '-0.375rem',
147
+ border: `${componentTheme.toggleBorderWidth} ${componentTheme.toggleBorderStyle} ${sharedTokens.focusOutline.infoColor}`,
148
+ borderRadius: `calc(${componentTheme.toggleBorderRadius} * 1.5)`,
149
+ opacity: 0,
150
+ pointerEvents: 'none'
151
+ },
152
+ '&:focus': {
153
+ '&::before': {
154
+ opacity: 1
155
+ }
156
+ },
157
+ '&:focus, &:hover, &:active': {
158
+ textDecoration: 'none',
159
+ color: componentTheme.textColor
160
+ },
161
+ textDecoration: 'none',
162
+ ...fluidWidthStyles,
163
+ ...fontSizeStyles[size]
164
+ },
165
+ icon: {
166
+ label: 'toggleDetails__icon',
167
+ display: 'flex',
168
+ alignItems: 'center',
169
+ '& > svg': {
170
+ display: 'block' /* fix vertical alignment of icon */
171
+ },
172
+ ...iconPositionStyles[iconPosition]
173
+ },
174
+ details: {
175
+ label: 'toggleDetails__details',
176
+ boxSizing: 'border-box',
177
+ paddingTop: componentTheme.togglePadding,
178
+ color: componentTheme.textColor,
179
+ lineHeight: componentTheme.lineHeight,
180
+ ...fontSizeStyles[size],
181
+ ...indentDetailsStyles[size]
182
+ },
183
+ content: {
184
+ label: 'toggleDetails__content',
185
+ opacity: 0.01,
186
+ animationName: contentAnimation,
187
+ animationFillMode: 'forwards',
188
+ animationDuration: '.3s'
189
+ }
190
+ };
191
+ };
192
+ var _default = exports.default = generateStyle;
@@ -10,14 +10,14 @@ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
10
10
  var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
11
11
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
12
12
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
13
- var _IconButton = require("@instructure/ui-buttons/lib/IconButton");
13
+ var _v11_ = require("@instructure/ui-buttons/v11_6");
14
14
  var _Transition = require("@instructure/ui-motion/lib/Transition");
15
15
  var _Expandable = require("@instructure/ui-expandable/lib/Expandable");
16
16
  var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
17
- var _Flex = require("@instructure/ui-flex/lib/Flex");
18
- var _View = require("@instructure/ui-view/lib/View");
19
- var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEndSolid.js");
20
- var _IconArrowOpenDownSolid = require("@instructure/ui-icons/lib/IconArrowOpenDownSolid.js");
17
+ var _v11_2 = require("@instructure/ui-flex/v11_6");
18
+ var _v11_3 = require("@instructure/ui-view/v11_6");
19
+ var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/generated/IconArrowOpenEndSolid.js");
20
+ var _IconArrowOpenDownSolid = require("@instructure/ui-icons/lib/generated/IconArrowOpenDownSolid.js");
21
21
  var _props = require("./props");
22
22
  var _emotion = require("@instructure/emotion");
23
23
  var _styles = _interopRequireDefault(require("./styles"));
@@ -52,7 +52,7 @@ var _dec, _class, _ToggleGroup;
52
52
  category: components
53
53
  ---
54
54
  **/
55
- let ToggleGroup = exports.ToggleGroup = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_ToggleGroup = class ToggleGroup extends _react.Component {
55
+ let ToggleGroup = exports.ToggleGroup = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_ToggleGroup = class ToggleGroup extends _react.Component {
56
56
  constructor(...args) {
57
57
  super(...args);
58
58
  this.ref = null;
@@ -100,7 +100,7 @@ let ToggleGroup = exports.ToggleGroup = (_dec = (0, _emotion.withStyle)(_styles.
100
100
  const props = {
101
101
  ...toggleProps
102
102
  };
103
- return (0, _jsxRuntime.jsx)(_IconButton.IconButton, {
103
+ return (0, _jsxRuntime.jsx)(_v11_.IconButton, {
104
104
  ...props,
105
105
  withBackground: false,
106
106
  withBorder: false,
@@ -112,7 +112,7 @@ let ToggleGroup = exports.ToggleGroup = (_dec = (0, _emotion.withStyle)(_styles.
112
112
  }
113
113
  renderDetails(detailsProps) {
114
114
  const styles = this.props.styles;
115
- return (0, _jsxRuntime.jsx)(_View.View, {
115
+ return (0, _jsxRuntime.jsx)(_v11_3.View, {
116
116
  ...detailsProps,
117
117
  display: "block",
118
118
  borderWidth: "small none none none",
@@ -135,7 +135,7 @@ let ToggleGroup = exports.ToggleGroup = (_dec = (0, _emotion.withStyle)(_styles.
135
135
  getToggleProps,
136
136
  getDetailsProps
137
137
  }) => {
138
- return (0, _jsxRuntime.jsxs)(_View.View, {
138
+ return (0, _jsxRuntime.jsxs)(_v11_3.View, {
139
139
  ...(0, _omitProps.omitProps)(this.props, ToggleGroup.allowedProps),
140
140
  borderWidth: this.props.border ? 'small' : 'none',
141
141
  as: Element,
@@ -145,11 +145,11 @@ let ToggleGroup = exports.ToggleGroup = (_dec = (0, _emotion.withStyle)(_styles.
145
145
  background: "primary",
146
146
  borderColor: styles === null || styles === void 0 ? void 0 : styles.borderColor,
147
147
  "data-cid": "ToggleGroup",
148
- children: [(0, _jsxRuntime.jsxs)(_Flex.Flex, {
148
+ children: [(0, _jsxRuntime.jsxs)(_v11_2.Flex, {
149
149
  padding: this.props.size === 'small' ? 'x-small' : 'small small small x-small',
150
- children: [(0, _jsxRuntime.jsx)(_Flex.Flex.Item, {
150
+ children: [(0, _jsxRuntime.jsx)(_v11_2.Flex.Item, {
151
151
  children: this.renderToggle(getToggleProps(), expanded)
152
- }), (0, _jsxRuntime.jsx)(_Flex.Flex.Item, {
152
+ }), (0, _jsxRuntime.jsx)(_v11_2.Flex.Item, {
153
153
  shouldGrow: true,
154
154
  shouldShrink: true,
155
155
  padding: "0 0 0 x-small",