@instructure/ui-tag 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/Tag/TagLocator.js +2 -2
- package/lib/Tag/index.js +10 -10
- package/lib/Tag/theme.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-tag
|
|
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-tag
|
|
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-tag
|
package/lib/Tag/TagLocator.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TagLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiTestLocator = require("@instructure/ui-test-locator");
|
|
8
8
|
var _index = require("./index");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -31,4 +31,4 @@ var _index = require("./index");
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
34
|
-
const TagLocator = exports.TagLocator = (0,
|
|
34
|
+
const TagLocator = exports.TagLocator = (0, _uiTestLocator.locator)(_index.Tag.selector);
|
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, _class2;
|
|
|
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 = (_class2 = 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,
|
|
@@ -108,7 +108,7 @@ let Tag = exports.Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
|
|
|
108
108
|
title: title || (typeof text === 'string' ? text : void 0)
|
|
109
109
|
}), (0, _emotion.jsx)("span", {
|
|
110
110
|
css: styles === null || styles === void 0 ? void 0 : styles.text
|
|
111
|
-
}, text), onClick && dismissible ? (0, _emotion.jsx)(
|
|
111
|
+
}, text), onClick && dismissible ? (0, _emotion.jsx)(_uiIcons.IconXLine, {
|
|
112
112
|
css: styles === null || styles === void 0 ? void 0 : styles.icon
|
|
113
113
|
}) : null);
|
|
114
114
|
}
|
package/lib/Tag/theme.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiColorUtils = require("@instructure/ui-color-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -65,7 +65,7 @@ const generateComponentTheme = theme => {
|
|
|
65
65
|
textColor
|
|
66
66
|
}) {
|
|
67
67
|
return {
|
|
68
|
-
[`${style}BackgroundHover`]: hoverColor || (0,
|
|
68
|
+
[`${style}BackgroundHover`]: hoverColor || (0, _uiColorUtils.darken)(mainColor, 5),
|
|
69
69
|
[`${style}Background`]: mainColor,
|
|
70
70
|
[`${style}BorderColor`]: borderColor,
|
|
71
71
|
// For 'pill'-style rounded corners
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tag",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.2-pr-snapshot-1721749364069",
|
|
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.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-icons": "8.56.
|
|
33
|
-
"@instructure/ui-react-utils": "8.56.
|
|
34
|
-
"@instructure/ui-testable": "8.56.
|
|
35
|
-
"@instructure/ui-view": "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-icons": "8.56.2-pr-snapshot-1721749364069",
|
|
33
|
+
"@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
34
|
+
"@instructure/ui-testable": "8.56.2-pr-snapshot-1721749364069",
|
|
35
|
+
"@instructure/ui-view": "8.56.2-pr-snapshot-1721749364069",
|
|
36
36
|
"prop-types": "^15.8.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@instructure/ui-babel-preset": "8.56.
|
|
40
|
-
"@instructure/ui-test-locator": "8.56.
|
|
41
|
-
"@instructure/ui-test-utils": "8.56.
|
|
42
|
-
"@instructure/ui-themes": "8.56.
|
|
39
|
+
"@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
|
|
40
|
+
"@instructure/ui-test-locator": "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
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.8 <=18"
|