@instructure/ui-view 8.56.0 → 8.56.2-pr-snapshot-1721749364069
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 +16 -0
- package/lib/ContextView/__new-tests__/ContextView.test.js +2 -2
- package/lib/ContextView/index.js +2 -2
- package/lib/ContextView/props.js +2 -2
- package/lib/ContextView/styles.js +2 -2
- package/lib/View/__new-tests__/View.test.js +2 -2
- package/lib/View/index.js +9 -12
- package/lib/View/props.js +4 -4
- package/lib/View/styles.js +2 -2
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## [8.56.2-pr-snapshot-1721749364069](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2-pr-snapshot-1721749364069) (2024-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-view
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.56.1](https://github.com/instructure/instructure-ui/compare/v8.56.0...v8.56.1) (2024-06-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-view
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @instructure/ui-view
|
|
@@ -5,7 +5,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
6
|
require("@testing-library/jest-dom");
|
|
7
7
|
var _index = require("../index");
|
|
8
|
-
var
|
|
8
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
9
9
|
var _ContextView, _ContextView2;
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
@@ -40,7 +40,7 @@ describe('<ContextView />', () => {
|
|
|
40
40
|
it('should meet a11y standards', async () => {
|
|
41
41
|
const _render2 = (0, _react2.render)(_ContextView2 || (_ContextView2 = /*#__PURE__*/_react.default.createElement(_index.ContextView, null))),
|
|
42
42
|
container = _render2.container;
|
|
43
|
-
const axeCheck = await (0,
|
|
43
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
44
44
|
expect(axeCheck).toBe(true);
|
|
45
45
|
});
|
|
46
46
|
});
|
package/lib/ContextView/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.ContextView = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _emotion = require("@instructure/emotion");
|
|
10
|
-
var
|
|
10
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
11
11
|
var _View = require("../View");
|
|
12
12
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
13
13
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -81,7 +81,7 @@ let ContextView = exports.ContextView = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
81
81
|
style = _this$props3.style,
|
|
82
82
|
textAlign = _this$props3.textAlign,
|
|
83
83
|
styles = _this$props3.styles;
|
|
84
|
-
return (0, _emotion.jsx)(_View.View, Object.assign({}, (0,
|
|
84
|
+
return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _uiReactUtils.omitProps)(this.props, ContextView.allowedProps), {
|
|
85
85
|
css: styles === null || styles === void 0 ? void 0 : styles.contextView,
|
|
86
86
|
style: style,
|
|
87
87
|
borderWidth: "none",
|
package/lib/ContextView/props.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _emotion = require("@instructure/emotion");
|
|
10
|
-
var
|
|
10
|
+
var _uiPosition = require("@instructure/ui-position");
|
|
11
11
|
/*
|
|
12
12
|
* The MIT License (MIT)
|
|
13
13
|
*
|
|
@@ -83,7 +83,7 @@ const propTypes = exports.propTypes = {
|
|
|
83
83
|
* Specifies how the arrow for `<ContextView />` will be rendered.
|
|
84
84
|
* Ex. `placement="top"` will render with an arrow pointing down.
|
|
85
85
|
*/
|
|
86
|
-
placement:
|
|
86
|
+
placement: _uiPosition.PositionPropTypes.placement,
|
|
87
87
|
/**
|
|
88
88
|
* Activate an outline around the component to make building your
|
|
89
89
|
* layout easier
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiPosition = require("@instructure/ui-position");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -97,7 +97,7 @@ const getArrowCorrections = (placement, theme) => {
|
|
|
97
97
|
return {};
|
|
98
98
|
};
|
|
99
99
|
const getArrowPlacementVariant = (placement, background, theme) => {
|
|
100
|
-
const transformedPlacement = (0,
|
|
100
|
+
const transformedPlacement = (0, _uiPosition.mirrorPlacement)(placement, ' ');
|
|
101
101
|
const isInversed = background === 'inverse';
|
|
102
102
|
if (endPlacements.includes(transformedPlacement)) {
|
|
103
103
|
return {
|
|
@@ -5,7 +5,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
6
|
require("@testing-library/jest-dom");
|
|
7
7
|
var _index = require("../../index");
|
|
8
|
-
var
|
|
8
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
9
9
|
var _View, _View2, _h, _h2, _h3, _h4, _h5, _View3, _View4, _View5, _View6, _View7, _View8, _View9, _View10;
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
@@ -186,7 +186,7 @@ describe('<View />', () => {
|
|
|
186
186
|
it('should meet a11y standards', async () => {
|
|
187
187
|
const _render11 = (0, _react2.render)(_View10 || (_View10 = /*#__PURE__*/_react.default.createElement(_index.View, null, "View Content"))),
|
|
188
188
|
container = _render11.container;
|
|
189
|
-
const axeCheck = await (0,
|
|
189
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
190
190
|
expect(axeCheck).toBe(true);
|
|
191
191
|
});
|
|
192
192
|
});
|
package/lib/View/index.js
CHANGED
|
@@ -7,13 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.View = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
|
+
var _uiI18n = require("@instructure/ui-i18n");
|
|
12
12
|
var _console = require("@instructure/console");
|
|
13
|
-
var
|
|
14
|
-
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
15
|
-
var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
|
|
16
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
13
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
17
14
|
var _emotion = require("@instructure/emotion");
|
|
18
15
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
19
16
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -50,7 +47,7 @@ category: components
|
|
|
50
47
|
---
|
|
51
48
|
@module View
|
|
52
49
|
**/
|
|
53
|
-
let View = exports.View = (_dec = (0,
|
|
50
|
+
let View = exports.View = (_dec = (0, _uiI18n.textDirectionContextConsumer)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_class2 = class View extends _react.Component {
|
|
54
51
|
get _element() {
|
|
55
52
|
return this.ref;
|
|
56
53
|
}
|
|
@@ -84,7 +81,7 @@ let View = exports.View = (_dec = (0, _textDirectionContextConsumer.textDirectio
|
|
|
84
81
|
if (!element) {
|
|
85
82
|
return;
|
|
86
83
|
}
|
|
87
|
-
const display = (0,
|
|
84
|
+
const display = (0, _uiDomUtils.getComputedStyle)(element).display;
|
|
88
85
|
if (display !== 'inline') {
|
|
89
86
|
return;
|
|
90
87
|
}
|
|
@@ -131,8 +128,8 @@ let View = exports.View = (_dec = (0, _textDirectionContextConsumer.textDirectio
|
|
|
131
128
|
styles = _this$props3.styles,
|
|
132
129
|
makeStyles = _this$props3.makeStyles,
|
|
133
130
|
props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
134
|
-
const ElementType = (0,
|
|
135
|
-
return (0, _emotion.jsx)(ElementType, Object.assign({}, (0,
|
|
131
|
+
const ElementType = (0, _uiReactUtils.getElementType)(View, this.props);
|
|
132
|
+
return (0, _emotion.jsx)(ElementType, Object.assign({}, (0, _uiReactUtils.passthroughProps)(props), {
|
|
136
133
|
className: className,
|
|
137
134
|
css: [styles === null || styles === void 0 ? void 0 : styles.view, styles === null || styles === void 0 ? void 0 : styles.inlineStyles],
|
|
138
135
|
ref: this.handleElementRef
|
|
@@ -165,10 +162,10 @@ let View = exports.View = (_dec = (0, _textDirectionContextConsumer.textDirectio
|
|
|
165
162
|
}
|
|
166
163
|
}
|
|
167
164
|
if (shouldLogError) {
|
|
168
|
-
Object.keys((0,
|
|
165
|
+
Object.keys((0, _uiReactUtils.pickProps)(props, propsToOmit)).forEach(prop => {
|
|
169
166
|
(0, _console.logError)(false, `[${Component.name}] prop '${prop}' is not allowed.`);
|
|
170
167
|
});
|
|
171
168
|
}
|
|
172
|
-
return (0,
|
|
169
|
+
return (0, _uiReactUtils.omitProps)(props, propsToOmit);
|
|
173
170
|
}, _class2)) || _class) || _class);
|
|
174
171
|
var _default = exports.default = View;
|
package/lib/View/props.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _uiPropTypes = require("@instructure/ui-prop-types");
|
|
10
|
+
var _uiI18n = require("@instructure/ui-i18n");
|
|
11
11
|
var _emotion = require("@instructure/emotion");
|
|
12
12
|
/*
|
|
13
13
|
* The MIT License (MIT)
|
|
@@ -55,7 +55,7 @@ const propTypes = exports.propTypes = {
|
|
|
55
55
|
background: _propTypes.default.oneOf(['transparent', 'primary', 'secondary', 'primary-inverse', 'brand', 'info', 'alert', 'success', 'danger', 'warning']),
|
|
56
56
|
shadow: _emotion.ThemeablePropTypes.shadow,
|
|
57
57
|
stacking: _emotion.ThemeablePropTypes.stacking,
|
|
58
|
-
cursor:
|
|
58
|
+
cursor: _uiPropTypes.cursor,
|
|
59
59
|
position: _propTypes.default.oneOf(['static', 'absolute', 'relative', 'sticky', 'fixed']),
|
|
60
60
|
insetInlineStart: _propTypes.default.string,
|
|
61
61
|
insetInlineEnd: _propTypes.default.string,
|
|
@@ -66,7 +66,7 @@ const propTypes = exports.propTypes = {
|
|
|
66
66
|
focusColor: _propTypes.default.oneOf(['info', 'inverse', 'success', 'danger']),
|
|
67
67
|
shouldAnimateFocus: _propTypes.default.bool,
|
|
68
68
|
withVisualDebug: _propTypes.default.bool,
|
|
69
|
-
dir: _propTypes.default.oneOf(Object.values(
|
|
69
|
+
dir: _propTypes.default.oneOf(Object.values(_uiI18n.textDirectionContextConsumer.DIRECTION)),
|
|
70
70
|
overscrollBehavior: _propTypes.default.oneOf(['auto', 'contain', 'none'])
|
|
71
71
|
};
|
|
72
72
|
|
package/lib/View/styles.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _uiI18n = require("@instructure/ui-i18n");
|
|
8
8
|
var _emotion = require("@instructure/emotion");
|
|
9
|
-
var
|
|
9
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
10
10
|
var _console = require("@instructure/console");
|
|
11
11
|
/*
|
|
12
12
|
* The MIT License (MIT)
|
|
@@ -86,7 +86,7 @@ const getStyleProps = ({
|
|
|
86
86
|
cursor,
|
|
87
87
|
style
|
|
88
88
|
}) => {
|
|
89
|
-
const whitelisted = (0,
|
|
89
|
+
const whitelisted = (0, _uiReactUtils.pickProps)(style || {}, {}, [
|
|
90
90
|
// Position/calculateElementPosition:
|
|
91
91
|
'top', 'left', 'position', 'display', 'transform', 'overflow', 'minWidth', 'minHeight',
|
|
92
92
|
// Img:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-view",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.2-pr-snapshot-1721749364069",
|
|
4
4
|
"description": "A component for basic styles including spacing, sizing, borders, display, positioning, and focus states.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.23.2",
|
|
27
|
-
"@instructure/console": "8.56.
|
|
28
|
-
"@instructure/emotion": "8.56.
|
|
29
|
-
"@instructure/shared-types": "8.56.
|
|
30
|
-
"@instructure/ui-color-utils": "8.56.
|
|
31
|
-
"@instructure/ui-dom-utils": "8.56.
|
|
32
|
-
"@instructure/ui-i18n": "8.56.
|
|
33
|
-
"@instructure/ui-position": "8.56.
|
|
34
|
-
"@instructure/ui-prop-types": "8.56.
|
|
35
|
-
"@instructure/ui-react-utils": "8.56.
|
|
27
|
+
"@instructure/console": "8.56.2-pr-snapshot-1721749364069",
|
|
28
|
+
"@instructure/emotion": "8.56.2-pr-snapshot-1721749364069",
|
|
29
|
+
"@instructure/shared-types": "8.56.2-pr-snapshot-1721749364069",
|
|
30
|
+
"@instructure/ui-color-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
31
|
+
"@instructure/ui-dom-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
32
|
+
"@instructure/ui-i18n": "8.56.2-pr-snapshot-1721749364069",
|
|
33
|
+
"@instructure/ui-position": "8.56.2-pr-snapshot-1721749364069",
|
|
34
|
+
"@instructure/ui-prop-types": "8.56.2-pr-snapshot-1721749364069",
|
|
35
|
+
"@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
36
36
|
"prop-types": "^15.8.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@instructure/ui-axe-check": "8.56.
|
|
40
|
-
"@instructure/ui-babel-preset": "8.56.
|
|
41
|
-
"@instructure/ui-test-utils": "8.56.
|
|
42
|
-
"@instructure/ui-themes": "8.56.
|
|
39
|
+
"@instructure/ui-axe-check": "8.56.2-pr-snapshot-1721749364069",
|
|
40
|
+
"@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
|
|
41
|
+
"@instructure/ui-test-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
42
|
+
"@instructure/ui-themes": "8.56.2-pr-snapshot-1721749364069",
|
|
43
43
|
"@testing-library/jest-dom": "^6.1.4",
|
|
44
44
|
"@testing-library/react": "^14.0.0"
|
|
45
45
|
},
|