@huma-finance/widgets 0.0.10 → 0.0.11

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.
Files changed (169) hide show
  1. package/.env.example +2 -2
  2. package/.eslintignore +2 -2
  3. package/.eslintrc.js +64 -64
  4. package/.prettierignore +4 -4
  5. package/.prettierrc.js +16 -16
  6. package/API.md +331 -331
  7. package/LICENSE +660 -660
  8. package/README.md +48 -48
  9. package/babel.config.js +15 -15
  10. package/config-overrides.js +9 -9
  11. package/cosmos.config.json +7 -7
  12. package/cypress/e2e/01-invoice-factoring-borrow.test.ts +62 -62
  13. package/cypress/support/e2e.ts +76 -76
  14. package/cypress/support/ethereum.ts +142 -142
  15. package/cypress/tsconfig.json +9 -9
  16. package/cypress/utils/index.ts +54 -54
  17. package/cypress.config.ts +20 -20
  18. package/dist/assets/output-15e10f9f.css +44 -0
  19. package/dist/cjs/assets/output-15e10f9f.css +44 -0
  20. package/dist/cjs/index.cjs +7731 -0
  21. package/dist/cjs/index.cjs.map +1 -0
  22. package/dist/index.d.ts +211 -0
  23. package/dist/index.js +7687 -0
  24. package/dist/index.js.map +1 -0
  25. package/jsdoc2md.json +20 -20
  26. package/package.json +4 -4
  27. package/public/index.html +40 -40
  28. package/public/manifest.json +25 -25
  29. package/public/robots.txt +3 -3
  30. package/rollup.config.js +81 -81
  31. package/src/components/Activity.tsx +123 -123
  32. package/src/components/AllowListModal.tsx +113 -113
  33. package/src/components/ApolloWrapper.tsx +15 -15
  34. package/src/components/ApproveAllowanceModal.tsx +118 -118
  35. package/src/components/BottomButton.tsx +31 -31
  36. package/src/components/ChooseAmountModal.tsx +315 -315
  37. package/src/components/CreditLine/borrow/1-Evaluation.tsx +158 -159
  38. package/src/components/CreditLine/borrow/2-AllowList.tsx +34 -34
  39. package/src/components/CreditLine/borrow/3-ChooseAmount.tsx +74 -74
  40. package/src/components/CreditLine/borrow/4-ApproveAllowance.tsx +29 -29
  41. package/src/components/CreditLine/borrow/5-Transfer.tsx +30 -30
  42. package/src/components/CreditLine/borrow/6-Success.tsx +30 -30
  43. package/src/components/CreditLine/borrow/index.tsx +119 -119
  44. package/src/components/CreditLine/payment/1-ChooseAmount.tsx +67 -67
  45. package/src/components/CreditLine/payment/2-ApproveAllowance.tsx +23 -23
  46. package/src/components/CreditLine/payment/3-Transfer.tsx +34 -34
  47. package/src/components/CreditLine/payment/4-Success.tsx +39 -39
  48. package/src/components/CreditLine/payment/index.tsx +94 -94
  49. package/src/components/ErrorModal.tsx +132 -132
  50. package/src/components/Factoring/FactoredList.tsx +143 -143
  51. package/src/components/Factoring/UpcomingList.tsx +90 -90
  52. package/src/components/Factoring/index.ts +2 -2
  53. package/src/components/HumaLoading.tsx +68 -68
  54. package/src/components/HumaTable.tsx +158 -158
  55. package/src/components/InvoiceFactoring/borrow/1-Evaluation.tsx +52 -46
  56. package/src/components/InvoiceFactoring/borrow/2-AllowList.tsx +34 -34
  57. package/src/components/InvoiceFactoring/borrow/3-ChooseAmount.tsx +86 -86
  58. package/src/components/InvoiceFactoring/borrow/4-ConfirmTransfer.tsx +104 -104
  59. package/src/components/InvoiceFactoring/borrow/5-ApproveNFT.tsx +55 -55
  60. package/src/components/InvoiceFactoring/borrow/6-Transfer.tsx +34 -34
  61. package/src/components/InvoiceFactoring/borrow/7-Success.tsx +20 -20
  62. package/src/components/InvoiceFactoring/borrow/index.tsx +96 -96
  63. package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +67 -67
  64. package/src/components/InvoiceFactoring/payment/2-ApproveAllowance.tsx +23 -23
  65. package/src/components/InvoiceFactoring/payment/3-Transfer.tsx +34 -34
  66. package/src/components/InvoiceFactoring/payment/4-Success.tsx +23 -23
  67. package/src/components/InvoiceFactoring/payment/index.tsx +86 -86
  68. package/src/components/Lend/supply/1-Evaluation.tsx +86 -86
  69. package/src/components/Lend/supply/2-ChooseAmount.tsx +70 -70
  70. package/src/components/Lend/supply/3-ApproveAllowance.tsx +25 -25
  71. package/src/components/Lend/supply/4-ConfirmTransfer.tsx +104 -104
  72. package/src/components/Lend/supply/6-Transfer.tsx +32 -32
  73. package/src/components/Lend/supply/7-Success.tsx +49 -49
  74. package/src/components/Lend/supply/index.tsx +144 -144
  75. package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +73 -73
  76. package/src/components/Lend/withdraw/2-ChooseAmount.tsx +50 -50
  77. package/src/components/Lend/withdraw/3-Transfer.tsx +32 -32
  78. package/src/components/Lend/withdraw/4-Success.tsx +49 -49
  79. package/src/components/Lend/withdraw/index.tsx +101 -101
  80. package/src/components/LoadingModal.tsx +49 -49
  81. package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +47 -57
  82. package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +124 -124
  83. package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +104 -104
  84. package/src/components/StreamFactoring/borrow/4-ApproveAllowance.tsx +65 -65
  85. package/src/components/StreamFactoring/borrow/5-Permit.tsx +144 -144
  86. package/src/components/StreamFactoring/borrow/6-Transfer.tsx +37 -37
  87. package/src/components/StreamFactoring/borrow/7-Success.tsx +20 -20
  88. package/src/components/StreamFactoring/borrow/index.tsx +94 -95
  89. package/src/components/StreamFactoring/payment/ChooseAmount.tsx +54 -54
  90. package/src/components/StreamFactoring/payment/Success.tsx +23 -23
  91. package/src/components/StreamFactoring/payment/Transfer.tsx +34 -34
  92. package/src/components/StreamFactoring/payment/index.tsx +66 -66
  93. package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +61 -61
  94. package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +185 -185
  95. package/src/components/SuperfluidFactoring/index.tsx +85 -85
  96. package/src/components/TxDoneModal.tsx +83 -83
  97. package/src/components/TxSendModal.tsx +59 -59
  98. package/src/components/ViewOnExplorer.tsx +26 -26
  99. package/src/components/WidgetWrapper.tsx +74 -74
  100. package/src/components/WrapperModal.tsx +54 -54
  101. package/src/components/buttons/TableActionButton.tsx +36 -36
  102. package/src/components/buttons/index.ts +1 -1
  103. package/src/components/humaModal/HumaModal.tsx +68 -68
  104. package/src/components/humaModal/HumaModalHeader.tsx +70 -70
  105. package/src/components/humaModal/index.tsx +2 -2
  106. package/src/components/icons/approve-lender.svg +30 -30
  107. package/src/components/icons/auto-payback.svg +40 -40
  108. package/src/components/icons/check-circle.svg +3 -3
  109. package/src/components/icons/check-green.svg +3 -3
  110. package/src/components/icons/check.svg +10 -10
  111. package/src/components/icons/donut.svg +904 -904
  112. package/src/components/icons/ellipse.svg +3 -3
  113. package/src/components/icons/huma-full.svg +22 -22
  114. package/src/components/icons/huma.svg +15 -15
  115. package/src/components/icons/index.tsx +93 -93
  116. package/src/components/icons/loader.svg +229 -229
  117. package/src/components/icons/metamask.svg +31 -31
  118. package/src/components/icons/polygon.svg +16 -16
  119. package/src/components/icons/receipt.svg +3 -3
  120. package/src/components/icons/separator.svg +3 -3
  121. package/src/components/icons/sorry.svg +31 -31
  122. package/src/components/icons/usdc.svg +5 -5
  123. package/src/components/icons/wallet-connect.svg +11 -11
  124. package/src/cosmos/CreditLineBorrow.fixture.tsx +85 -85
  125. package/src/cosmos/CreditLinePayment.fixture.tsx +49 -49
  126. package/src/cosmos/InvoiceFactoringBorrow.fixture.tsx +111 -111
  127. package/src/cosmos/InvoiceFactoringPayment.fixture.tsx +67 -67
  128. package/src/cosmos/LendSupply.fixture.tsx +75 -75
  129. package/src/cosmos/LendWithdraw.fixture.tsx +43 -43
  130. package/src/cosmos/SDKTesting.fixture.tsx +557 -516
  131. package/src/cosmos/SuperfluidFactoringBorrow.fixture.tsx +12 -12
  132. package/src/cosmos/WalletWrapper.tsx +52 -52
  133. package/src/cosmos/abis/InvoiceNFT.json +644 -644
  134. package/src/cosmos/abis/ReceivableFactoringPool.json +1529 -1529
  135. package/src/cosmos/utils/index.ts +169 -169
  136. package/src/fonts/Recoleta/Recoleta-Black.otf +0 -0
  137. package/src/fonts/Recoleta/Recoleta-Bold.otf +0 -0
  138. package/src/fonts/Recoleta/Recoleta-Light.otf +0 -0
  139. package/src/fonts/Recoleta/Recoleta-Medium.otf +0 -0
  140. package/src/fonts/Recoleta/Recoleta-Regular.otf +0 -0
  141. package/src/fonts/Recoleta/Recoleta-RegularDEMO.otf +0 -0
  142. package/src/fonts/Recoleta/Recoleta-SemiBold.otf +0 -0
  143. package/src/fonts/Recoleta/Recoleta-Thin.otf +0 -0
  144. package/src/hooks/useEA.ts +72 -72
  145. package/src/hooks/useRedux.ts +6 -6
  146. package/src/index.css +61 -61
  147. package/src/index.tsx +219 -213
  148. package/src/react-app-env.d.ts +1 -1
  149. package/src/reportWebVitals.ts +15 -15
  150. package/src/setupTests.ts +6 -6
  151. package/src/store/index.ts +27 -27
  152. package/src/store/widgets.reducers.ts +120 -120
  153. package/src/store/widgets.selectors.ts +3 -3
  154. package/src/store/widgets.store.ts +55 -55
  155. package/src/theme/breakpoints.ts +10 -10
  156. package/src/theme/components.ts +70 -70
  157. package/src/theme/coreThemeConstants.ts +29 -29
  158. package/src/theme/cssMixins.ts +92 -92
  159. package/src/theme/hooks/useGetSizes.ts +31 -31
  160. package/src/theme/index.ts +24 -24
  161. package/src/theme/palette.ts +150 -150
  162. package/src/theme/shape.ts +7 -7
  163. package/src/theme/theme.types.ts +80 -80
  164. package/src/theme/typography.ts +117 -117
  165. package/src/utilTypes.d.ts +29 -29
  166. package/src/utils/env.ts +9 -9
  167. package/tsconfig.build.json +7 -7
  168. package/tsconfig.json +32 -32
  169. package/webpack.cosmos.js +54 -54
package/src/index.tsx CHANGED
@@ -1,213 +1,219 @@
1
- import './index.css'
2
-
3
- import { JsonRpcProvider } from '@ethersproject/providers'
4
- import { ThemeProvider } from '@mui/material'
5
- import { Provider as Eip1193Provider } from '@web3-react/types'
6
- import { Provider as AtomProvider } from 'jotai'
7
- import { Provider as ReduxProvider } from 'react-redux'
8
-
9
- import {
10
- CreditLineBorrow,
11
- CreditLineBorrowProps,
12
- } from './components/CreditLine/borrow'
13
- import {
14
- CreditLinePayment,
15
- CreditLinePaymentProps,
16
- } from './components/CreditLine/payment'
17
- import {
18
- InvoiceFactoringBorrow,
19
- InvoiceFactoringBorrowProps,
20
- } from './components/InvoiceFactoring/borrow'
21
- import {
22
- InvoiceFactoringPayment,
23
- InvoiceFactoringPaymentProps,
24
- } from './components/InvoiceFactoring/payment'
25
- import { LendSupply, LendSupplyProps } from './components/Lend/supply'
26
- import { LendWithdraw, LendWithdrawProps } from './components/Lend/withdraw'
27
- import { SuperfluidFactoring } from './components/SuperfluidFactoring'
28
- import { store } from './store'
29
- import { themeHuma } from './theme'
30
- import { WCProps } from './utilTypes'
31
-
32
- /**
33
- * Mapping of your JSON-RPC connections indexed by chainId
34
- * @typedef {Object} JsonRpcConnectionMap
35
- * @property {Object.<number, string|Array<string>|JsonRpcProvider|Array<JsonRpcProvider>>} chainId Chain id to map the JSON-RPC URL/URLs or JsonRpcProvider/JsonRpcProviders
36
- */
37
- type JsonRpcConnectionMap = {
38
- [chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[]
39
- }
40
-
41
- /**
42
- * Object representing the props passed to web3 provider
43
- * @typedef {Object} WidgetProps
44
- * @property {JsonRpcConnectionMap|undefined} jsonRpcUrlMap Optional mapping of your JSON-RPC connections indexed by chainId
45
- * @property {Eip1193Provider|JsonRpcProvider|null|undefined} provider Optional EIP-1193 provider or JsonRpc Provider
46
- */
47
- type WidgetProps = {
48
- jsonRpcUrlMap?: JsonRpcConnectionMap
49
- provider?: Eip1193Provider | JsonRpcProvider | null
50
- }
51
-
52
- function Widget(props: WCProps<WidgetProps>) {
53
- const { children } = props
54
- return (
55
- <ThemeProvider theme={themeHuma}>
56
- <ReduxProvider store={store}>
57
- <AtomProvider>{children}</AtomProvider>
58
- </ReduxProvider>
59
- </ThemeProvider>
60
- )
61
- }
62
-
63
- /**
64
- * Invoice factoring pool borrow widget props
65
- * @typedef {Object} InvoiceFactoringBorrowWidgetProps
66
- * @property {InvoiceFactoringBorrowProps} InvoiceFactoringBorrowProps - Invoice factoring pool borrow props.
67
- * @property {WidgetProps} WidgetProps - Widget general props.
68
- */
69
- type InvoiceFactoringBorrowWidgetProps = InvoiceFactoringBorrowProps &
70
- WidgetProps
71
-
72
- /**
73
- * Invoice factoring borrow widget
74
- *
75
- * @param {InvoiceFactoringBorrowWidgetProps} props - The invoice factoring pool borrow widget props.
76
- * @returns Invoice factoring pool borrow widget component
77
- */
78
- export function InvoiceFactoringBorrowWidget(
79
- props: InvoiceFactoringBorrowWidgetProps,
80
- ) {
81
- return (
82
- <Widget {...props}>
83
- <InvoiceFactoringBorrow {...props} />
84
- </Widget>
85
- )
86
- }
87
-
88
- /**
89
- * Invoice factoring pool payment widget props
90
- * @typedef {Object} InvoiceFactoringPaymentWidgetProps
91
- * @property {InvoiceFactoringPaymentProps} InvoiceFactoringPaymentProps - Invoice factoring pool payment props.
92
- * @property {WidgetProps} WidgetProps - Widget general props.
93
- */
94
- type InvoiceFactoringPaymentWidgetProps = InvoiceFactoringPaymentProps &
95
- WidgetProps
96
-
97
- /**
98
- * Invoice factoring payment widget
99
- *
100
- * @param {InvoiceFactoringPaymentWidgetProps} props - The invoice factoring pool payment widget props.
101
- * @returns Invoice factoring pool payment widget component
102
- */
103
- export function InvoiceFactoringPaymentWidget(
104
- props: InvoiceFactoringPaymentWidgetProps,
105
- ) {
106
- return (
107
- <Widget {...props}>
108
- <InvoiceFactoringPayment {...props} />
109
- </Widget>
110
- )
111
- }
112
-
113
- /**
114
- * Credit line pool borrow widget props
115
- * @typedef {Object} CreditLineBorrowWidgetProps
116
- * @property {CreditLineBorrowProps} CreditLineBorrowProps - Credit line pool borrow props.
117
- * @property {WidgetProps} WidgetProps - Widget general props.
118
- */
119
- type CreditLineBorrowWidgetProps = CreditLineBorrowProps & WidgetProps
120
-
121
- /**
122
- * Credit line borrow widget
123
- *
124
- * @param {CreditLineBorrowWidgetProps} props - The credit line pool borrow widget props.
125
- * @returns Credit line pool borrow widget component
126
- */
127
- export function CreditLineBorrowWidget(props: CreditLineBorrowWidgetProps) {
128
- return (
129
- <Widget {...props}>
130
- <CreditLineBorrow {...props} />
131
- </Widget>
132
- )
133
- }
134
-
135
- /**
136
- * Credit line pool payment widget props
137
- * @typedef {Object} CreditLinePaymentWidgetProps
138
- * @property {CreditLinePaymentProps} CreditLinePaymentProps - Credit line pool payment props.
139
- * @property {WidgetProps} WidgetProps - Widget general props.
140
- */
141
- type CreditLinePaymentWidgetProps = CreditLinePaymentProps & WidgetProps
142
-
143
- /**
144
- * Credit line payment widget
145
- *
146
- * @param {CreditLinePaymentWidgetProps} props - The credit line pool payment widget props.
147
- * @returns Credit line pool payment widget component
148
- */
149
- export function CreditLinePaymentWidget(props: CreditLinePaymentWidgetProps) {
150
- return (
151
- <Widget {...props}>
152
- <CreditLinePayment {...props} />
153
- </Widget>
154
- )
155
- }
156
-
157
- /**
158
- * Lend pool supply widget props
159
- * @typedef {Object} LendSupplyWidgetProps
160
- * @property {LendSupplyProps} LendSupplyProps - Lend pool supply props.
161
- * @property {WidgetProps} WidgetProps - Widget general props.
162
- */
163
- type LendSupplyWidgetProps = LendSupplyProps & WidgetProps
164
-
165
- /**
166
- * Lend supply widget
167
- *
168
- * @param {LendSupplyWidgetProps} props - The lend pool supply widget props.
169
- * @returns Lend pool supply widget component
170
- */
171
- export function LendSupplyWidget(props: LendSupplyWidgetProps) {
172
- return (
173
- <Widget {...props}>
174
- <LendSupply {...props} />
175
- </Widget>
176
- )
177
- }
178
-
179
- /**
180
- * Lend pool withdraw widget props
181
- * @typedef {Object} LendWithdrawWidgetProps
182
- * @property {LendWithdrawProps} LendWithdrawProps - Lend pool withdraw props.
183
- * @property {WidgetProps} WidgetProps - Widget general props.
184
- */
185
- type LendWithdrawWidgetProps = LendWithdrawProps & WidgetProps
186
-
187
- /**
188
- * Lend withdraw widget
189
- *
190
- * @param {LendWithdrawProps & WidgetProps} props The lend pool withdraw widget props
191
- * @returns Lend pool withdraw widget component
192
- */
193
- export function LendWithdrawWidget(props: LendWithdrawWidgetProps) {
194
- return (
195
- <Widget {...props}>
196
- <LendWithdraw {...props} />
197
- </Widget>
198
- )
199
- }
200
-
201
- /**
202
- * Superfluid factoring widget
203
- *
204
- * @param {WidgetProps} props - The superfluid factoring widget props.
205
- * @returns Superfluid factoring widget component
206
- */
207
- export function SuperfluidFactoringWidget(props: WidgetProps) {
208
- return (
209
- <Widget {...props}>
210
- <SuperfluidFactoring />
211
- </Widget>
212
- )
213
- }
1
+ import './index.css'
2
+
3
+ import { JsonRpcProvider } from '@ethersproject/providers'
4
+ import {
5
+ Provider as Web3Provider,
6
+ ProviderProps as Web3Props,
7
+ } from '@huma-finance/shared'
8
+ import { ThemeProvider } from '@mui/material'
9
+ import { Provider as Eip1193Provider } from '@web3-react/types'
10
+ import { Provider as AtomProvider } from 'jotai'
11
+ import { Provider as ReduxProvider } from 'react-redux'
12
+
13
+ import {
14
+ CreditLineBorrow,
15
+ CreditLineBorrowProps,
16
+ } from './components/CreditLine/borrow'
17
+ import {
18
+ CreditLinePayment,
19
+ CreditLinePaymentProps,
20
+ } from './components/CreditLine/payment'
21
+ import {
22
+ InvoiceFactoringBorrow,
23
+ InvoiceFactoringBorrowProps,
24
+ } from './components/InvoiceFactoring/borrow'
25
+ import {
26
+ InvoiceFactoringPayment,
27
+ InvoiceFactoringPaymentProps,
28
+ } from './components/InvoiceFactoring/payment'
29
+ import { LendSupply, LendSupplyProps } from './components/Lend/supply'
30
+ import { LendWithdraw, LendWithdrawProps } from './components/Lend/withdraw'
31
+ import { SuperfluidFactoring } from './components/SuperfluidFactoring'
32
+ import { store } from './store'
33
+ import { themeHuma } from './theme'
34
+ import { WCProps } from './utilTypes'
35
+
36
+ /**
37
+ * Mapping of your JSON-RPC connections indexed by chainId
38
+ * @typedef {Object} JsonRpcConnectionMap
39
+ * @property {Object.<number, string|Array<string>|JsonRpcProvider|Array<JsonRpcProvider>>} chainId Chain id to map the JSON-RPC URL/URLs or JsonRpcProvider/JsonRpcProviders
40
+ */
41
+ type JsonRpcConnectionMap = {
42
+ [chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[]
43
+ }
44
+
45
+ /**
46
+ * Object representing the props passed to web3 provider
47
+ * @typedef {Object} WidgetProps
48
+ * @property {JsonRpcConnectionMap|undefined} jsonRpcUrlMap Optional mapping of your JSON-RPC connections indexed by chainId
49
+ * @property {Eip1193Provider|JsonRpcProvider|null|undefined} provider Optional EIP-1193 provider or JsonRpc Provider
50
+ */
51
+ type WidgetProps = {
52
+ jsonRpcUrlMap?: JsonRpcConnectionMap
53
+ provider?: Eip1193Provider | JsonRpcProvider | null
54
+ }
55
+
56
+ function Widget(props: WCProps<WidgetProps>) {
57
+ const { children } = props
58
+ return (
59
+ <ThemeProvider theme={themeHuma}>
60
+ <ReduxProvider store={store}>
61
+ <Web3Provider {...(props as Web3Props)}>
62
+ <AtomProvider>{children}</AtomProvider>
63
+ </Web3Provider>
64
+ </ReduxProvider>
65
+ </ThemeProvider>
66
+ )
67
+ }
68
+
69
+ /**
70
+ * Invoice factoring pool borrow widget props
71
+ * @typedef {Object} InvoiceFactoringBorrowWidgetProps
72
+ * @property {InvoiceFactoringBorrowProps} InvoiceFactoringBorrowProps - Invoice factoring pool borrow props.
73
+ * @property {WidgetProps} WidgetProps - Widget general props.
74
+ */
75
+ type InvoiceFactoringBorrowWidgetProps = InvoiceFactoringBorrowProps &
76
+ WidgetProps
77
+
78
+ /**
79
+ * Invoice factoring borrow widget
80
+ *
81
+ * @param {InvoiceFactoringBorrowWidgetProps} props - The invoice factoring pool borrow widget props.
82
+ * @returns Invoice factoring pool borrow widget component
83
+ */
84
+ export function InvoiceFactoringBorrowWidget(
85
+ props: InvoiceFactoringBorrowWidgetProps,
86
+ ) {
87
+ return (
88
+ <Widget {...props}>
89
+ <InvoiceFactoringBorrow {...props} />
90
+ </Widget>
91
+ )
92
+ }
93
+
94
+ /**
95
+ * Invoice factoring pool payment widget props
96
+ * @typedef {Object} InvoiceFactoringPaymentWidgetProps
97
+ * @property {InvoiceFactoringPaymentProps} InvoiceFactoringPaymentProps - Invoice factoring pool payment props.
98
+ * @property {WidgetProps} WidgetProps - Widget general props.
99
+ */
100
+ type InvoiceFactoringPaymentWidgetProps = InvoiceFactoringPaymentProps &
101
+ WidgetProps
102
+
103
+ /**
104
+ * Invoice factoring payment widget
105
+ *
106
+ * @param {InvoiceFactoringPaymentWidgetProps} props - The invoice factoring pool payment widget props.
107
+ * @returns Invoice factoring pool payment widget component
108
+ */
109
+ export function InvoiceFactoringPaymentWidget(
110
+ props: InvoiceFactoringPaymentWidgetProps,
111
+ ) {
112
+ return (
113
+ <Widget {...props}>
114
+ <InvoiceFactoringPayment {...props} />
115
+ </Widget>
116
+ )
117
+ }
118
+
119
+ /**
120
+ * Credit line pool borrow widget props
121
+ * @typedef {Object} CreditLineBorrowWidgetProps
122
+ * @property {CreditLineBorrowProps} CreditLineBorrowProps - Credit line pool borrow props.
123
+ * @property {WidgetProps} WidgetProps - Widget general props.
124
+ */
125
+ type CreditLineBorrowWidgetProps = CreditLineBorrowProps & WidgetProps
126
+
127
+ /**
128
+ * Credit line borrow widget
129
+ *
130
+ * @param {CreditLineBorrowWidgetProps} props - The credit line pool borrow widget props.
131
+ * @returns Credit line pool borrow widget component
132
+ */
133
+ export function CreditLineBorrowWidget(props: CreditLineBorrowWidgetProps) {
134
+ return (
135
+ <Widget {...props}>
136
+ <CreditLineBorrow {...props} />
137
+ </Widget>
138
+ )
139
+ }
140
+
141
+ /**
142
+ * Credit line pool payment widget props
143
+ * @typedef {Object} CreditLinePaymentWidgetProps
144
+ * @property {CreditLinePaymentProps} CreditLinePaymentProps - Credit line pool payment props.
145
+ * @property {WidgetProps} WidgetProps - Widget general props.
146
+ */
147
+ type CreditLinePaymentWidgetProps = CreditLinePaymentProps & WidgetProps
148
+
149
+ /**
150
+ * Credit line payment widget
151
+ *
152
+ * @param {CreditLinePaymentWidgetProps} props - The credit line pool payment widget props.
153
+ * @returns Credit line pool payment widget component
154
+ */
155
+ export function CreditLinePaymentWidget(props: CreditLinePaymentWidgetProps) {
156
+ return (
157
+ <Widget {...props}>
158
+ <CreditLinePayment {...props} />
159
+ </Widget>
160
+ )
161
+ }
162
+
163
+ /**
164
+ * Lend pool supply widget props
165
+ * @typedef {Object} LendSupplyWidgetProps
166
+ * @property {LendSupplyProps} LendSupplyProps - Lend pool supply props.
167
+ * @property {WidgetProps} WidgetProps - Widget general props.
168
+ */
169
+ type LendSupplyWidgetProps = LendSupplyProps & WidgetProps
170
+
171
+ /**
172
+ * Lend supply widget
173
+ *
174
+ * @param {LendSupplyWidgetProps} props - The lend pool supply widget props.
175
+ * @returns Lend pool supply widget component
176
+ */
177
+ export function LendSupplyWidget(props: LendSupplyWidgetProps) {
178
+ return (
179
+ <Widget {...props}>
180
+ <LendSupply {...props} />
181
+ </Widget>
182
+ )
183
+ }
184
+
185
+ /**
186
+ * Lend pool withdraw widget props
187
+ * @typedef {Object} LendWithdrawWidgetProps
188
+ * @property {LendWithdrawProps} LendWithdrawProps - Lend pool withdraw props.
189
+ * @property {WidgetProps} WidgetProps - Widget general props.
190
+ */
191
+ type LendWithdrawWidgetProps = LendWithdrawProps & WidgetProps
192
+
193
+ /**
194
+ * Lend withdraw widget
195
+ *
196
+ * @param {LendWithdrawProps & WidgetProps} props The lend pool withdraw widget props
197
+ * @returns Lend pool withdraw widget component
198
+ */
199
+ export function LendWithdrawWidget(props: LendWithdrawWidgetProps) {
200
+ return (
201
+ <Widget {...props}>
202
+ <LendWithdraw {...props} />
203
+ </Widget>
204
+ )
205
+ }
206
+
207
+ /**
208
+ * Superfluid factoring widget
209
+ *
210
+ * @param {WidgetProps} props - The superfluid factoring widget props.
211
+ * @returns Superfluid factoring widget component
212
+ */
213
+ export function SuperfluidFactoringWidget(props: WidgetProps) {
214
+ return (
215
+ <Widget {...props}>
216
+ <SuperfluidFactoring />
217
+ </Widget>
218
+ )
219
+ }
@@ -1 +1 @@
1
- /// <reference types="react-scripts" />
1
+ /// <reference types="react-scripts" />
@@ -1,15 +1,15 @@
1
- import { ReportHandler } from 'web-vitals';
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry);
7
- getFID(onPerfEntry);
8
- getFCP(onPerfEntry);
9
- getLCP(onPerfEntry);
10
- getTTFB(onPerfEntry);
11
- });
12
- }
13
- };
14
-
15
- export default reportWebVitals;
1
+ import { ReportHandler } from 'web-vitals';
2
+
3
+ const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
+ if (onPerfEntry && onPerfEntry instanceof Function) {
5
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
+ getCLS(onPerfEntry);
7
+ getFID(onPerfEntry);
8
+ getFCP(onPerfEntry);
9
+ getLCP(onPerfEntry);
10
+ getTTFB(onPerfEntry);
11
+ });
12
+ }
13
+ };
14
+
15
+ export default reportWebVitals;
package/src/setupTests.ts CHANGED
@@ -1,6 +1,6 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
3
- // allows you to do things like:
4
- // expect(element).toHaveTextContent(/react/i)
5
- // learn more: https://github.com/testing-library/jest-dom
6
- import '@testing-library/jest-dom/extend-expect'
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
3
+ // allows you to do things like:
4
+ // expect(element).toHaveTextContent(/react/i)
5
+ // learn more: https://github.com/testing-library/jest-dom
6
+ import '@testing-library/jest-dom/extend-expect'
@@ -1,27 +1,27 @@
1
- import {
2
- Action,
3
- ActionCreator,
4
- AnyAction,
5
- configureStore,
6
- ThunkAction,
7
- } from '@reduxjs/toolkit'
8
-
9
- import widgetsReducers from './widgets.reducers'
10
-
11
- export const store = configureStore({
12
- reducer: {
13
- widget: widgetsReducers,
14
- },
15
- })
16
-
17
- export type AppDispatch = typeof store.dispatch
18
- export type RootState = ReturnType<typeof store.getState>
19
- export type AppThunk<ReturnType = void> = ThunkAction<
20
- ReturnType,
21
- RootState,
22
- unknown,
23
- Action<string>
24
- >
25
- export type AppActionThunk<ReturnType = void> = ActionCreator<
26
- ThunkAction<ReturnType, RootState, unknown, AnyAction>
27
- >
1
+ import {
2
+ Action,
3
+ ActionCreator,
4
+ AnyAction,
5
+ configureStore,
6
+ ThunkAction,
7
+ } from '@reduxjs/toolkit'
8
+
9
+ import widgetsReducers from './widgets.reducers'
10
+
11
+ export const store = configureStore({
12
+ reducer: {
13
+ widget: widgetsReducers,
14
+ },
15
+ })
16
+
17
+ export type AppDispatch = typeof store.dispatch
18
+ export type RootState = ReturnType<typeof store.getState>
19
+ export type AppThunk<ReturnType = void> = ThunkAction<
20
+ ReturnType,
21
+ RootState,
22
+ unknown,
23
+ Action<string>
24
+ >
25
+ export type AppActionThunk<ReturnType = void> = ActionCreator<
26
+ ThunkAction<ReturnType, RootState, unknown, AnyAction>
27
+ >