@leafygreen-ui/inline-definition
Advanced tools
Comparing version
# @leafygreen-ui/inline-definition | ||
## 1.0.3 | ||
### Patch Changes | ||
- 0dc3907e: Updates definition to support `React.ReactNode` not just `string` | ||
- Updated dependencies [001a277f] | ||
- Updated dependencies [d0dac1a0] | ||
- @leafygreen-ui/typography@5.0.0 | ||
## 1.0.2 | ||
@@ -4,0 +13,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("prop-types"),require("@leafygreen-ui/tooltip"),require("@leafygreen-ui/typography"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette"));else if("function"==typeof define&&define.amd)define(["react","prop-types","@leafygreen-ui/tooltip","@leafygreen-ui/typography","@leafygreen-ui/emotion","@leafygreen-ui/palette"],r);else{var t="object"==typeof exports?r(require("react"),require("prop-types"),require("@leafygreen-ui/tooltip"),require("@leafygreen-ui/typography"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette")):r(e.react,e["prop-types"],e["@leafygreen-ui/tooltip"],e["@leafygreen-ui/typography"],e["@leafygreen-ui/emotion"],e["@leafygreen-ui/palette"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}("undefined"!=typeof self?self:this,(function(e,r,t,n,o,i){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o.default}});var n,o=(n=t(1))&&n.__esModule?n:{default:n}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=f(t(2)),o=f(t(3)),i=f(t(4)),u=t(5),a=t(6),l=t(7);function f(e){return e&&e.__esModule?e:{default:e}}function c(){return(c=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function p(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function s(){var e=y(["\n max-width: 240px;\n"]);return s=function(){return e},e}function d(){var e=y(["\n background-repeat: repeat-x;\n background-position: center bottom;\n background-size: 3px 2px;\n\n background-image: radial-gradient(\n circle closest-side,\n "," 75%,\n transparent 25%\n );\n\n &:hover {\n background-image: radial-gradient(\n circle closest-side,\n currentColor 75%,\n transparent 25%\n );\n }\n"]);return d=function(){return e},e}function y(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var g=(0,a.css)(d(),l.uiColors.gray.dark1),b=(0,a.css)(s());function m(e){var r=e.definition,t=e.children,o=e.className,l=p(e,["definition","children","className"]);return n.default.createElement(i.default,c({justify:"middle",spacing:5},l,{trigger:n.default.createElement("span",{className:(0,a.cx)(g,o)},t)}),n.default.createElement(u.Body,{className:b},r))}m.displayName="InlineDefinition",m.propTypes={definition:o.default.string.isRequired,className:o.default.string,children:o.default.node};var v=m;r.default=v},function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r){e.exports=t},function(e,r){e.exports=n},function(e,r){e.exports=o},function(e,r){e.exports=i}])})); | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("prop-types"),require("@leafygreen-ui/tooltip"),require("@leafygreen-ui/typography"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette"));else if("function"==typeof define&&define.amd)define(["react","prop-types","@leafygreen-ui/tooltip","@leafygreen-ui/typography","@leafygreen-ui/emotion","@leafygreen-ui/palette"],r);else{var t="object"==typeof exports?r(require("react"),require("prop-types"),require("@leafygreen-ui/tooltip"),require("@leafygreen-ui/typography"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette")):r(e.react,e["prop-types"],e["@leafygreen-ui/tooltip"],e["@leafygreen-ui/typography"],e["@leafygreen-ui/emotion"],e["@leafygreen-ui/palette"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}("undefined"!=typeof self?self:this,(function(e,r,t,n,o,i){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o.default}});var n,o=(n=t(1))&&n.__esModule?n:{default:n}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=f(t(2)),o=f(t(3)),i=f(t(4)),u=t(5),a=t(6),l=t(7);function f(e){return e&&e.__esModule?e:{default:e}}function c(){return(c=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function p(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function s(){var e=y(["\n max-width: 360px;\n"]);return s=function(){return e},e}function d(){var e=y(["\n background-repeat: repeat-x;\n background-position: center bottom;\n background-size: 3px 2px;\n\n background-image: radial-gradient(\n circle closest-side,\n "," 75%,\n transparent 25%\n );\n\n &:hover {\n background-image: radial-gradient(\n circle closest-side,\n currentColor 75%,\n transparent 25%\n );\n }\n"]);return d=function(){return e},e}function y(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var g=(0,a.css)(d(),l.uiColors.gray.dark1),b=(0,a.css)(s());function m(e){var r=e.definition,t=e.children,o=e.className,l=p(e,["definition","children","className"]);return n.default.createElement(i.default,c({justify:"middle",spacing:5},l,{trigger:n.default.createElement("span",{className:(0,a.cx)(g,o)},t)}),n.default.createElement(u.Body,{className:b},r))}m.displayName="InlineDefinition",m.propTypes={definition:o.default.node.isRequired,className:o.default.string,children:o.default.node};var v=m;r.default=v},function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r){e.exports=t},function(e,r){e.exports=n},function(e,r){e.exports=o},function(e,r){e.exports=i}])})); | ||
//# sourceMappingURL=index.bundle.js.map |
@@ -1,6 +0,6 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { TooltipProps } from '@leafygreen-ui/tooltip'; | ||
declare type InlineDefinitionProps = Partial<TooltipProps> & { | ||
definition: string; | ||
definition: React.ReactNode; | ||
}; | ||
@@ -11,3 +11,3 @@ declare function InlineDefinition({ definition, children, className, ...tooltipProps }: InlineDefinitionProps): JSX.Element; | ||
var propTypes: { | ||
definition: PropTypes.Validator<string>; | ||
definition: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; | ||
className: PropTypes.Requireable<string>; | ||
@@ -14,0 +14,0 @@ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; |
@@ -34,3 +34,3 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
var underline = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-repeat: repeat-x;\n background-position: center bottom;\n background-size: 3px 2px;\n\n background-image: radial-gradient(\n circle closest-side,\n ", " 75%,\n transparent 25%\n );\n\n &:hover {\n background-image: radial-gradient(\n circle closest-side,\n currentColor 75%,\n transparent 25%\n );\n }\n"], ["\n background-repeat: repeat-x;\n background-position: center bottom;\n background-size: 3px 2px;\n\n background-image: radial-gradient(\n circle closest-side,\n ", " 75%,\n transparent 25%\n );\n\n &:hover {\n background-image: radial-gradient(\n circle closest-side,\n currentColor 75%,\n transparent 25%\n );\n }\n"])), uiColors.gray.dark1); | ||
var maxWidth = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n max-width: 240px;\n"], ["\n max-width: 240px;\n"]))); | ||
var maxWidth = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n max-width: 360px;\n"], ["\n max-width: 360px;\n"]))); | ||
function InlineDefinition(_a) { | ||
@@ -43,3 +43,3 @@ var definition = _a.definition, children = _a.children, className = _a.className, tooltipProps = __rest(_a, ["definition", "children", "className"]); | ||
InlineDefinition.propTypes = { | ||
definition: PropTypes.string.isRequired, | ||
definition: PropTypes.node.isRequired, | ||
className: PropTypes.string, | ||
@@ -46,0 +46,0 @@ children: PropTypes.node, |
{ | ||
"name": "@leafygreen-ui/inline-definition", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "leafyGreen UI Kit Inline Definition", | ||
"main": "./dist/index.bundle.js", | ||
"types": "./dist/index.d.ts", | ||
"typesVersions": { | ||
"<3.9": { | ||
"*": [ | ||
"ts3.4/*" | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
@@ -16,3 +23,3 @@ "build": "../../node_modules/.bin/webpack --config ../../webpack.config.js" | ||
"@leafygreen-ui/lib": "^5.1.1", | ||
"@leafygreen-ui/typography": "^4.3.0", | ||
"@leafygreen-ui/typography": "^5.0.0", | ||
"@leafygreen-ui/palette": "^2.0.2", | ||
@@ -19,0 +26,0 @@ "@leafygreen-ui/tooltip": "^5.0.0", |
@@ -55,8 +55,8 @@ # Inline Definition | ||
| Prop | Type | Description | Default | | ||
| ------------ | --------------------- | ------------------------------------------------------------ | ------- | | ||
| `definition` | **Required** `string` | Content that describes the term. Will appear inside Tooltip. | | | ||
| `children` | `string` | Text that will appear underlined | | | ||
| `className` | `string` | className will be applied to the trigger element | | | ||
| Prop | Type | Description | Default | | ||
| ------------ | ------------------------------ | ------------------------------------------------------------ | ------- | | ||
| `definition` | **Required** `React.ReactNode` | Content that describes the term. Will appear inside Tooltip. | | | ||
| `children` | `string` | Text that will appear underlined | | | ||
| `className` | `string` | className will be applied to the trigger element | | | ||
_Any other properties will be spread on the `Tooltip` element_ |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
324101
0.16%238
0.85%+ Added
- Removed