@xyo-network/react-theme 2.26.36 → 2.26.39
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/dist/docs.json +1 -1
- package/package.json +1 -1
- package/src/appThemeOptions.tsx +30 -0
- package/src/fontFamily.ts +1 -0
- package/src/index.ts +6 -0
- package/src/partialDarkThemeOptions.tsx +28 -0
- package/src/partialLightThemeOptions.tsx +24 -0
- package/src/themeOptions.ts +103 -0
- package/src/webThemeOptions.tsx +8 -0
package/dist/docs.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"fileName": "index.ts",
|
|
11
11
|
"line": 1,
|
|
12
12
|
"character": 0,
|
|
13
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
13
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/413a933/packages/theme/src/index.ts#L1"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material'
|
|
2
|
+
import merge from 'lodash/merge'
|
|
3
|
+
|
|
4
|
+
import { themeOptions } from './themeOptions'
|
|
5
|
+
|
|
6
|
+
const partialAppThemeOptions: ThemeOptions = {
|
|
7
|
+
components: {
|
|
8
|
+
MuiTypography: {
|
|
9
|
+
styleOverrides: {
|
|
10
|
+
root: ({ ownerState }) => {
|
|
11
|
+
const { clamped } = ownerState
|
|
12
|
+
|
|
13
|
+
if (clamped) {
|
|
14
|
+
const maxWidth = parseInt(clamped as string, 10)
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
textOverflow: 'ellipsis',
|
|
19
|
+
whiteSpace: 'nowrap',
|
|
20
|
+
width: `clamp(1%, 100%, ${maxWidth}px)`,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
spacing: 8,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const appThemeOptions = merge({}, themeOptions, partialAppThemeOptions)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const fontFamilyPrimary = ['Lexend Deca', 'Helvetica', 'sans-serif'].join(',')
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { darken, ThemeOptions } from '@mui/material'
|
|
2
|
+
import merge from 'lodash/merge'
|
|
3
|
+
|
|
4
|
+
const appComponents: ThemeOptions['components'] = {
|
|
5
|
+
MuiPaper: {
|
|
6
|
+
defaultProps: {
|
|
7
|
+
variant: 'elevation',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const partialDarkThemeOptions: ThemeOptions = {
|
|
13
|
+
palette: {
|
|
14
|
+
background: {
|
|
15
|
+
default: darken('#171626', 0.1),
|
|
16
|
+
paper: '#171626',
|
|
17
|
+
},
|
|
18
|
+
mode: 'dark',
|
|
19
|
+
primary: {
|
|
20
|
+
main: '#9993F5',
|
|
21
|
+
},
|
|
22
|
+
secondary: {
|
|
23
|
+
main: '#8EC8FF',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const partialAppDarkThemeOptions: ThemeOptions = merge({}, partialDarkThemeOptions, { components: appComponents })
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material'
|
|
2
|
+
import merge from 'lodash/merge'
|
|
3
|
+
|
|
4
|
+
const appComponents: ThemeOptions['components'] = {
|
|
5
|
+
MuiPaper: {
|
|
6
|
+
defaultProps: {
|
|
7
|
+
variant: 'outlined',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const partialLightThemeOptions: ThemeOptions = {
|
|
13
|
+
palette: {
|
|
14
|
+
mode: 'light',
|
|
15
|
+
primary: {
|
|
16
|
+
main: '#1f1a66',
|
|
17
|
+
},
|
|
18
|
+
secondary: {
|
|
19
|
+
main: '#0f68c9',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const partialAppLightThemeOptions: ThemeOptions = merge({}, partialLightThemeOptions, { components: appComponents })
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
import { fontFamilyPrimary } from './fontFamily'
|
|
4
|
+
|
|
5
|
+
export const components: ThemeOptions['components'] = {
|
|
6
|
+
MuiCard: {
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
justifyContent: 'space-between',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
MuiCardHeader: {
|
|
16
|
+
styleOverrides: {
|
|
17
|
+
content: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
MuiLink: {
|
|
25
|
+
defaultProps: {
|
|
26
|
+
underline: 'none',
|
|
27
|
+
},
|
|
28
|
+
styleOverrides: {
|
|
29
|
+
root: {
|
|
30
|
+
'&:hover': {
|
|
31
|
+
filter: 'brightness(75%)',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
MuiTableCell: {
|
|
37
|
+
styleOverrides: {
|
|
38
|
+
body: {
|
|
39
|
+
fontFamily: 'monospace',
|
|
40
|
+
whiteSpace: 'nowrap',
|
|
41
|
+
},
|
|
42
|
+
head: {
|
|
43
|
+
fontWeight: 700,
|
|
44
|
+
whiteSpace: 'nowrap',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const typography: ThemeOptions['typography'] = {
|
|
51
|
+
body1: {
|
|
52
|
+
lineHeight: 1.57,
|
|
53
|
+
},
|
|
54
|
+
body2: {
|
|
55
|
+
lineHeight: 1.57,
|
|
56
|
+
},
|
|
57
|
+
button: {
|
|
58
|
+
fontSize: '1rem',
|
|
59
|
+
textTransform: 'inherit',
|
|
60
|
+
},
|
|
61
|
+
fontFamily: fontFamilyPrimary,
|
|
62
|
+
fontWeightBold: 700,
|
|
63
|
+
fontWeightLight: 200,
|
|
64
|
+
fontWeightMedium: 600,
|
|
65
|
+
fontWeightRegular: 400,
|
|
66
|
+
h1: {
|
|
67
|
+
fontFamily: fontFamilyPrimary,
|
|
68
|
+
fontSize: '4rem',
|
|
69
|
+
},
|
|
70
|
+
h2: {
|
|
71
|
+
fontFamily: fontFamilyPrimary,
|
|
72
|
+
fontSize: '2.4rem',
|
|
73
|
+
},
|
|
74
|
+
h3: {
|
|
75
|
+
fontFamily: fontFamilyPrimary,
|
|
76
|
+
fontSize: '2.24rem',
|
|
77
|
+
},
|
|
78
|
+
h4: {
|
|
79
|
+
fontSize: '2rem',
|
|
80
|
+
},
|
|
81
|
+
h5: {
|
|
82
|
+
fontSize: '1.5rem',
|
|
83
|
+
},
|
|
84
|
+
h6: {
|
|
85
|
+
fontSize: '1.25rem',
|
|
86
|
+
},
|
|
87
|
+
subtitle1: {
|
|
88
|
+
opacity: '50%',
|
|
89
|
+
textTransform: 'uppercase',
|
|
90
|
+
},
|
|
91
|
+
subtitle2: {
|
|
92
|
+
opacity: '50%',
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const themeOptions: ThemeOptions = {
|
|
97
|
+
components,
|
|
98
|
+
shape: {
|
|
99
|
+
borderRadius: 8,
|
|
100
|
+
},
|
|
101
|
+
spacing: 16,
|
|
102
|
+
typography,
|
|
103
|
+
}
|