@lifi/widget 3.23.3 → 3.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/LICENSE +165 -0
- package/README.md +14 -14
- package/dist/esm/components/AppContainer.js +22 -8
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +6 -1
- package/dist/esm/components/Avatar/Avatar.js +4 -4
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.d.ts +13 -4
- package/dist/esm/components/Avatar/Avatar.style.js +20 -10
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.d.ts +8 -2
- package/dist/esm/components/Avatar/SmallAvatar.js +7 -5
- package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +6 -0
- package/dist/esm/components/Avatar/TokenAvatar.js +7 -7
- package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/utils.d.ts +1 -8
- package/dist/esm/components/Avatar/utils.js +5 -8
- package/dist/esm/components/Avatar/utils.js.map +1 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +6 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +4 -1
- package/dist/esm/components/Header/Header.style.js +8 -5
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +2 -8
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +2 -2
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +2 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js +22 -17
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.style.d.ts +4 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.d.ts +6 -0
- package/dist/esm/components/TokenList/TokenDetailsSheet.js +24 -0
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.d.ts +8 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +67 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.d.ts +5 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js +28 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -0
- package/dist/esm/components/TokenList/TokenList.js +2 -2
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +29 -11
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +45 -40
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +7 -0
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/hooks/useTokenBalances.d.ts +2 -1
- package/dist/esm/hooks/useTokenBalances.js +2 -2
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.d.ts +2 -1
- package/dist/esm/hooks/useTokenSearch.js +7 -2
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.d.ts +2 -1
- package/dist/esm/hooks/useTokens.js +6 -13
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/i18n/bn.json +5 -0
- package/dist/esm/i18n/de.json +5 -0
- package/dist/esm/i18n/en.json +4 -0
- package/dist/esm/i18n/es.json +5 -0
- package/dist/esm/i18n/fr.json +5 -0
- package/dist/esm/i18n/hi.json +5 -0
- package/dist/esm/i18n/id.json +5 -0
- package/dist/esm/i18n/it.json +5 -0
- package/dist/esm/i18n/ja.json +5 -0
- package/dist/esm/i18n/ko.json +5 -0
- package/dist/esm/i18n/pt.json +5 -0
- package/dist/esm/i18n/th.json +5 -0
- package/dist/esm/i18n/tr.json +5 -0
- package/dist/esm/i18n/uk.json +5 -0
- package/dist/esm/i18n/vi.json +5 -0
- package/dist/esm/i18n/zh.json +5 -0
- package/dist/esm/icons/lifi.d.ts +1 -1
- package/dist/esm/icons/lifi.js +1 -1
- package/dist/esm/icons/lifi.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +1 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js +18 -7
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js.map +1 -1
- package/dist/esm/types/widget.d.ts +2 -0
- package/dist/esm/utils/format.d.ts +1 -0
- package/dist/esm/utils/format.js +16 -0
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/item.d.ts +7 -2
- package/dist/esm/utils/item.js +10 -3
- package/dist/esm/utils/item.js.map +1 -1
- package/package.json +18 -18
- package/package.json.tmp +18 -18
- package/src/components/AppContainer.tsx +26 -8
- package/src/components/Avatar/Avatar.style.tsx +23 -11
- package/src/components/Avatar/Avatar.tsx +11 -6
- package/src/components/Avatar/SmallAvatar.tsx +13 -5
- package/src/components/Avatar/TokenAvatar.tsx +38 -8
- package/src/components/Avatar/utils.ts +5 -10
- package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +5 -1
- package/src/components/Header/Header.style.ts +11 -6
- package/src/components/RouteCard/RouteCardEssentials.tsx +2 -9
- package/src/components/Routes/RoutesExpanded.tsx +7 -2
- package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +2 -2
- package/src/components/SendToWallet/SendToWalletButton.tsx +3 -2
- package/src/components/Step/CircularProgress.style.tsx +25 -17
- package/src/components/TokenList/TokenDetailsSheet.tsx +48 -0
- package/src/components/TokenList/TokenDetailsSheetContent.style.tsx +34 -0
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +200 -0
- package/src/components/TokenList/TokenList.tsx +7 -2
- package/src/components/TokenList/TokenListItem.tsx +117 -50
- package/src/components/TokenList/VirtualizedTokenList.tsx +95 -74
- package/src/components/TokenList/types.ts +8 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useTokenBalances.ts +9 -3
- package/src/hooks/useTokenSearch.ts +11 -2
- package/src/hooks/useTokens.ts +10 -21
- package/src/i18n/bn.json +5 -0
- package/src/i18n/de.json +5 -0
- package/src/i18n/en.json +4 -0
- package/src/i18n/es.json +5 -0
- package/src/i18n/fr.json +5 -0
- package/src/i18n/hi.json +5 -0
- package/src/i18n/id.json +5 -0
- package/src/i18n/it.json +5 -0
- package/src/i18n/ja.json +5 -0
- package/src/i18n/ko.json +5 -0
- package/src/i18n/pt.json +5 -0
- package/src/i18n/th.json +5 -0
- package/src/i18n/tr.json +5 -0
- package/src/i18n/uk.json +5 -0
- package/src/i18n/vi.json +5 -0
- package/src/i18n/zh.json +5 -0
- package/src/icons/lifi.ts +1 -1
- package/src/index.ts +1 -0
- package/src/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +1 -0
- package/src/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/src/pages/SelectChainPage/SelectChainPage.tsx +1 -1
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +1 -0
- package/src/pages/TransactionPage/StatusBottomSheet.style.tsx +19 -11
- package/src/types/widget.ts +2 -0
- package/src/utils/format.ts +19 -0
- package/src/utils/item.ts +29 -4
- package/LICENSE.md +0 -201
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [3.24.0](https://github.com/lifinance/widget/compare/v3.23.0...v3.24.0) (2025-07-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add fit-content option for widget container ([#404](https://github.com/lifinance/widget/issues/404)) ([bc90dd4](https://github.com/lifinance/widget/commit/bc90dd430f30c3eac9027fd6b3d416e7e8331aed))
|
|
11
|
+
* add optional filter for wallets in modal ([#414](https://github.com/lifinance/widget/issues/414)) ([348167f](https://github.com/lifinance/widget/commit/348167fa346b69db4975536d1d5dff36ea1da7c3))
|
|
12
|
+
* add token details drawer ([#423](https://github.com/lifinance/widget/issues/423)) ([a7f3b8b](https://github.com/lifinance/widget/commit/a7f3b8b772d668e5adb6778079d9155f4d6d473a))
|
|
13
|
+
* implement separate token filtering for from/to lists ([#444](https://github.com/lifinance/widget/issues/444)) ([41732ff](https://github.com/lifinance/widget/commit/41732ff29b24fa37d49cea937ec5195d804be948))
|
|
14
|
+
* restyled connect wallet view ([#418](https://github.com/lifinance/widget/issues/418)) ([8149607](https://github.com/lifinance/widget/commit/8149607a65d760a61437865f32b603b199575847))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* adjust show all transactions button styles ([#411](https://github.com/lifinance/widget/issues/411)) ([9932617](https://github.com/lifinance/widget/commit/9932617d50905f8b14db4c77e0e84afb86ad159f))
|
|
20
|
+
* adjust themed status color for processes and bottom sheet ([#448](https://github.com/lifinance/widget/issues/448)) ([f227803](https://github.com/lifinance/widget/commit/f2278037a31373c8b047e13ab0157f854350c802))
|
|
21
|
+
* cutoff corners on full height ([#445](https://github.com/lifinance/widget/issues/445)) ([c9a40b5](https://github.com/lifinance/widget/commit/c9a40b527ff3a2321b24cdc294150a119957c9b6))
|
|
22
|
+
* format long bridging times ([#431](https://github.com/lifinance/widget/issues/431)) ([b12e93b](https://github.com/lifinance/widget/commit/b12e93b78bdf4776ae21bb56fe00c62c85bc025e))
|
|
23
|
+
* missing highlight on Azure theme ([#426](https://github.com/lifinance/widget/issues/426)) ([6539e91](https://github.com/lifinance/widget/commit/6539e91a27ddf4c2f48e1ab5069d7939e4a91013))
|
|
24
|
+
* send to wallet adjustments ([#415](https://github.com/lifinance/widget/issues/415)) ([1cab928](https://github.com/lifinance/widget/commit/1cab928a3a941aa71c428a75c87bc17ce5b9df0a))
|
|
25
|
+
* update height setting for restricted heights ([#436](https://github.com/lifinance/widget/issues/436)) ([1395bc6](https://github.com/lifinance/widget/commit/1395bc613532d2435df82efa7decdfff9b689834))
|
|
26
|
+
* wallet toggle, add cache cleaning command ([#437](https://github.com/lifinance/widget/issues/437)) ([8b71caa](https://github.com/lifinance/widget/commit/8b71caa94ce9ace7548127857c7add636e223c03))
|
|
27
|
+
|
|
5
28
|
### [3.23.3](https://github.com/lifinance/widget/compare/v3.23.1-alpha.0...v3.23.3) (2025-06-06)
|
|
6
29
|
|
|
7
30
|
|
package/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
[](/LICENSE)
|
|
4
4
|
[](https://www.npmjs.com/package/@lifi/widget)
|
|
5
5
|
[](https://www.npmjs.com/package/@lifi/widget)
|
|
6
6
|
[](https://crowdin.com/project/lifi-widget)
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
<h1 align="center">LI.FI Widget</h1>
|
|
12
12
|
|
|
13
|
-

|
|
14
14
|
|
|
15
|
-
[**LI.FI Widget**](https://docs.li.fi/
|
|
15
|
+
[**LI.FI Widget**](https://docs.li.fi/widget/overview) is a set of prebuilt UI components that will help you integrate a secure cross-chain bridging and swapping experience that can be styled to match your web app design perfectly and helps drive your multi-chain strategy and attract new users from everywhere.
|
|
16
16
|
|
|
17
|
-
[**LI.FI Widget**](https://docs.li.fi/
|
|
17
|
+
[**LI.FI Widget**](https://docs.li.fi/widget/overview) features include:
|
|
18
18
|
|
|
19
|
-
- All ecosystems, chains, bridges, exchanges, and solvers that [LI.FI](https://docs.li.fi/
|
|
19
|
+
- All ecosystems, chains, bridges, exchanges, and solvers that [LI.FI](https://docs.li.fi/introduction/chains) supports
|
|
20
20
|
- Embeddable variants - compact, wide, and drawer
|
|
21
21
|
- Options to allow or deny certain chains, tokens, bridges, and exchanges
|
|
22
22
|
- Pre-configured themes and lots of customization options with dark mode support so you can match the look and feel of your web app
|
|
@@ -37,25 +37,26 @@ LI.FI Widget is available as an [npm package](https://www.npmjs.com/package/@lif
|
|
|
37
37
|
**pnpm:**
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
|
-
pnpm add @lifi/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query
|
|
40
|
+
pnpm add @lifi/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query @mysten/dapp-kit
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
**npm:**
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
npm install @lifi/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query
|
|
46
|
+
npm install @lifi/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query @mysten/dapp-kit
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
**yarn:**
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
yarn add @lifi/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query
|
|
52
|
+
yarn add @lifi/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query @mysten/dapp-kit
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
- [Wagmi](https://wagmi.sh/) is type safe, extensible, and modular library for building Ethereum apps.
|
|
56
56
|
- [Bigmi](https://github.com/lifinance/bigmi) is modular TypeScript library that provides reactive primitives for building Bitcoin applications.
|
|
57
57
|
- [@solana/wallet-adapter-react](https://github.com/anza-xyz/wallet-adapter) is modular TypeScript wallet adapters and components for Solana applications.
|
|
58
58
|
- [TanStack Query](https://tanstack.com/query/v5) is an async state manager that handles requests, caching, and more.
|
|
59
|
+
- [@mysten/dapp-kit](https://sdk.mystenlabs.com/dapp-kit) provides React tools for wallet integration and data access in Sui blockchain dApps.
|
|
59
60
|
|
|
60
61
|
### LI.FI Wallet Management
|
|
61
62
|
|
|
@@ -102,13 +103,17 @@ export const WidgetPage = () => {
|
|
|
102
103
|
};
|
|
103
104
|
```
|
|
104
105
|
|
|
106
|
+
Please refer to our [documentation](https://docs.li.fi/widget/compatibility) if you encounter any issues with importing.
|
|
107
|
+
|
|
108
|
+
You can also refer to the [examples](/examples) folder in this repository to see how to import the widget in your specific context.
|
|
109
|
+
|
|
105
110
|
## Examples
|
|
106
111
|
|
|
107
112
|
Visit our [playground](https://playground.li.fi) to see how you can customize your [LI.FI Widget](https://www.npmjs.com/package/@lifi/widget) experience. Additionally, see [examples](/examples) folder in this repository.
|
|
108
113
|
|
|
109
114
|
## Documentation
|
|
110
115
|
|
|
111
|
-
Please visit [LI.FI Widget Documentation](https://docs.li.fi/
|
|
116
|
+
Please visit [LI.FI Widget Documentation](https://docs.li.fi/widget/install-widget).
|
|
112
117
|
|
|
113
118
|
## Contributing Translations
|
|
114
119
|
|
|
@@ -121,8 +126,3 @@ Thank you for your support!
|
|
|
121
126
|
## Changelog
|
|
122
127
|
|
|
123
128
|
The [changelog](/CHANGELOG.md) is regularly updated to reflect what's changed in each new release.
|
|
124
|
-
|
|
125
|
-
## License
|
|
126
|
-
|
|
127
|
-
This project is licensed under the terms of the
|
|
128
|
-
[Apache-2.0](/LICENSE.md).
|
|
@@ -37,6 +37,11 @@ export const AppExpandedContainer = styled(Box, {
|
|
|
37
37
|
export const RelativeContainer = styled(Box, {
|
|
38
38
|
shouldForwardProp: (prop) => prop !== 'variant',
|
|
39
39
|
})(({ theme }) => {
|
|
40
|
+
const maxHeight = theme.container?.height === 'fit-content'
|
|
41
|
+
? 'none'
|
|
42
|
+
: theme.container?.maxHeight ||
|
|
43
|
+
theme.container?.height ||
|
|
44
|
+
defaultMaxHeight;
|
|
40
45
|
return {
|
|
41
46
|
position: 'relative',
|
|
42
47
|
boxSizing: 'content-box',
|
|
@@ -50,9 +55,7 @@ export const RelativeContainer = styled(Box, {
|
|
|
50
55
|
...theme.container,
|
|
51
56
|
maxHeight: theme.container?.display === 'flex' && !theme.container?.height
|
|
52
57
|
? '100%'
|
|
53
|
-
:
|
|
54
|
-
? theme.container?.maxHeight
|
|
55
|
-
: theme.container?.height || defaultMaxHeight,
|
|
58
|
+
: maxHeight,
|
|
56
59
|
variants: [
|
|
57
60
|
{
|
|
58
61
|
props: {
|
|
@@ -70,9 +73,11 @@ export const RelativeContainer = styled(Box, {
|
|
|
70
73
|
const CssBaselineContainer = styled(ScopedCssBaseline, {
|
|
71
74
|
shouldForwardProp: (prop) => !['variant', 'paddingTopAdjustment', 'elementId'].includes(prop),
|
|
72
75
|
})(({ theme, variant, paddingTopAdjustment }) => {
|
|
73
|
-
const
|
|
74
|
-
?
|
|
75
|
-
: theme.container?.
|
|
76
|
+
const maxHeight = theme.container?.height === 'fit-content'
|
|
77
|
+
? 'none'
|
|
78
|
+
: theme.container?.maxHeight ||
|
|
79
|
+
theme.container?.height ||
|
|
80
|
+
defaultMaxHeight;
|
|
76
81
|
return {
|
|
77
82
|
display: 'flex',
|
|
78
83
|
flex: 1,
|
|
@@ -82,13 +87,22 @@ const CssBaselineContainer = styled(ScopedCssBaseline, {
|
|
|
82
87
|
width: '100%',
|
|
83
88
|
maxHeight: variant === 'drawer' || theme.container?.display === 'flex'
|
|
84
89
|
? 'none'
|
|
85
|
-
:
|
|
90
|
+
: maxHeight,
|
|
86
91
|
overflowY: 'auto',
|
|
87
92
|
height: theme.container?.display === 'flex' ? 'auto' : '100%',
|
|
88
93
|
paddingTop: paddingTopAdjustment,
|
|
89
94
|
// This allows FullPageContainer.tsx to expand and fill the available vertical space in max height and default layout modes
|
|
90
95
|
'&:has(.full-page-container)': {
|
|
91
|
-
height:
|
|
96
|
+
height: theme.container?.maxHeight ||
|
|
97
|
+
theme.container?.height ||
|
|
98
|
+
defaultMaxHeight,
|
|
99
|
+
},
|
|
100
|
+
'&:has(.long-list)': {
|
|
101
|
+
maxHeight: theme.container?.maxHeight ||
|
|
102
|
+
(theme.container?.height !== 'fit-content'
|
|
103
|
+
? theme.container?.height
|
|
104
|
+
: undefined) ||
|
|
105
|
+
defaultMaxHeight,
|
|
92
106
|
},
|
|
93
107
|
};
|
|
94
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppContainer.js","sourceRoot":"","sources":["../../../src/components/AppContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAA;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEpE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEjE,0GAA0G;AAC1G,wHAAwH;AACxH,uHAAuH;AACvH,mIAAmI;AACnI,0BAA0B;AAC1B,2BAA2B;AAC3B,6EAA6E;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,EAAE;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAA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,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,CAAC;CACR,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxE,4CAA4C;IAC5C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,eAAe,EAAE,CAAA;IACvD,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAA;IAC1C,MAAM,uBAAuB,GAC3B,KAAK,EAAE,MAAM,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;IAExD,OAAO,CACL,KAAC,iBAAiB,IAChB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,eAAe,CAAC,SAAS,CAAC,iBAAiB,EAAE,SAAS,CAAC,YAE3D,KAAC,oBAAoB,IACnB,EAAE,EAAE,eAAe,CAAC,SAAS,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAC7D,OAAO,EAAE,OAAO,EAChB,iBAAiB,QACjB,oBAAoB,EAAE,uBAAuB,EAC7C,SAAS,EAAE,SAAS,YAGpB,KAAC,aAAa,IAAC,cAAc,kBAAE,QAAQ,GAAiB,GACnC,GAEL,CACrB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -4,5 +4,10 @@ export declare const AvatarBadgedDefault: React.FC<{
|
|
|
4
4
|
}>;
|
|
5
5
|
export declare const AvatarBadgedSkeleton: React.FC<{
|
|
6
6
|
sx?: SxProps<Theme>;
|
|
7
|
+
avatarSize?: number;
|
|
8
|
+
badgeSize?: number;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const AvatarSkeleton: React.FC<{
|
|
11
|
+
avatarSize: number;
|
|
12
|
+
badgeSize: number;
|
|
7
13
|
}>;
|
|
8
|
-
export declare const AvatarSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,10 +5,10 @@ import { SmallAvatarSkeleton } from './SmallAvatar.js';
|
|
|
5
5
|
export const AvatarBadgedDefault = ({ sx }) => {
|
|
6
6
|
return (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(AvatarDefaultBadge, {}), sx: sx, children: _jsx(AvatarDefault, {}) }));
|
|
7
7
|
};
|
|
8
|
-
export const AvatarBadgedSkeleton = ({ sx }) => {
|
|
9
|
-
return (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(SmallAvatarSkeleton, {}), sx: sx, children: _jsx(AvatarSkeleton, {}) }));
|
|
8
|
+
export const AvatarBadgedSkeleton = ({ sx, avatarSize = 40, badgeSize = 16 }) => {
|
|
9
|
+
return (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(SmallAvatarSkeleton, { size: badgeSize }), sx: sx, children: _jsx(AvatarSkeleton, { avatarSize: avatarSize, badgeSize: badgeSize }) }));
|
|
10
10
|
};
|
|
11
|
-
export const AvatarSkeleton = () => {
|
|
12
|
-
return (_jsx(AvatarSkeletonMaskedContainer, { children: _jsx(Skeleton, { width:
|
|
11
|
+
export const AvatarSkeleton = ({ avatarSize, badgeSize }) => {
|
|
12
|
+
return (_jsx(AvatarSkeletonMaskedContainer, { badgeSize: badgeSize, children: _jsx(Skeleton, { width: avatarSize, height: avatarSize, variant: "circular" }) }));
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,mB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OAAO,EAAE,EACzD,YAAY,EAAE,KAAC,mBAAmB,IAAC,IAAI,EAAE,SAAS,GAAI,EACtD,EAAE,EAAE,EAAE,YAEN,KAAC,cAAc,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAI,GAC1D,CACT,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAGtB,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE;IACjC,OAAO,CACL,KAAC,6BAA6B,IAAC,SAAS,EAAE,SAAS,YACjD,KAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAC,UAAU,GAAG,GACxC,CACjC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
export declare const AvatarMasked: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarOwnProps & import("@mui/material").AvatarSlotsAndSlotProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "classes" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet" | "slots" | "slotProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme
|
|
1
|
+
export declare const AvatarMasked: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarOwnProps & import("@mui/material").AvatarSlotsAndSlotProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "classes" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet" | "slots" | "slotProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
2
|
+
avatarSize?: number;
|
|
3
|
+
badgeSize?: number;
|
|
4
|
+
}, {}, {}>;
|
|
2
5
|
export declare const TokenAvatarGroup: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarGroupOwnProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/material").AvatarGroupOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
3
|
-
export declare const AvatarDefault: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme
|
|
4
|
-
|
|
6
|
+
export declare const AvatarDefault: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
7
|
+
badgeSize?: number;
|
|
8
|
+
}, {}, {}>;
|
|
9
|
+
export declare const AvatarDefaultBadge: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
|
+
size?: number;
|
|
11
|
+
}, {}, {}>;
|
|
5
12
|
export declare const AvatarSkeletonContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
6
|
-
export declare const AvatarSkeletonMaskedContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme
|
|
13
|
+
export declare const AvatarSkeletonMaskedContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
14
|
+
badgeSize?: number;
|
|
15
|
+
}, {}, {}>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AvatarGroup, Box, Avatar as MuiAvatar, avatarClasses, badgeClasses, styled, } from '@mui/material';
|
|
2
|
-
import {
|
|
3
|
-
export const AvatarMasked = styled(MuiAvatar
|
|
4
|
-
|
|
2
|
+
import { getAvatarMask } from './utils.js';
|
|
3
|
+
export const AvatarMasked = styled(MuiAvatar, {
|
|
4
|
+
shouldForwardProp: (prop) => prop !== 'avatarSize' && prop !== 'badgeSize',
|
|
5
|
+
})(({ avatarSize = 40, badgeSize = 16 }) => ({
|
|
6
|
+
width: avatarSize,
|
|
7
|
+
height: avatarSize,
|
|
8
|
+
mask: getAvatarMask(badgeSize),
|
|
5
9
|
}));
|
|
6
10
|
export const TokenAvatarGroup = styled(AvatarGroup)(({ theme }) => ({
|
|
7
11
|
[`& .${badgeClasses.badge}:last-of-type .${avatarClasses.root}`]: {
|
|
@@ -19,7 +23,9 @@ export const TokenAvatarGroup = styled(AvatarGroup)(({ theme }) => ({
|
|
|
19
23
|
border: 'none',
|
|
20
24
|
},
|
|
21
25
|
}));
|
|
22
|
-
export const AvatarDefault = styled(Box
|
|
26
|
+
export const AvatarDefault = styled(Box, {
|
|
27
|
+
shouldForwardProp: (prop) => prop !== 'badgeSize',
|
|
28
|
+
})(({ theme, badgeSize = 16 }) => {
|
|
23
29
|
const root = theme.components?.MuiAvatar?.styleOverrides?.root;
|
|
24
30
|
return {
|
|
25
31
|
display: 'flex',
|
|
@@ -29,18 +35,20 @@ export const AvatarDefault = styled(Box)(({ theme }) => {
|
|
|
29
35
|
height: root?.height,
|
|
30
36
|
width: root?.width,
|
|
31
37
|
color: theme.vars.palette.text.secondary,
|
|
32
|
-
mask:
|
|
38
|
+
mask: getAvatarMask(badgeSize),
|
|
33
39
|
background: theme.vars.palette.grey[300],
|
|
34
40
|
...theme.applyStyles('dark', {
|
|
35
41
|
background: theme.vars.palette.grey[800],
|
|
36
42
|
}),
|
|
37
43
|
};
|
|
38
44
|
});
|
|
39
|
-
export const AvatarDefaultBadge = styled(Box
|
|
45
|
+
export const AvatarDefaultBadge = styled(Box, {
|
|
46
|
+
shouldForwardProp: (prop) => prop !== 'size',
|
|
47
|
+
})(({ theme, size = 16 }) => {
|
|
40
48
|
return {
|
|
41
49
|
borderRadius: '50%',
|
|
42
|
-
height:
|
|
43
|
-
width:
|
|
50
|
+
height: size,
|
|
51
|
+
width: size,
|
|
44
52
|
background: theme.vars.palette.grey[300],
|
|
45
53
|
...theme.applyStyles('dark', {
|
|
46
54
|
background: theme.vars.palette.grey[800],
|
|
@@ -51,9 +59,11 @@ export const AvatarSkeletonContainer = styled(Box)(({ theme }) => ({
|
|
|
51
59
|
background: theme.vars.palette.background.paper,
|
|
52
60
|
borderRadius: '50%',
|
|
53
61
|
}));
|
|
54
|
-
export const AvatarSkeletonMaskedContainer = styled(Box
|
|
62
|
+
export const AvatarSkeletonMaskedContainer = styled(Box, {
|
|
63
|
+
shouldForwardProp: (prop) => prop !== 'badgeSize',
|
|
64
|
+
})(({ theme, badgeSize = 16 }) => ({
|
|
55
65
|
background: theme.vars.palette.background.paper,
|
|
56
66
|
borderRadius: '50%',
|
|
57
|
-
mask:
|
|
67
|
+
mask: getAvatarMask(badgeSize),
|
|
58
68
|
}));
|
|
59
69
|
//# sourceMappingURL=Avatar.style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.style.js","sourceRoot":"","sources":["../../../../src/components/Avatar/Avatar.style.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,GAAG,EACH,MAAM,IAAI,SAAS,EACnB,aAAa,EACb,YAAY,EACZ,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Avatar.style.js","sourceRoot":"","sources":["../../../../src/components/Avatar/Avatar.style.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,GAAG,EACH,MAAM,IAAI,SAAS,EACnB,aAAa,EACb,YAAY,EACZ,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,EAAE;IAC5C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,WAAW;CAC3E,CAAC,CACA,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACxC,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;CAC/B,CAAC,CACH,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAClE,CAAC,MAAM,YAAY,CAAC,KAAK,kBAAkB,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE;QAChE,SAAS,EAAE,YAAY;KACxB;IACD,CAAC,MAAM,aAAa,CAAC,IAAI,EAAE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mallAvatar: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarOwnProps & import("@mui/material").AvatarSlotsAndSlotProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "classes" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet" | "slots" | "slotProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & SmallAvatarProps, {}, {}>;
|
|
5
|
+
export declare const SmallAvatarSkeleton: React.FC<{
|
|
6
|
+
size?: number;
|
|
7
|
+
}>;
|
|
8
|
+
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar, Skeleton, styled } from '@mui/material';
|
|
3
3
|
import { AvatarSkeletonContainer } from './Avatar.style.js';
|
|
4
|
-
export const SmallAvatar = styled(Avatar
|
|
4
|
+
export const SmallAvatar = styled(Avatar, {
|
|
5
|
+
shouldForwardProp: (prop) => prop !== 'size',
|
|
6
|
+
})(({ theme, size = 16 }) => ({
|
|
5
7
|
background: theme.vars.palette.background.paper,
|
|
6
|
-
width:
|
|
7
|
-
height:
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
8
10
|
}));
|
|
9
|
-
export const SmallAvatarSkeleton = () => {
|
|
10
|
-
return (_jsx(AvatarSkeletonContainer, { children: _jsx(Skeleton, { width:
|
|
11
|
+
export const SmallAvatarSkeleton = ({ size = 16 }) => {
|
|
12
|
+
return (_jsx(AvatarSkeletonContainer, { children: _jsx(Skeleton, { width: size, height: size, variant: "circular" }) }));
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=SmallAvatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmallAvatar.js","sourceRoot":"","sources":["../../../../src/components/Avatar/SmallAvatar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"SmallAvatar.js","sourceRoot":"","sources":["../../../../src/components/Avatar/SmallAvatar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAM3D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE;IACxC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,MAAM;CAC7C,CAAC,CAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9C,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK;IAC/C,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;CACb,CAAC,CAAC,CAAA;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAE3B,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE,EAAE;IACrB,OAAO,CACL,KAAC,uBAAuB,cACtB,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,UAAU,GAAG,GAClC,CAC3B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -5,15 +5,21 @@ export declare const TokenAvatar: React.FC<{
|
|
|
5
5
|
chain?: Chain;
|
|
6
6
|
isLoading?: boolean;
|
|
7
7
|
sx?: SxProps<Theme>;
|
|
8
|
+
tokenAvatarSize?: number;
|
|
9
|
+
chainAvatarSize?: number;
|
|
8
10
|
}>;
|
|
9
11
|
export declare const TokenAvatarFallback: React.FC<{
|
|
10
12
|
token?: StaticToken;
|
|
11
13
|
isLoading?: boolean;
|
|
12
14
|
sx?: SxProps<Theme>;
|
|
15
|
+
tokenAvatarSize: number;
|
|
16
|
+
chainAvatarSize: number;
|
|
13
17
|
}>;
|
|
14
18
|
export declare const TokenAvatarBase: React.FC<{
|
|
15
19
|
token?: StaticToken;
|
|
16
20
|
chain?: Chain;
|
|
17
21
|
isLoading?: boolean;
|
|
18
22
|
sx?: SxProps<Theme>;
|
|
23
|
+
avatarSize: number;
|
|
24
|
+
badgeSize: number;
|
|
19
25
|
}>;
|
|
@@ -5,18 +5,18 @@ import { useToken } from '../../hooks/useToken.js';
|
|
|
5
5
|
import { AvatarBadgedSkeleton } from './Avatar.js';
|
|
6
6
|
import { AvatarDefaultBadge, AvatarMasked } from './Avatar.style.js';
|
|
7
7
|
import { SmallAvatar } from './SmallAvatar.js';
|
|
8
|
-
export const TokenAvatar = ({ token, chain, isLoading, sx }) => {
|
|
8
|
+
export const TokenAvatar = ({ token, chain, isLoading, sx, tokenAvatarSize = 40, chainAvatarSize = 16, }) => {
|
|
9
9
|
if (!chain || !token?.logoURI) {
|
|
10
|
-
return _jsx(TokenAvatarFallback, { token: token, isLoading: isLoading, sx: sx });
|
|
10
|
+
return (_jsx(TokenAvatarFallback, { token: token, isLoading: isLoading, sx: sx, tokenAvatarSize: tokenAvatarSize, chainAvatarSize: chainAvatarSize }));
|
|
11
11
|
}
|
|
12
|
-
return (_jsx(TokenAvatarBase, { token: token, chain: chain, isLoading: isLoading, sx: sx }));
|
|
12
|
+
return (_jsx(TokenAvatarBase, { token: token, chain: chain, isLoading: isLoading, sx: sx, avatarSize: tokenAvatarSize, badgeSize: chainAvatarSize }));
|
|
13
13
|
};
|
|
14
|
-
export const TokenAvatarFallback = ({ token, isLoading, sx }) => {
|
|
14
|
+
export const TokenAvatarFallback = ({ token, isLoading, sx, tokenAvatarSize, chainAvatarSize }) => {
|
|
15
15
|
const { chain } = useChain(token?.chainId);
|
|
16
16
|
const { token: chainToken, isLoading: isLoadingToken } = useToken(token?.chainId, token?.address);
|
|
17
|
-
return (_jsx(TokenAvatarBase, { token: chainToken ?? token, isLoading: isLoading || isLoadingToken, chain: chain, sx: sx }));
|
|
17
|
+
return (_jsx(TokenAvatarBase, { token: chainToken ?? token, isLoading: isLoading || isLoadingToken, chain: chain, sx: sx, avatarSize: tokenAvatarSize, badgeSize: chainAvatarSize }));
|
|
18
18
|
};
|
|
19
|
-
export const TokenAvatarBase = ({ token, chain, isLoading, sx }) => {
|
|
20
|
-
return isLoading ? (_jsx(AvatarBadgedSkeleton, {})) : (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain ? (_jsx(SmallAvatar, { src: chain.logoURI, alt: chain.name, children: chain.name[0] })) : (_jsx(AvatarDefaultBadge, {})), sx: sx, children: _jsx(AvatarMasked, { src: token?.logoURI, alt: token?.symbol, children: token?.symbol?.[0] }) }));
|
|
19
|
+
export const TokenAvatarBase = ({ token, chain, isLoading, sx, avatarSize, badgeSize }) => {
|
|
20
|
+
return isLoading ? (_jsx(AvatarBadgedSkeleton, { avatarSize: avatarSize, badgeSize: badgeSize })) : (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain ? (_jsx(SmallAvatar, { src: chain.logoURI, alt: chain.name, size: badgeSize, children: chain.name[0] })) : (_jsx(AvatarDefaultBadge, { size: badgeSize })), sx: sx, children: _jsx(AvatarMasked, { src: token?.logoURI, alt: token?.symbol, avatarSize: avatarSize, badgeSize: badgeSize, children: token?.symbol?.[0] }) }));
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=TokenAvatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenAvatar.js","sourceRoot":"","sources":["../../../../src/components/Avatar/TokenAvatar.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;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