@instructure/ui-tag 10.13.0 → 10.13.1-pr-snapshot-1741357986437
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 +8 -0
- package/lib/Tag/__new-tests__/Tag.test.js +7 -7
- package/lib/Tag/index.js +10 -10
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.13.1-pr-snapshot-1741357986437](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-pr-snapshot-1741357986437) (2025-03-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tag
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [10.13.0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.13.0) (2025-03-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-tag
|
|
@@ -7,8 +7,8 @@ var _userEvent = require("@testing-library/user-event");
|
|
|
7
7
|
require("@testing-library/jest-dom");
|
|
8
8
|
var _vitest = require("vitest");
|
|
9
9
|
var _index = require("../index");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
11
|
+
var _uiView = require("@instructure/ui-view");
|
|
12
12
|
var _Tag, _Tag2;
|
|
13
13
|
/*
|
|
14
14
|
* The MIT License (MIT)
|
|
@@ -33,13 +33,13 @@ var _Tag, _Tag2;
|
|
|
33
33
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
34
|
* SOFTWARE.
|
|
35
35
|
*/
|
|
36
|
-
const originalOmitViewProps =
|
|
36
|
+
const originalOmitViewProps = _uiView.View.omitViewProps;
|
|
37
37
|
describe('<Tag />', async () => {
|
|
38
38
|
beforeAll(() => {
|
|
39
39
|
// View component read Component.name instead of Component.displayName
|
|
40
40
|
// causing [undefined] in error messages
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
_uiView.View.omitViewProps = (props, Component) => {
|
|
43
43
|
const ModifiedComponent = {
|
|
44
44
|
...Component,
|
|
45
45
|
name: 'Tag'
|
|
@@ -48,7 +48,7 @@ describe('<Tag />', async () => {
|
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
afterAll(() => {
|
|
51
|
-
|
|
51
|
+
_uiView.View.omitViewProps = originalOmitViewProps;
|
|
52
52
|
});
|
|
53
53
|
it('should display text', async () => {
|
|
54
54
|
(0, _react2.render)(_Tag || (_Tag = /*#__PURE__*/_react.default.createElement(_index.Tag, {
|
|
@@ -87,7 +87,7 @@ describe('<Tag />', async () => {
|
|
|
87
87
|
text: "Summer"
|
|
88
88
|
}))),
|
|
89
89
|
container = _render2.container;
|
|
90
|
-
const axeCheck = await (0,
|
|
90
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
91
91
|
expect(axeCheck).toBe(true);
|
|
92
92
|
});
|
|
93
93
|
describe('when passing down props to View', async () => {
|
|
@@ -95,7 +95,7 @@ describe('<Tag />', async () => {
|
|
|
95
95
|
margin: 'small',
|
|
96
96
|
elementRef: () => {}
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
_uiView.View.allowedProps.filter(prop => prop !== 'children').forEach(prop => {
|
|
99
99
|
if (Object.keys(allowedProps).indexOf(prop) < 0) {
|
|
100
100
|
it(`should NOT allow the '${prop}' prop`, async () => {
|
|
101
101
|
const props = {
|
package/lib/Tag/index.js
CHANGED
|
@@ -7,11 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.Tag = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
11
|
+
var _uiView = require("@instructure/ui-view");
|
|
12
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
13
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
14
|
+
var _uiTestable = require("@instructure/ui-testable");
|
|
15
15
|
var _emotion = require("@instructure/emotion");
|
|
16
16
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
17
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -46,7 +46,7 @@ var _dec, _dec2, _class, _Tag;
|
|
|
46
46
|
category: components
|
|
47
47
|
---
|
|
48
48
|
**/
|
|
49
|
-
let Tag = exports.Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
49
|
+
let Tag = exports.Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = (_Tag = class Tag extends _react.Component {
|
|
50
50
|
constructor(...args) {
|
|
51
51
|
super(...args);
|
|
52
52
|
this.ref = null;
|
|
@@ -81,7 +81,7 @@ let Tag = exports.Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
|
|
|
81
81
|
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
82
82
|
}
|
|
83
83
|
get focused() {
|
|
84
|
-
return (0,
|
|
84
|
+
return (0, _uiDomUtils.isActiveElement)(this.ref);
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
87
|
const _this$props4 = this.props,
|
|
@@ -94,8 +94,8 @@ let Tag = exports.Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
|
|
|
94
94
|
onClick = _this$props4.onClick,
|
|
95
95
|
margin = _this$props4.margin,
|
|
96
96
|
styles = _this$props4.styles;
|
|
97
|
-
const passthroughProps =
|
|
98
|
-
return (0, _emotion.jsx)(
|
|
97
|
+
const passthroughProps = _uiView.View.omitViewProps((0, _uiReactUtils.omitProps)(this.props, Tag.allowedProps), Tag);
|
|
98
|
+
return (0, _emotion.jsx)(_uiView.View, Object.assign({}, passthroughProps, {
|
|
99
99
|
elementRef: this.handleRef,
|
|
100
100
|
css: styles === null || styles === void 0 ? void 0 : styles.tag,
|
|
101
101
|
className: className,
|
|
@@ -110,7 +110,7 @@ let Tag = exports.Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
|
|
|
110
110
|
title: title || (typeof text === 'string' ? text : void 0)
|
|
111
111
|
}), (0, _emotion.jsx)("span", {
|
|
112
112
|
css: styles === null || styles === void 0 ? void 0 : styles.text
|
|
113
|
-
}, text), onClick && dismissible ? (0, _emotion.jsx)(
|
|
113
|
+
}, text), onClick && dismissible ? (0, _emotion.jsx)(_uiIcons.IconXLine, {
|
|
114
114
|
css: styles === null || styles === void 0 ? void 0 : styles.icon
|
|
115
115
|
}) : null);
|
|
116
116
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tag",
|
|
3
|
-
"version": "10.13.
|
|
3
|
+
"version": "10.13.1-pr-snapshot-1741357986437",
|
|
4
4
|
"description": "A tag component",
|
|
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.26.0",
|
|
27
|
-
"@instructure/console": "10.13.
|
|
28
|
-
"@instructure/emotion": "10.13.
|
|
29
|
-
"@instructure/shared-types": "10.13.
|
|
30
|
-
"@instructure/ui-color-utils": "10.13.
|
|
31
|
-
"@instructure/ui-dom-utils": "10.13.
|
|
32
|
-
"@instructure/ui-icons": "10.13.
|
|
33
|
-
"@instructure/ui-react-utils": "10.13.
|
|
34
|
-
"@instructure/ui-testable": "10.13.
|
|
35
|
-
"@instructure/ui-view": "10.13.
|
|
27
|
+
"@instructure/console": "10.13.1-pr-snapshot-1741357986437",
|
|
28
|
+
"@instructure/emotion": "10.13.1-pr-snapshot-1741357986437",
|
|
29
|
+
"@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
|
|
30
|
+
"@instructure/ui-color-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
31
|
+
"@instructure/ui-dom-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
32
|
+
"@instructure/ui-icons": "10.13.1-pr-snapshot-1741357986437",
|
|
33
|
+
"@instructure/ui-react-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
34
|
+
"@instructure/ui-testable": "10.13.1-pr-snapshot-1741357986437",
|
|
35
|
+
"@instructure/ui-view": "10.13.1-pr-snapshot-1741357986437",
|
|
36
36
|
"prop-types": "^15.8.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@instructure/ui-axe-check": "10.13.
|
|
40
|
-
"@instructure/ui-babel-preset": "10.13.
|
|
41
|
-
"@instructure/ui-test-utils": "10.13.
|
|
42
|
-
"@instructure/ui-themes": "10.13.
|
|
39
|
+
"@instructure/ui-axe-check": "10.13.1-pr-snapshot-1741357986437",
|
|
40
|
+
"@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
|
|
41
|
+
"@instructure/ui-test-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
42
|
+
"@instructure/ui-themes": "10.13.1-pr-snapshot-1741357986437",
|
|
43
43
|
"@testing-library/jest-dom": "^6.6.3",
|
|
44
44
|
"@testing-library/react": "^16.0.1",
|
|
45
45
|
"@testing-library/user-event": "^14.5.2",
|