UNPKG

6.4 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-0711941d.js');
8require('./unsupportedIterableToArray-68db1d3b.js');
9var React = require('react');
10var React__default = _interopDefault(React);
11require('./_commonjsHelpers-72d386ba.js');
12var index = require('./index-b0606964.js');
13require('./defineProperty-0921a47c.js');
14require('./toConsumableArray-d8a4a2c3.js');
15var _styled = require('styled-components');
16var _styled__default = _interopDefault(_styled);
17require('./getPrototypeOf-2a661a20.js');
18require('./color.js');
19require('./components.js');
20require('./contains-component.js');
21require('./css.js');
22require('./dayjs.min-e07657bf.js');
23require('./date.js');
24require('./miscellaneous.js');
25require('./environment.js');
26require('./font.js');
27require('./math-f4029164.js');
28require('./characters.js');
29require('./format.js');
30require('./keycodes.js');
31require('./url.js');
32require('./web3.js');
33var constants = require('./constants.js');
34require('./breakpoints.js');
35require('./springs.js');
36require('./text-styles.js');
37require('./theme-dark.js');
38require('./theme-light.js');
39require('./Theme.js');
40require('./extends-40571110.js');
41var objectWithoutProperties = require('./objectWithoutProperties-35db8ab0.js');
42require('./index-ecc57c9f.js');
43require('./isObject-ec755c87.js');
44require('./Viewport-15101437.js');
45require('./Layout.js');
46require('./FocusVisible.js');
47require('./ButtonBase.js');
48require('./IconPropTypes-56de5759.js');
49require('./IconAddUser.js');
50require('./IconAlert.js');
51require('./IconAlignCenter.js');
52require('./IconAlignJustify.js');
53require('./IconAlignLeft.js');
54require('./IconAlignRight.js');
55require('./IconAragon.js');
56require('./IconArrowDown.js');
57require('./IconArrowLeft.js');
58require('./IconArrowRight.js');
59require('./IconArrowUp.js');
60require('./IconAtSign.js');
61require('./IconBlock.js');
62require('./IconBookmark.js');
63require('./IconCalendar.js');
64require('./IconCanvas.js');
65require('./IconCaution.js');
66require('./IconCenter.js');
67require('./IconChart.js');
68require('./IconChat.js');
69require('./IconCheck.js');
70require('./IconChip.js');
71require('./IconCircleCheck.js');
72require('./IconCircleMinus.js');
73require('./IconCirclePlus.js');
74require('./IconClock.js');
75require('./IconCloudDownload.js');
76require('./IconCloudUpload.js');
77require('./IconCoin.js');
78require('./IconConfiguration.js');
79require('./IconConnect.js');
80require('./IconConnection.js');
81require('./IconConsole.js');
82require('./IconCopy.js');
83require('./IconCross.js');
84require('./IconDashedSquare.js');
85require('./IconDown.js');
86require('./IconDownload.js');
87require('./IconEdit.js');
88require('./IconEllipsis.js');
89require('./IconEnter.js');
90require('./IconEthereum.js');
91require('./IconExternal.js');
92require('./IconFile.js');
93require('./IconFilter.js');
94require('./IconFlag.js');
95require('./IconFolder.js');
96require('./IconGraph2.js');
97require('./IconGraph.js');
98require('./IconGrid.js');
99require('./IconGroup.js');
100require('./IconHash.js');
101require('./IconHeart.js');
102require('./IconHide.js');
103require('./IconHome.js');
104require('./IconImage.js');
105require('./IconInfo.js');
106require('./IconLabel.js');
107require('./IconLayers.js');
108require('./IconLeft.js');
109require('./IconLink.js');
110require('./IconLocation.js');
111require('./IconLock.js');
112require('./IconMail.js');
113require('./IconMaximize.js');
114require('./IconMenu.js');
115require('./IconMinimize.js');
116require('./IconMinus.js');
117require('./IconMove.js');
118require('./IconNoPicture.js');
119require('./IconPicture.js');
120require('./IconPlus.js');
121require('./IconPower.js');
122require('./IconPrint.js');
123require('./IconProhibited.js');
124require('./IconQuestion.js');
125require('./IconRefresh.js');
126require('./IconRemoveUser.js');
127require('./IconRight.js');
128require('./IconRotateLeft.js');
129require('./IconRotateRight.js');
130require('./IconSearch.js');
131require('./IconSettings.js');
132require('./IconShare.js');
133require('./IconSquareMinus.js');
134require('./IconSquarePlus.js');
135require('./IconSquare.js');
136require('./IconStarFilled.js');
137require('./IconStar.js');
138require('./IconSwap.js');
139require('./IconTarget.js');
140require('./IconToken.js');
141require('./IconTrash.js');
142require('./IconUnlock.js');
143require('./IconUp.js');
144require('./IconUpload.js');
145require('./IconUser.js');
146require('./IconView.js');
147require('./IconVote.js');
148require('./IconWallet.js');
149require('./IconWarning.js');
150require('./IconWorld.js');
151require('./IconWrite.js');
152require('./IconZoomIn.js');
153require('./IconZoomOut.js');
154require('./objectWithoutPropertiesLoose-1af20ad0.js');
155require('react-dom');
156require('./web-d0294535.js');
157require('./Button.js');
158require('./ButtonIcon.js');
159require('./TextInput.js');
160require('./ToastHub.js');
161require('./index-0db71dc1.js');
162require('./RootPortal.js');
163var TextCopy = require('./TextCopy.js');
164require('./taggedTemplateLiteral-227ed122.js');
165require('./_react_commonjs-external-bf8fc71c.js');
166var EthIdenticon = require('./EthIdenticon.js');
167
168var HEIGHT = 5 * constants.GU;
169var IDENTICON_SIZE = 6 * constants.GU;
170
171var _StyledEthIdenticon = _styled__default(EthIdenticon.default).withConfig({
172 displayName: "AddressField___StyledEthIdenticon",
173 componentId: "m75adw-0"
174})(["transform:scale(", ");transform-origin:50% 50%;"], function (p) {
175 return p._css;
176});
177
178var AddressField = React__default.forwardRef(function AddressField(_ref, ref) {
179 var address = _ref.address,
180 autofocus = _ref.autofocus,
181 icon = _ref.icon,
182 onCopy = _ref.onCopy,
183 props = objectWithoutProperties._objectWithoutProperties(_ref, ["address", "autofocus", "icon", "onCopy"]);
184
185 return /*#__PURE__*/React__default.createElement(TextCopy.default, {
186 ref: ref,
187 adornment: icon || /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(_StyledEthIdenticon, {
188 address: address,
189 onCopy: onCopy,
190 scale: 2,
191 _css: (HEIGHT - 2) / IDENTICON_SIZE
192 })),
193 autofocus: autofocus,
194 value: address
195 });
196});
197AddressField.propTypes = {
198 address: index.PropTypes.string.isRequired,
199 autofocus: index.PropTypes.bool,
200 icon: index.PropTypes.node,
201 onCopy: index.PropTypes.func
202};
203AddressField.defaultProps = {
204 autofocus: true
205};
206
207exports.default = AddressField;
208//# sourceMappingURL=AddressField.js.map