Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hig/text-link

Package Overview
Dependencies
Maintainers
6
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hig/text-link - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

158

build/index.es.js

@@ -1,2 +0,2 @@

import React, { Component } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

@@ -1643,95 +1643,71 @@ import ThemeContext from '@hig/theme-context';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var TextLink = function TextLink(props) {
var children = props.children,
link = props.link,
target = props.target,
onClick = props.onClick,
onBlur = props.onBlur,
onFocus = props.onFocus,
onMouseUp = props.onMouseUp,
onMouseDown = props.onMouseDown,
onMouseLeave = props.onMouseLeave,
onMouseEnter = props.onMouseEnter,
otherProps = _objectWithoutProperties(props, ["children", "link", "target", "onClick", "onBlur", "onFocus", "onMouseUp", "onMouseDown", "onMouseLeave", "onMouseEnter"]);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var className = otherProps.className;
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Element = link ? "a" : "span";
var linkProps = link ? {
href: link,
target: target
} : { role: "button" };
var TextLink = function (_Component) {
_inherits(TextLink, _Component);
return React.createElement(
ThemeContext.Consumer,
null,
function (_ref) {
var resolvedRoles = _ref.resolvedRoles;
return React.createElement(
ControlBehavior,
{
onBlur: onBlur,
onFocus: onFocus,
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onMouseUp: onMouseUp
},
function (_ref2) {
var hasFocus = _ref2.hasFocus,
hasHover = _ref2.hasHover,
isPressed = _ref2.isPressed,
handleBlur = _ref2.onBlur,
handleFocus = _ref2.onFocus,
handleMouseDown = _ref2.onMouseDown,
handleMouseEnter = _ref2.onMouseEnter,
handleMouseLeave = _ref2.onMouseLeave,
handleMouseUp = _ref2.onMouseUp;
var customStylesheet = props.stylesheet;
function TextLink() {
_classCallCheck(this, TextLink);
return _possibleConstructorReturn(this, (TextLink.__proto__ || Object.getPrototypeOf(TextLink)).apply(this, arguments));
}
_createClass(TextLink, [{
key: "render",
value: function render() {
var _this2 = this;
var _props = this.props,
children = _props.children,
link = _props.link,
target = _props.target,
onClick = _props.onClick,
onBlur = _props.onBlur,
onFocus = _props.onFocus,
onMouseUp = _props.onMouseUp,
onMouseDown = _props.onMouseDown,
onMouseLeave = _props.onMouseLeave,
onMouseEnter = _props.onMouseEnter,
otherProps = _objectWithoutProperties(_props, ["children", "link", "target", "onClick", "onBlur", "onFocus", "onMouseUp", "onMouseDown", "onMouseLeave", "onMouseEnter"]);
var className = otherProps.className;
var Element = link ? "a" : "span";
var linkProps = link ? {
href: link,
target: target
} : { role: "button" };
return React.createElement(
ThemeContext.Consumer,
null,
function (_ref) {
var resolvedRoles = _ref.resolvedRoles;
var styles = stylesheet(_extends$1({
stylesheet: customStylesheet,
hasFocus: hasFocus,
hasHover: hasHover,
isPressed: isPressed
}, props), resolvedRoles);
return React.createElement(
ControlBehavior,
{
onBlur: onBlur,
onFocus: onFocus,
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onMouseUp: onMouseUp
},
function (_ref2) {
var hasFocus = _ref2.hasFocus,
hasHover = _ref2.hasHover,
isPressed = _ref2.isPressed,
handleBlur = _ref2.onBlur,
handleFocus = _ref2.onFocus,
handleMouseDown = _ref2.onMouseDown,
handleMouseEnter = _ref2.onMouseEnter,
handleMouseLeave = _ref2.onMouseLeave,
handleMouseUp = _ref2.onMouseUp;
var customStylesheet = _this2.props.stylesheet;
var styles = stylesheet(_extends$1({
stylesheet: customStylesheet,
hasFocus: hasFocus,
hasHover: hasHover,
isPressed: isPressed
}, _this2.props), resolvedRoles);
return React.createElement(
Element,
_extends$1({}, linkProps, otherProps, {
className: cx(css(styles), className),
onBlur: handleBlur,
onFocus: handleFocus,
onMouseDown: handleMouseDown,
onMouseEnter: handleMouseEnter,
onMouseLeave: handleMouseLeave,
onMouseUp: handleMouseUp,
onClick: onClick
}),
children
);
}
Element,
_extends$1({}, linkProps, otherProps, {
className: cx(css(styles), className),
onBlur: handleBlur,
onFocus: handleFocus,
onMouseDown: handleMouseDown,
onMouseEnter: handleMouseEnter,
onMouseLeave: handleMouseLeave,
onMouseUp: handleMouseUp,
onClick: onClick
}),
children
);

@@ -1741,6 +1717,6 @@ }

}
}]);
);
};
return TextLink;
}(Component);
TextLink.displayName = "TextLink";

@@ -1806,3 +1782,3 @@ TextLink.propTypes = {

"required": false,
"description": "The href to link to. Note that this was previously 'href'\n in the version distributed with hig-react."
"description": "The href to link to. Note that this was previously 'href'\n in the version distributed with hig-react."
},

@@ -1809,0 +1785,0 @@ "onClick": {

@@ -7,4 +7,3 @@ 'use strict';

var React = require('react');
var React__default = _interopDefault(React);
var React = _interopDefault(require('react'));
var PropTypes = _interopDefault(require('prop-types'));

@@ -1651,95 +1650,71 @@ var ThemeContext = _interopDefault(require('@hig/theme-context'));

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var TextLink = function TextLink(props) {
var children = props.children,
link = props.link,
target = props.target,
onClick = props.onClick,
onBlur = props.onBlur,
onFocus = props.onFocus,
onMouseUp = props.onMouseUp,
onMouseDown = props.onMouseDown,
onMouseLeave = props.onMouseLeave,
onMouseEnter = props.onMouseEnter,
otherProps = _objectWithoutProperties(props, ["children", "link", "target", "onClick", "onBlur", "onFocus", "onMouseUp", "onMouseDown", "onMouseLeave", "onMouseEnter"]);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var className = otherProps.className;
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Element = link ? "a" : "span";
var linkProps = link ? {
href: link,
target: target
} : { role: "button" };
var TextLink = function (_Component) {
_inherits(TextLink, _Component);
return React.createElement(
ThemeContext.Consumer,
null,
function (_ref) {
var resolvedRoles = _ref.resolvedRoles;
return React.createElement(
behaviors.ControlBehavior,
{
onBlur: onBlur,
onFocus: onFocus,
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onMouseUp: onMouseUp
},
function (_ref2) {
var hasFocus = _ref2.hasFocus,
hasHover = _ref2.hasHover,
isPressed = _ref2.isPressed,
handleBlur = _ref2.onBlur,
handleFocus = _ref2.onFocus,
handleMouseDown = _ref2.onMouseDown,
handleMouseEnter = _ref2.onMouseEnter,
handleMouseLeave = _ref2.onMouseLeave,
handleMouseUp = _ref2.onMouseUp;
var customStylesheet = props.stylesheet;
function TextLink() {
_classCallCheck(this, TextLink);
return _possibleConstructorReturn(this, (TextLink.__proto__ || Object.getPrototypeOf(TextLink)).apply(this, arguments));
}
_createClass(TextLink, [{
key: "render",
value: function render() {
var _this2 = this;
var _props = this.props,
children = _props.children,
link = _props.link,
target = _props.target,
onClick = _props.onClick,
onBlur = _props.onBlur,
onFocus = _props.onFocus,
onMouseUp = _props.onMouseUp,
onMouseDown = _props.onMouseDown,
onMouseLeave = _props.onMouseLeave,
onMouseEnter = _props.onMouseEnter,
otherProps = _objectWithoutProperties(_props, ["children", "link", "target", "onClick", "onBlur", "onFocus", "onMouseUp", "onMouseDown", "onMouseLeave", "onMouseEnter"]);
var className = otherProps.className;
var Element = link ? "a" : "span";
var linkProps = link ? {
href: link,
target: target
} : { role: "button" };
return React__default.createElement(
ThemeContext.Consumer,
null,
function (_ref) {
var resolvedRoles = _ref.resolvedRoles;
return React__default.createElement(
behaviors.ControlBehavior,
{
onBlur: onBlur,
onFocus: onFocus,
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onMouseUp: onMouseUp
},
function (_ref2) {
var hasFocus = _ref2.hasFocus,
hasHover = _ref2.hasHover,
isPressed = _ref2.isPressed,
handleBlur = _ref2.onBlur,
handleFocus = _ref2.onFocus,
handleMouseDown = _ref2.onMouseDown,
handleMouseEnter = _ref2.onMouseEnter,
handleMouseLeave = _ref2.onMouseLeave,
handleMouseUp = _ref2.onMouseUp;
var customStylesheet = _this2.props.stylesheet;
var styles = stylesheet(_extends$1({
stylesheet: customStylesheet,
hasFocus: hasFocus,
hasHover: hasHover,
isPressed: isPressed
}, _this2.props), resolvedRoles);
return React__default.createElement(
Element,
_extends$1({}, linkProps, otherProps, {
className: cx(css(styles), className),
onBlur: handleBlur,
onFocus: handleFocus,
onMouseDown: handleMouseDown,
onMouseEnter: handleMouseEnter,
onMouseLeave: handleMouseLeave,
onMouseUp: handleMouseUp,
onClick: onClick
}),
children
);
}
var styles = stylesheet(_extends$1({
stylesheet: customStylesheet,
hasFocus: hasFocus,
hasHover: hasHover,
isPressed: isPressed
}, props), resolvedRoles);
return React.createElement(
Element,
_extends$1({}, linkProps, otherProps, {
className: cx(css(styles), className),
onBlur: handleBlur,
onFocus: handleFocus,
onMouseDown: handleMouseDown,
onMouseEnter: handleMouseEnter,
onMouseLeave: handleMouseLeave,
onMouseUp: handleMouseUp,
onClick: onClick
}),
children
);

@@ -1749,6 +1724,6 @@ }

}
}]);
);
};
return TextLink;
}(React.Component);
TextLink.displayName = "TextLink";

@@ -1814,3 +1789,3 @@ TextLink.propTypes = {

"required": false,
"description": "The href to link to. Note that this was previously 'href'\n in the version distributed with hig-react."
"description": "The href to link to. Note that this was previously 'href'\n in the version distributed with hig-react."
},

@@ -1817,0 +1792,0 @@ "onClick": {

@@ -0,1 +1,8 @@

# [@hig/text-link-v1.2.1](https://github.com/Autodesk/hig/compare/@hig/text-link@1.2.0...@hig/text-link@1.2.1) (2022-01-12)
### Bug Fixes
* react v. in peerDependencies instead of dependencies ([4701332](https://github.com/Autodesk/hig/commit/4701332))
# [@hig/text-link-v1.2.0](https://github.com/Autodesk/hig/compare/@hig/text-link@1.1.1...@hig/text-link@1.2.0) (2020-09-09)

@@ -2,0 +9,0 @@

{
"name": "@hig/text-link",
"version": "1.2.0",
"version": "1.2.1",
"description": "HIG Text Link",

@@ -25,5 +25,5 @@ "author": "Autodesk Inc.",

"peerDependencies": {
"@hig/theme-context": "^3.0.0",
"@hig/theme-data": "^2.17.0",
"react": "^15.4.1 || ^16.3.2"
"@hig/theme-context": "^3.0.2",
"@hig/theme-data": "^2.22.0",
"react": "^17.0.0"
},

@@ -30,0 +30,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc