@tds/core-text
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,129 +8,2 @@ 'use strict'; | ||
var asyncGenerator = function () { | ||
function AwaitValue(value) { | ||
this.value = value; | ||
} | ||
function AsyncGenerator(gen) { | ||
var front, back; | ||
function send(key, arg) { | ||
return new Promise(function (resolve, reject) { | ||
var request = { | ||
key: key, | ||
arg: arg, | ||
resolve: resolve, | ||
reject: reject, | ||
next: null | ||
}; | ||
if (back) { | ||
back = back.next = request; | ||
} else { | ||
front = back = request; | ||
resume(key, arg); | ||
} | ||
}); | ||
} | ||
function resume(key, arg) { | ||
try { | ||
var result = gen[key](arg); | ||
var value = result.value; | ||
if (value instanceof AwaitValue) { | ||
Promise.resolve(value.value).then(function (arg) { | ||
resume("next", arg); | ||
}, function (arg) { | ||
resume("throw", arg); | ||
}); | ||
} else { | ||
settle(result.done ? "return" : "normal", result.value); | ||
} | ||
} catch (err) { | ||
settle("throw", err); | ||
} | ||
} | ||
function settle(type, value) { | ||
switch (type) { | ||
case "return": | ||
front.resolve({ | ||
value: value, | ||
done: true | ||
}); | ||
break; | ||
case "throw": | ||
front.reject(value); | ||
break; | ||
default: | ||
front.resolve({ | ||
value: value, | ||
done: false | ||
}); | ||
break; | ||
} | ||
front = front.next; | ||
if (front) { | ||
resume(front.key, front.arg); | ||
} else { | ||
back = null; | ||
} | ||
} | ||
this._invoke = send; | ||
if (typeof gen.return !== "function") { | ||
this.return = undefined; | ||
} | ||
} | ||
if (typeof Symbol === "function" && Symbol.asyncIterator) { | ||
AsyncGenerator.prototype[Symbol.asyncIterator] = function () { | ||
return this; | ||
}; | ||
} | ||
AsyncGenerator.prototype.next = function (arg) { | ||
return this._invoke("next", arg); | ||
}; | ||
AsyncGenerator.prototype.throw = function (arg) { | ||
return this._invoke("throw", arg); | ||
}; | ||
AsyncGenerator.prototype.return = function (arg) { | ||
return this._invoke("return", arg); | ||
}; | ||
return { | ||
wrap: function (fn) { | ||
return function () { | ||
return new AsyncGenerator(fn.apply(this, arguments)); | ||
}; | ||
}, | ||
await: function (value) { | ||
return new AwaitValue(value); | ||
} | ||
}; | ||
}(); | ||
var _extends = Object.assign || function (target) { | ||
@@ -150,14 +23,2 @@ for (var i = 1; i < arguments.length; i++) { | ||
var objectWithoutProperties = function (obj, keys) { | ||
@@ -192,7 +53,5 @@ var target = {}; | ||
var styles = { "wordBreak": "TDS_Typography-modules__wordBreak___11Xyp", "baseSupSubScripts": "TDS_Typography-modules__baseSupSubScripts___1mG2W", "sup": "TDS_Typography-modules__sup___1MtKm TDS_Typography-modules__baseSupSubScripts___1mG2W", "base": "TDS_Typography-modules__base___3JQ2A TDS_Typography-modules__wordBreak___11Xyp", "baseFont": "TDS_Typography-modules__baseFont___-Br-_", "small": "TDS_Typography-modules__small___2C82x TDS_Typography-modules__wordBreak___11Xyp", "smallFont": "TDS_Typography-modules__smallFont___LAiJ9", "medium": "TDS_Typography-modules__medium___2XcY8 TDS_Typography-modules__wordBreak___11Xyp", "mediumFont": "TDS_Typography-modules__mediumFont___36OCZ", "large": "TDS_Typography-modules__large___3n6Vn TDS_Typography-modules__wordBreak___11Xyp", "largeFont": "TDS_Typography-modules__largeFont___2ELMx TDS_Typography-modules__wordBreak___11Xyp", "boldFont": "TDS_Typography-modules__boldFont___30Cjc TDS_Typography-modules__wordBreak___11Xyp", "color": "TDS_Typography-modules__color___22Swj", "invertedColor": "TDS_Typography-modules__invertedColor___EXfdx", "inheritColor": "TDS_Typography-modules__inheritColor___EKqsc" }; | ||
var styles = { "wordBreak": "TDS_Typography-modules__wordBreak___3dmWU", "baseSupSubScripts": "TDS_Typography-modules__baseSupSubScripts___Y12Fl", "sup": "TDS_Typography-modules__sup___2XNsz TDS_Typography-modules__baseSupSubScripts___Y12Fl", "base": "TDS_Typography-modules__base___gCTVZ TDS_Typography-modules__wordBreak___3dmWU", "baseFont": "TDS_Typography-modules__baseFont___2g1ZX", "small": "TDS_Typography-modules__small___3H68Z TDS_Typography-modules__wordBreak___3dmWU", "smallFont": "TDS_Typography-modules__smallFont___XkTI5", "medium": "TDS_Typography-modules__medium___1DC1g TDS_Typography-modules__wordBreak___3dmWU", "mediumFont": "TDS_Typography-modules__mediumFont___2ULml", "large": "TDS_Typography-modules__large___3Z5sJ TDS_Typography-modules__wordBreak___3dmWU", "largeFont": "TDS_Typography-modules__largeFont___3fZLf TDS_Typography-modules__wordBreak___3dmWU", "boldFont": "TDS_Typography-modules__boldFont___2MqlI TDS_Typography-modules__wordBreak___3dmWU", "color": "TDS_Typography-modules__color___1Jt_W", "invertedColor": "TDS_Typography-modules__invertedColor___2axxL", "inheritColor": "TDS_Typography-modules__inheritColor___3YAyL" }; | ||
/** | ||
* @version 1.0.0 | ||
* | ||
* Superscript text an as HTML `<sup>` element. | ||
@@ -222,5 +81,5 @@ * | ||
/** | ||
* @version 1.0.0 | ||
* Inline text usually as an HTML `<span>` element. | ||
* | ||
* Inline text usually as an HTML `<span>` element. | ||
* @version ./package.json | ||
*/ | ||
@@ -227,0 +86,0 @@ var Text = function Text(_ref, context) { |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
var asyncGenerator = function () { | ||
function AwaitValue(value) { | ||
this.value = value; | ||
} | ||
function AsyncGenerator(gen) { | ||
var front, back; | ||
function send(key, arg) { | ||
return new Promise(function (resolve, reject) { | ||
var request = { | ||
key: key, | ||
arg: arg, | ||
resolve: resolve, | ||
reject: reject, | ||
next: null | ||
}; | ||
if (back) { | ||
back = back.next = request; | ||
} else { | ||
front = back = request; | ||
resume(key, arg); | ||
} | ||
}); | ||
} | ||
function resume(key, arg) { | ||
try { | ||
var result = gen[key](arg); | ||
var value = result.value; | ||
if (value instanceof AwaitValue) { | ||
Promise.resolve(value.value).then(function (arg) { | ||
resume("next", arg); | ||
}, function (arg) { | ||
resume("throw", arg); | ||
}); | ||
} else { | ||
settle(result.done ? "return" : "normal", result.value); | ||
} | ||
} catch (err) { | ||
settle("throw", err); | ||
} | ||
} | ||
function settle(type, value) { | ||
switch (type) { | ||
case "return": | ||
front.resolve({ | ||
value: value, | ||
done: true | ||
}); | ||
break; | ||
case "throw": | ||
front.reject(value); | ||
break; | ||
default: | ||
front.resolve({ | ||
value: value, | ||
done: false | ||
}); | ||
break; | ||
} | ||
front = front.next; | ||
if (front) { | ||
resume(front.key, front.arg); | ||
} else { | ||
back = null; | ||
} | ||
} | ||
this._invoke = send; | ||
if (typeof gen.return !== "function") { | ||
this.return = undefined; | ||
} | ||
} | ||
if (typeof Symbol === "function" && Symbol.asyncIterator) { | ||
AsyncGenerator.prototype[Symbol.asyncIterator] = function () { | ||
return this; | ||
}; | ||
} | ||
AsyncGenerator.prototype.next = function (arg) { | ||
return this._invoke("next", arg); | ||
}; | ||
AsyncGenerator.prototype.throw = function (arg) { | ||
return this._invoke("throw", arg); | ||
}; | ||
AsyncGenerator.prototype.return = function (arg) { | ||
return this._invoke("return", arg); | ||
}; | ||
return { | ||
wrap: function (fn) { | ||
return function () { | ||
return new AsyncGenerator(fn.apply(this, arguments)); | ||
}; | ||
}, | ||
await: function (value) { | ||
return new AwaitValue(value); | ||
} | ||
}; | ||
}(); | ||
var _extends = Object.assign || function (target) { | ||
@@ -145,14 +18,2 @@ for (var i = 1; i < arguments.length; i++) { | ||
var objectWithoutProperties = function (obj, keys) { | ||
@@ -187,7 +48,5 @@ var target = {}; | ||
var styles = { "wordBreak": "TDS_Typography-modules__wordBreak___11Xyp", "baseSupSubScripts": "TDS_Typography-modules__baseSupSubScripts___1mG2W", "sup": "TDS_Typography-modules__sup___1MtKm TDS_Typography-modules__baseSupSubScripts___1mG2W", "base": "TDS_Typography-modules__base___3JQ2A TDS_Typography-modules__wordBreak___11Xyp", "baseFont": "TDS_Typography-modules__baseFont___-Br-_", "small": "TDS_Typography-modules__small___2C82x TDS_Typography-modules__wordBreak___11Xyp", "smallFont": "TDS_Typography-modules__smallFont___LAiJ9", "medium": "TDS_Typography-modules__medium___2XcY8 TDS_Typography-modules__wordBreak___11Xyp", "mediumFont": "TDS_Typography-modules__mediumFont___36OCZ", "large": "TDS_Typography-modules__large___3n6Vn TDS_Typography-modules__wordBreak___11Xyp", "largeFont": "TDS_Typography-modules__largeFont___2ELMx TDS_Typography-modules__wordBreak___11Xyp", "boldFont": "TDS_Typography-modules__boldFont___30Cjc TDS_Typography-modules__wordBreak___11Xyp", "color": "TDS_Typography-modules__color___22Swj", "invertedColor": "TDS_Typography-modules__invertedColor___EXfdx", "inheritColor": "TDS_Typography-modules__inheritColor___EKqsc" }; | ||
var styles = { "wordBreak": "TDS_Typography-modules__wordBreak___3dmWU", "baseSupSubScripts": "TDS_Typography-modules__baseSupSubScripts___Y12Fl", "sup": "TDS_Typography-modules__sup___2XNsz TDS_Typography-modules__baseSupSubScripts___Y12Fl", "base": "TDS_Typography-modules__base___gCTVZ TDS_Typography-modules__wordBreak___3dmWU", "baseFont": "TDS_Typography-modules__baseFont___2g1ZX", "small": "TDS_Typography-modules__small___3H68Z TDS_Typography-modules__wordBreak___3dmWU", "smallFont": "TDS_Typography-modules__smallFont___XkTI5", "medium": "TDS_Typography-modules__medium___1DC1g TDS_Typography-modules__wordBreak___3dmWU", "mediumFont": "TDS_Typography-modules__mediumFont___2ULml", "large": "TDS_Typography-modules__large___3Z5sJ TDS_Typography-modules__wordBreak___3dmWU", "largeFont": "TDS_Typography-modules__largeFont___3fZLf TDS_Typography-modules__wordBreak___3dmWU", "boldFont": "TDS_Typography-modules__boldFont___2MqlI TDS_Typography-modules__wordBreak___3dmWU", "color": "TDS_Typography-modules__color___1Jt_W", "invertedColor": "TDS_Typography-modules__invertedColor___2axxL", "inheritColor": "TDS_Typography-modules__inheritColor___3YAyL" }; | ||
/** | ||
* @version 1.0.0 | ||
* | ||
* Superscript text an as HTML `<sup>` element. | ||
@@ -217,5 +76,5 @@ * | ||
/** | ||
* @version 1.0.0 | ||
* Inline text usually as an HTML `<span>` element. | ||
* | ||
* Inline text usually as an HTML `<span>` element. | ||
* @version ./package.json | ||
*/ | ||
@@ -222,0 +81,0 @@ var Text = function Text(_ref, context) { |
{ | ||
"name": "@tds/core-text", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Inline text", | ||
@@ -31,4 +31,5 @@ "main": "index.cjs.js", | ||
"devDependencies": { | ||
"@tds/core-colours": "^1.0.0" | ||
"@tds/core-colours": "^1.0.0", | ||
"@tds/shared-typography": "^1.0.1" | ||
} | ||
} |
@@ -9,8 +9,8 @@ import React from 'react' | ||
import styles from '../../shared/styles/Typography.modules.scss' | ||
import styles from '../../shared/styles/Typography/Typography.modules.scss' | ||
/** | ||
* @version 1.0.0 | ||
* Inline text usually as an HTML `<span>` element. | ||
* | ||
* Inline text usually as an HTML `<span>` element. | ||
* @version ./package.json | ||
*/ | ||
@@ -17,0 +17,0 @@ const Text = ({ block, bold, size, invert, children, ...rest }, context) => { |
@@ -1,2 +0,2 @@ | ||
``` | ||
```jsx | ||
<Text>Tell us what you think</Text> | ||
@@ -7,3 +7,3 @@ ``` | ||
``` | ||
```jsx | ||
<Box between={2}> | ||
@@ -13,6 +13,4 @@ <Text bold> | ||
</Text> | ||
<Text size="small"> | ||
Sign up for 2 years and save BIG on your first 12 months. | ||
</Text> | ||
<Text size="small">Sign up for 2 years and save BIG on your first 12 months.</Text> | ||
</Box> | ||
``` |
@@ -6,7 +6,5 @@ import React from 'react' | ||
import styles from '../../../shared/styles/Typography.modules.scss' | ||
import styles from '../../../shared/styles/Typography/Typography.modules.scss' | ||
/** | ||
* @version 1.0.0 | ||
* | ||
* Superscript text an as HTML `<sup>` element. | ||
@@ -13,0 +11,0 @@ * |
Only use `Text.Sup` as a child of `Paragraph` or `Text`. Use [`Heading.Sup`](#headingsup) for superscript within headings. | ||
``` | ||
```jsx | ||
<Text> | ||
@@ -5,0 +5,0 @@ Enjoy buffer-free streaming any time of day<Text.Sup>2</Text.Sup>. |
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
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
21
28700
2
434