UNPKG

3.07 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
7require('./slicedToArray-ef426d0f.js');
8require('./unsupportedIterableToArray-8a00e599.js');
9var React = require('react');
10var React__default = _interopDefault(React);
11require('./_commonjsHelpers-72d386ba.js');
12var index = require('./index-b0606964.js');
13require('./toConsumableArray-7f36359f.js');
14var _styled = require('styled-components');
15var _styled__default = _interopDefault(_styled);
16require('./getPrototypeOf-e2d1e599.js');
17require('./color.js');
18require('./components.js');
19require('./contains-component.js');
20require('./css.js');
21require('./dayjs.min-aa59a48e.js');
22require('./date.js');
23require('./miscellaneous.js');
24var environment = require('./environment.js');
25var font = require('./font.js');
26require('./math-ecfd5d91.js');
27require('./characters.js');
28require('./format.js');
29require('./keycodes.js');
30require('./url.js');
31require('./web3.js');
32var _extends$1 = require('./extends-40571110.js');
33var objectWithoutProperties = require('./objectWithoutProperties-35db8ab0.js');
34
35var _StyledSpan = _styled__default("span").withConfig({
36 displayName: "Text___StyledSpan",
37 componentId: "yxw4o9-0"
38})(["", ";", ";"], function (p) {
39 return p._css;
40}, function (p) {
41 return p._css2;
42});
43
44function Text(_ref) {
45 var children = _ref.children,
46 color = _ref.color,
47 deprecationNotice = _ref.deprecationNotice,
48 monospace = _ref.monospace,
49 size = _ref.size,
50 smallcaps = _ref.smallcaps,
51 weight = _ref.weight,
52 props = objectWithoutProperties._objectWithoutProperties(_ref, ["children", "color", "deprecationNotice", "monospace", "size", "smallcaps", "weight"]);
53
54 if (deprecationNotice) {
55 environment.warnOnce('Text', 'Text, Text.Block and Text.Paragraph are deprecated. ' + 'Please use the textStyle() utility function instead.');
56 }
57
58 return /*#__PURE__*/React__default.createElement(_StyledSpan, _extends$1._extends({}, props, {
59 _css: font.font({
60 deprecationNotice: false,
61 monospace: monospace,
62 size: size,
63 smallcaps: smallcaps,
64 weight: weight
65 }),
66 _css2: color ? "color: ".concat(color) : ''
67 }), children);
68}
69
70var Block = function Block(props) {
71 return /*#__PURE__*/React__default.createElement(Text, _extends$1._extends({
72 as: "div"
73 }, props));
74};
75
76var Paragraph = function Paragraph(props) {
77 return /*#__PURE__*/React__default.createElement(Text, _extends$1._extends({
78 as: "p"
79 }, props));
80};
81
82Text.propTypes = Block.propTypes = Paragraph.propTypes = {
83 children: index.PropTypes.node,
84 color: index.PropTypes.string,
85 deprecationNotice: index.PropTypes.bool,
86 monospace: index.PropTypes.bool,
87 size: index.PropTypes.string,
88 smallcaps: index.PropTypes.bool,
89 weight: index.PropTypes.string
90};
91Text.defaultProps = {
92 deprecationNotice: true
93};
94Text.Block = Block;
95Text.Paragraph = Paragraph;
96
97exports.default = Text;
98//# sourceMappingURL=Text.js.map