@instructure/ui-link 8.33.1 → 8.33.2

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/lib/Link/props.js CHANGED
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.propTypes = exports.allowedProps = void 0;
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _emotion = require("@instructure/emotion");
13
-
14
10
  /*
15
11
  * The MIT License (MIT)
16
12
  *
@@ -34,6 +30,7 @@ var _emotion = require("@instructure/emotion");
34
30
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
31
  * SOFTWARE.
36
32
  */
33
+
37
34
  const propTypes = {
38
35
  children: _propTypes.default.node.isRequired,
39
36
  href: _propTypes.default.string,
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  /*
9
8
  * The MIT License (MIT)
10
9
  *
@@ -41,11 +40,11 @@ exports.default = void 0;
41
40
  */
42
41
  const generateStyle = (componentTheme, props, state) => {
43
42
  const isWithinText = props.isWithinText,
44
- renderIcon = props.renderIcon,
45
- iconPlacement = props.iconPlacement,
46
- color = props.color;
43
+ renderIcon = props.renderIcon,
44
+ iconPlacement = props.iconPlacement,
45
+ color = props.color;
47
46
  const containsTruncateText = state.containsTruncateText,
48
- hasVisibleChildren = state.hasVisibleChildren;
47
+ hasVisibleChildren = state.hasVisibleChildren;
49
48
  const inverseStyle = color === 'link-inverse';
50
49
  const baseStyles = {
51
50
  boxSizing: 'border-box',
@@ -72,11 +71,12 @@ const generateStyle = (componentTheme, props, state) => {
72
71
  },
73
72
  '&::-moz-focus-inner': {
74
73
  border: 0 // removes default dotted focus outline in Firefox
75
-
76
74
  }
77
- }; // If Link is a button or link, it should look clickable
75
+ };
78
76
 
79
- const isClickableStyles = { ...baseStyles,
77
+ // If Link is a button or link, it should look clickable
78
+ const isClickableStyles = {
79
+ ...baseStyles,
80
80
  cursor: 'pointer',
81
81
  color: componentTheme.color,
82
82
  textDecoration: isWithinText ? componentTheme.textDecorationWithinText : componentTheme.textDecorationOutsideText,
@@ -118,7 +118,8 @@ const generateStyle = (componentTheme, props, state) => {
118
118
  '&:-webkit-any(a), &:-webkit-any(button)': isClickableStyles,
119
119
  '&:is(button)': buttonStyle,
120
120
  '&:-webkit-any(button)': buttonStyle,
121
- ...(inverseStyle && { ...inverseStyles,
121
+ ...(inverseStyle && {
122
+ ...inverseStyles,
122
123
  '&:is(a):link, &:is(a):visited, &:is(button)': inverseStyles,
123
124
  '&:-webkit-any(a):link, &:-webkit-any(a):visited, &:-webkit-any(button)': inverseStyles
124
125
  })
@@ -134,6 +135,5 @@ const generateStyle = (componentTheme, props, state) => {
134
135
  }
135
136
  };
136
137
  };
137
-
138
138
  var _default = generateStyle;
139
139
  exports.default = _default;
package/lib/Link/theme.js CHANGED
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _darken = require("@instructure/ui-color-utils/lib/darken.js");
9
-
10
8
  /*
11
9
  * The MIT License (MIT)
12
10
  *
@@ -38,12 +36,13 @@ var _darken = require("@instructure/ui-color-utils/lib/darken.js");
38
36
  */
39
37
  const generateComponentTheme = theme => {
40
38
  const colors = theme.colors,
41
- borders = theme.borders,
42
- typography = theme.typography,
43
- spacing = theme.spacing,
44
- themeName = theme.key; // if any styling should depend on the theme itself,
45
- // this object should specify it
39
+ borders = theme.borders,
40
+ typography = theme.typography,
41
+ spacing = theme.spacing,
42
+ themeName = theme.key;
46
43
 
44
+ // if any styling should depend on the theme itself,
45
+ // this object should specify it
47
46
  const themeSpecificStyle = {
48
47
  canvas: {
49
48
  color: theme['ic-link-color'],
@@ -54,8 +53,9 @@ const generateComponentTheme = theme => {
54
53
  textDecorationOutsideText: 'underline',
55
54
  hoverTextDecorationOutsideText: 'none'
56
55
  }
57
- }; // maps the theme variables to component specific style variables
56
+ };
58
57
 
58
+ // maps the theme variables to component specific style variables
59
59
  const componentVariables = {
60
60
  fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
61
61
  fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
@@ -75,10 +75,10 @@ const generateComponentTheme = theme => {
75
75
  // make icon slightly larger than inherited font-size,
76
76
  iconPlusTextMargin: spacing === null || spacing === void 0 ? void 0 : spacing.xxSmall
77
77
  };
78
- return { ...componentVariables,
78
+ return {
79
+ ...componentVariables,
79
80
  ...themeSpecificStyle[themeName]
80
81
  };
81
82
  };
82
-
83
83
  var _default = generateComponentTheme;
84
84
  exports.default = _default;
package/lib/index.js CHANGED
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "Link", {
9
9
  return _Link.Link;
10
10
  }
11
11
  });
12
-
13
12
  var _Link = require("./Link");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-link",
3
- "version": "8.33.1",
3
+ "version": "8.33.2",
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.33.1",
28
- "@instructure/emotion": "8.33.1",
29
- "@instructure/shared-types": "8.33.1",
30
- "@instructure/ui-a11y-utils": "8.33.1",
31
- "@instructure/ui-color-utils": "8.33.1",
32
- "@instructure/ui-dom-utils": "8.33.1",
33
- "@instructure/ui-icons": "8.33.1",
34
- "@instructure/ui-prop-types": "8.33.1",
35
- "@instructure/ui-react-utils": "8.33.1",
36
- "@instructure/ui-testable": "8.33.1",
37
- "@instructure/ui-view": "8.33.1",
27
+ "@instructure/console": "8.33.2",
28
+ "@instructure/emotion": "8.33.2",
29
+ "@instructure/shared-types": "8.33.2",
30
+ "@instructure/ui-a11y-utils": "8.33.2",
31
+ "@instructure/ui-color-utils": "8.33.2",
32
+ "@instructure/ui-dom-utils": "8.33.2",
33
+ "@instructure/ui-icons": "8.33.2",
34
+ "@instructure/ui-prop-types": "8.33.2",
35
+ "@instructure/ui-react-utils": "8.33.2",
36
+ "@instructure/ui-testable": "8.33.2",
37
+ "@instructure/ui-view": "8.33.2",
38
38
  "prop-types": "^15"
39
39
  },
40
40
  "devDependencies": {
41
- "@instructure/ui-babel-preset": "8.33.1",
42
- "@instructure/ui-test-locator": "8.33.1",
43
- "@instructure/ui-test-queries": "8.33.1",
44
- "@instructure/ui-test-utils": "8.33.1",
45
- "@instructure/ui-themes": "8.33.1"
41
+ "@instructure/ui-babel-preset": "8.33.2",
42
+ "@instructure/ui-test-locator": "8.33.2",
43
+ "@instructure/ui-test-queries": "8.33.2",
44
+ "@instructure/ui-test-utils": "8.33.2",
45
+ "@instructure/ui-themes": "8.33.2"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8 <=18"