@huma-finance/widgets 0.0.6-alpha.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/.env.example +3 -0
- package/.eslintignore +2 -0
- package/.eslintrc.js +64 -0
- package/.prettierignore +4 -0
- package/.prettierrc.js +16 -0
- package/API.md +331 -0
- package/LICENSE +661 -0
- package/README.md +48 -0
- package/babel.config.js +15 -0
- package/config-overrides.js +9 -0
- package/cosmos.config.json +7 -0
- package/cypress/e2e/01-invoice-factoring-borrow.test.ts +62 -0
- package/cypress/support/e2e.ts +76 -0
- package/cypress/support/ethereum.ts +142 -0
- package/cypress/tsconfig.json +9 -0
- package/cypress/utils/index.ts +54 -0
- package/cypress.config.ts +20 -0
- package/dist/assets/output-15e10f9f.css +44 -0
- package/dist/cjs/assets/output-15e10f9f.css +44 -0
- package/dist/cjs/index.cjs +17576 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.d.ts +211 -0
- package/dist/index.js +17529 -0
- package/dist/index.js.map +1 -0
- package/jsdoc2md.json +20 -0
- package/package.json +193 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +40 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/rollup.config.js +81 -0
- package/src/components/Activity.tsx +123 -0
- package/src/components/AllowListModal.tsx +113 -0
- package/src/components/ApolloWrapper.tsx +15 -0
- package/src/components/ApproveAllowanceModal.tsx +118 -0
- package/src/components/BottomButton.tsx +31 -0
- package/src/components/ChooseAmountModal.tsx +315 -0
- package/src/components/CreditLine/borrow/1-Evaluation.tsx +159 -0
- package/src/components/CreditLine/borrow/2-AllowList.tsx +34 -0
- package/src/components/CreditLine/borrow/3-ChooseAmount.tsx +74 -0
- package/src/components/CreditLine/borrow/4-ApproveAllowance.tsx +29 -0
- package/src/components/CreditLine/borrow/5-Transfer.tsx +30 -0
- package/src/components/CreditLine/borrow/6-Success.tsx +30 -0
- package/src/components/CreditLine/borrow/index.tsx +119 -0
- package/src/components/CreditLine/payment/1-ChooseAmount.tsx +67 -0
- package/src/components/CreditLine/payment/2-ApproveAllowance.tsx +23 -0
- package/src/components/CreditLine/payment/3-Transfer.tsx +34 -0
- package/src/components/CreditLine/payment/4-Success.tsx +39 -0
- package/src/components/CreditLine/payment/index.tsx +94 -0
- package/src/components/ErrorModal.tsx +132 -0
- package/src/components/Factoring/FactoredList.tsx +143 -0
- package/src/components/Factoring/UpcomingList.tsx +90 -0
- package/src/components/Factoring/index.ts +2 -0
- package/src/components/HumaLoading.tsx +68 -0
- package/src/components/HumaTable.tsx +158 -0
- package/src/components/InvoiceFactoring/borrow/1-Evaluation.tsx +46 -0
- package/src/components/InvoiceFactoring/borrow/2-AllowList.tsx +34 -0
- package/src/components/InvoiceFactoring/borrow/3-ChooseAmount.tsx +92 -0
- package/src/components/InvoiceFactoring/borrow/4-ConfirmTransfer.tsx +104 -0
- package/src/components/InvoiceFactoring/borrow/5-ApproveNFT.tsx +55 -0
- package/src/components/InvoiceFactoring/borrow/6-Transfer.tsx +34 -0
- package/src/components/InvoiceFactoring/borrow/7-Success.tsx +20 -0
- package/src/components/InvoiceFactoring/borrow/index.tsx +96 -0
- package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +67 -0
- package/src/components/InvoiceFactoring/payment/2-ApproveAllowance.tsx +23 -0
- package/src/components/InvoiceFactoring/payment/3-Transfer.tsx +34 -0
- package/src/components/InvoiceFactoring/payment/4-Success.tsx +23 -0
- package/src/components/InvoiceFactoring/payment/index.tsx +86 -0
- package/src/components/Lend/supply/1-Evaluation.tsx +86 -0
- package/src/components/Lend/supply/2-ChooseAmount.tsx +70 -0
- package/src/components/Lend/supply/3-ApproveAllowance.tsx +25 -0
- package/src/components/Lend/supply/4-ConfirmTransfer.tsx +104 -0
- package/src/components/Lend/supply/6-Transfer.tsx +32 -0
- package/src/components/Lend/supply/7-Success.tsx +49 -0
- package/src/components/Lend/supply/index.tsx +144 -0
- package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +73 -0
- package/src/components/Lend/withdraw/2-ChooseAmount.tsx +50 -0
- package/src/components/Lend/withdraw/3-Transfer.tsx +32 -0
- package/src/components/Lend/withdraw/4-Success.tsx +49 -0
- package/src/components/Lend/withdraw/index.tsx +101 -0
- package/src/components/LoadingModal.tsx +49 -0
- package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +57 -0
- package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +124 -0
- package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +104 -0
- package/src/components/StreamFactoring/borrow/4-ApproveAllowance.tsx +65 -0
- package/src/components/StreamFactoring/borrow/5-Permit.tsx +144 -0
- package/src/components/StreamFactoring/borrow/6-Transfer.tsx +37 -0
- package/src/components/StreamFactoring/borrow/7-Success.tsx +20 -0
- package/src/components/StreamFactoring/borrow/index.tsx +95 -0
- package/src/components/StreamFactoring/payment/ChooseAmount.tsx +54 -0
- package/src/components/StreamFactoring/payment/Success.tsx +23 -0
- package/src/components/StreamFactoring/payment/Transfer.tsx +34 -0
- package/src/components/StreamFactoring/payment/index.tsx +66 -0
- package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +61 -0
- package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +185 -0
- package/src/components/SuperfluidFactoring/index.tsx +85 -0
- package/src/components/TxDoneModal.tsx +83 -0
- package/src/components/TxSendModal.tsx +59 -0
- package/src/components/ViewOnExplorer.tsx +26 -0
- package/src/components/WidgetWrapper.tsx +74 -0
- package/src/components/WrapperModal.tsx +54 -0
- package/src/components/buttons/TableActionButton.tsx +36 -0
- package/src/components/buttons/index.ts +1 -0
- package/src/components/humaModal/HumaModal.tsx +68 -0
- package/src/components/humaModal/HumaModalHeader.tsx +70 -0
- package/src/components/humaModal/index.tsx +2 -0
- package/src/components/icons/approve-lender.svg +30 -0
- package/src/components/icons/auto-payback.svg +40 -0
- package/src/components/icons/check-circle.svg +3 -0
- package/src/components/icons/check-green.svg +3 -0
- package/src/components/icons/check.svg +10 -0
- package/src/components/icons/donut.svg +904 -0
- package/src/components/icons/ellipse.svg +3 -0
- package/src/components/icons/ethereum.svg +1 -0
- package/src/components/icons/huma-full.svg +22 -0
- package/src/components/icons/huma.svg +15 -0
- package/src/components/icons/index.tsx +93 -0
- package/src/components/icons/loader.svg +229 -0
- package/src/components/icons/metamask.svg +31 -0
- package/src/components/icons/polygon.svg +16 -0
- package/src/components/icons/receipt.svg +3 -0
- package/src/components/icons/separator.svg +3 -0
- package/src/components/icons/sorry.svg +31 -0
- package/src/components/icons/spinner.gif +0 -0
- package/src/components/icons/usdc.svg +5 -0
- package/src/components/icons/wallet-connect.svg +12 -0
- package/src/cosmos/CreditLineBorrow.fixture.tsx +85 -0
- package/src/cosmos/CreditLinePayment.fixture.tsx +49 -0
- package/src/cosmos/InvoiceFactoringBorrow.fixture.tsx +111 -0
- package/src/cosmos/InvoiceFactoringPayment.fixture.tsx +67 -0
- package/src/cosmos/LendSupply.fixture.tsx +75 -0
- package/src/cosmos/LendWithdraw.fixture.tsx +43 -0
- package/src/cosmos/SDKTesting.fixture.tsx +507 -0
- package/src/cosmos/SuperfluidFactoringBorrow.fixture.tsx +12 -0
- package/src/cosmos/WalletWrapper.tsx +52 -0
- package/src/cosmos/abis/InvoiceNFT.json +644 -0
- package/src/cosmos/abis/ReceivableFactoringPool.json +1529 -0
- package/src/cosmos/utils/index.ts +169 -0
- package/src/fonts/Inter/Inter-Black.ttf +0 -0
- package/src/fonts/Inter/Inter-Bold.ttf +0 -0
- package/src/fonts/Inter/Inter-ExtraBold.ttf +0 -0
- package/src/fonts/Inter/Inter-ExtraLight.ttf +0 -0
- package/src/fonts/Inter/Inter-Light.ttf +0 -0
- package/src/fonts/Inter/Inter-Medium.ttf +0 -0
- package/src/fonts/Inter/Inter-Regular.ttf +0 -0
- package/src/fonts/Inter/Inter-SemiBold.ttf +0 -0
- package/src/fonts/Inter/Inter-Thin.ttf +0 -0
- package/src/fonts/Recoleta/Recoleta-Black.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-Bold.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-Light.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-Medium.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-Regular.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-RegularDEMO.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-SemiBold.otf +0 -0
- package/src/fonts/Recoleta/Recoleta-Thin.otf +0 -0
- package/src/fonts/Roboto/LICENSE.txt +202 -0
- package/src/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/src/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/src/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/src/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/src/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/src/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/src/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/src/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/src/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/src/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/src/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/src/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Black.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Bold.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Book.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Heavy.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Light.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Regular.ttf +0 -0
- package/src/fonts/UniNeue/UniNeue-Thin.ttf +0 -0
- package/src/hooks/useEA.ts +70 -0
- package/src/hooks/useRedux.ts +6 -0
- package/src/index.css +61 -0
- package/src/index.tsx +219 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/reportWebVitals.ts +15 -0
- package/src/setupTests.ts +6 -0
- package/src/store/index.ts +27 -0
- package/src/store/widgets.reducers.ts +120 -0
- package/src/store/widgets.selectors.ts +3 -0
- package/src/store/widgets.store.ts +55 -0
- package/src/theme/breakpoints.ts +10 -0
- package/src/theme/components.ts +70 -0
- package/src/theme/coreThemeConstants.ts +29 -0
- package/src/theme/cssMixins.ts +92 -0
- package/src/theme/hooks/useGetSizes.ts +34 -0
- package/src/theme/index.ts +24 -0
- package/src/theme/palette.ts +150 -0
- package/src/theme/shape.ts +7 -0
- package/src/theme/theme.types.ts +80 -0
- package/src/theme/typography.ts +117 -0
- package/src/utilTypes.d.ts +29 -0
- package/src/utils/env.ts +9 -0
- package/tsconfig.build.json +7 -0
- package/tsconfig.json +32 -0
- package/webpack.cosmos.js +54 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
import { breakpoints } from './breakpoints'
|
|
4
|
+
import { components } from './components'
|
|
5
|
+
import { coreThemeConstants } from './coreThemeConstants'
|
|
6
|
+
import { cssMixins } from './cssMixins'
|
|
7
|
+
import { paletteCore } from './palette'
|
|
8
|
+
import { shape } from './shape'
|
|
9
|
+
import { typography } from './typography'
|
|
10
|
+
|
|
11
|
+
export * from './components'
|
|
12
|
+
|
|
13
|
+
const themeBase = createTheme({
|
|
14
|
+
breakpoints,
|
|
15
|
+
cssMixins,
|
|
16
|
+
palette: paletteCore,
|
|
17
|
+
shape,
|
|
18
|
+
spacing: coreThemeConstants.spacingBase,
|
|
19
|
+
typography,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const themeHuma = createTheme(themeBase, {
|
|
23
|
+
components: components(themeBase),
|
|
24
|
+
})
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
// primary
|
|
4
|
+
export const primaryPurple = '#c265d0'
|
|
5
|
+
export const primaryBlueLight = '#4473EB'
|
|
6
|
+
export const primaryGradient =
|
|
7
|
+
'linear-gradient(232.71deg, #A363F4 4.17%, #FF6A8A 178.69%);'
|
|
8
|
+
|
|
9
|
+
// Secondary
|
|
10
|
+
export const pendingBlueDark = '#1148B2'
|
|
11
|
+
export const pendingBlue = '#226BF9'
|
|
12
|
+
export const pendingBlueMid = '#4584FF'
|
|
13
|
+
export const pendingBlueLight = '#79A5FB'
|
|
14
|
+
export const warningRed = '#D01638'
|
|
15
|
+
export const warningRedMid = '#E71E44'
|
|
16
|
+
export const warningRedLight = '#FF4366'
|
|
17
|
+
export const warningRedPastel = '#FF708B'
|
|
18
|
+
export const backgroundBlue = '#081824'
|
|
19
|
+
export const darkBackground = '#0C2436'
|
|
20
|
+
|
|
21
|
+
export const white = '#FFFFFF'
|
|
22
|
+
|
|
23
|
+
export const black = {
|
|
24
|
+
1: '#000000',
|
|
25
|
+
2: '#2A252F',
|
|
26
|
+
3: '#423B46',
|
|
27
|
+
4: '#534E59',
|
|
28
|
+
5: '#6B6572',
|
|
29
|
+
6: '#76707E',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const orange = {
|
|
33
|
+
100: '#FFA979',
|
|
34
|
+
300: '#FF8F51',
|
|
35
|
+
500: '#FD792F',
|
|
36
|
+
700: '#E96216',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const yellow = {
|
|
40
|
+
100: '#FFECB0',
|
|
41
|
+
300: '#FFE07E',
|
|
42
|
+
500: '#FFD54F',
|
|
43
|
+
700: '#F8BE28',
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const grey = {
|
|
47
|
+
100: '#CBD6DE',
|
|
48
|
+
200: '#6B6B6B',
|
|
49
|
+
300: '#606060',
|
|
50
|
+
400: '#5E7485',
|
|
51
|
+
600: '#395062',
|
|
52
|
+
700: '#6B6572',
|
|
53
|
+
800: '#4A4A4A',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const green = {
|
|
57
|
+
100: '#66F8D3',
|
|
58
|
+
200: '#1DE9B6',
|
|
59
|
+
500: '#00CA97',
|
|
60
|
+
700: '#0DBC90',
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const blue = {
|
|
64
|
+
50: '#8AD5FF',
|
|
65
|
+
100: '#3DB9FF',
|
|
66
|
+
200: '#0BA7FE',
|
|
67
|
+
300: '#0095E9',
|
|
68
|
+
500: '#0070AF',
|
|
69
|
+
800: '#013859',
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const red = {
|
|
73
|
+
50: '#FEAEA8',
|
|
74
|
+
100: '#FA8B84',
|
|
75
|
+
200: '#EA726A',
|
|
76
|
+
300: '#E75E55',
|
|
77
|
+
500: '#BC4E46',
|
|
78
|
+
800: '#472D33',
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const purple = {
|
|
82
|
+
100: '#DEB8FC',
|
|
83
|
+
200: '#C476FF',
|
|
84
|
+
300: '#B452FF',
|
|
85
|
+
500: '#9D3BE8',
|
|
86
|
+
800: '#651C9C',
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const paletteCore: ThemeOptions['palette'] = {
|
|
90
|
+
alert: {
|
|
91
|
+
contrastText: black[1],
|
|
92
|
+
dark: yellow[700],
|
|
93
|
+
light: yellow[300],
|
|
94
|
+
main: yellow[500],
|
|
95
|
+
},
|
|
96
|
+
background: {
|
|
97
|
+
default: white,
|
|
98
|
+
paper: white,
|
|
99
|
+
},
|
|
100
|
+
common: {
|
|
101
|
+
black: black[1],
|
|
102
|
+
white,
|
|
103
|
+
},
|
|
104
|
+
default: {
|
|
105
|
+
contrastText: black[1],
|
|
106
|
+
dark: white,
|
|
107
|
+
light: white,
|
|
108
|
+
main: white,
|
|
109
|
+
},
|
|
110
|
+
divider: grey[600],
|
|
111
|
+
error: {
|
|
112
|
+
dark: warningRed,
|
|
113
|
+
light: warningRedPastel,
|
|
114
|
+
main: warningRedLight,
|
|
115
|
+
},
|
|
116
|
+
grey,
|
|
117
|
+
info: {
|
|
118
|
+
contrastText: black[1],
|
|
119
|
+
dark: pendingBlue,
|
|
120
|
+
light: pendingBlueLight,
|
|
121
|
+
main: pendingBlueMid,
|
|
122
|
+
superDark: darkBackground,
|
|
123
|
+
superLight: blue[50],
|
|
124
|
+
},
|
|
125
|
+
mode: 'light',
|
|
126
|
+
primary: {
|
|
127
|
+
main: primaryPurple,
|
|
128
|
+
light: primaryBlueLight,
|
|
129
|
+
},
|
|
130
|
+
secondary: {
|
|
131
|
+
contrastText: black[1],
|
|
132
|
+
main: white,
|
|
133
|
+
},
|
|
134
|
+
success: {
|
|
135
|
+
light: green[100],
|
|
136
|
+
main: green[200],
|
|
137
|
+
},
|
|
138
|
+
text: {
|
|
139
|
+
primary: black[5],
|
|
140
|
+
secondary: black[6],
|
|
141
|
+
tertiary: black[3],
|
|
142
|
+
quaternary: grey[400],
|
|
143
|
+
},
|
|
144
|
+
warning: {
|
|
145
|
+
contrastText: black[1],
|
|
146
|
+
light: orange[100],
|
|
147
|
+
main: orange[500],
|
|
148
|
+
superLight: yellow[100],
|
|
149
|
+
},
|
|
150
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Theme as MUITheme,
|
|
3
|
+
PaletteColorOptions,
|
|
4
|
+
} from '@mui/material/styles'
|
|
5
|
+
import { cssMixins } from './cssMixins'
|
|
6
|
+
|
|
7
|
+
declare module '@mui/material/styles/createPalette' {
|
|
8
|
+
interface TypeText {
|
|
9
|
+
quaternary: string
|
|
10
|
+
tertiary: string
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '@mui/material/styles' {
|
|
15
|
+
interface Theme {
|
|
16
|
+
cssMixins: typeof cssMixins
|
|
17
|
+
}
|
|
18
|
+
interface ThemeOptions {
|
|
19
|
+
cssMixins: typeof cssMixins
|
|
20
|
+
}
|
|
21
|
+
interface PaletteColor {
|
|
22
|
+
superDark?: string
|
|
23
|
+
superLight?: string
|
|
24
|
+
}
|
|
25
|
+
interface SimplePaletteColorOptions {
|
|
26
|
+
contrastText?: string
|
|
27
|
+
dark?: string
|
|
28
|
+
faded?: string
|
|
29
|
+
light?: string
|
|
30
|
+
main: string
|
|
31
|
+
superDark?: string
|
|
32
|
+
superLight?: string
|
|
33
|
+
}
|
|
34
|
+
interface Palette {
|
|
35
|
+
alert: SimplePaletteColorOptions
|
|
36
|
+
default: SimplePaletteColorOptions
|
|
37
|
+
}
|
|
38
|
+
interface PaletteOptions {
|
|
39
|
+
alert?: PaletteColorOptions
|
|
40
|
+
default?: PaletteColorOptions
|
|
41
|
+
}
|
|
42
|
+
interface TypographyVariants {
|
|
43
|
+
body2Small: React.CSSProperties
|
|
44
|
+
h3Large: React.CSSProperties
|
|
45
|
+
labsSmall: React.CSSProperties
|
|
46
|
+
nav: React.CSSProperties
|
|
47
|
+
navSub: React.CSSProperties
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface TypographyVariantsOptions {
|
|
51
|
+
body2Small: React.CSSProperties
|
|
52
|
+
h3Large: React.CSSProperties
|
|
53
|
+
labsSmall: React.CSSProperties
|
|
54
|
+
nav: React.CSSProperties
|
|
55
|
+
navSub: React.CSSProperties
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Update the Typography's variant prop options
|
|
60
|
+
declare module '@mui/material/Typography' {
|
|
61
|
+
interface TypographyPropsVariantOverrides {
|
|
62
|
+
body2Small: true
|
|
63
|
+
h3Large: true
|
|
64
|
+
labsSmall: true
|
|
65
|
+
nav: true
|
|
66
|
+
navSub: true
|
|
67
|
+
sceneHeader: true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare module '@mui/material/Button' {
|
|
72
|
+
interface ButtonPropsColorOverrides {
|
|
73
|
+
alert: PaletteColorOptions | true
|
|
74
|
+
default: PaletteColorOptions | true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare module '@emotion/react' {
|
|
79
|
+
export interface Theme extends MUITheme {}
|
|
80
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material'
|
|
2
|
+
import { coreThemeConstants } from './coreThemeConstants'
|
|
3
|
+
|
|
4
|
+
export const typography: ThemeOptions['typography'] = {
|
|
5
|
+
body1: {
|
|
6
|
+
fontWeight: 400,
|
|
7
|
+
fontSize: '1.5rem',
|
|
8
|
+
letterSpacing: coreThemeConstants.letterSpacing.md,
|
|
9
|
+
lineHeight: coreThemeConstants.lineHeight.lg,
|
|
10
|
+
},
|
|
11
|
+
body2: {
|
|
12
|
+
fontWeight: 400,
|
|
13
|
+
fontSize: '1rem',
|
|
14
|
+
letterSpacing: coreThemeConstants.letterSpacing.xs,
|
|
15
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
16
|
+
},
|
|
17
|
+
body2Small: {
|
|
18
|
+
fontSize: '0.875rem',
|
|
19
|
+
fontWeight: 400,
|
|
20
|
+
letterSpacing: coreThemeConstants.letterSpacing.xs,
|
|
21
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
22
|
+
},
|
|
23
|
+
fontFamily: coreThemeConstants.fontFamily,
|
|
24
|
+
fontWeightBold: 600,
|
|
25
|
+
fontWeightLight: 300,
|
|
26
|
+
fontWeightMedium: 500,
|
|
27
|
+
fontWeightRegular: 400,
|
|
28
|
+
h1: {
|
|
29
|
+
/**
|
|
30
|
+
* h1 in design
|
|
31
|
+
* Used for
|
|
32
|
+
* - title in ProductCard
|
|
33
|
+
* - Apy value in ProductCard
|
|
34
|
+
* - title in protocol-position block
|
|
35
|
+
*/
|
|
36
|
+
fontSize: '1.5rem',
|
|
37
|
+
fontWeight: 900,
|
|
38
|
+
letterSpacing: coreThemeConstants.letterSpacing.xs,
|
|
39
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
40
|
+
},
|
|
41
|
+
h2: {
|
|
42
|
+
/**
|
|
43
|
+
* h2 in design
|
|
44
|
+
* Used for
|
|
45
|
+
* - amount in small AmountDetail
|
|
46
|
+
* - Alert titles
|
|
47
|
+
*/
|
|
48
|
+
fontSize: '1.25rem',
|
|
49
|
+
fontWeight: 500,
|
|
50
|
+
letterSpacing: coreThemeConstants.letterSpacing.sm,
|
|
51
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
52
|
+
},
|
|
53
|
+
h3: {
|
|
54
|
+
/**
|
|
55
|
+
* h3 in design
|
|
56
|
+
* Used for
|
|
57
|
+
* - Secondary headers in below fold content
|
|
58
|
+
*/
|
|
59
|
+
fontSize: '1rem',
|
|
60
|
+
fontWeight: 500,
|
|
61
|
+
letterSpacing: coreThemeConstants.letterSpacing.md,
|
|
62
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
63
|
+
},
|
|
64
|
+
h3Large: {
|
|
65
|
+
/**
|
|
66
|
+
* h3 in design
|
|
67
|
+
* Used for
|
|
68
|
+
* - Secondary headers in below fold content
|
|
69
|
+
*/
|
|
70
|
+
fontSize: '1.875rem',
|
|
71
|
+
fontWeight: 500,
|
|
72
|
+
letterSpacing: coreThemeConstants.letterSpacing.md,
|
|
73
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
74
|
+
},
|
|
75
|
+
h4: {
|
|
76
|
+
/**
|
|
77
|
+
* Used for
|
|
78
|
+
* - large feature text on product home pages
|
|
79
|
+
*/
|
|
80
|
+
fontSize: '2.5rem',
|
|
81
|
+
fontWeight: 700,
|
|
82
|
+
letterSpacing: coreThemeConstants.letterSpacing.lg,
|
|
83
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
84
|
+
},
|
|
85
|
+
h5: {
|
|
86
|
+
/**
|
|
87
|
+
* Used for
|
|
88
|
+
* - main title of scenes,
|
|
89
|
+
*/
|
|
90
|
+
fontSize: '1.75rem',
|
|
91
|
+
fontWeight: 500,
|
|
92
|
+
letterSpacing: coreThemeConstants.letterSpacing.md,
|
|
93
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
94
|
+
},
|
|
95
|
+
h6: {
|
|
96
|
+
fontSize: '1.25rem',
|
|
97
|
+
fontWeight: 500,
|
|
98
|
+
letterSpacing: coreThemeConstants.letterSpacing.sm,
|
|
99
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
100
|
+
color: 'rgba(0, 0, 0, 0.87)',
|
|
101
|
+
},
|
|
102
|
+
labsSmall: {
|
|
103
|
+
fontSize: '0.75rem',
|
|
104
|
+
},
|
|
105
|
+
nav: {
|
|
106
|
+
fontSize: '0.875rem',
|
|
107
|
+
fontWeight: 400,
|
|
108
|
+
letterSpacing: coreThemeConstants.letterSpacing.sm,
|
|
109
|
+
lineHeight: coreThemeConstants.lineHeight.md,
|
|
110
|
+
},
|
|
111
|
+
navSub: {
|
|
112
|
+
fontSize: '0.75rem',
|
|
113
|
+
fontWeight: 500,
|
|
114
|
+
letterSpacing: coreThemeConstants.letterSpacing.md,
|
|
115
|
+
// lineHeight: '1rem',
|
|
116
|
+
},
|
|
117
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SvgIconProps } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
export type WCProps<P = {}> = P & {
|
|
4
|
+
children?: React.ReactNode
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type IconType = (
|
|
8
|
+
props: SvgIconProps<'svg', {}>,
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
) => React.ReactElement<any, string | React.JSXElementConstructor<any>>
|
|
11
|
+
|
|
12
|
+
export type ColumnType<T> = {
|
|
13
|
+
title: string
|
|
14
|
+
dataIndex?: string
|
|
15
|
+
width?: number
|
|
16
|
+
noSeparator?: boolean
|
|
17
|
+
style?: Record<string, string>
|
|
18
|
+
action?: (record: T) => React.ReactNode
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type CustomError = {
|
|
22
|
+
message: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
interface Window {
|
|
27
|
+
REACT_APP_FORCE_DEV_PREFIX_FOR_URLS: string
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/utils/env.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"noFallthroughCasesInSwitch": true,
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"jsxImportSource": "@emotion/react",
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
"declaration": true,
|
|
19
|
+
"declarationDir": "dts",
|
|
20
|
+
"emitDeclarationOnly": true,
|
|
21
|
+
"composite": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src/**/*", "src/**/*.json"],
|
|
24
|
+
"references": [
|
|
25
|
+
{
|
|
26
|
+
"path": "../huma-shared"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "../huma-sdk"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const webpack = require('webpack')
|
|
2
|
+
const dotenv = require('dotenv')
|
|
3
|
+
|
|
4
|
+
module.exports = (webpackConfig) => {
|
|
5
|
+
const { module } = webpackConfig
|
|
6
|
+
const { rules } = module
|
|
7
|
+
return {
|
|
8
|
+
...webpackConfig,
|
|
9
|
+
resolve: {
|
|
10
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
11
|
+
fallback: {
|
|
12
|
+
crypto: require.resolve('crypto-browserify'),
|
|
13
|
+
stream: require.resolve('stream-browserify'),
|
|
14
|
+
assert: require.resolve('assert'),
|
|
15
|
+
path: require.resolve('path-browserify'),
|
|
16
|
+
buffer: require.resolve('buffer'),
|
|
17
|
+
},
|
|
18
|
+
alias: {
|
|
19
|
+
zlib: require.resolve('browserify-zlib'),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
module: {
|
|
23
|
+
rules: [
|
|
24
|
+
...rules,
|
|
25
|
+
{
|
|
26
|
+
test: /\.svg$/i,
|
|
27
|
+
use: ['@svgr/webpack', 'url-loader'],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
test: /\.(png|jpe?g|gif)$/i,
|
|
31
|
+
use: [
|
|
32
|
+
{
|
|
33
|
+
loader: 'file-loader',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
plugins: [
|
|
40
|
+
new webpack.ProvidePlugin({
|
|
41
|
+
Buffer: ['buffer', 'Buffer'],
|
|
42
|
+
}),
|
|
43
|
+
// new webpack.DefinePlugin({
|
|
44
|
+
// ...Object.entries(dotenv.config().parsed).reduce(
|
|
45
|
+
// (acc, curr) => ({
|
|
46
|
+
// ...acc,
|
|
47
|
+
// [`process.env.${curr[0]}`]: JSON.stringify(curr[1]),
|
|
48
|
+
// }),
|
|
49
|
+
// {},
|
|
50
|
+
// ),
|
|
51
|
+
// }),
|
|
52
|
+
],
|
|
53
|
+
}
|
|
54
|
+
}
|