@entur/tooltip
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -6,2 +6,8 @@ # Change Log | ||
## [1.0.2](https://bitbucket.org/enturas/design-system/compare/@entur/tooltip@1.0.1...@entur/tooltip@1.0.2) (2019-11-14) | ||
### Bug Fixes | ||
- **css classnames:** fixing naming collisions with CSS classes ([a93ca43](https://bitbucket.org/enturas/design-system/commits/a93ca435d3a01d61d8f02694a672686b9e943a66)) | ||
## [1.0.1](https://bitbucket.org/enturas/design-system/compare/@entur/tooltip@1.0.0...@entur/tooltip@1.0.1) (2019-10-30) | ||
@@ -8,0 +14,0 @@ |
@@ -5,2 +5,4 @@ 'use strict'; | ||
var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray')); | ||
var _objectWithoutProperties = _interopDefault(require('@babel/runtime/helpers/objectWithoutProperties')); | ||
var React = require('react'); | ||
@@ -10,17 +12,2 @@ var React__default = _interopDefault(React); | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
var Tooltip = function Tooltip(_ref) { | ||
@@ -31,10 +18,11 @@ var placement = _ref.placement, | ||
className = _ref.className, | ||
rest = _objectWithoutPropertiesLoose(_ref, ["placement", "content", "children", "className"]); | ||
rest = _objectWithoutProperties(_ref, ["placement", "content", "children", "className"]); | ||
var _useState = React.useState(false), | ||
showTooltip = _useState[0], | ||
setShowTooltip = _useState[1]; | ||
_useState2 = _slicedToArray(_useState, 2), | ||
showTooltip = _useState2[0], | ||
setShowTooltip = _useState2[1]; | ||
return React__default.createElement("div", { | ||
className: "entur-tooltip-wrapper", | ||
className: "eds-tooltip-wrapper", | ||
onMouseLeave: function onMouseLeave() { | ||
@@ -44,7 +32,7 @@ return setShowTooltip(false); | ||
}, React__default.createElement("div", Object.assign({ | ||
className: classNames('entur-tooltip', className, "entur-tooltip--" + placement), | ||
className: classNames('eds-tooltip', className, "eds-tooltip--".concat(placement)), | ||
role: "tooltip", | ||
"aria-hidden": !showTooltip | ||
}, rest), content), React__default.createElement("span", { | ||
className: "entur-tooltip--trigger", | ||
className: "eds-tooltip--trigger", | ||
onMouseOver: function onMouseOver() { | ||
@@ -51,0 +39,0 @@ return setShowTooltip(true); |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=e(require("classnames"));exports.Tooltip=function(e){var o=e.placement,a=e.content,u=e.children,c=e.className,i=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["placement","content","children","className"]),l=t.useState(!1),s=l[0],f=l[1];return n.createElement("div",{className:"entur-tooltip-wrapper",onMouseLeave:function(){return f(!1)}},n.createElement("div",Object.assign({className:r("entur-tooltip",c,"entur-tooltip--"+o),role:"tooltip","aria-hidden":!s},i),a),n.createElement("span",{className:"entur-tooltip--trigger",onMouseOver:function(){return f(!0)},onFocus:function(){return f(!0)},onBlur:function(){return f(!1)},"aria-describedby":a},u))}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@babel/runtime/helpers/slicedToArray")),r=e(require("@babel/runtime/helpers/objectWithoutProperties")),n=require("react"),o=e(n),a=e(require("classnames"));exports.Tooltip=function(e){var i=e.placement,s=e.content,c=e.children,l=e.className,u=r(e,["placement","content","children","className"]),p=n.useState(!1),d=t(p,2),m=d[0],b=d[1];return o.createElement("div",{className:"eds-tooltip-wrapper",onMouseLeave:function(){return b(!1)}},o.createElement("div",Object.assign({className:a("eds-tooltip",l,"eds-tooltip--".concat(i)),role:"tooltip","aria-hidden":!m},u),s),o.createElement("span",{className:"eds-tooltip--trigger",onMouseOver:function(){return b(!0)},onFocus:function(){return b(!0)},onBlur:function(){return b(!1)},"aria-describedby":s},c))}; | ||
//# sourceMappingURL=tooltip.cjs.production.min.js.map |
@@ -0,19 +1,6 @@ | ||
import _slicedToArray from '@babel/runtime/helpers/slicedToArray'; | ||
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties'; | ||
import React, { useState } from 'react'; | ||
import classNames from 'classnames'; | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
var Tooltip = function Tooltip(_ref) { | ||
@@ -24,10 +11,11 @@ var placement = _ref.placement, | ||
className = _ref.className, | ||
rest = _objectWithoutPropertiesLoose(_ref, ["placement", "content", "children", "className"]); | ||
rest = _objectWithoutProperties(_ref, ["placement", "content", "children", "className"]); | ||
var _useState = useState(false), | ||
showTooltip = _useState[0], | ||
setShowTooltip = _useState[1]; | ||
_useState2 = _slicedToArray(_useState, 2), | ||
showTooltip = _useState2[0], | ||
setShowTooltip = _useState2[1]; | ||
return React.createElement("div", { | ||
className: "entur-tooltip-wrapper", | ||
className: "eds-tooltip-wrapper", | ||
onMouseLeave: function onMouseLeave() { | ||
@@ -37,7 +25,7 @@ return setShowTooltip(false); | ||
}, React.createElement("div", Object.assign({ | ||
className: classNames('entur-tooltip', className, "entur-tooltip--" + placement), | ||
className: classNames('eds-tooltip', className, "eds-tooltip--".concat(placement)), | ||
role: "tooltip", | ||
"aria-hidden": !showTooltip | ||
}, rest), content), React.createElement("span", { | ||
className: "entur-tooltip--trigger", | ||
className: "eds-tooltip--trigger", | ||
onMouseOver: function onMouseOver() { | ||
@@ -44,0 +32,0 @@ return setShowTooltip(true); |
{ | ||
"name": "@entur/tooltip", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "EUPL-1.2", | ||
@@ -30,5 +30,5 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@entur/tokens": "^1.0.0" | ||
"@entur/tokens": "^1.0.1" | ||
}, | ||
"gitHead": "33a589c66b9169353060466237d3e69972b7a726" | ||
"gitHead": "f474568d4572a715c5800781e34d42999d7c22ba" | ||
} |
@@ -5,3 +5,3 @@ # Tooltip | ||
> 💡 Looking for the [documentation](https://entur-design-system.firebaseapp.com/komponenter/tooltip)? | ||
> 💡 Looking for the [documentation](https://design.entur.org/komponenter/tooltip)? | ||
@@ -24,2 +24,2 @@ ## Installation | ||
Please refer to the [documentation](https://entur-design-system.firebaseapp.com/komponenter/tooltip) for usage information. | ||
Please refer to the [documentation](https://design.entur.org/komponenter/tooltip) for usage information. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
36408
224