@instructure/ui-position 11.7.10 → 11.7.11-pr-snapshot-1794841957152

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/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.11-pr-snapshot-1794841957152](https://github.com/instructure/instructure-ui/compare/v11.7.10...v11.7.11-pr-snapshot-1794841957152) (2026-11-16)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([9c2e562](https://github.com/instructure/instructure-ui/commit/9c2e5629e7c509fdfc0d1770d1b81e70e60e083b))
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.10](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.10) (2026-10-14)
7
20
 
8
21
  **Note:** Version bump only for package @instructure/ui-position
@@ -1,28 +1,4 @@
1
- var _dec, _dec2, _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 { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
2
  import { Component } from 'react';
27
3
  import { callRenderProp, ensureSingleChild, safeCloneElement, withDeterministicId } from '@instructure/ui-react-utils';
28
4
  import { addPositionChangeListener, findDOMNode } from '@instructure/ui-dom-utils';
@@ -34,237 +10,220 @@ import generateStyle from './styles.js';
34
10
  import generateComponentTheme from './theme.js';
35
11
  import { allowedProps } from './props.js';
36
12
  import { calculateElementPosition } from '../calculateElementPosition.js';
37
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
38
- /**
39
- ---
40
- category: components/Util Components
41
- ---
42
- **/
43
- let Position = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class Position extends Component {
44
- static displayName = 'Position';
45
- static componentId = 'Position';
46
- static allowedProps = allowedProps;
47
- static defaultProps = {
48
- placement: 'bottom center',
49
- mountNode: null,
50
- insertAt: 'bottom',
51
- constrain: 'window',
52
- offsetX: 0,
53
- offsetY: 0,
54
- shouldTrackPosition: true,
55
- shouldPositionOverTarget: false,
56
- children: null
57
- };
58
- static locatorAttribute = 'data-position';
59
- static targetLocatorAttribute = 'data-position-target';
60
- static contentLocatorAttribute = 'data-position-content';
61
- constructor(props) {
62
- super(props);
63
- const initial = this.calculatePosition(props);
64
- this._availableHeight = initial.availableHeight;
65
- this._availableWidth = initial.availableWidth;
66
- this.state = {
67
- positioned: false,
68
- placement: initial.placement,
69
- style: initial.style
70
- };
71
- this.position = debounce(this.position, 0, {
72
- leading: false,
73
- trailing: true
74
- });
75
- this._id = this.props.id || props.deterministicId();
76
- }
77
- ref = null;
78
- _id;
79
- _timeouts = [];
80
- _listener = null;
81
- _content;
82
- _target;
83
- _availableHeight;
84
- _availableWidth;
85
- handleRef = el => {
86
- const {
87
- elementRef
88
- } = this.props;
89
- this.ref = el;
90
- if (typeof elementRef === 'function') {
91
- elementRef(el);
13
+ export class PositionBase extends Component {
14
+ static{
15
+ this.displayName = 'Position';
92
16
  }
93
- };
94
- shouldComponentUpdate(nextProps, nextState, nextContext) {
95
- return !deepEqual(this.state, nextState) || !shallowEqual(this.props, nextProps) || !shallowEqual(this.context, nextContext);
96
- }
97
- componentDidMount() {
98
- this.toggleLocatorAttributes(true);
99
- this.props.makeStyles?.();
100
- }
101
- componentDidUpdate(prevProps, prevState) {
102
- this.position();
103
- this.toggleLocatorAttributes(true);
104
- if (this.props.shouldTrackPosition !== prevProps.shouldTrackPosition) {
105
- this.props.shouldTrackPosition ? this.startTracking() : this.stopTracking();
17
+ static{
18
+ this.componentId = 'Position';
106
19
  }
107
- const {
108
- style,
109
- placement
110
- } = this.state;
111
- if (style && prevState.style && (placement !== prevState.placement || style.top !== prevState.style.top || style.left !== prevState.style.left) && typeof this.props.onPositionChanged === 'function') {
112
- this.props.onPositionChanged({
113
- top: style.top,
114
- left: style.left,
115
- placement
116
- });
20
+ static{
21
+ this.allowedProps = allowedProps;
117
22
  }
118
- this.props.makeStyles?.();
119
- }
120
- componentWillUnmount() {
121
- ;
122
- this.position.cancel();
123
- this.stopTracking();
124
- this._timeouts.forEach(timeout => clearTimeout(timeout));
125
- this.toggleLocatorAttributes(false);
126
- }
127
- toggleLocatorAttributes(set) {
128
- // We have to find the actual DOM nodes and append the attributes
129
- // directly, as we can't be sure when safe cloning the child that
130
- // it will accept the data attribute as a prop
131
- this.toggleLocatorAttribute(findDOMNode(this._content), Position.contentLocatorAttribute, set);
132
- this.toggleLocatorAttribute(findDOMNode(this._target), Position.targetLocatorAttribute, set);
133
- }
134
- toggleLocatorAttribute(node, locator, set) {
135
- if (node && node.hasAttribute) {
136
- if (set && !node.hasAttribute(locator)) {
137
- ;
138
- node.setAttribute(locator, this._id);
139
- }
140
- if (!set && node.hasAttribute(locator)) {
23
+ static{
24
+ this.defaultProps = {
25
+ placement: 'bottom center',
26
+ mountNode: null,
27
+ insertAt: 'bottom',
28
+ constrain: 'window',
29
+ offsetX: 0,
30
+ offsetY: 0,
31
+ shouldTrackPosition: true,
32
+ shouldPositionOverTarget: false,
33
+ children: null
34
+ };
35
+ }
36
+ static{
37
+ this.locatorAttribute = 'data-position';
38
+ }
39
+ static{
40
+ this.targetLocatorAttribute = 'data-position-target';
41
+ }
42
+ static{
43
+ this.contentLocatorAttribute = 'data-position-content';
44
+ }
45
+ constructor(props){
46
+ super(props), this.ref = null, this._timeouts = [], this._listener = null, this.handleRef = (el)=>{
47
+ const { elementRef } = this.props;
48
+ this.ref = el;
49
+ if (typeof elementRef === 'function') {
50
+ elementRef(el);
51
+ }
52
+ }, this.handlePortalOpen = ()=>{
53
+ this.position();
54
+ if (this.props.shouldTrackPosition) {
55
+ this.startTracking();
56
+ }
57
+ this._timeouts.push(setTimeout(()=>{
58
+ if (this.state.positioned && typeof this.props.onPositioned === 'function') {
59
+ this.props.onPositioned({
60
+ top: this.state.style.top,
61
+ left: this.state.style.left,
62
+ placement: this.state.placement
63
+ });
64
+ }
65
+ }, 0));
66
+ }, this.position = ()=>{
67
+ const { placement, style, availableHeight, availableWidth } = this.calculatePosition(this.props);
68
+ this._availableHeight = availableHeight;
69
+ this._availableWidth = availableWidth;
70
+ this.applyAvailableSpaceCustomProperties();
71
+ this.setState({
72
+ positioned: true,
73
+ placement,
74
+ style
75
+ });
76
+ };
77
+ const initial = this.calculatePosition(props);
78
+ this._availableHeight = initial.availableHeight;
79
+ this._availableWidth = initial.availableWidth;
80
+ this.state = {
81
+ positioned: false,
82
+ placement: initial.placement,
83
+ style: initial.style
84
+ };
85
+ this.position = debounce(this.position, 0, {
86
+ leading: false,
87
+ trailing: true
88
+ });
89
+ this._id = this.props.id || props.deterministicId();
90
+ }
91
+ shouldComponentUpdate(nextProps, nextState, nextContext) {
92
+ return !deepEqual(this.state, nextState) || !shallowEqual(this.props, nextProps) || !shallowEqual(this.context, nextContext);
93
+ }
94
+ componentDidMount() {
95
+ this.toggleLocatorAttributes(true);
96
+ this.props.makeStyles?.();
97
+ }
98
+ componentDidUpdate(prevProps, prevState) {
99
+ this.position();
100
+ this.toggleLocatorAttributes(true);
101
+ if (this.props.shouldTrackPosition !== prevProps.shouldTrackPosition) {
102
+ this.props.shouldTrackPosition ? this.startTracking() : this.stopTracking();
103
+ }
104
+ const { style, placement } = this.state;
105
+ if (style && prevState.style && (placement !== prevState.placement || style.top !== prevState.style.top || style.left !== prevState.style.left) && typeof this.props.onPositionChanged === 'function') {
106
+ this.props.onPositionChanged({
107
+ top: style.top,
108
+ left: style.left,
109
+ placement
110
+ });
111
+ }
112
+ this.props.makeStyles?.();
113
+ }
114
+ componentWillUnmount() {
141
115
  ;
142
- node.removeAttribute(locator);
143
- }
116
+ this.position.cancel();
117
+ this.stopTracking();
118
+ this._timeouts.forEach((timeout)=>clearTimeout(timeout));
119
+ this.toggleLocatorAttributes(false);
120
+ }
121
+ toggleLocatorAttributes(set) {
122
+ this.toggleLocatorAttribute(findDOMNode(this._content), Position.contentLocatorAttribute, set);
123
+ this.toggleLocatorAttribute(findDOMNode(this._target), Position.targetLocatorAttribute, set);
124
+ }
125
+ toggleLocatorAttribute(node, locator, set) {
126
+ if (node && node.hasAttribute) {
127
+ if (set && !node.hasAttribute(locator)) {
128
+ ;
129
+ node.setAttribute(locator, this._id);
130
+ }
131
+ if (!set && node.hasAttribute(locator)) {
132
+ ;
133
+ node.removeAttribute(locator);
134
+ }
135
+ }
144
136
  }
145
- }
146
- handlePortalOpen = () => {
147
- this.position();
148
- if (this.props.shouldTrackPosition) {
149
- this.startTracking();
137
+ applyAvailableSpaceCustomProperties() {
138
+ const node = findDOMNode(this._content);
139
+ if (!node?.style) return;
140
+ const set = (name, value)=>{
141
+ if (typeof value === 'number' && Number.isFinite(value)) {
142
+ node.style.setProperty(name, `${value}px`);
143
+ } else {
144
+ node.style.removeProperty(name);
145
+ }
146
+ };
147
+ set('--ui-position-available-height', this._availableHeight);
148
+ set('--ui-position-available-width', this._availableWidth);
150
149
  }
151
- this._timeouts.push(setTimeout(() => {
152
- if (this.state.positioned && typeof this.props.onPositioned === 'function') {
153
- this.props.onPositioned({
154
- top: this.state.style.top,
155
- left: this.state.style.left,
156
- placement: this.state.placement
150
+ calculatePosition(props) {
151
+ return calculateElementPosition(this._content, this._target, {
152
+ placement: props.placement,
153
+ offsetX: props.offsetX,
154
+ offsetY: props.offsetY,
155
+ constrain: props.constrain,
156
+ container: props.mountNode,
157
+ over: props.shouldPositionOverTarget
157
158
  });
158
- }
159
- }, 0));
160
- };
161
-
162
- // Write `--ui-position-available-{height,width}` directly on the content
163
- // node's inline style
164
- applyAvailableSpaceCustomProperties() {
165
- const node = findDOMNode(this._content);
166
- if (!node?.style) return;
167
- const set = (name, value) => {
168
- if (typeof value === 'number' && Number.isFinite(value)) {
169
- node.style.setProperty(name, `${value}px`);
170
- } else {
171
- node.style.removeProperty(name);
172
- }
173
- };
174
- set('--ui-position-available-height', this._availableHeight);
175
- set('--ui-position-available-width', this._availableWidth);
176
- }
177
- calculatePosition(props) {
178
- return calculateElementPosition(this._content, this._target, {
179
- placement: props.placement,
180
- offsetX: props.offsetX,
181
- offsetY: props.offsetY,
182
- constrain: props.constrain,
183
- container: props.mountNode,
184
- over: props.shouldPositionOverTarget
185
- });
186
- }
187
- position = () => {
188
- const {
189
- placement,
190
- style,
191
- availableHeight,
192
- availableWidth
193
- } = this.calculatePosition(this.props);
194
- this._availableHeight = availableHeight;
195
- this._availableWidth = availableWidth;
196
- this.applyAvailableSpaceCustomProperties();
197
- this.setState({
198
- positioned: true,
199
- placement,
200
- style
201
- });
202
- };
203
- startTracking() {
204
- this._listener = this._listener || addPositionChangeListener(this._target, this.position);
205
- }
206
- stopTracking() {
207
- if (this._listener) {
208
- this._listener.remove();
209
- this._listener = null;
210
159
  }
211
- }
212
-
213
- // content that needs to be positioned relative to the target
214
- renderContent() {
215
- let content = ensureSingleChild(this.props.children);
216
- if (content) {
217
- content = safeCloneElement(content, {
218
- ref: el => {
219
- this._content = el;
220
- },
221
- style: {
222
- boxSizing: 'border-box',
223
- zIndex: this.props.styles?.zIndex,
224
- ...content.props.style,
225
- ...this.state.style
226
- },
227
- ...(content.props.className && {
228
- className: content.props.className
229
- }),
230
- [Position.contentLocatorAttribute]: this._id
231
- });
232
- content = _jsx(Portal, {
233
- open: true,
234
- onOpen: this.handlePortalOpen,
235
- mountNode: this.props.mountNode,
236
- insertAt: this.props.insertAt,
237
- children: content
238
- });
160
+ startTracking() {
161
+ this._listener = this._listener || addPositionChangeListener(this._target, this.position);
239
162
  }
240
- return content;
241
- }
242
- renderTarget() {
243
- const target = callRenderProp(this.props.renderTarget);
244
- if (target) {
245
- return safeCloneElement(target, {
246
- ref: el => {
247
- this._target = el;
248
- },
249
- [Position.targetLocatorAttribute]: this._id
250
- });
251
- } else if (this.props.target) {
252
- this._target = callRenderProp(this.props.target);
163
+ stopTracking() {
164
+ if (this._listener) {
165
+ this._listener.remove();
166
+ this._listener = null;
167
+ }
168
+ }
169
+ renderContent() {
170
+ let content = ensureSingleChild(this.props.children);
171
+ if (content) {
172
+ content = safeCloneElement(content, {
173
+ ref: (el)=>{
174
+ this._content = el;
175
+ },
176
+ style: {
177
+ boxSizing: 'border-box',
178
+ zIndex: this.props.styles?.zIndex,
179
+ ...content.props.style,
180
+ ...this.state.style
181
+ },
182
+ ...content.props.className && {
183
+ className: content.props.className
184
+ },
185
+ [Position.contentLocatorAttribute]: this._id
186
+ });
187
+ content = /*#__PURE__*/ _jsx(Portal, {
188
+ open: true,
189
+ onOpen: this.handlePortalOpen,
190
+ mountNode: this.props.mountNode,
191
+ insertAt: this.props.insertAt,
192
+ children: content
193
+ });
194
+ }
195
+ return content;
196
+ }
197
+ renderTarget() {
198
+ const target = callRenderProp(this.props.renderTarget);
199
+ if (target) {
200
+ return safeCloneElement(target, {
201
+ ref: (el)=>{
202
+ this._target = el;
203
+ },
204
+ [Position.targetLocatorAttribute]: this._id
205
+ });
206
+ } else if (this.props.target) {
207
+ this._target = callRenderProp(this.props.target);
208
+ }
209
+ return null;
210
+ }
211
+ render() {
212
+ const props = {
213
+ [Position.locatorAttribute]: this._id
214
+ };
215
+ return /*#__PURE__*/ _jsxs("span", {
216
+ ...props,
217
+ css: this.props.styles?.position,
218
+ ref: this.handleRef,
219
+ "data-cid": combineDataCid('Position', this.props),
220
+ children: [
221
+ this.renderTarget(),
222
+ this.renderContent()
223
+ ]
224
+ });
253
225
  }
254
- return null;
255
- }
256
- render() {
257
- const props = {
258
- [Position.locatorAttribute]: this._id
259
- };
260
- return _jsxs("span", {
261
- ...props,
262
- css: this.props.styles?.position,
263
- ref: this.handleRef,
264
- "data-cid": combineDataCid('Position', this.props),
265
- children: [this.renderTarget(), this.renderContent()]
266
- });
267
- }
268
- }) || _class) || _class);
226
+ }
227
+ const Position = withDeterministicId()(withStyle(generateStyle, generateComponentTheme)(PositionBase));
269
228
  export default Position;
270
- export { Position };
229
+ export { Position };
@@ -1,26 +1,19 @@
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 = ['renderTarget', 'target', 'placement', 'mountNode', 'insertAt', 'constrain', 'offsetX', 'offsetY', 'id', 'shouldTrackPosition', 'shouldPositionOverTarget', 'onPositionChanged', 'onPositioned', 'children', 'containerDisplay', 'elementRef'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'renderTarget',
3
+ 'target',
4
+ 'placement',
5
+ 'mountNode',
6
+ 'insertAt',
7
+ 'constrain',
8
+ 'offsetX',
9
+ 'offsetY',
10
+ 'id',
11
+ 'shouldTrackPosition',
12
+ 'shouldPositionOverTarget',
13
+ 'onPositionChanged',
14
+ 'onPositioned',
15
+ 'children',
16
+ 'containerDisplay',
17
+ 'elementRef'
18
+ ];
19
+ export { allowedProps };
@@ -1,44 +1,10 @@
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
- /**
26
- * ---
27
- * private: true
28
- * ---
29
- * Generates the style object from the theme and provided additional information
30
- * @param {Object} componentTheme The theme variable object.
31
- * @param {Object} props the props of the component, the style is applied to
32
- * @param {Object} state the state of the component, the style is applied to
33
- * @return {Object} The final style object, which will be used in the component
34
- */
35
- const generateStyle = (componentTheme, props) => {
36
- return {
37
- position: {
38
- label: 'position',
39
- display: props.containerDisplay
40
- },
41
- zIndex: componentTheme.zIndex
42
- };
1
+ const generateStyle = (componentTheme, props)=>{
2
+ return {
3
+ position: {
4
+ label: 'position',
5
+ display: props.containerDisplay
6
+ },
7
+ zIndex: componentTheme.zIndex
8
+ };
43
9
  };
44
- export default generateStyle;
10
+ export default generateStyle;
@@ -1,41 +1,10 @@
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
- /**
26
- * Generates the theme object for the component from the theme and provided additional information
27
- * @param {Object} theme The actual theme object.
28
- * @return {Object} The final theme object with the overrides and component variables
29
- */
30
- const generateComponentTheme = theme => {
31
- const {
32
- stacking
33
- } = theme;
34
- const componentVariables = {
35
- zIndex: stacking?.topmost
36
- };
37
- return {
38
- ...componentVariables
39
- };
1
+ const generateComponentTheme = (theme)=>{
2
+ const { stacking } = theme;
3
+ const componentVariables = {
4
+ zIndex: stacking?.topmost
5
+ };
6
+ return {
7
+ ...componentVariables
8
+ };
40
9
  };
41
- export default generateComponentTheme;
10
+ export default generateComponentTheme;