@hig/text-link
Advanced tools
Comparing version 0.1.0-alpha.e9f6f0b1 to 0.1.0-alpha.f372de37
@@ -1,5 +0,311 @@ | ||
import { TextLink } from 'hig-react'; | ||
import PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
import cx from 'classnames'; | ||
TextLink.displayName = "TextLink"; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var HIGLightTheme = { | ||
themeId: "hig-light", | ||
themeClass: "hig--light-theme" | ||
}; | ||
var themeContextShape = { | ||
/** Uniquely identifies a theme */ | ||
themeId: PropTypes.string, | ||
/** A class added to each themed element */ | ||
themeClass: PropTypes.string | ||
}; | ||
var _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i];for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
}return target; | ||
}; | ||
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 _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _possibleConstructorReturn(self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
}return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; | ||
} | ||
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 === 'undefined' ? 'undefined' : _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 Provider = function (_Component) { | ||
_inherits(Provider, _Component); | ||
function Provider() { | ||
_classCallCheck(this, Provider); | ||
return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments)); | ||
} | ||
_createClass(Provider, [{ | ||
key: "getChildContext", | ||
value: function getChildContext() { | ||
return _extends({}, this.props.value); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
return this.props.children; | ||
} | ||
}]); | ||
return Provider; | ||
}(Component); | ||
Provider.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
value: PropTypes.shape(themeContextShape), | ||
/** Content within will be provided with the passed theme */ | ||
children: PropTypes.node.isRequired | ||
}; | ||
Provider.childContextTypes = themeContextShape; | ||
Provider.defaultProps = { | ||
value: HIGLightTheme | ||
}; | ||
var _createClass$1 = 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 _classCallCheck$1(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _possibleConstructorReturn$1(self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
}return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits$1(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _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 Consumer = function (_Component) { | ||
_inherits$1(Consumer, _Component); | ||
function Consumer() { | ||
_classCallCheck$1(this, Consumer); | ||
return _possibleConstructorReturn$1(this, (Consumer.__proto__ || Object.getPrototypeOf(Consumer)).apply(this, arguments)); | ||
} | ||
_createClass$1(Consumer, [{ | ||
key: "render", | ||
value: function render() { | ||
var theme = this.context.themeId && this.context.themeClass ? this.context : HIGLightTheme; | ||
return this.props.children(theme); | ||
} | ||
}]); | ||
return Consumer; | ||
}(Component); | ||
Consumer.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
children: PropTypes.func | ||
}; | ||
Consumer.contextTypes = themeContextShape; | ||
Consumer.__docgenInfo = { | ||
"description": "", | ||
"displayName": "Consumer", | ||
"props": { | ||
"children": { | ||
"type": { | ||
"name": "func" | ||
}, | ||
"required": false, | ||
"description": "A theme provided to the consumer within" | ||
} | ||
} | ||
}; | ||
var index = { Provider: Provider, Consumer: Consumer }; | ||
var targets = Object.freeze({ | ||
SELF: "_self", | ||
BLANK: "_blank", | ||
PARENT: "_parent", | ||
TOP: "_top" | ||
}); | ||
var availableTargets = Object.freeze(Object.values(targets)); | ||
/** @type {Object.<string, string>} */ | ||
var types = Object.freeze({ | ||
PRIMARY: "primary", | ||
SECONDARY: "secondary" | ||
}); | ||
/** @type {string[]} */ | ||
var AVAILABLE_TYPES = Object.freeze(Object.values(types)); | ||
/** @type {Object.<string, string>} */ | ||
var classNames = Object.freeze({ | ||
wrapper: "hig__text-link", | ||
wrapperPrimary: "hig__text-link--primary", | ||
wrapperSecondary: "hig__text-link--secondary" | ||
}); | ||
var _createClass$2 = 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; }; }(); | ||
var _wrapperModifiersByTy; | ||
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn$2(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; } | ||
function _inherits$2(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; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var wrapperModifiersByType = (_wrapperModifiersByTy = {}, _defineProperty(_wrapperModifiersByTy, types.PRIMARY, classNames.wrapperPrimary), _defineProperty(_wrapperModifiersByTy, types.SECONDARY, classNames.wrapperSecondary), _wrapperModifiersByTy); | ||
var TextLink = function (_Component) { | ||
_inherits$2(TextLink, _Component); | ||
function TextLink() { | ||
_classCallCheck$2(this, TextLink); | ||
return _possibleConstructorReturn$2(this, (TextLink.__proto__ || Object.getPrototypeOf(TextLink)).apply(this, arguments)); | ||
} | ||
_createClass$2(TextLink, [{ | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
children = _props.children, | ||
link = _props.link, | ||
onClick = _props.onClick, | ||
target = _props.target, | ||
type = _props.type; | ||
var linkClasses = function linkClasses(themeClass) { | ||
return cx(themeClass, classNames.wrapper, wrapperModifiersByType[type]); | ||
}; | ||
return React.createElement( | ||
index.Consumer, | ||
null, | ||
function (_ref) { | ||
var themeClass = _ref.themeClass; | ||
return React.createElement( | ||
"a", | ||
{ | ||
href: link, | ||
onClick: onClick, | ||
className: linkClasses(themeClass), | ||
target: target | ||
}, | ||
children | ||
); | ||
} | ||
); | ||
} | ||
}]); | ||
return TextLink; | ||
}(Component); | ||
TextLink.propTypes = { | ||
/** Text content of the link */ | ||
children: PropTypes.string, | ||
/** The href to link to. Note that this was previously 'href' in the version distributed with hig-react. */ | ||
link: PropTypes.string.isRequired, | ||
/** Called when link is clicked */ | ||
onClick: PropTypes.func, | ||
/** Specify the anchor tag's target */ | ||
target: PropTypes.oneOf(availableTargets), | ||
/** Indicates the style of link */ | ||
type: PropTypes.oneOf(AVAILABLE_TYPES) | ||
}; | ||
TextLink.defaultProps = { | ||
type: types.PRIMARY | ||
}; | ||
TextLink.__docgenInfo = { | ||
"description": "", | ||
"displayName": "TextLink", | ||
"props": { | ||
"children": { | ||
"type": { | ||
"name": "string" | ||
}, | ||
"required": false, | ||
"description": "Text content of the link" | ||
}, | ||
"link": { | ||
"type": { | ||
"name": "string" | ||
}, | ||
"required": true, | ||
"description": "The href to link to. Note that this was previously 'href' in the version distributed with hig-react." | ||
}, | ||
"onClick": { | ||
"type": { | ||
"name": "func" | ||
}, | ||
"required": false, | ||
"description": "Called when link is clicked" | ||
}, | ||
"target": { | ||
"type": { | ||
"name": "enum", | ||
"computed": true, | ||
"value": "availableTargets" | ||
}, | ||
"required": false, | ||
"description": "Specify the anchor tag's target" | ||
}, | ||
"type": { | ||
"type": { | ||
"name": "enum", | ||
"computed": true, | ||
"value": "AVAILABLE_TYPES" | ||
}, | ||
"required": false, | ||
"description": "Indicates the style of link", | ||
"defaultValue": { | ||
"value": "types.PRIMARY", | ||
"computed": true | ||
} | ||
} | ||
} | ||
}; | ||
export default TextLink; |
'use strict'; | ||
var higReact = require('hig-react'); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
higReact.TextLink.displayName = "TextLink"; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
module.exports = higReact.TextLink; | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var cx = _interopDefault(require('classnames')); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var HIGLightTheme = { | ||
themeId: "hig-light", | ||
themeClass: "hig--light-theme" | ||
}; | ||
var themeContextShape = { | ||
/** Uniquely identifies a theme */ | ||
themeId: PropTypes.string, | ||
/** A class added to each themed element */ | ||
themeClass: PropTypes.string | ||
}; | ||
var _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i];for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
}return target; | ||
}; | ||
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 _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _possibleConstructorReturn(self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
}return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; | ||
} | ||
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 === 'undefined' ? 'undefined' : _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 Provider = function (_Component) { | ||
_inherits(Provider, _Component); | ||
function Provider() { | ||
_classCallCheck(this, Provider); | ||
return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments)); | ||
} | ||
_createClass(Provider, [{ | ||
key: "getChildContext", | ||
value: function getChildContext() { | ||
return _extends({}, this.props.value); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
return this.props.children; | ||
} | ||
}]); | ||
return Provider; | ||
}(React.Component); | ||
Provider.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
value: PropTypes.shape(themeContextShape), | ||
/** Content within will be provided with the passed theme */ | ||
children: PropTypes.node.isRequired | ||
}; | ||
Provider.childContextTypes = themeContextShape; | ||
Provider.defaultProps = { | ||
value: HIGLightTheme | ||
}; | ||
var _createClass$1 = 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 _classCallCheck$1(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _possibleConstructorReturn$1(self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
}return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits$1(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _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 Consumer = function (_Component) { | ||
_inherits$1(Consumer, _Component); | ||
function Consumer() { | ||
_classCallCheck$1(this, Consumer); | ||
return _possibleConstructorReturn$1(this, (Consumer.__proto__ || Object.getPrototypeOf(Consumer)).apply(this, arguments)); | ||
} | ||
_createClass$1(Consumer, [{ | ||
key: "render", | ||
value: function render() { | ||
var theme = this.context.themeId && this.context.themeClass ? this.context : HIGLightTheme; | ||
return this.props.children(theme); | ||
} | ||
}]); | ||
return Consumer; | ||
}(React.Component); | ||
Consumer.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
children: PropTypes.func | ||
}; | ||
Consumer.contextTypes = themeContextShape; | ||
Consumer.__docgenInfo = { | ||
"description": "", | ||
"displayName": "Consumer", | ||
"props": { | ||
"children": { | ||
"type": { | ||
"name": "func" | ||
}, | ||
"required": false, | ||
"description": "A theme provided to the consumer within" | ||
} | ||
} | ||
}; | ||
var index = { Provider: Provider, Consumer: Consumer }; | ||
var targets = Object.freeze({ | ||
SELF: "_self", | ||
BLANK: "_blank", | ||
PARENT: "_parent", | ||
TOP: "_top" | ||
}); | ||
var availableTargets = Object.freeze(Object.values(targets)); | ||
/** @type {Object.<string, string>} */ | ||
var types = Object.freeze({ | ||
PRIMARY: "primary", | ||
SECONDARY: "secondary" | ||
}); | ||
/** @type {string[]} */ | ||
var AVAILABLE_TYPES = Object.freeze(Object.values(types)); | ||
/** @type {Object.<string, string>} */ | ||
var classNames = Object.freeze({ | ||
wrapper: "hig__text-link", | ||
wrapperPrimary: "hig__text-link--primary", | ||
wrapperSecondary: "hig__text-link--secondary" | ||
}); | ||
var _createClass$2 = 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; }; }(); | ||
var _wrapperModifiersByTy; | ||
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn$2(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; } | ||
function _inherits$2(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; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var wrapperModifiersByType = (_wrapperModifiersByTy = {}, _defineProperty(_wrapperModifiersByTy, types.PRIMARY, classNames.wrapperPrimary), _defineProperty(_wrapperModifiersByTy, types.SECONDARY, classNames.wrapperSecondary), _wrapperModifiersByTy); | ||
var TextLink = function (_Component) { | ||
_inherits$2(TextLink, _Component); | ||
function TextLink() { | ||
_classCallCheck$2(this, TextLink); | ||
return _possibleConstructorReturn$2(this, (TextLink.__proto__ || Object.getPrototypeOf(TextLink)).apply(this, arguments)); | ||
} | ||
_createClass$2(TextLink, [{ | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
children = _props.children, | ||
link = _props.link, | ||
onClick = _props.onClick, | ||
target = _props.target, | ||
type = _props.type; | ||
var linkClasses = function linkClasses(themeClass) { | ||
return cx(themeClass, classNames.wrapper, wrapperModifiersByType[type]); | ||
}; | ||
return React__default.createElement( | ||
index.Consumer, | ||
null, | ||
function (_ref) { | ||
var themeClass = _ref.themeClass; | ||
return React__default.createElement( | ||
"a", | ||
{ | ||
href: link, | ||
onClick: onClick, | ||
className: linkClasses(themeClass), | ||
target: target | ||
}, | ||
children | ||
); | ||
} | ||
); | ||
} | ||
}]); | ||
return TextLink; | ||
}(React.Component); | ||
TextLink.propTypes = { | ||
/** Text content of the link */ | ||
children: PropTypes.string, | ||
/** The href to link to. Note that this was previously 'href' in the version distributed with hig-react. */ | ||
link: PropTypes.string.isRequired, | ||
/** Called when link is clicked */ | ||
onClick: PropTypes.func, | ||
/** Specify the anchor tag's target */ | ||
target: PropTypes.oneOf(availableTargets), | ||
/** Indicates the style of link */ | ||
type: PropTypes.oneOf(AVAILABLE_TYPES) | ||
}; | ||
TextLink.defaultProps = { | ||
type: types.PRIMARY | ||
}; | ||
TextLink.__docgenInfo = { | ||
"description": "", | ||
"displayName": "TextLink", | ||
"props": { | ||
"children": { | ||
"type": { | ||
"name": "string" | ||
}, | ||
"required": false, | ||
"description": "Text content of the link" | ||
}, | ||
"link": { | ||
"type": { | ||
"name": "string" | ||
}, | ||
"required": true, | ||
"description": "The href to link to. Note that this was previously 'href' in the version distributed with hig-react." | ||
}, | ||
"onClick": { | ||
"type": { | ||
"name": "func" | ||
}, | ||
"required": false, | ||
"description": "Called when link is clicked" | ||
}, | ||
"target": { | ||
"type": { | ||
"name": "enum", | ||
"computed": true, | ||
"value": "availableTargets" | ||
}, | ||
"required": false, | ||
"description": "Specify the anchor tag's target" | ||
}, | ||
"type": { | ||
"type": { | ||
"name": "enum", | ||
"computed": true, | ||
"value": "AVAILABLE_TYPES" | ||
}, | ||
"required": false, | ||
"description": "Indicates the style of link", | ||
"defaultValue": { | ||
"value": "types.PRIMARY", | ||
"computed": true | ||
} | ||
} | ||
} | ||
}; | ||
exports.default = TextLink; |
{ | ||
"name": "@hig/text-link", | ||
"version": "0.1.0-alpha.e9f6f0b1", | ||
"version": "0.1.0-alpha.f372de37", | ||
"description": "HIG Text Link", | ||
@@ -17,4 +17,4 @@ "author": "Autodesk Inc.", | ||
"dependencies": { | ||
"@hig/themes": "0.1.0-alpha.f372de37", | ||
"classnames": "^2.2.5", | ||
"hig-react": "0.29.0-alpha.e9f6f0b1", | ||
"react-lifecycles-compat": "^3.0.2" | ||
@@ -27,6 +27,6 @@ }, | ||
"devDependencies": { | ||
"@hig/babel-preset": "0.2.0-alpha.e9f6f0b1", | ||
"@hig/eslint-config": "0.2.0-alpha.e9f6f0b1", | ||
"@hig/scripts": "0.2.0-alpha.e9f6f0b1", | ||
"@hig/styles": "0.1.0-alpha.e9f6f0b1" | ||
"@hig/babel-preset": "0.2.0-alpha.f372de37", | ||
"@hig/eslint-config": "0.2.0-alpha.f372de37", | ||
"@hig/scripts": "0.2.0-alpha.f372de37", | ||
"@hig/styles": "0.2.0-alpha.f372de37" | ||
}, | ||
@@ -33,0 +33,0 @@ "scripts": { |
@@ -23,6 +23,5 @@ # Text Link | ||
```jsx | ||
<TextLink | ||
href="https://github.com/Autodesk/hig" | ||
text="This is a primary text link" | ||
/> | ||
<TextLink link="https://github.com/Autodesk/hig"> | ||
This is a primary text link | ||
</TextLink> | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26066
592
27
1
+ Added@hig/themes@0.1.0-alpha.f372de37(transitive)
- Removedhig-react@0.29.0-alpha.e9f6f0b1
- Removed@babel/runtime@7.26.0(transitive)
- Removed@hig/icon@0.1.0-alpha.e9f6f0b1(transitive)
- Removed@hig/icon-button@0.1.0-alpha.e9f6f0b1(transitive)
- Removed@hig/icons@0.1.0-alpha.e9f6f0b1(transitive)
- Removed@hig/typography@0.1.0-alpha.e9f6f0b1(transitive)
- Removedasap@2.0.6(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedcreate-react-class@15.7.0(transitive)
- Removeddom-helpers@3.4.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removedhig-interface@0.2.0-alpha.e9f6f0b1(transitive)
- Removedhig-react@0.29.0-alpha.e9f6f0b1(transitive)
- Removedhig-vanilla@0.2.0-alpha.e9f6f0b1(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedpromise@7.3.1(transitive)
- Removedreact@15.7.018.3.1(transitive)
- Removedreact-dom@15.7.018.3.1(transitive)
- Removedreact-flip-move@3.0.5(transitive)
- Removedreact-transition-group@2.9.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedscheduler@0.23.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedua-parser-js@0.7.39(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)