@huma-finance/widgets 0.0.78-beta.1034 → 0.0.78-beta.1044

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 (42) hide show
  1. package/dist/index.js +12133 -10900
  2. package/dist/src/components/Lend/solanaWithdraw/1-Option.d.ts +12 -0
  3. package/dist/src/components/Lend/solanaWithdraw/2-WithdrawAndDepositConfirm.d.ts +15 -0
  4. package/dist/src/components/Lend/solanaWithdraw/{1-ConfirmTransfer.d.ts → 3-WithdrawOnlyConfirm.d.ts} +1 -1
  5. package/dist/src/components/Lend/solanaWithdraw/4-TransferAndDeposit.d.ts +13 -0
  6. package/dist/src/components/Lend/solanaWithdraw/{3-Done.d.ts → 6-Done.d.ts} +3 -1
  7. package/dist/src/components/Lend/solanaWithdraw/components/Apy.d.ts +7 -0
  8. package/dist/src/components/Lend/solanaWithdraw/components/Benefit.d.ts +2 -0
  9. package/dist/src/components/Lend/solanaWithdraw/components/CommitSwitcher.d.ts +12 -0
  10. package/dist/src/components/Lend/solanaWithdraw/components/ModeSelector.d.ts +12 -0
  11. package/dist/src/components/Lend/solanaWithdraw/components/SelectModeTitle.d.ts +2 -0
  12. package/dist/src/components/Lend/solanaWithdraw/index.d.ts +10 -0
  13. package/dist/src/components/TxDoneModal.d.ts +1 -1
  14. package/dist/src/components/WidgetWrapper.d.ts +2 -1
  15. package/dist/src/components/icons/index.d.ts +7 -0
  16. package/dist/src/store/widgets.store.d.ts +3 -0
  17. package/package.json +5 -5
  18. package/src/components/Lend/solanaWithdraw/1-Option.tsx +180 -0
  19. package/src/components/Lend/solanaWithdraw/2-WithdrawAndDepositConfirm.tsx +208 -0
  20. package/src/components/Lend/solanaWithdraw/{1-ConfirmTransfer.tsx → 3-WithdrawOnlyConfirm.tsx} +2 -2
  21. package/src/components/Lend/solanaWithdraw/4-TransferAndDeposit.tsx +274 -0
  22. package/src/components/Lend/solanaWithdraw/{3-Done.tsx → 6-Done.tsx} +27 -3
  23. package/src/components/Lend/solanaWithdraw/components/Apy.tsx +126 -0
  24. package/src/components/Lend/solanaWithdraw/components/Benefit.tsx +63 -0
  25. package/src/components/Lend/solanaWithdraw/components/CommitSwitcher.tsx +198 -0
  26. package/src/components/Lend/solanaWithdraw/components/ModeSelector.tsx +148 -0
  27. package/src/components/Lend/solanaWithdraw/components/SelectModeTitle.tsx +61 -0
  28. package/src/components/Lend/solanaWithdraw/index.tsx +102 -12
  29. package/src/components/TxDoneModal.tsx +3 -3
  30. package/src/components/WidgetWrapper.tsx +3 -1
  31. package/src/components/icons/huma-no-empty-space.svg +15 -0
  32. package/src/components/icons/index.tsx +49 -14
  33. package/src/components/icons/minus-sign-inactive.svg +4 -0
  34. package/src/components/icons/minus-sign.svg +14 -0
  35. package/src/components/icons/mode-classic.svg +3 -0
  36. package/src/components/icons/mode-maxi.svg +3 -0
  37. package/src/components/icons/plus-sign-inactive.svg +4 -0
  38. package/src/components/icons/plus-sign.svg +14 -0
  39. package/src/hooks/useLogOnFirstMount.ts +1 -1
  40. package/src/store/widgets.store.ts +3 -0
  41. /package/dist/src/components/Lend/solanaWithdraw/{2-Transfer.d.ts → 5-Transfer.d.ts} +0 -0
  42. /package/src/components/Lend/solanaWithdraw/{2-Transfer.tsx → 5-Transfer.tsx} +0 -0
@@ -1,25 +1,32 @@
1
1
  import { SvgIconProps } from '@mui/material'
2
- import HumaLogoSvg from './huma.svg?react'
2
+ import ApproveLenderSvg from './approve-lender.svg?react'
3
+ import AutoPaybackSvg from './auto-payback.svg?react'
4
+ import CeloSvg from './celo.svg?react'
5
+ import CheckCircleSvg from './check-circle.svg?react'
6
+ import CheckGreenSvg from './check-green.svg?react'
7
+ import CheckSvg from './check.svg?react'
8
+ import CongratulationsSvg from './congratulations.svg?react'
9
+ import DonutSvg from './donut.svg?react'
10
+ import EthereumSvg from './ethereum.svg?react'
3
11
  import HumaFullLogoSvg from './huma-full.svg?react'
12
+ import HumaNoEmptySpaceSvg from './huma-no-empty-space.svg?react'
13
+ import HumaPointsSvg from './huma-points.svg?react'
14
+ import HumaLogoSvg from './huma.svg?react'
15
+ import LoaderSvg from './loader.svg?react'
4
16
  import MetamaskSvg from './metamask.svg?react'
5
- import WalletConnectSvg from './wallet-connect.svg?react'
6
- import EthereumSvg from './ethereum.svg?react'
17
+ import MinusSignInactiveSvg from './minus-sign-inactive.svg?react'
18
+ import MinusSignSvg from './minus-sign.svg?react'
19
+ import ModeClassicSvg from './mode-classic.svg?react'
20
+ import ModeMaxiSvg from './mode-maxi.svg?react'
21
+ import PlusSignInactiveSvg from './plus-sign-inactive.svg?react'
22
+ import PlusSignSvg from './plus-sign.svg?react'
7
23
  import PolygonSvg from './polygon.svg?react'
8
24
  import ReceiptSvg from './receipt.svg?react'
25
+ import RibbonSvg from './ribbon.svg?react'
9
26
  import SeparatorSvg from './separator.svg?react'
10
- import LoaderSvg from './loader.svg?react'
11
27
  import SorrySvg from './sorry.svg?react'
12
- import CheckSvg from './check.svg?react'
13
- import CheckGreenSvg from './check-green.svg?react'
14
- import CheckCircleSvg from './check-circle.svg?react'
15
- import AutoPaybackSvg from './auto-payback.svg?react'
16
- import ApproveLenderSvg from './approve-lender.svg?react'
17
- import DonutSvg from './donut.svg?react'
18
28
  import UsdcSvg from './usdc.svg?react'
19
- import CeloSvg from './celo.svg?react'
20
- import CongratulationsSvg from './congratulations.svg?react'
21
- import RibbonSvg from './ribbon.svg?react'
22
- import HumaPointsSvg from './huma-points.svg?react'
29
+ import WalletConnectSvg from './wallet-connect.svg?react'
23
30
 
24
31
  export function HumaIcon(props: SvgIconProps): React.ReactElement {
25
32
  return <HumaLogoSvg {...props} />
@@ -29,6 +36,10 @@ export function HumaFullIcon(props: SvgIconProps): React.ReactElement {
29
36
  return <HumaFullLogoSvg {...props} />
30
37
  }
31
38
 
39
+ export function HumaNoEmptySpaceIcon(props: SvgIconProps): React.ReactElement {
40
+ return <HumaNoEmptySpaceSvg {...props} />
41
+ }
42
+
32
43
  export function MetamaskIcon(props: SvgIconProps): React.ReactElement {
33
44
  return <MetamaskSvg {...props} />
34
45
  }
@@ -105,6 +116,30 @@ export function HumaPointsIcon(props: SvgIconProps): React.ReactElement {
105
116
  return <HumaPointsSvg {...props} />
106
117
  }
107
118
 
119
+ export function ModeClassicIcon(props: SvgIconProps): React.ReactElement {
120
+ return <ModeClassicSvg {...props} />
121
+ }
122
+
123
+ export function ModeMaxiIcon(props: SvgIconProps): React.ReactElement {
124
+ return <ModeMaxiSvg {...props} />
125
+ }
126
+
127
+ export function MinusSignIcon(props: SvgIconProps): React.ReactElement {
128
+ return <MinusSignSvg {...props} />
129
+ }
130
+
131
+ export function PlusSignIcon(props: SvgIconProps): React.ReactElement {
132
+ return <PlusSignSvg {...props} />
133
+ }
134
+
135
+ export function MinusSignInactiveIcon(props: SvgIconProps): React.ReactElement {
136
+ return <MinusSignInactiveSvg {...props} />
137
+ }
138
+
139
+ export function PlusSignInactiveIcon(props: SvgIconProps): React.ReactElement {
140
+ return <PlusSignInactiveSvg {...props} />
141
+ }
142
+
108
143
  export function getIcon(icon: string) {
109
144
  if (!icon) return null
110
145
 
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="60" height="61" viewBox="0 0 60 61" fill="none">
2
+ <circle cx="30" cy="30.8257" r="30" fill="white" fill-opacity="0.05"/>
3
+ <path d="M21 32.8257V28.8257H39V32.8257H21Z" fill="#464646"/>
4
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="30" cy="30" r="29.5" fill="white" fill-opacity="0.05" stroke="url(#paint0_linear_9564_1347)"/>
3
+ <path d="M21 32V28H39V32H21Z" fill="white"/>
4
+ <defs>
5
+ <linearGradient id="paint0_linear_9564_1347" x1="60" y1="5.78314" x2="3.23158e-06" y2="60" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#C733FF"/>
7
+ <stop offset="1" stop-color="#74DEFF"/>
8
+ <linearGradient id="paint1_linear_11507_28492" x1="39" y1="28.3855" x2="37.1353" y2="35.9681" gradientUnits="userSpaceOnUse">
9
+ <stop stop-color="#C733FF"/>
10
+ <stop offset="1" stop-color="#74DEFF"/>
11
+ </linearGradient>
12
+ </linearGradient>
13
+ </defs>
14
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2
+ <path d="M22.29 21.355C22.29 21.7112 22.0013 22 21.645 22H1.64502C1.28879 22 1 21.7112 1 21.355C1 20.9987 1.28879 20.71 1.64502 20.71H21.645C22.0013 20.71 22.29 20.9987 22.29 21.355ZM5.5166 17.1289C5.5166 17.6812 5.06889 18.1289 4.5166 18.1289H2C1.44772 18.1289 1 17.6812 1 17.1289V8.80664C1 8.25436 1.44772 7.80664 2 7.80664H4.5166C5.06889 7.80664 5.5166 8.25436 5.5166 8.80664V17.1289ZM13.9033 17.1289C13.9033 17.6812 13.4556 18.1289 12.9033 18.1289H10.3867C9.83443 18.1289 9.38672 17.6812 9.38672 17.1289V6.22559C9.38672 5.6733 9.83443 5.22559 10.3867 5.22559H12.9033C13.4556 5.22559 13.9033 5.6733 13.9033 6.22559V17.1289ZM22.29 17.1289C22.29 17.6812 21.8423 18.1289 21.29 18.1289H18.7744C18.2221 18.1289 17.7744 17.6812 17.7744 17.1289V3C17.7744 2.44772 18.2221 2 18.7744 2H21.29C21.8423 2 22.29 2.44772 22.29 3V17.1289Z" fill="#74DEFF"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2
+ <path d="M7.20774 19.856C6.41674 20.647 3.66272 21.3501 3.11872 21.4831C3.07872 21.4931 3.03974 21.4971 2.99974 21.4971C2.86674 21.4971 2.73774 21.444 2.64274 21.347C2.51874 21.221 2.47173 21.0391 2.51673 20.8681C2.66773 20.3011 3.45874 17.4301 4.24574 16.6431C4.68874 16.2001 5.26375 15.9721 5.84175 15.9781C6.40075 15.9911 6.93773 16.2281 7.35273 16.6431C8.19873 17.4901 8.13374 18.931 7.20774 19.856ZM17.2077 14.7291L16.9497 16.3C16.6497 18.19 15.3497 19.8001 13.5697 20.5101L11.1897 21.4601C11.1297 21.4901 11.0597 21.5001 10.9997 21.5001C10.8897 21.5001 10.7697 21.4601 10.6797 21.3801C10.5397 21.2701 10.4697 21.0801 10.5097 20.9001L11.1727 17.5641C11.0757 17.5831 10.9837 17.6091 10.8847 17.6261C10.7627 17.6471 10.6397 17.6571 10.5177 17.6571C9.93374 17.6571 9.35973 17.4201 8.92973 16.9911L7.00773 15.0681C6.48773 14.5481 6.25072 13.8181 6.37272 13.1131C6.38972 13.0161 6.41573 12.9251 6.43373 12.8291L3.11872 13.4881C3.08872 13.4981 3.04875 13.498 3.01875 13.498C2.86875 13.498 2.72874 13.4381 2.63874 13.3181C2.51874 13.1781 2.48873 12.9781 2.55873 12.8081L3.51875 10.4181C4.21875 8.64806 5.82873 7.34807 7.71873 7.04807L9.26972 6.78906C11.8307 3.85206 15.8527 2.24707 20.9977 2.24707C21.4117 2.24707 21.7477 2.58307 21.7477 2.99707C21.7497 8.14607 20.1457 12.1681 17.2077 14.7291ZM18.9687 9.69507C18.8147 7.18507 16.8137 5.18506 14.3037 5.03006C11.4047 6.27906 8.66075 8.70106 7.85075 13.3701C7.81275 13.5911 7.89574 13.835 8.06874 14.007L9.99073 15.9301C10.1627 16.1021 10.4077 16.1841 10.6287 16.1471C15.2987 15.3381 17.7207 12.5951 18.9687 9.69507ZM13.4997 8.25006C12.2567 8.25006 11.2497 9.25706 11.2497 10.5001C11.2497 11.7431 12.2567 12.7501 13.4997 12.7501C14.7427 12.7501 15.7497 11.7431 15.7497 10.5001C15.7497 9.25706 14.7427 8.25006 13.4997 8.25006Z" fill="#C677FF"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="60" height="61" viewBox="0 0 60 61" fill="none">
2
+ <circle cx="30" cy="30.8257" r="30" fill="white" fill-opacity="0.05"/>
3
+ <path d="M28.576 37.47V31.486H23V27.984H28.576V22H32.18V27.984H37.756V31.486H32.18V37.47H28.576Z" fill="#464646"/>
4
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="30" cy="30" r="29.5" fill="white" fill-opacity="0.05" stroke="url(#paint0_linear_9564_1363)"/>
3
+ <path d="M28.576 37.47V31.486H23V27.984H28.576V22H32.18V27.984H37.756V31.486H32.18V37.47H28.576Z" fill="white"/>
4
+ <defs>
5
+ <linearGradient id="paint0_linear_9564_1363" x1="60" y1="5.78314" x2="3.23158e-06" y2="60" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#C733FF"/>
7
+ <stop offset="1" stop-color="#74DEFF"/>
8
+ </linearGradient>
9
+ <linearGradient id="paint1_linear_11507_28493" x1="37.756" y1="23.4911" x2="22.3766" y2="36.7467" gradientUnits="userSpaceOnUse">
10
+ <stop stop-color="#C733FF"/>
11
+ <stop offset="1" stop-color="#74DEFF"/>
12
+ </linearGradient>
13
+ </defs>
14
+ </svg>
@@ -1,5 +1,5 @@
1
- import { useEffect, useRef } from 'react'
2
1
  import { LoggingActions } from '@huma-finance/web-shared'
2
+ import { useEffect, useRef } from 'react'
3
3
  import { selectWidgetLoggingContext } from '../store/widgets.selectors'
4
4
  import { useAppSelector } from './useRedux'
5
5
 
@@ -17,6 +17,9 @@ export enum WIDGET_STEP {
17
17
  Permit = 'Permit',
18
18
  ApproveAllowance = 'ApproveAllowance',
19
19
  MintNFT = 'MintNFT',
20
+ Option = 'Option',
21
+ ConfirmWithdrawAndDeposit = 'ConfirmWithdrawAndDeposit',
22
+ ConfirmWithdrawOnly = 'ConfirmWithdrawOnly',
20
23
  ConfirmTransfer = 'ConfirmTransfer',
21
24
  ApproveNFT = 'ApproveNFT',
22
25
  Transfer = 'Transfer',