@instructure/ui-link 8.25.1-snapshot-10 → 8.25.1-snapshot-15
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/Link/index.js +65 -64
- package/lib/Link/index.js +65 -64
- package/package.json +17 -17
- package/tsconfig.build.tsbuildinfo +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
|
-
## [8.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-15](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-15) (2022-06-23)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-link
|
|
9
9
|
|
package/es/Link/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children", "onClick", "color", "href", "margin", "renderIcon", "iconPlacement", "isWithinText"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -46,29 +46,67 @@ category: components
|
|
|
46
46
|
---
|
|
47
47
|
@tsProps
|
|
48
48
|
**/
|
|
49
|
-
let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class Link extends Component {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class Link extends Component {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
this.state = {
|
|
53
|
+
hasFocus: false
|
|
54
|
+
};
|
|
55
|
+
this.ref = null;
|
|
56
|
+
|
|
57
|
+
this.makeStyleProps = () => {
|
|
58
|
+
return {
|
|
59
|
+
containsTruncateText: this.containsTruncateText,
|
|
60
|
+
hasVisibleChildren: this.hasVisibleChildren
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
this.handleElementRef = el => {
|
|
65
|
+
const elementRef = this.props.elementRef;
|
|
66
|
+
this.ref = el;
|
|
67
|
+
|
|
68
|
+
if (typeof elementRef === 'function') {
|
|
69
|
+
elementRef(el);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
this.handleClick = event => {
|
|
74
|
+
const onClick = this.props.onClick;
|
|
75
|
+
const interaction = this.interaction;
|
|
76
|
+
|
|
77
|
+
if (interaction === 'disabled') {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
} else if (typeof onClick === 'function') {
|
|
81
|
+
onClick(event);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
this.handleFocus = event => {
|
|
86
|
+
this.setState({
|
|
87
|
+
hasFocus: true
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
if (typeof this.props.onFocus === 'function') {
|
|
91
|
+
this.props.onFocus(event);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
this.handleBlur = event => {
|
|
96
|
+
this.setState({
|
|
97
|
+
hasFocus: false
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (typeof this.props.onBlur === 'function') {
|
|
101
|
+
this.props.onBlur(event);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
65
105
|
|
|
66
106
|
get _link() {
|
|
67
107
|
return this.ref;
|
|
68
108
|
}
|
|
69
109
|
|
|
70
|
-
ref = null;
|
|
71
|
-
|
|
72
110
|
componentDidMount() {
|
|
73
111
|
var _this$props$makeStyle, _this$props;
|
|
74
112
|
|
|
@@ -81,50 +119,6 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
81
119
|
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
|
|
82
120
|
}
|
|
83
121
|
|
|
84
|
-
makeStyleProps = () => {
|
|
85
|
-
return {
|
|
86
|
-
containsTruncateText: this.containsTruncateText,
|
|
87
|
-
hasVisibleChildren: this.hasVisibleChildren
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
handleElementRef = el => {
|
|
91
|
-
const elementRef = this.props.elementRef;
|
|
92
|
-
this.ref = el;
|
|
93
|
-
|
|
94
|
-
if (typeof elementRef === 'function') {
|
|
95
|
-
elementRef(el);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
handleClick = event => {
|
|
99
|
-
const onClick = this.props.onClick;
|
|
100
|
-
const interaction = this.interaction;
|
|
101
|
-
|
|
102
|
-
if (interaction === 'disabled') {
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
event.stopPropagation();
|
|
105
|
-
} else if (typeof onClick === 'function') {
|
|
106
|
-
onClick(event);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
handleFocus = event => {
|
|
110
|
-
this.setState({
|
|
111
|
-
hasFocus: true
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
if (typeof this.props.onFocus === 'function') {
|
|
115
|
-
this.props.onFocus(event);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
handleBlur = event => {
|
|
119
|
-
this.setState({
|
|
120
|
-
hasFocus: false
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
if (typeof this.props.onBlur === 'function') {
|
|
124
|
-
this.props.onBlur(event);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
122
|
get containsTruncateText() {
|
|
129
123
|
let truncateText = false;
|
|
130
124
|
React.Children.forEach(this.props.children, child => {
|
|
@@ -236,6 +230,13 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
236
230
|
}), renderIcon && iconPlacement === 'start' && this.renderIcon(), children, renderIcon && iconPlacement === 'end' && this.renderIcon());
|
|
237
231
|
}
|
|
238
232
|
|
|
239
|
-
}
|
|
233
|
+
}, _class2.displayName = "Link", _class2.componentId = 'Link', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
234
|
+
// Leave interaction default undefined so that `disabled` can also be supplied
|
|
235
|
+
interaction: void 0,
|
|
236
|
+
color: 'link',
|
|
237
|
+
iconPlacement: 'start',
|
|
238
|
+
isWithinText: true,
|
|
239
|
+
forceButtonRole: true
|
|
240
|
+
}, _class2)) || _class) || _class);
|
|
240
241
|
export default Link;
|
|
241
242
|
export { Link };
|
package/lib/Link/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var _props = require("./props");
|
|
|
45
45
|
|
|
46
46
|
const _excluded = ["children", "onClick", "color", "href", "margin", "renderIcon", "iconPlacement", "isWithinText"];
|
|
47
47
|
|
|
48
|
-
var _dec, _dec2, _class;
|
|
48
|
+
var _dec, _dec2, _class, _class2;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
---
|
|
@@ -53,29 +53,67 @@ category: components
|
|
|
53
53
|
---
|
|
54
54
|
@tsProps
|
|
55
55
|
**/
|
|
56
|
-
let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = class Link extends _react.Component {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
56
|
+
let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class Link extends _react.Component {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this.state = {
|
|
60
|
+
hasFocus: false
|
|
61
|
+
};
|
|
62
|
+
this.ref = null;
|
|
63
|
+
|
|
64
|
+
this.makeStyleProps = () => {
|
|
65
|
+
return {
|
|
66
|
+
containsTruncateText: this.containsTruncateText,
|
|
67
|
+
hasVisibleChildren: this.hasVisibleChildren
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
this.handleElementRef = el => {
|
|
72
|
+
const elementRef = this.props.elementRef;
|
|
73
|
+
this.ref = el;
|
|
74
|
+
|
|
75
|
+
if (typeof elementRef === 'function') {
|
|
76
|
+
elementRef(el);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
this.handleClick = event => {
|
|
81
|
+
const onClick = this.props.onClick;
|
|
82
|
+
const interaction = this.interaction;
|
|
83
|
+
|
|
84
|
+
if (interaction === 'disabled') {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
} else if (typeof onClick === 'function') {
|
|
88
|
+
onClick(event);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
this.handleFocus = event => {
|
|
93
|
+
this.setState({
|
|
94
|
+
hasFocus: true
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (typeof this.props.onFocus === 'function') {
|
|
98
|
+
this.props.onFocus(event);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
this.handleBlur = event => {
|
|
103
|
+
this.setState({
|
|
104
|
+
hasFocus: false
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
if (typeof this.props.onBlur === 'function') {
|
|
108
|
+
this.props.onBlur(event);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
72
112
|
|
|
73
113
|
get _link() {
|
|
74
114
|
return this.ref;
|
|
75
115
|
}
|
|
76
116
|
|
|
77
|
-
ref = null;
|
|
78
|
-
|
|
79
117
|
componentDidMount() {
|
|
80
118
|
var _this$props$makeStyle, _this$props;
|
|
81
119
|
|
|
@@ -88,50 +126,6 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
88
126
|
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
|
|
89
127
|
}
|
|
90
128
|
|
|
91
|
-
makeStyleProps = () => {
|
|
92
|
-
return {
|
|
93
|
-
containsTruncateText: this.containsTruncateText,
|
|
94
|
-
hasVisibleChildren: this.hasVisibleChildren
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
handleElementRef = el => {
|
|
98
|
-
const elementRef = this.props.elementRef;
|
|
99
|
-
this.ref = el;
|
|
100
|
-
|
|
101
|
-
if (typeof elementRef === 'function') {
|
|
102
|
-
elementRef(el);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
handleClick = event => {
|
|
106
|
-
const onClick = this.props.onClick;
|
|
107
|
-
const interaction = this.interaction;
|
|
108
|
-
|
|
109
|
-
if (interaction === 'disabled') {
|
|
110
|
-
event.preventDefault();
|
|
111
|
-
event.stopPropagation();
|
|
112
|
-
} else if (typeof onClick === 'function') {
|
|
113
|
-
onClick(event);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
handleFocus = event => {
|
|
117
|
-
this.setState({
|
|
118
|
-
hasFocus: true
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
if (typeof this.props.onFocus === 'function') {
|
|
122
|
-
this.props.onFocus(event);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
handleBlur = event => {
|
|
126
|
-
this.setState({
|
|
127
|
-
hasFocus: false
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
if (typeof this.props.onBlur === 'function') {
|
|
131
|
-
this.props.onBlur(event);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
129
|
get containsTruncateText() {
|
|
136
130
|
let truncateText = false;
|
|
137
131
|
|
|
@@ -244,7 +238,14 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
244
238
|
}), renderIcon && iconPlacement === 'start' && this.renderIcon(), children, renderIcon && iconPlacement === 'end' && this.renderIcon());
|
|
245
239
|
}
|
|
246
240
|
|
|
247
|
-
}
|
|
241
|
+
}, _class2.displayName = "Link", _class2.componentId = 'Link', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
242
|
+
// Leave interaction default undefined so that `disabled` can also be supplied
|
|
243
|
+
interaction: void 0,
|
|
244
|
+
color: 'link',
|
|
245
|
+
iconPlacement: 'start',
|
|
246
|
+
isWithinText: true,
|
|
247
|
+
forceButtonRole: true
|
|
248
|
+
}, _class2)) || _class) || _class);
|
|
248
249
|
exports.Link = Link;
|
|
249
250
|
var _default = Link;
|
|
250
251
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-15",
|
|
4
4
|
"description": "A component for creating links",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.13.10",
|
|
27
|
-
"@instructure/console": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/emotion": "8.25.1-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.25.1-snapshot-
|
|
31
|
-
"@instructure/ui-color-utils": "8.25.1-snapshot-
|
|
32
|
-
"@instructure/ui-dom-utils": "8.25.1-snapshot-
|
|
33
|
-
"@instructure/ui-icons": "8.25.1-snapshot-
|
|
34
|
-
"@instructure/ui-prop-types": "8.25.1-snapshot-
|
|
35
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
36
|
-
"@instructure/ui-testable": "8.25.1-snapshot-
|
|
37
|
-
"@instructure/ui-view": "8.25.1-snapshot-
|
|
27
|
+
"@instructure/console": "8.25.1-snapshot-15",
|
|
28
|
+
"@instructure/emotion": "8.25.1-snapshot-15",
|
|
29
|
+
"@instructure/shared-types": "8.25.1-snapshot-15",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.25.1-snapshot-15",
|
|
31
|
+
"@instructure/ui-color-utils": "8.25.1-snapshot-15",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.25.1-snapshot-15",
|
|
33
|
+
"@instructure/ui-icons": "8.25.1-snapshot-15",
|
|
34
|
+
"@instructure/ui-prop-types": "8.25.1-snapshot-15",
|
|
35
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-15",
|
|
36
|
+
"@instructure/ui-testable": "8.25.1-snapshot-15",
|
|
37
|
+
"@instructure/ui-view": "8.25.1-snapshot-15",
|
|
38
38
|
"prop-types": "^15"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
42
|
-
"@instructure/ui-test-locator": "8.25.1-snapshot-
|
|
43
|
-
"@instructure/ui-test-queries": "8.25.1-snapshot-
|
|
44
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
45
|
-
"@instructure/ui-themes": "8.25.1-snapshot-
|
|
41
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-15",
|
|
42
|
+
"@instructure/ui-test-locator": "8.25.1-snapshot-15",
|
|
43
|
+
"@instructure/ui-test-queries": "8.25.1-snapshot-15",
|
|
44
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-15",
|
|
45
|
+
"@instructure/ui-themes": "8.25.1-snapshot-15"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|