@instructure/ui-link 8.25.1-snapshot-1 → 8.25.1-snapshot-10

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 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-1](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-1) (2022-06-10)
6
+ ## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
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, _class2;
4
+ var _dec, _dec2, _class;
5
5
 
6
6
  /*
7
7
  * The MIT License (MIT)
@@ -46,67 +46,29 @@ category: components
46
46
  ---
47
47
  @tsProps
48
48
  **/
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
- }
49
+ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class Link extends Component {
50
+ static displayName = "Link";
51
+ static componentId = 'Link';
52
+ static propTypes = propTypes;
53
+ static allowedProps = allowedProps;
54
+ static defaultProps = {
55
+ // Leave interaction default undefined so that `disabled` can also be supplied
56
+ interaction: void 0,
57
+ color: 'link',
58
+ iconPlacement: 'start',
59
+ isWithinText: true,
60
+ forceButtonRole: true
61
+ };
62
+ state = {
63
+ hasFocus: false
64
+ };
105
65
 
106
66
  get _link() {
107
67
  return this.ref;
108
68
  }
109
69
 
70
+ ref = null;
71
+
110
72
  componentDidMount() {
111
73
  var _this$props$makeStyle, _this$props;
112
74
 
@@ -119,6 +81,50 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
119
81
  (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
120
82
  }
121
83
 
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
+
122
128
  get containsTruncateText() {
123
129
  let truncateText = false;
124
130
  React.Children.forEach(this.props.children, child => {
@@ -230,13 +236,6 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
230
236
  }), renderIcon && iconPlacement === 'start' && this.renderIcon(), children, renderIcon && iconPlacement === 'end' && this.renderIcon());
231
237
  }
232
238
 
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);
239
+ }) || _class) || _class);
241
240
  export default Link;
242
241
  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, _class2;
48
+ var _dec, _dec2, _class;
49
49
 
50
50
  /**
51
51
  ---
@@ -53,67 +53,29 @@ 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 = (_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
- }
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
+ static displayName = "Link";
58
+ static componentId = 'Link';
59
+ static propTypes = _props.propTypes;
60
+ static allowedProps = _props.allowedProps;
61
+ static defaultProps = {
62
+ // Leave interaction default undefined so that `disabled` can also be supplied
63
+ interaction: void 0,
64
+ color: 'link',
65
+ iconPlacement: 'start',
66
+ isWithinText: true,
67
+ forceButtonRole: true
68
+ };
69
+ state = {
70
+ hasFocus: false
71
+ };
112
72
 
113
73
  get _link() {
114
74
  return this.ref;
115
75
  }
116
76
 
77
+ ref = null;
78
+
117
79
  componentDidMount() {
118
80
  var _this$props$makeStyle, _this$props;
119
81
 
@@ -126,6 +88,50 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
126
88
  (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
127
89
  }
128
90
 
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
+
129
135
  get containsTruncateText() {
130
136
  let truncateText = false;
131
137
 
@@ -238,14 +244,7 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
238
244
  }), renderIcon && iconPlacement === 'start' && this.renderIcon(), children, renderIcon && iconPlacement === 'end' && this.renderIcon());
239
245
  }
240
246
 
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);
247
+ }) || _class) || _class);
249
248
  exports.Link = Link;
250
249
  var _default = Link;
251
250
  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-1",
3
+ "version": "8.25.1-snapshot-10",
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-1",
28
- "@instructure/emotion": "8.25.1-snapshot-1",
29
- "@instructure/shared-types": "8.25.1-snapshot-1",
30
- "@instructure/ui-a11y-utils": "8.25.1-snapshot-1",
31
- "@instructure/ui-color-utils": "8.25.1-snapshot-1",
32
- "@instructure/ui-dom-utils": "8.25.1-snapshot-1",
33
- "@instructure/ui-icons": "8.25.1-snapshot-1",
34
- "@instructure/ui-prop-types": "8.25.1-snapshot-1",
35
- "@instructure/ui-react-utils": "8.25.1-snapshot-1",
36
- "@instructure/ui-testable": "8.25.1-snapshot-1",
37
- "@instructure/ui-view": "8.25.1-snapshot-1",
27
+ "@instructure/console": "8.25.1-snapshot-10",
28
+ "@instructure/emotion": "8.25.1-snapshot-10",
29
+ "@instructure/shared-types": "8.25.1-snapshot-10",
30
+ "@instructure/ui-a11y-utils": "8.25.1-snapshot-10",
31
+ "@instructure/ui-color-utils": "8.25.1-snapshot-10",
32
+ "@instructure/ui-dom-utils": "8.25.1-snapshot-10",
33
+ "@instructure/ui-icons": "8.25.1-snapshot-10",
34
+ "@instructure/ui-prop-types": "8.25.1-snapshot-10",
35
+ "@instructure/ui-react-utils": "8.25.1-snapshot-10",
36
+ "@instructure/ui-testable": "8.25.1-snapshot-10",
37
+ "@instructure/ui-view": "8.25.1-snapshot-10",
38
38
  "prop-types": "^15"
39
39
  },
40
40
  "devDependencies": {
41
- "@instructure/ui-babel-preset": "8.25.1-snapshot-1",
42
- "@instructure/ui-test-locator": "8.25.1-snapshot-1",
43
- "@instructure/ui-test-queries": "8.25.1-snapshot-1",
44
- "@instructure/ui-test-utils": "8.25.1-snapshot-1",
45
- "@instructure/ui-themes": "8.25.1-snapshot-1"
41
+ "@instructure/ui-babel-preset": "8.25.1-snapshot-10",
42
+ "@instructure/ui-test-locator": "8.25.1-snapshot-10",
43
+ "@instructure/ui-test-queries": "8.25.1-snapshot-10",
44
+ "@instructure/ui-test-utils": "8.25.1-snapshot-10",
45
+ "@instructure/ui-themes": "8.25.1-snapshot-10"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8 <=17"