@xyo-network/os-react-runtime 2.3.0 → 2.3.2

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 (87) hide show
  1. package/dist/browser/DappPage.d.ts.map +1 -1
  2. package/dist/browser/components/RenderHtml.d.ts.map +1 -1
  3. package/dist/browser/components/Widgets/StackOfWidgets.d.ts.map +1 -1
  4. package/dist/browser/components/Widgets/Types/BarGraph/HorizontalBarGraph.d.ts.map +1 -1
  5. package/dist/browser/components/Widgets/Types/DataColumns/TwoColTwoStat.d.ts.map +1 -1
  6. package/dist/browser/components/Widgets/Types/Tables/BooleanTable.d.ts.map +1 -1
  7. package/dist/browser/dapps/shared/accounts/components/AccountCard.d.ts.map +1 -1
  8. package/dist/browser/dapps/shared/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.d.ts.map +1 -1
  9. package/dist/browser/dapps/shared/name-service/DomainIcon.d.ts.map +1 -1
  10. package/dist/browser/dapps/shared/table/NextIteratorFlexbox.d.ts.map +1 -1
  11. package/dist/browser/hooks/ResourceHooks.d.ts.map +1 -1
  12. package/dist/browser/hooks/bios/useBios.d.ts.map +1 -1
  13. package/dist/browser/hooks/intent/useDappIntentListener2.d.ts.map +1 -1
  14. package/dist/browser/hooks/os/useDappRegistrationResults.d.ts.map +1 -1
  15. package/dist/browser/hooks/useDebugClick.d.ts.map +1 -1
  16. package/dist/browser/hooks/useDetectCustomer.d.ts.map +1 -1
  17. package/dist/browser/hooks/useStackReady.d.ts.map +1 -1
  18. package/dist/browser/index.mjs +533 -388
  19. package/dist/browser/index.mjs.map +1 -1
  20. package/dist/browser/modules/Dapp/Button/IconEx.d.ts.map +1 -1
  21. package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts.map +1 -1
  22. package/dist/browser/modules/Dapp/Page/Row.d.ts.map +1 -1
  23. package/dist/browser/modules/Dapp/modules/Window/AppBar.d.ts.map +1 -1
  24. package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts.map +1 -1
  25. package/dist/browser/modules/Dapp/modules/Window/LoadingFlexbox.d.ts.map +1 -1
  26. package/dist/browser/modules/Dapp/modules/Window/Trail.d.ts.map +1 -1
  27. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts.map +1 -1
  28. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenu.d.ts.map +1 -1
  29. package/dist/browser/modules/Dapp/modules/Window/hooks/useDappState.d.ts.map +1 -1
  30. package/dist/browser/modules/Dapp/modules/Window/hooks/useDecomposeDappSet.d.ts.map +1 -1
  31. package/dist/browser/modules/Dapp/modules/Window/menu/BottomMenuArea.d.ts +7 -0
  32. package/dist/browser/modules/Dapp/modules/Window/menu/BottomMenuArea.d.ts.map +1 -0
  33. package/dist/browser/modules/Dapp/modules/Window/menu/BottomNavigation.d.ts.map +1 -1
  34. package/dist/browser/modules/Dapp/modules/Window/menu/Drawer.d.ts +1 -2
  35. package/dist/browser/modules/Dapp/modules/Window/menu/Drawer.d.ts.map +1 -1
  36. package/dist/browser/modules/Dapp/modules/Window/menu/StyledListItems.d.ts +7 -0
  37. package/dist/browser/modules/Dapp/modules/Window/menu/StyledListItems.d.ts.map +1 -0
  38. package/dist/browser/modules/Dapp/modules/Window/menu/index.d.ts +1 -0
  39. package/dist/browser/modules/Dapp/modules/Window/menu/index.d.ts.map +1 -1
  40. package/dist/browser/modules/Dapp/modules/Window/menu/stories/DefaultData.d.ts +24 -0
  41. package/dist/browser/modules/Dapp/modules/Window/menu/stories/DefaultData.d.ts.map +1 -0
  42. package/dist/browser/modules/Dapp/modules/access-interface/components/Dialog.d.ts.map +1 -1
  43. package/dist/browser/settings/Theme/ThemeCssVars.d.ts +1 -1
  44. package/dist/browser/settings/Theme/ThemeCssVars.d.ts.map +1 -1
  45. package/package.json +11 -10
  46. package/src/DappPage.tsx +6 -3
  47. package/src/components/RenderHtml.tsx +1 -0
  48. package/src/components/Widgets/StackOfWidgets.tsx +1 -0
  49. package/src/components/Widgets/Types/BarGraph/HorizontalBarGraph.tsx +1 -0
  50. package/src/components/Widgets/Types/DataColumns/TwoColTwoStat.tsx +1 -0
  51. package/src/components/Widgets/Types/Tables/BooleanTable.tsx +1 -0
  52. package/src/dapps/shared/accounts/components/AccountCard.tsx +1 -0
  53. package/src/dapps/shared/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.tsx +1 -0
  54. package/src/dapps/shared/accounts/components/PaymentMethods.tsx +5 -5
  55. package/src/dapps/shared/name-service/DomainIcon.tsx +3 -4
  56. package/src/dapps/shared/table/NextIteratorFlexbox.tsx +3 -2
  57. package/src/hooks/ResourceHooks.ts +1 -0
  58. package/src/hooks/bios/useBios.ts +1 -2
  59. package/src/hooks/bios/useKernel.ts +2 -2
  60. package/src/hooks/intent/useDappIntentListener2.tsx +1 -0
  61. package/src/hooks/os/useDappRegistrationResults.tsx +1 -0
  62. package/src/hooks/useDebugClick.tsx +1 -0
  63. package/src/hooks/useDetectCustomer.tsx +1 -0
  64. package/src/hooks/useStackReady.tsx +1 -0
  65. package/src/modules/Dapp/Button/IconEx.tsx +3 -2
  66. package/src/modules/Dapp/Button/hooks/useLaunchPoint.tsx +1 -0
  67. package/src/modules/Dapp/Page/Row.tsx +1 -0
  68. package/src/modules/Dapp/modules/Window/AppBar.tsx +9 -6
  69. package/src/modules/Dapp/modules/Window/DappWindow.tsx +1 -0
  70. package/src/modules/Dapp/modules/Window/LoadingFlexbox.tsx +1 -0
  71. package/src/modules/Dapp/modules/Window/Trail.tsx +2 -0
  72. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.tsx +1 -0
  73. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.tsx +1 -0
  74. package/src/modules/Dapp/modules/Window/hooks/useDappState.tsx +1 -0
  75. package/src/modules/Dapp/modules/Window/hooks/useDecomposeDappSet.tsx +1 -0
  76. package/src/modules/Dapp/modules/Window/menu/BottomMenuArea.tsx +133 -0
  77. package/src/modules/Dapp/modules/Window/menu/BottomNavigation.tsx +2 -0
  78. package/src/modules/Dapp/modules/Window/menu/Drawer.tsx +52 -116
  79. package/src/modules/Dapp/modules/Window/menu/StyledListItems.tsx +36 -0
  80. package/src/modules/Dapp/modules/Window/menu/index.ts +1 -0
  81. package/src/modules/Dapp/modules/Window/menu/stories/DefaultData.tsx +119 -0
  82. package/src/modules/Dapp/modules/Window/menu/stories/Drawer.stories.tsx +35 -0
  83. package/src/modules/Dapp/modules/Window/menu/stories/default.manifest.json +20 -0
  84. package/src/modules/Dapp/modules/access-interface/components/Dialog.tsx +2 -1
  85. package/src/settings/Theme/ThemeCssVars.ts +46 -20
  86. package/src/settings/Theme/ThemeProvider.tsx +3 -3
  87. package/dist/browser/xyoOS-Icon-Black-ACSS4SEQ.svg +0 -1
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @eslint-react/no-array-index-key */
1
2
  import {
2
3
  alpha, Card, CardContent, Chip, Container, Divider, Typography, useTheme,
3
4
  } from '@mui/material'
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */
1
2
  import type { DappName, XyOsContext } from '@xyo-network/os-model'
2
3
  import {
3
4
  useEffect, useRef, useState,
@@ -1,6 +1,7 @@
1
1
  import type { XyOsContext } from '@xyo-network/os-model'
2
2
  import { DappIntentTypes } from '@xyo-network/os-model'
3
3
 
4
+ // eslint-disable-next-line @eslint-react/hooks-extra/no-redundant-custom-hook
4
5
  export const useDappState = (intentType?: DappIntentTypes, context?: XyOsContext | null) => {
5
6
  const minimized = intentType === DappIntentTypes.Minimize
6
7
  const open = intentType === DappIntentTypes.Launch
@@ -2,6 +2,7 @@ import type { RegisteredReactDappSet } from '@xyo-network/os-react-model'
2
2
 
3
3
  import { NodeManifest } from '../NodeManifest.js'
4
4
 
5
+ // eslint-disable-next-line @eslint-react/hooks-extra/no-redundant-custom-hook
5
6
  export const useDecomposeDappSet = (dappSet?: RegisteredReactDappSet) => {
6
7
  const { dapp } = dappSet ?? {}
7
8
  const DappComponent = dapp?.params.modes?.window?.component ?? NodeManifest
@@ -0,0 +1,133 @@
1
+ /* eslint-disable @eslint-react/no-array-index-key */
2
+ import {
3
+ BugReport, KeyboardArrowDownRounded, KeyboardArrowUpRounded,
4
+ } from '@mui/icons-material'
5
+ import {
6
+ Card,
7
+ Collapse,
8
+ Divider,
9
+ IconButton,
10
+ Stack,
11
+ Toolbar,
12
+ Tooltip,
13
+ Typography,
14
+ useTheme,
15
+ } from '@mui/material'
16
+ import { RotationAnimation } from '@xylabs/react-animation'
17
+ import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
18
+ import { DarkModeIconButtonForColorScheme } from '@xylabs/react-invertible-theme'
19
+ import { LinkEx } from '@xylabs/react-link'
20
+ import React, { useState } from 'react'
21
+
22
+ // eslint-disable-next-line import-x/no-internal-modules
23
+ import XyoOSLogoWhite from './img/xyoOS-Icon-White.svg'
24
+ import { socialLinksData } from './SocialData.js'
25
+
26
+ export interface BottomMenuAreaProps {
27
+ backgroundColor: string
28
+ openDebug: () => void
29
+ }
30
+
31
+ export const BottomMenuArea: React.FC<BottomMenuAreaProps> = ({ openDebug, backgroundColor }) => {
32
+ const theme = useTheme()
33
+ const [expanded, setExpanded] = useState(false)
34
+ const logo = XyoOSLogoWhite
35
+
36
+ // Toggle expand/collapse
37
+ const handleExpandClick = () => {
38
+ setExpanded(!expanded)
39
+ }
40
+
41
+ return (
42
+ <Card
43
+ sx={{
44
+ position: 'relative',
45
+ borderTopLeftRadius: '10px',
46
+ borderTopRightRadius: '10px',
47
+ borderBottomLeftRadius: '0px',
48
+ borderBottomRightRadius: '0px',
49
+ backgroundColor: backgroundColor,
50
+ overflow: 'hidden',
51
+ }}
52
+ elevation={4}
53
+ >
54
+ {/* Collapsed View */}
55
+ <FlexCol paddingY={1} alignItems="stretch">
56
+ <Stack
57
+ paddingX={2}
58
+ justifyContent="space-between"
59
+ flexDirection="row"
60
+ gap={0.5}
61
+ onClick={handleExpandClick}
62
+ sx={{ textTransform: 'none', cursor: 'pointer' }}
63
+ >
64
+ <Typography gutterBottom={false}>More</Typography>
65
+ {expanded ? <KeyboardArrowUpRounded sx={{ color: '#fff' }} /> : <KeyboardArrowDownRounded sx={{ color: '#fff' }} />}
66
+ </Stack>
67
+ </FlexCol>
68
+ {/* Expanded Content */}
69
+ <Collapse in={expanded} timeout="auto" unmountOnExit sx={{ paddingBottom: 3, color: '#fff' }}>
70
+ <Divider flexItem></Divider>
71
+ <FlexCol alignItems="center">
72
+ <Toolbar sx={{ paddingX: 1.5 }}>
73
+ <Tooltip title="Debug Node View">
74
+ <IconButton onClick={openDebug} sx={{ color: '#fff' }}>
75
+ <BugReport />
76
+ </IconButton>
77
+ </Tooltip>
78
+ <Tooltip title="Toggle Light/Dark Mode">
79
+ <span>
80
+ <DarkModeIconButtonForColorScheme defaultLightModeColor="warning" />
81
+ </span>
82
+ </Tooltip>
83
+ </Toolbar>
84
+ <FlexRow flexWrap="wrap">
85
+ {socialLinksData.map((social, index) => (
86
+ <RotationAnimation key={index} rotation={20}>
87
+ <IconButton
88
+ sx={{ color: '#fff' }}
89
+ href={social.link}
90
+ target="_blank"
91
+
92
+ >
93
+ {social.icon}
94
+ </IconButton>
95
+ </RotationAnimation>
96
+ ))}
97
+ </FlexRow>
98
+ <FlexRow padding={1} justifyContent="center" gap={0.5}>
99
+ <Typography variant="body2" color={theme.palette.text.primary}>
100
+ Powered By
101
+ </Typography>
102
+ <img
103
+ style={{ color: theme.palette.text.primary, fill: theme.palette.text.primary }}
104
+ src={logo}
105
+ width="auto"
106
+ height="20px"
107
+ />
108
+ </FlexRow>
109
+ <Typography variant="caption" color={theme.palette.text.primary}>
110
+ Copyright © 2024 XY Labs, Inc.
111
+ </Typography>
112
+ <Stack gap={0.5} flexDirection="row">
113
+ <LinkEx color="inherit" target="_blank" href="https://xylabs.com/privacy/">
114
+ <Typography variant="caption">Privacy</Typography>
115
+ </LinkEx>
116
+ {' '}
117
+
118
+ {' '}
119
+ <LinkEx color="inherit" target="_blank" href="https://xylabs.com/terms/">
120
+ <Typography variant="caption">Terms</Typography>
121
+ </LinkEx>
122
+ {' '}
123
+
124
+ {' '}
125
+ <LinkEx color="inherit" target="_blank" href="https://xyo.network/">
126
+ <Typography variant="caption">XYO Website</Typography>
127
+ </LinkEx>
128
+ </Stack>
129
+ </FlexCol>
130
+ </Collapse>
131
+ </Card>
132
+ )
133
+ }
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @eslint-react/no-array-index-key */
2
+ /* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */
1
3
  import type { BottomNavigationProps } from '@mui/material'
2
4
  import {
3
5
  BottomNavigation, BottomNavigationAction, Paper, styled,
@@ -1,27 +1,21 @@
1
- import { BugReport } from '@mui/icons-material'
1
+ /* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */
2
2
  import type { DrawerProps } from '@mui/material'
3
3
  import {
4
- Divider,
4
+ alpha,
5
+ darken,
5
6
  Drawer,
6
- IconButton,
7
7
  List,
8
8
  ListItem,
9
- ListItemButton,
10
9
  ListItemIcon,
11
10
  ListItemText,
12
- Stack,
13
- styled,
14
- Toolbar,
15
11
  Tooltip,
16
12
  Typography,
17
13
  useTheme,
18
14
  } from '@mui/material'
19
- import { RotationAnimation } from '@xylabs/react-animation'
20
15
  import {
21
16
  FlexCol, FlexGrowRow, FlexRow,
22
17
  } from '@xylabs/react-flexbox'
23
- import { DarkModeIconButtonForColorScheme, useColorSchemeEx } from '@xylabs/react-invertible-theme'
24
- import { LinkEx } from '@xylabs/react-link'
18
+ import { useColorSchemeEx } from '@xylabs/react-invertible-theme'
25
19
  import type {
26
20
  DappName, DappNavItem, DappNavMenuConfig, DappVersion, XyOsContext,
27
21
  } from '@xyo-network/os-model'
@@ -31,13 +25,10 @@ import React, { useEffect, useState } from 'react'
31
25
  import { RenderHtml } from '../../../../../components/index.ts'
32
26
  import { useDebugClick } from '../../../../../hooks/index.ts'
33
27
  import { DebugDialogWithNode } from '../../../Debug/index.ts'
34
- // eslint-disable-next-line import-x/no-internal-modules
35
- import XyoOSLogoBlack from './img/xyoOS-Icon-Black.svg'
36
- // eslint-disable-next-line import-x/no-internal-modules
37
- import XyoOSLogoWhite from './img/xyoOS-Icon-White.svg'
38
- import { socialLinksData } from './SocialData.js'
28
+ import { BottomMenuArea } from './BottomMenuArea.tsx'
29
+ import { StyledListItemButton, StyledMenuIconWrapSpan } from './StyledListItems.tsx'
39
30
 
40
- interface DappMenuDrawerProps extends DrawerProps {
31
+ export interface DappMenuDrawerProps extends DrawerProps {
41
32
  activePath?: string
42
33
  context?: XyOsContext | null
43
34
  iconSvg?: string
@@ -62,10 +53,9 @@ export const DappMenuDrawer: React.FC<DappMenuDrawerProps> = ({
62
53
  const [path, setPath] = useState('')
63
54
  const { darkMode } = useColorSchemeEx()
64
55
  const theme = useTheme()
65
- const activeColor = darkMode ? theme.palette.primary.main : theme.palette.secondary.main
66
- const logo = darkMode ? XyoOSLogoWhite : XyoOSLogoBlack
56
+ const drawerColor = darkMode ? theme.palette.background.paper : darken(theme.palette.primary.main, 0.5)
57
+ const activeColor = theme.palette.primary.light
67
58
 
68
- // update based off active path changes
69
59
  useEffect(() => {
70
60
  if (menuConfig?.defaultPath && menuItems && activePath) {
71
61
  const newPath = menuItems.find(item => activePath === item.path)?.path ?? ''
@@ -89,132 +79,78 @@ export const DappMenuDrawer: React.FC<DappMenuDrawerProps> = ({
89
79
  anchor="left"
90
80
  PaperProps={{
91
81
  sx: {
92
- background: 'transparent', borderRight: 'none', position: 'static',
82
+ position: 'static', backgroundColor: drawerColor, borderRight: 'none',
93
83
  },
94
84
  }}
95
- sx={{ borderRight: `solid ${darkMode ? theme.palette.grey[900] : theme.palette.grey[300]}`, maxWidth: '280px' }}
85
+ sx={{ width: '280px' }}
96
86
  {...props}
97
87
  >
98
88
  <FlexCol alignItems="stretch" justifyContent="space-between" height="100dvh">
99
- <FlexCol paddingY={1} paddingX={2} alignItems="stretch">
89
+ <FlexCol alignItems="stretch" justifyContent="flex-start" flexGrow={1} overflow="auto">
100
90
  <Tooltip title={version}>
101
91
  <FlexGrowRow
102
- marginBottom={2}
92
+ id="dapp-name-and-icon"
93
+ padding={2}
103
94
  justifyContent="flex-start"
104
95
  gap={1}
105
96
  sx={{ cursor: 'pointer' }}
97
+ flexGrow={0}
106
98
  >
107
- {iconSvg
108
- ? RenderHtml({ htmlString: iconSvg })
109
- : null}
110
- <Typography noWrap variant="h5" letterSpacing="-1px" fontWeight="300">
99
+ {iconSvg ? RenderHtml({ htmlString: iconSvg }) : null}
100
+ <Typography noWrap variant="h6" letterSpacing="-1px">
111
101
  {name}
112
102
  </Typography>
113
103
  </FlexGrowRow>
114
104
  </Tooltip>
115
105
  <DebugDialogWithNode closeDebug={closeDebug} debugOpen={debugOpen} context={context} />
116
- <List sx={{ p: 0 }}>
106
+ <List sx={{ p: 0, overflow: 'auto' }}>
117
107
  {menuItems?.map(({
118
108
  svgIcon: icon, primaryText, path: pathFromPayload,
119
- }) => {
120
- return (
121
- <ListItem
122
- key={primaryText}
123
- disablePadding
124
- sx={{
125
- // Note: setting color here lets it cascade down to both text and svg elements with fill="currentColor"
126
- // see - https://css-tricks.com/cascading-svg-fill-color/
127
- color: pathFromPayload === path ? activeColor : undefined,
128
- }}
109
+ }) => (
110
+ <ListItem
111
+ key={primaryText}
112
+ disablePadding
113
+ sx={{ paddingBottom: 1 }}
114
+ >
115
+ <StyledListItemButton
116
+ onClick={() => handleChange(pathFromPayload)}
117
+ active={pathFromPayload === path}
118
+ disableRipple
119
+ disableTouchRipple
129
120
  >
130
- <ListItemButton onClick={() => handleChange(pathFromPayload)}>
131
- <ListItemIcon sx={{ color: 'inherit' }}>
121
+ <FlexRow
122
+ flexGrow={1}
123
+ paddingX={2}
124
+ paddingY={0.5}
125
+ sx={{ '&:hover': { backgroundColor: alpha('#ffffff', 0.05) }, 'borderRadius': '10px' }}
126
+ >
127
+ <ListItemIcon
128
+ sx={{ color: pathFromPayload === path ? activeColor : alpha('#fff', 0.3), justifyContent: 'center' }}
129
+ >
132
130
  <StyledMenuIconWrapSpan
133
131
  ref={(ref) => {
134
132
  if (ref) {
135
133
  ref.innerHTML = icon ?? ''
136
134
  }
137
135
  }}
138
- >
139
- </StyledMenuIconWrapSpan>
136
+ />
140
137
  </ListItemIcon>
141
- <ListItemText primary={primaryText} />
142
- </ListItemButton>
143
- </ListItem>
144
- )
145
- })}
138
+ <ListItemText
139
+ primaryTypographyProps={{
140
+ fontWeight: path === pathFromPayload ? 'bold' : 'inherit',
141
+ color: pathFromPayload === path ? 'inherit' : alpha(theme.palette.text.primary, 0.5),
142
+ }}
143
+ primary={primaryText}
144
+ style={{ opacity: pathFromPayload === path ? 1 : 0.5 }}
145
+ />
146
+ </FlexRow>
147
+ </StyledListItemButton>
148
+ </ListItem>
149
+ ))}
146
150
  </List>
147
151
  </FlexCol>
148
- <FlexCol>
149
- <Divider variant="middle" flexItem />
150
- <FlexCol padding={2}>
151
- <Toolbar sx={{ paddingX: 1.5 }}>
152
- <Tooltip title="Debug Node View">
153
- <IconButton onClick={openDebug}>
154
- <BugReport sx={{ color: theme.palette.text.primary }} />
155
- </IconButton>
156
- </Tooltip>
157
- <Tooltip title="Toggle Light/Dark Mode">
158
- <span>
159
- <DarkModeIconButtonForColorScheme defaultLightModeColor="warning" />
160
- </span>
161
- </Tooltip>
162
- </Toolbar>
163
- <FlexRow flexWrap="wrap">
164
- {socialLinksData.map((social, index) => {
165
- return (
166
- <RotationAnimation key={index} rotation={20}>
167
- <IconButton
168
- sx={{ color: theme.palette.text.primary }}
169
- href={social.link}
170
- target="_blank"
171
- >
172
- {social.icon}
173
- </IconButton>
174
- </RotationAnimation>
175
- )
176
- })}
177
- </FlexRow>
178
- <FlexRow padding={1} justifyContent="center" gap={0.5}>
179
- <Typography variant="body2" color={theme.palette.text.primary}>
180
- Powered By
181
- </Typography>
182
- <img
183
- style={{ color: theme.palette.text.primary, fill: theme.palette.text.primary }}
184
- src={logo}
185
- width="auto"
186
- height="20px"
187
- />
188
- </FlexRow>
189
- <LinkEx target="_blank" href="https://xylabs.com/">
190
- <Typography variant="caption">Copyright © 2024 XY Labs, Inc.</Typography>
191
- </LinkEx>
192
- <Stack gap={0.5} flexDirection="row">
193
- <LinkEx target="_blank" href="https://xylabs.com/privacy/">
194
- <Typography variant="caption">Privacy</Typography>
195
- </LinkEx>
196
- {' '}
197
-
198
- {' '}
199
- <LinkEx target="_blank" href="https://xylabs.com/terms/">
200
- <Typography variant="caption">Terms</Typography>
201
- </LinkEx>
202
- {' '}
203
-
204
- {' '}
205
- <LinkEx target="_blank" href="https://xyo.network/">
206
- <Typography variant="caption">XYO Website</Typography>
207
- </LinkEx>
208
- </Stack>
209
- </FlexCol>
210
- </FlexCol>
152
+ <BottomMenuArea openDebug={openDebug} backgroundColor={theme.palette.primary.dark} />
211
153
  </FlexCol>
212
154
  </Drawer>
213
155
  )
214
156
  }
215
-
216
- const StyledMenuIconWrapSpan = styled('span', { name: 'StyledMenuIconWrapSpan' })(() => ({
217
- alignItems: 'center',
218
- display: 'inline-flex',
219
- flexDirection: 'column',
220
- }))
@@ -0,0 +1,36 @@
1
+ import { ListItemButton, styled } from '@mui/material'
2
+
3
+ // Styled span for wrapping menu icons
4
+ export const StyledMenuIconWrapSpan = styled('span', { name: 'StyledMenuIconWrapSpan' })(() => ({
5
+ alignItems: 'center',
6
+ display: 'inline-flex',
7
+ flexDirection: 'column',
8
+ }))
9
+
10
+ export const StyledListItemButton = styled(ListItemButton, { name: 'StyledListItemButton' })<{
11
+ active?: boolean
12
+ }>(({ theme, active }) => {
13
+ const activeOrHoverColor = theme.palette.primary.main
14
+
15
+ return {
16
+ 'position': 'relative',
17
+ 'padding': '8px 16px',
18
+ 'borderRadius': '12px',
19
+ 'transition': 'background-color 0.3s ease',
20
+ '&:hover': {
21
+ backgroundColor: 'transparent',
22
+ borderRadius: '12px',
23
+ },
24
+ '&::before': {
25
+ content: '""',
26
+ position: 'absolute',
27
+ left: 0,
28
+ top: 0,
29
+ bottom: 0,
30
+ width: '6px',
31
+ backgroundColor: active ? activeOrHoverColor : 'transparent',
32
+ borderRadius: '0 4px 4px 0',
33
+ transition: 'background-color 0.3s ease',
34
+ },
35
+ }
36
+ })
@@ -1,2 +1,3 @@
1
1
  export * from './BottomNavigation.js'
2
2
  export * from './Drawer.js'
3
+ export * from './StyledListItems.tsx'
@@ -0,0 +1,119 @@
1
+ /* eslint-disable react-refresh/only-export-components */
2
+ /* eslint-disable @stylistic/max-len */
3
+ import type {
4
+ DappConfig,
5
+ DappIcon,
6
+ DappName,
7
+ DappNavItem,
8
+ DappNavMenuConfig,
9
+ DappPackageManifestPayload,
10
+ DappVersion,
11
+ } from '@xyo-network/os-model'
12
+ import {
13
+ DappConfigSchema,
14
+ DappIconSchema,
15
+ DappMode,
16
+ DappNavItemSchema,
17
+ DappNavMenuConfigSchema,
18
+ } from '@xyo-network/os-model'
19
+
20
+ import DefaultDappManifest from './default.manifest.json'
21
+
22
+ export const DefaultName: DappName = 'DApp Name' as const
23
+
24
+ const version: DappVersion = '1.0.0'
25
+
26
+ export const DefaultConfig: DappConfig = {
27
+ manifest: DefaultDappManifest as DappPackageManifestPayload,
28
+ modes: [DappMode.Window],
29
+ name: DefaultName,
30
+ schema: DappConfigSchema,
31
+ sources: ['network.xyo.dapp.Default.source'],
32
+ version,
33
+ }
34
+
35
+ export const DefaultDappIcon: DappIcon = {
36
+ active: false,
37
+ installed: 'preInstalled',
38
+ name: DefaultName,
39
+ schema: DappIconSchema,
40
+ type: 'system',
41
+ version,
42
+ }
43
+
44
+ export const DefaultPayloads = [DefaultConfig, DefaultDappIcon]
45
+
46
+ export type DefaultMenuItemPaths = 'all' | 'payment-methods' | 'keys' | 'links' | 'crypto' | 'emails' | 'phones' | 'dapps'
47
+
48
+ export const DefaultMenuItems: DappNavItem<DefaultMenuItemPaths>[] = [
49
+ {
50
+ path: 'payment-methods',
51
+ primaryText: 'Payment Methods',
52
+ schema: DappNavItemSchema,
53
+ svgIcon: `
54
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
55
+ `,
56
+ weight: 0,
57
+ },
58
+ {
59
+ path: 'keys',
60
+ primaryText: 'API Keys',
61
+ schema: DappNavItemSchema,
62
+ svgIcon: `
63
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
64
+ `,
65
+ weight: 0,
66
+ },
67
+ {
68
+ path: 'links',
69
+ primaryText: 'Linked Default',
70
+ schema: DappNavItemSchema,
71
+ svgIcon: `
72
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
73
+ `,
74
+ weight: 0,
75
+ },
76
+ {
77
+ path: 'crypto',
78
+ primaryText: 'Crypto Wallets',
79
+ schema: DappNavItemSchema,
80
+ svgIcon: `
81
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
82
+ `,
83
+ weight: 0,
84
+ },
85
+ {
86
+ path: 'emails',
87
+ primaryText: 'Email Addresses',
88
+ schema: DappNavItemSchema,
89
+ svgIcon: `
90
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
91
+ `,
92
+ weight: 0,
93
+ },
94
+ {
95
+ path: 'phones',
96
+ primaryText: 'Phone Numbers',
97
+ schema: DappNavItemSchema,
98
+ svgIcon: `
99
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
100
+ `,
101
+ weight: 0,
102
+ },
103
+ {
104
+ path: 'dapps',
105
+ primaryText: 'Dapps',
106
+ schema: DappNavItemSchema,
107
+ svgIcon: `
108
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="none"><path fill="currentColor" d="M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>
109
+ `,
110
+ weight: 0,
111
+ },
112
+ ]
113
+
114
+ export const DefaultMenuConfig: DappNavMenuConfig = {
115
+ defaultPath: 'payment-methods',
116
+ schema: DappNavMenuConfigSchema,
117
+ }
118
+
119
+ export const DefaultMenuPayloads = [...DefaultMenuItems, DefaultMenuConfig]
@@ -0,0 +1,35 @@
1
+ import type { Meta, StoryFn } from '@storybook/react'
2
+ import React from 'react'
3
+ import { BrowserRouter } from 'react-router-dom'
4
+
5
+ import { DappMenuDrawer } from '../Drawer.tsx'
6
+ import {
7
+ DefaultConfig, DefaultMenuConfig, DefaultMenuItems,
8
+ } from './DefaultData.tsx'
9
+
10
+ const StorybookEntry: Meta = {
11
+ component: DappMenuDrawer,
12
+ title: 'shared/DappMenuDrawer',
13
+ }
14
+
15
+ const Template: StoryFn<typeof DappMenuDrawer> = (props) => {
16
+ return (
17
+ <BrowserRouter>
18
+ <DappMenuDrawer {...props}>
19
+ </DappMenuDrawer>
20
+ </BrowserRouter>
21
+ )
22
+ }
23
+
24
+ const Default = Template.bind({})
25
+ Default.args = {
26
+ activePath: DefaultMenuConfig.defaultPath,
27
+ menuConfig: DefaultMenuConfig,
28
+ menuItems: DefaultMenuItems,
29
+ name: DefaultConfig.name,
30
+ version: DefaultConfig.version,
31
+ }
32
+
33
+ export { Default }
34
+
35
+ export default StorybookEntry
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/dapp-package-manifest-schema.json",
3
+ "nodes": [
4
+ {
5
+ "config": {
6
+ "accountPath": "0'",
7
+ "name": "DefaultNode",
8
+ "schema": "network.xyo.node.config"
9
+ }
10
+ }
11
+ ],
12
+ "external": {
13
+ "modules": [
14
+ {
15
+ "name": "OsDefaultNode"
16
+ }
17
+ ]
18
+ },
19
+ "schema": "network.xyo.manifest.package.dapp"
20
+ }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-misused-promises */
1
2
  import { ArrowForward } from '@mui/icons-material'
2
3
  import type { DialogProps } from '@mui/material'
3
4
  import {
@@ -120,7 +121,7 @@ export const DappAccessDialog: React.FC<AccessDialogProps> = ({
120
121
  <Button variant="outlined" onClick={onClose}>
121
122
  Cancel
122
123
  </Button>
123
- <Button variant="contained" onClick={() => { handleAllow().catch(console.error) }}>
124
+ <Button variant="contained" onClick={handleAllow}>
124
125
  Allow
125
126
  </Button>
126
127
  </DialogActions>