@instructure/ui-link 8.17.1-snapshot.21 → 8.17.1-snapshot.30
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/es/Link/index.js +14 -22
- package/es/Link/theme.js +11 -11
- package/lib/Link/index.js +14 -22
- package/lib/Link/theme.js +11 -11
- package/package.json +18 -18
- package/tsconfig.build.tsbuildinfo +1 -1
package/es/Link/index.js
CHANGED
|
@@ -108,15 +108,11 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
componentDidMount() {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
|
|
111
|
+
this.props.makeStyles?.(this.makeStyleProps());
|
|
114
112
|
}
|
|
115
113
|
|
|
116
114
|
componentDidUpdate() {
|
|
117
|
-
|
|
118
|
-
|
|
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());
|
|
115
|
+
this.props.makeStyles?.(this.makeStyleProps());
|
|
120
116
|
}
|
|
121
117
|
|
|
122
118
|
get containsTruncateText() {
|
|
@@ -173,28 +169,24 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
173
169
|
}
|
|
174
170
|
|
|
175
171
|
renderIcon() {
|
|
176
|
-
var _this$props$styles;
|
|
177
|
-
|
|
178
172
|
warn( // if display prop is used, warn about icon or TruncateText
|
|
179
173
|
this.props.display === void 0, '[Link] Using the display property with an icon may cause layout issues.');
|
|
180
174
|
return jsx("span", {
|
|
181
|
-
css:
|
|
175
|
+
css: this.props.styles?.icon
|
|
182
176
|
}, callRenderProp(this.props.renderIcon));
|
|
183
177
|
}
|
|
184
178
|
|
|
185
179
|
render() {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
isWithinText = _this$props3.isWithinText,
|
|
197
|
-
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
180
|
+
const _this$props = this.props,
|
|
181
|
+
children = _this$props.children,
|
|
182
|
+
onClick = _this$props.onClick,
|
|
183
|
+
color = _this$props.color,
|
|
184
|
+
href = _this$props.href,
|
|
185
|
+
margin = _this$props.margin,
|
|
186
|
+
renderIcon = _this$props.renderIcon,
|
|
187
|
+
iconPlacement = _this$props.iconPlacement,
|
|
188
|
+
isWithinText = _this$props.isWithinText,
|
|
189
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
198
190
|
|
|
199
191
|
const interaction = this.interaction;
|
|
200
192
|
const isDisabled = interaction === 'disabled';
|
|
@@ -214,7 +206,7 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
214
206
|
role: role,
|
|
215
207
|
type: type,
|
|
216
208
|
tabIndex: tabIndex,
|
|
217
|
-
css:
|
|
209
|
+
css: this.props.styles?.link
|
|
218
210
|
}), renderIcon && iconPlacement === 'start' && this.renderIcon(), children, renderIcon && iconPlacement === 'end' && this.renderIcon());
|
|
219
211
|
}
|
|
220
212
|
|
package/es/Link/theme.js
CHANGED
|
@@ -49,23 +49,23 @@ const generateComponentTheme = theme => {
|
|
|
49
49
|
}; // maps the theme variables to component specific style variables
|
|
50
50
|
|
|
51
51
|
const componentVariables = {
|
|
52
|
-
fontFamily: typography
|
|
53
|
-
fontWeight: typography
|
|
54
|
-
color: colors
|
|
52
|
+
fontFamily: typography?.fontFamily,
|
|
53
|
+
fontWeight: typography?.fontWeightNormal,
|
|
54
|
+
color: colors?.textLink,
|
|
55
55
|
textDecorationWithinText: 'underline',
|
|
56
56
|
hoverTextDecorationWithinText: 'none',
|
|
57
57
|
textDecorationOutsideText: 'none',
|
|
58
58
|
hoverTextDecorationOutsideText: 'underline',
|
|
59
|
-
focusOutlineWidth: borders
|
|
60
|
-
focusOutlineColor: colors
|
|
61
|
-
focusOutlineStyle: borders
|
|
62
|
-
hoverColor: darken(colors
|
|
63
|
-
colorInverse: colors
|
|
64
|
-
focusInverseOutlineColor: colors
|
|
65
|
-
focusInverseIconOutlineColor: colors
|
|
59
|
+
focusOutlineWidth: borders?.widthMedium,
|
|
60
|
+
focusOutlineColor: colors?.borderBrand,
|
|
61
|
+
focusOutlineStyle: borders?.style,
|
|
62
|
+
hoverColor: darken(colors?.textLink, 10),
|
|
63
|
+
colorInverse: colors?.textLight,
|
|
64
|
+
focusInverseOutlineColor: colors?.borderLightest,
|
|
65
|
+
focusInverseIconOutlineColor: colors?.borderLightest,
|
|
66
66
|
iconSize: '1.125em',
|
|
67
67
|
// make icon slightly larger than inherited font-size,
|
|
68
|
-
iconPlusTextMargin: spacing
|
|
68
|
+
iconPlusTextMargin: spacing?.xxSmall
|
|
69
69
|
};
|
|
70
70
|
return { ...componentVariables,
|
|
71
71
|
...themeSpecificStyle[themeName]
|
package/lib/Link/index.js
CHANGED
|
@@ -115,15 +115,11 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
componentDidMount() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
|
|
118
|
+
this.props.makeStyles?.(this.makeStyleProps());
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
componentDidUpdate() {
|
|
124
|
-
|
|
125
|
-
|
|
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());
|
|
122
|
+
this.props.makeStyles?.(this.makeStyleProps());
|
|
127
123
|
}
|
|
128
124
|
|
|
129
125
|
get containsTruncateText() {
|
|
@@ -182,28 +178,24 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
182
178
|
}
|
|
183
179
|
|
|
184
180
|
renderIcon() {
|
|
185
|
-
var _this$props$styles;
|
|
186
|
-
|
|
187
181
|
(0, _console.logWarn)( // if display prop is used, warn about icon or TruncateText
|
|
188
182
|
this.props.display === void 0, '[Link] Using the display property with an icon may cause layout issues.');
|
|
189
183
|
return (0, _emotion.jsx)("span", {
|
|
190
|
-
css:
|
|
184
|
+
css: this.props.styles?.icon
|
|
191
185
|
}, (0, _callRenderProp.callRenderProp)(this.props.renderIcon));
|
|
192
186
|
}
|
|
193
187
|
|
|
194
188
|
render() {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
isWithinText = _this$props3.isWithinText,
|
|
206
|
-
props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
189
|
+
const _this$props = this.props,
|
|
190
|
+
children = _this$props.children,
|
|
191
|
+
onClick = _this$props.onClick,
|
|
192
|
+
color = _this$props.color,
|
|
193
|
+
href = _this$props.href,
|
|
194
|
+
margin = _this$props.margin,
|
|
195
|
+
renderIcon = _this$props.renderIcon,
|
|
196
|
+
iconPlacement = _this$props.iconPlacement,
|
|
197
|
+
isWithinText = _this$props.isWithinText,
|
|
198
|
+
props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
207
199
|
const interaction = this.interaction;
|
|
208
200
|
const isDisabled = interaction === 'disabled';
|
|
209
201
|
const role = onClick && this.element !== 'button' ? 'button' : void 0;
|
|
@@ -222,7 +214,7 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
222
214
|
role: role,
|
|
223
215
|
type: type,
|
|
224
216
|
tabIndex: tabIndex,
|
|
225
|
-
css:
|
|
217
|
+
css: this.props.styles?.link
|
|
226
218
|
}), renderIcon && iconPlacement === 'start' && this.renderIcon(), children, renderIcon && iconPlacement === 'end' && this.renderIcon());
|
|
227
219
|
}
|
|
228
220
|
|
package/lib/Link/theme.js
CHANGED
|
@@ -57,23 +57,23 @@ const generateComponentTheme = theme => {
|
|
|
57
57
|
}; // maps the theme variables to component specific style variables
|
|
58
58
|
|
|
59
59
|
const componentVariables = {
|
|
60
|
-
fontFamily: typography
|
|
61
|
-
fontWeight: typography
|
|
62
|
-
color: colors
|
|
60
|
+
fontFamily: typography?.fontFamily,
|
|
61
|
+
fontWeight: typography?.fontWeightNormal,
|
|
62
|
+
color: colors?.textLink,
|
|
63
63
|
textDecorationWithinText: 'underline',
|
|
64
64
|
hoverTextDecorationWithinText: 'none',
|
|
65
65
|
textDecorationOutsideText: 'none',
|
|
66
66
|
hoverTextDecorationOutsideText: 'underline',
|
|
67
|
-
focusOutlineWidth: borders
|
|
68
|
-
focusOutlineColor: colors
|
|
69
|
-
focusOutlineStyle: borders
|
|
70
|
-
hoverColor: (0, _darken.darken)(colors
|
|
71
|
-
colorInverse: colors
|
|
72
|
-
focusInverseOutlineColor: colors
|
|
73
|
-
focusInverseIconOutlineColor: colors
|
|
67
|
+
focusOutlineWidth: borders?.widthMedium,
|
|
68
|
+
focusOutlineColor: colors?.borderBrand,
|
|
69
|
+
focusOutlineStyle: borders?.style,
|
|
70
|
+
hoverColor: (0, _darken.darken)(colors?.textLink, 10),
|
|
71
|
+
colorInverse: colors?.textLight,
|
|
72
|
+
focusInverseOutlineColor: colors?.borderLightest,
|
|
73
|
+
focusInverseIconOutlineColor: colors?.borderLightest,
|
|
74
74
|
iconSize: '1.125em',
|
|
75
75
|
// make icon slightly larger than inherited font-size,
|
|
76
|
-
iconPlusTextMargin: spacing
|
|
76
|
+
iconPlusTextMargin: spacing?.xxSmall
|
|
77
77
|
};
|
|
78
78
|
return { ...componentVariables,
|
|
79
79
|
...themeSpecificStyle[themeName]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "8.17.1-snapshot.
|
|
3
|
+
"version": "8.17.1-snapshot.30+cb1322c25",
|
|
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.17.1-snapshot.
|
|
28
|
-
"@instructure/emotion": "8.17.1-snapshot.
|
|
29
|
-
"@instructure/shared-types": "8.17.1-snapshot.
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.17.1-snapshot.
|
|
31
|
-
"@instructure/ui-color-utils": "8.17.1-snapshot.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.17.1-snapshot.
|
|
33
|
-
"@instructure/ui-icons": "8.17.1-snapshot.
|
|
34
|
-
"@instructure/ui-prop-types": "8.17.1-snapshot.
|
|
35
|
-
"@instructure/ui-react-utils": "8.17.1-snapshot.
|
|
36
|
-
"@instructure/ui-testable": "8.17.1-snapshot.
|
|
37
|
-
"@instructure/ui-view": "8.17.1-snapshot.
|
|
27
|
+
"@instructure/console": "8.17.1-snapshot.30+cb1322c25",
|
|
28
|
+
"@instructure/emotion": "8.17.1-snapshot.30+cb1322c25",
|
|
29
|
+
"@instructure/shared-types": "8.17.1-snapshot.30+cb1322c25",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
31
|
+
"@instructure/ui-color-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
33
|
+
"@instructure/ui-icons": "8.17.1-snapshot.30+cb1322c25",
|
|
34
|
+
"@instructure/ui-prop-types": "8.17.1-snapshot.30+cb1322c25",
|
|
35
|
+
"@instructure/ui-react-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
36
|
+
"@instructure/ui-testable": "8.17.1-snapshot.30+cb1322c25",
|
|
37
|
+
"@instructure/ui-view": "8.17.1-snapshot.30+cb1322c25",
|
|
38
38
|
"prop-types": "^15"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-babel-preset": "8.17.1-snapshot.
|
|
42
|
-
"@instructure/ui-test-locator": "8.17.1-snapshot.
|
|
43
|
-
"@instructure/ui-test-queries": "8.17.1-snapshot.
|
|
44
|
-
"@instructure/ui-test-utils": "8.17.1-snapshot.
|
|
45
|
-
"@instructure/ui-themes": "8.17.1-snapshot.
|
|
41
|
+
"@instructure/ui-babel-preset": "8.17.1-snapshot.30+cb1322c25",
|
|
42
|
+
"@instructure/ui-test-locator": "8.17.1-snapshot.30+cb1322c25",
|
|
43
|
+
"@instructure/ui-test-queries": "8.17.1-snapshot.30+cb1322c25",
|
|
44
|
+
"@instructure/ui-test-utils": "8.17.1-snapshot.30+cb1322c25",
|
|
45
|
+
"@instructure/ui-themes": "8.17.1-snapshot.30+cb1322c25"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "cb1322c25257139750149d7a817f1fb32571c1ed"
|
|
55
55
|
}
|