@instructure/ui-view 10.16.1-snapshot-0 → 10.16.1-snapshot-1
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 +1 -1
- package/es/ContextView/__examples__/ContextView.examples.js +4 -4
- package/es/ContextView/__new-tests__/ContextView.test.js +3 -3
- package/es/ContextView/index.js +27 -24
- package/es/View/__new-tests__/View.test.js +85 -38
- package/es/View/index.js +7 -5
- package/lib/ContextView/__examples__/ContextView.examples.js +4 -5
- package/lib/ContextView/__new-tests__/ContextView.test.js +4 -5
- package/lib/ContextView/index.js +26 -23
- package/lib/View/__new-tests__/View.test.js +87 -41
- package/lib/View/index.js +6 -4
- package/package.json +14 -14
- package/src/ContextView/__examples__/ContextView.examples.tsx +0 -2
- package/src/ContextView/__new-tests__/ContextView.test.tsx +0 -1
- package/src/ContextView/index.tsx +1 -2
- package/src/View/__new-tests__/View.test.tsx +1 -1
- package/src/View/index.tsx +1 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/ContextView/__examples__/ContextView.examples.d.ts.map +1 -1
- package/types/ContextView/__new-tests__/ContextView.test.d.ts.map +1 -1
- package/types/ContextView/index.d.ts +1 -3
- package/types/ContextView/index.d.ts.map +1 -1
- package/types/View/index.d.ts +1 -3
- package/types/View/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
## [10.16.1-snapshot-
|
|
6
|
+
## [10.16.1-snapshot-1](https://github.com/instructure/instructure-ui/compare/v10.16.0...v10.16.1-snapshot-1) (2025-04-22)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-view
|
|
9
9
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var _span;
|
|
2
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
3
|
/*
|
|
3
4
|
* The MIT License (MIT)
|
|
4
5
|
*
|
|
@@ -23,7 +24,6 @@ var _span;
|
|
|
23
24
|
* SOFTWARE.
|
|
24
25
|
*/
|
|
25
26
|
|
|
26
|
-
import React from 'react';
|
|
27
27
|
export default {
|
|
28
28
|
sectionProp: 'background',
|
|
29
29
|
propValues: {
|
|
@@ -31,9 +31,9 @@ export default {
|
|
|
31
31
|
},
|
|
32
32
|
getComponentProps: () => {
|
|
33
33
|
return {
|
|
34
|
-
children: _span || (_span =
|
|
35
|
-
|
|
36
|
-
}, "
|
|
34
|
+
children: _span || (_span = _jsx("span", {
|
|
35
|
+
children: "Hello World"
|
|
36
|
+
}, "0")),
|
|
37
37
|
padding: 'small',
|
|
38
38
|
debug: false
|
|
39
39
|
};
|
|
@@ -23,20 +23,20 @@ var _ContextView, _ContextView2;
|
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import React from 'react';
|
|
27
26
|
import { render } from '@testing-library/react';
|
|
28
27
|
import '@testing-library/jest-dom';
|
|
29
28
|
import { ContextView } from '../index';
|
|
30
29
|
import { runAxeCheck } from '@instructure/ui-axe-check';
|
|
30
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
31
31
|
describe('<ContextView />', () => {
|
|
32
32
|
it('should render', () => {
|
|
33
|
-
const _render = render(_ContextView || (_ContextView =
|
|
33
|
+
const _render = render(_ContextView || (_ContextView = _jsx(ContextView, {}))),
|
|
34
34
|
container = _render.container;
|
|
35
35
|
const contextView = container.querySelector("span[class$='-contextView']");
|
|
36
36
|
expect(contextView).toBeInTheDocument();
|
|
37
37
|
});
|
|
38
38
|
it('should meet a11y standards', async () => {
|
|
39
|
-
const _render2 = render(_ContextView2 || (_ContextView2 =
|
|
39
|
+
const _render2 = render(_ContextView2 || (_ContextView2 = _jsx(ContextView, {}))),
|
|
40
40
|
container = _render2.container;
|
|
41
41
|
const axeCheck = await runAxeCheck(container);
|
|
42
42
|
expect(axeCheck).toBe(true);
|
package/es/ContextView/index.js
CHANGED
|
@@ -22,15 +22,15 @@ var _dec, _class, _ContextView;
|
|
|
22
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*/
|
|
25
|
-
/** @jsx jsx */
|
|
26
25
|
|
|
27
26
|
import { Component } from 'react';
|
|
28
|
-
import {
|
|
27
|
+
import { withStyle } from '@instructure/emotion';
|
|
29
28
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
30
29
|
import { View } from '../View';
|
|
31
30
|
import generateStyle from './styles';
|
|
32
31
|
import generateComponentTheme from './theme';
|
|
33
32
|
import { propTypes, allowedProps } from './props';
|
|
33
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
34
34
|
/**
|
|
35
35
|
---
|
|
36
36
|
category: components
|
|
@@ -76,7 +76,8 @@ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
76
76
|
textAlign = _this$props3.textAlign,
|
|
77
77
|
styles = _this$props3.styles,
|
|
78
78
|
borderColor = _this$props3.borderColor;
|
|
79
|
-
return
|
|
79
|
+
return _jsx(View, {
|
|
80
|
+
...omitProps(this.props, ContextView.allowedProps),
|
|
80
81
|
css: styles === null || styles === void 0 ? void 0 : styles.contextView,
|
|
81
82
|
style: style,
|
|
82
83
|
borderWidth: "none",
|
|
@@ -85,27 +86,29 @@ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
85
86
|
withVisualDebug: debug,
|
|
86
87
|
elementRef: this.handleRef,
|
|
87
88
|
margin: margin,
|
|
88
|
-
stacking: stacking
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
89
|
+
stacking: stacking,
|
|
90
|
+
children: _jsxs(View, {
|
|
91
|
+
css: styles === null || styles === void 0 ? void 0 : styles.contextView__content,
|
|
92
|
+
display: "block",
|
|
93
|
+
borderRadius: "medium",
|
|
94
|
+
borderWidth: "small",
|
|
95
|
+
borderColor: borderColor || (background === 'default' ? 'primary' : 'transparent'),
|
|
96
|
+
background: background === 'default' ? 'primary' : 'primary-inverse',
|
|
97
|
+
withVisualDebug: debug,
|
|
98
|
+
height: height,
|
|
99
|
+
width: width,
|
|
100
|
+
maxHeight: maxHeight,
|
|
101
|
+
maxWidth: maxWidth,
|
|
102
|
+
minHeight: minHeight,
|
|
103
|
+
minWidth: minWidth,
|
|
104
|
+
padding: padding,
|
|
105
|
+
shadow: shadow,
|
|
106
|
+
textAlign: textAlign,
|
|
107
|
+
children: [_jsx("span", {
|
|
108
|
+
css: styles === null || styles === void 0 ? void 0 : styles.contextView__arrow
|
|
109
|
+
}), children]
|
|
110
|
+
})
|
|
111
|
+
});
|
|
109
112
|
}
|
|
110
113
|
}, _ContextView.displayName = "ContextView", _ContextView.componentId = 'ContextView', _ContextView.allowedProps = allowedProps, _ContextView.propTypes = propTypes, _ContextView.defaultProps = {
|
|
111
114
|
as: 'span',
|
|
@@ -23,12 +23,12 @@ var _View, _View2, _h, _h2, _h3, _h4, _h5, _View3, _View4, _View5, _View6, _View
|
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import React from 'react';
|
|
27
26
|
import { render, screen } from '@testing-library/react';
|
|
28
27
|
import { vi } from 'vitest';
|
|
29
28
|
import '@testing-library/jest-dom';
|
|
30
29
|
import { View } from '../../index';
|
|
31
30
|
import { runAxeCheck } from '@instructure/ui-axe-check';
|
|
31
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
32
32
|
describe('<View />', () => {
|
|
33
33
|
let consoleWarningMock;
|
|
34
34
|
let consoleErrorMock;
|
|
@@ -42,14 +42,22 @@ describe('<View />', () => {
|
|
|
42
42
|
consoleErrorMock.mockRestore();
|
|
43
43
|
});
|
|
44
44
|
it('should render', () => {
|
|
45
|
-
const _render = render(_View || (_View =
|
|
45
|
+
const _render = render(_View || (_View = _jsx(View, {
|
|
46
|
+
children: _jsx("h1", {
|
|
47
|
+
children: "View Content"
|
|
48
|
+
})
|
|
49
|
+
}))),
|
|
46
50
|
container = _render.container;
|
|
47
51
|
const view = container.querySelector("span[class$='-view']");
|
|
48
52
|
expect(view).toBeInTheDocument();
|
|
49
53
|
expect(view).toHaveTextContent('View Content');
|
|
50
54
|
});
|
|
51
55
|
it('should render children', () => {
|
|
52
|
-
render(_View2 || (_View2 =
|
|
56
|
+
render(_View2 || (_View2 = _jsx(View, {
|
|
57
|
+
children: _jsx("h1", {
|
|
58
|
+
children: "View Content"
|
|
59
|
+
})
|
|
60
|
+
})));
|
|
53
61
|
const viewContent = screen.getByText('View Content');
|
|
54
62
|
expect(viewContent).toBeInTheDocument();
|
|
55
63
|
expect(viewContent.tagName).toBe('H1');
|
|
@@ -66,11 +74,14 @@ describe('<View />', () => {
|
|
|
66
74
|
display: 'block',
|
|
67
75
|
pointerEvents: 'none'
|
|
68
76
|
};
|
|
69
|
-
const _render2 = render(
|
|
77
|
+
const _render2 = render(_jsx(View, {
|
|
70
78
|
style: {
|
|
71
79
|
...styleProps
|
|
72
|
-
}
|
|
73
|
-
|
|
80
|
+
},
|
|
81
|
+
children: _h || (_h = _jsx("h1", {
|
|
82
|
+
children: "View Content"
|
|
83
|
+
}))
|
|
84
|
+
})),
|
|
74
85
|
container = _render2.container;
|
|
75
86
|
const view = container.querySelector("span[class$='-view']");
|
|
76
87
|
const styles = getComputedStyle(view);
|
|
@@ -85,11 +96,14 @@ describe('<View />', () => {
|
|
|
85
96
|
expect(styles['pointerEvents']).toEqual('none');
|
|
86
97
|
});
|
|
87
98
|
it('should pass flex style', () => {
|
|
88
|
-
const _render3 = render(
|
|
99
|
+
const _render3 = render(_jsx(View, {
|
|
89
100
|
style: {
|
|
90
101
|
flexBasis: '200px'
|
|
91
|
-
}
|
|
92
|
-
|
|
102
|
+
},
|
|
103
|
+
children: _h2 || (_h2 = _jsx("h1", {
|
|
104
|
+
children: "View Content"
|
|
105
|
+
}))
|
|
106
|
+
})),
|
|
93
107
|
container = _render3.container;
|
|
94
108
|
const view = container.querySelector("span[class$='-view']");
|
|
95
109
|
const styles = getComputedStyle(view);
|
|
@@ -97,37 +111,49 @@ describe('<View />', () => {
|
|
|
97
111
|
});
|
|
98
112
|
it('should pass className', () => {
|
|
99
113
|
const className = 'fooBarBaz';
|
|
100
|
-
const _render4 = render(
|
|
101
|
-
className: className
|
|
102
|
-
|
|
114
|
+
const _render4 = render(_jsx(View, {
|
|
115
|
+
className: className,
|
|
116
|
+
children: _h3 || (_h3 = _jsx("h1", {
|
|
117
|
+
children: "View Content"
|
|
118
|
+
}))
|
|
119
|
+
})),
|
|
103
120
|
container = _render4.container;
|
|
104
121
|
const view = container.querySelector("span[class$='-view']");
|
|
105
122
|
expect(view.classList.contains(className)).toEqual(true);
|
|
106
123
|
});
|
|
107
124
|
it('should provide an elementRef', () => {
|
|
108
125
|
const elementRef = vi.fn();
|
|
109
|
-
const _render5 = render(
|
|
110
|
-
elementRef: elementRef
|
|
111
|
-
|
|
126
|
+
const _render5 = render(_jsx(View, {
|
|
127
|
+
elementRef: elementRef,
|
|
128
|
+
children: _h4 || (_h4 = _jsx("h1", {
|
|
129
|
+
children: "View Content"
|
|
130
|
+
}))
|
|
131
|
+
})),
|
|
112
132
|
container = _render5.container;
|
|
113
133
|
const view = container.querySelector("span[class$='-view']");
|
|
114
134
|
expect(elementRef).toHaveBeenCalledWith(view);
|
|
115
135
|
});
|
|
116
136
|
it('should pass cursor', () => {
|
|
117
137
|
const cursor = 'cell';
|
|
118
|
-
const _render6 = render(
|
|
119
|
-
cursor: cursor
|
|
120
|
-
|
|
138
|
+
const _render6 = render(_jsx(View, {
|
|
139
|
+
cursor: cursor,
|
|
140
|
+
children: _h5 || (_h5 = _jsx("h1", {
|
|
141
|
+
children: "View Content"
|
|
142
|
+
}))
|
|
143
|
+
})),
|
|
121
144
|
container = _render6.container;
|
|
122
145
|
const view = container.querySelector("span[class$='-view']");
|
|
123
146
|
const styles = getComputedStyle(view);
|
|
124
147
|
expect(styles['cursor']).toEqual(cursor);
|
|
125
148
|
});
|
|
126
149
|
it('should set overflow', () => {
|
|
127
|
-
const _render7 = render(_View3 || (_View3 =
|
|
150
|
+
const _render7 = render(_View3 || (_View3 = _jsx(View, {
|
|
128
151
|
overflowX: "hidden",
|
|
129
|
-
overflowY: "auto"
|
|
130
|
-
|
|
152
|
+
overflowY: "auto",
|
|
153
|
+
children: _jsx("h1", {
|
|
154
|
+
children: "View Content"
|
|
155
|
+
})
|
|
156
|
+
}))),
|
|
131
157
|
container = _render7.container;
|
|
132
158
|
const view = container.querySelector("span[class$='-view']");
|
|
133
159
|
const styles = getComputedStyle(view);
|
|
@@ -135,21 +161,27 @@ describe('<View />', () => {
|
|
|
135
161
|
expect(styles.overflowY).toEqual('auto');
|
|
136
162
|
});
|
|
137
163
|
it('should set CSS position', () => {
|
|
138
|
-
const _render8 = render(_View4 || (_View4 =
|
|
139
|
-
position: "fixed"
|
|
140
|
-
|
|
164
|
+
const _render8 = render(_View4 || (_View4 = _jsx(View, {
|
|
165
|
+
position: "fixed",
|
|
166
|
+
children: _jsx("h1", {
|
|
167
|
+
children: "View Content"
|
|
168
|
+
})
|
|
169
|
+
}))),
|
|
141
170
|
container = _render8.container;
|
|
142
171
|
const view = container.querySelector("span[class$='-view']");
|
|
143
172
|
const styles = getComputedStyle(view);
|
|
144
173
|
expect(styles.position).toEqual('fixed');
|
|
145
174
|
});
|
|
146
175
|
it('should set inline offset (top, bottom, left, right)', () => {
|
|
147
|
-
const _render9 = render(_View5 || (_View5 =
|
|
176
|
+
const _render9 = render(_View5 || (_View5 = _jsx(View, {
|
|
148
177
|
insetBlockStart: "0",
|
|
149
178
|
insetBlockEnd: "20px",
|
|
150
179
|
insetInlineStart: "2px",
|
|
151
|
-
insetInlineEnd: "3px"
|
|
152
|
-
|
|
180
|
+
insetInlineEnd: "3px",
|
|
181
|
+
children: _jsx("h1", {
|
|
182
|
+
children: "View Content"
|
|
183
|
+
})
|
|
184
|
+
}))),
|
|
153
185
|
container = _render9.container;
|
|
154
186
|
const view = container.querySelector("span[class$='-view']");
|
|
155
187
|
const styles = getComputedStyle(view);
|
|
@@ -159,38 +191,53 @@ describe('<View />', () => {
|
|
|
159
191
|
expect(styles['right']).toEqual('3px');
|
|
160
192
|
});
|
|
161
193
|
it('should override default max-width', () => {
|
|
162
|
-
const _render10 = render(_View6 || (_View6 =
|
|
194
|
+
const _render10 = render(_View6 || (_View6 = _jsx(View, {
|
|
195
|
+
children: _jsx("h1", {
|
|
196
|
+
children: "View Content"
|
|
197
|
+
})
|
|
198
|
+
}))),
|
|
163
199
|
container = _render10.container,
|
|
164
200
|
rerender = _render10.rerender;
|
|
165
201
|
const view = container.querySelector("span[class$='-view']");
|
|
166
202
|
const styles = getComputedStyle(view);
|
|
167
203
|
expect(styles.maxWidth).toEqual('100%');
|
|
168
|
-
rerender(_View7 || (_View7 =
|
|
169
|
-
maxWidth: "200px"
|
|
170
|
-
|
|
204
|
+
rerender(_View7 || (_View7 = _jsx(View, {
|
|
205
|
+
maxWidth: "200px",
|
|
206
|
+
children: _jsx("h1", {
|
|
207
|
+
children: "View Content"
|
|
208
|
+
})
|
|
209
|
+
})));
|
|
171
210
|
const newStyles = getComputedStyle(view);
|
|
172
211
|
expect(newStyles.maxWidth).toEqual('200px');
|
|
173
212
|
});
|
|
174
213
|
describe('withFocusOutline', () => {
|
|
175
214
|
it('should warn when withFocusOutline is true without position=relative', () => {
|
|
176
|
-
render(_View8 || (_View8 =
|
|
177
|
-
withFocusOutline: true
|
|
178
|
-
|
|
215
|
+
render(_View8 || (_View8 = _jsx(View, {
|
|
216
|
+
withFocusOutline: true,
|
|
217
|
+
children: _jsx("h1", {
|
|
218
|
+
children: "View Content"
|
|
219
|
+
})
|
|
220
|
+
})));
|
|
179
221
|
const expectedErrorMessage = 'Warning: [View] the focus outline will only show if the `position` prop is `relative`.';
|
|
180
222
|
expect(consoleErrorMock).toHaveBeenCalledWith(expect.stringContaining(expectedErrorMessage), expect.any(String));
|
|
181
223
|
});
|
|
182
224
|
it('should warn when withFocusOutline is `true`, display is set to `inline`, and focusPosition is set to `offset`', () => {
|
|
183
|
-
render(_View9 || (_View9 =
|
|
225
|
+
render(_View9 || (_View9 = _jsx(View, {
|
|
184
226
|
withFocusOutline: true,
|
|
185
227
|
display: "inline",
|
|
186
|
-
focusPosition: "offset"
|
|
187
|
-
|
|
228
|
+
focusPosition: "offset",
|
|
229
|
+
children: _jsx("h1", {
|
|
230
|
+
children: "View Content"
|
|
231
|
+
})
|
|
232
|
+
})));
|
|
188
233
|
const expectedErrorMessage = 'Warning: [View] when display is set to `inline` the focus outline will only show if `focusPosition` is set to `inset`.';
|
|
189
234
|
expect(consoleErrorMock).toHaveBeenCalledWith(expect.stringContaining(expectedErrorMessage), expect.any(String));
|
|
190
235
|
});
|
|
191
236
|
});
|
|
192
237
|
it('should meet a11y standards', async () => {
|
|
193
|
-
const _render11 = render(_View10 || (_View10 =
|
|
238
|
+
const _render11 = render(_View10 || (_View10 = _jsx(View, {
|
|
239
|
+
children: "View Content"
|
|
240
|
+
}))),
|
|
194
241
|
container = _render11.container;
|
|
195
242
|
const axeCheck = await runAxeCheck(container);
|
|
196
243
|
expect(axeCheck).toBe(true);
|
package/es/View/index.js
CHANGED
|
@@ -25,16 +25,16 @@ var _dec, _dec2, _class, _View;
|
|
|
25
25
|
* SOFTWARE.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
/** @jsx jsx */
|
|
29
28
|
import { Component } from 'react';
|
|
30
29
|
import { getComputedStyle } from '@instructure/ui-dom-utils';
|
|
31
30
|
import { textDirectionContextConsumer } from '@instructure/ui-i18n';
|
|
32
31
|
import { logError as error } from '@instructure/console';
|
|
33
32
|
import { getElementType, omitProps, pickProps, passthroughProps } from '@instructure/ui-react-utils';
|
|
34
|
-
import {
|
|
33
|
+
import { withStyle } from '@instructure/emotion';
|
|
35
34
|
import generateStyle from './styles';
|
|
36
35
|
import generateComponentTheme from './theme';
|
|
37
36
|
import { propTypes, allowedProps } from './props';
|
|
37
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
38
38
|
/**
|
|
39
39
|
---
|
|
40
40
|
category: components
|
|
@@ -123,11 +123,13 @@ let View = (_dec = textDirectionContextConsumer(), _dec2 = withStyle(generateSty
|
|
|
123
123
|
makeStyles = _this$props3.makeStyles,
|
|
124
124
|
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
125
125
|
const ElementType = getElementType(View, this.props);
|
|
126
|
-
return
|
|
126
|
+
return _jsx(ElementType, {
|
|
127
|
+
...passthroughProps(props),
|
|
127
128
|
className: className,
|
|
128
129
|
css: [styles === null || styles === void 0 ? void 0 : styles.view, styles === null || styles === void 0 ? void 0 : styles.inlineStyles],
|
|
129
|
-
ref: this.handleElementRef
|
|
130
|
-
|
|
130
|
+
ref: this.handleElementRef,
|
|
131
|
+
children: children
|
|
132
|
+
});
|
|
131
133
|
}
|
|
132
134
|
}, _View.displayName = "View", _View.componentId = 'View', _View.allowedProps = allowedProps, _View.propTypes = propTypes, _View.defaultProps = {
|
|
133
135
|
display: 'auto',
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var
|
|
7
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
8
|
var _span;
|
|
10
9
|
/*
|
|
11
10
|
* The MIT License (MIT)
|
|
@@ -37,9 +36,9 @@ var _default = exports.default = {
|
|
|
37
36
|
},
|
|
38
37
|
getComponentProps: () => {
|
|
39
38
|
return {
|
|
40
|
-
children: _span || (_span =
|
|
41
|
-
|
|
42
|
-
}, "
|
|
39
|
+
children: _span || (_span = (0, _jsxRuntime.jsx)("span", {
|
|
40
|
+
children: "Hello World"
|
|
41
|
+
}, "0")),
|
|
43
42
|
padding: 'small',
|
|
44
43
|
debug: false
|
|
45
44
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
3
|
+
var _react = require("@testing-library/react");
|
|
6
4
|
require("@testing-library/jest-dom");
|
|
7
5
|
var _index = require("../index");
|
|
8
6
|
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
7
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
8
|
var _ContextView, _ContextView2;
|
|
10
9
|
/*
|
|
11
10
|
* The MIT License (MIT)
|
|
@@ -32,13 +31,13 @@ var _ContextView, _ContextView2;
|
|
|
32
31
|
*/
|
|
33
32
|
describe('<ContextView />', () => {
|
|
34
33
|
it('should render', () => {
|
|
35
|
-
const _render = (0,
|
|
34
|
+
const _render = (0, _react.render)(_ContextView || (_ContextView = (0, _jsxRuntime.jsx)(_index.ContextView, {}))),
|
|
36
35
|
container = _render.container;
|
|
37
36
|
const contextView = container.querySelector("span[class$='-contextView']");
|
|
38
37
|
expect(contextView).toBeInTheDocument();
|
|
39
38
|
});
|
|
40
39
|
it('should meet a11y standards', async () => {
|
|
41
|
-
const _render2 = (0,
|
|
40
|
+
const _render2 = (0, _react.render)(_ContextView2 || (_ContextView2 = (0, _jsxRuntime.jsx)(_index.ContextView, {}))),
|
|
42
41
|
container = _render2.container;
|
|
43
42
|
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
|
|
44
43
|
expect(axeCheck).toBe(true);
|
package/lib/ContextView/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var _View = require("../View");
|
|
|
12
12
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
13
13
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
14
14
|
var _props = require("./props");
|
|
15
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
15
16
|
var _dec, _class, _ContextView;
|
|
16
17
|
/*
|
|
17
18
|
* The MIT License (MIT)
|
|
@@ -36,7 +37,6 @@ var _dec, _class, _ContextView;
|
|
|
36
37
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37
38
|
* SOFTWARE.
|
|
38
39
|
*/
|
|
39
|
-
/** @jsx jsx */
|
|
40
40
|
/**
|
|
41
41
|
---
|
|
42
42
|
category: components
|
|
@@ -82,7 +82,8 @@ let ContextView = exports.ContextView = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
82
82
|
textAlign = _this$props3.textAlign,
|
|
83
83
|
styles = _this$props3.styles,
|
|
84
84
|
borderColor = _this$props3.borderColor;
|
|
85
|
-
return (0,
|
|
85
|
+
return (0, _jsxRuntime.jsx)(_View.View, {
|
|
86
|
+
...(0, _omitProps.omitProps)(this.props, ContextView.allowedProps),
|
|
86
87
|
css: styles === null || styles === void 0 ? void 0 : styles.contextView,
|
|
87
88
|
style: style,
|
|
88
89
|
borderWidth: "none",
|
|
@@ -91,27 +92,29 @@ let ContextView = exports.ContextView = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
91
92
|
withVisualDebug: debug,
|
|
92
93
|
elementRef: this.handleRef,
|
|
93
94
|
margin: margin,
|
|
94
|
-
stacking: stacking
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
95
|
+
stacking: stacking,
|
|
96
|
+
children: (0, _jsxRuntime.jsxs)(_View.View, {
|
|
97
|
+
css: styles === null || styles === void 0 ? void 0 : styles.contextView__content,
|
|
98
|
+
display: "block",
|
|
99
|
+
borderRadius: "medium",
|
|
100
|
+
borderWidth: "small",
|
|
101
|
+
borderColor: borderColor || (background === 'default' ? 'primary' : 'transparent'),
|
|
102
|
+
background: background === 'default' ? 'primary' : 'primary-inverse',
|
|
103
|
+
withVisualDebug: debug,
|
|
104
|
+
height: height,
|
|
105
|
+
width: width,
|
|
106
|
+
maxHeight: maxHeight,
|
|
107
|
+
maxWidth: maxWidth,
|
|
108
|
+
minHeight: minHeight,
|
|
109
|
+
minWidth: minWidth,
|
|
110
|
+
padding: padding,
|
|
111
|
+
shadow: shadow,
|
|
112
|
+
textAlign: textAlign,
|
|
113
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
|
114
|
+
css: styles === null || styles === void 0 ? void 0 : styles.contextView__arrow
|
|
115
|
+
}), children]
|
|
116
|
+
})
|
|
117
|
+
});
|
|
115
118
|
}
|
|
116
119
|
}, _ContextView.displayName = "ContextView", _ContextView.componentId = 'ContextView', _ContextView.allowedProps = _props.allowedProps, _ContextView.propTypes = _props.propTypes, _ContextView.defaultProps = {
|
|
117
120
|
as: 'span',
|