Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
c647fc2f
Commit
c647fc2f
authored
Feb 21, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api docs pages
parent
99cb9b03
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
52 deletions
+87
-52
api-docs.tsx
pages/api-docs.tsx
+2
-2
graphiql.tsx
pages/graphiql.tsx
+5
-5
semanticTokens.ts
toolkit/theme/foundations/semanticTokens.ts
+4
-4
SwaggerUI.tsx
ui/apiDocs/SwaggerUI.tsx
+37
-37
GraphQL.tsx
ui/graphQL/GraphQL.tsx
+4
-3
Chakra.tsx
ui/pages/Chakra.tsx
+3
-1
Popover.tsx
ui/showcases/Popover.tsx
+32
-0
No files found.
pages/api-docs.tsx
View file @
c647fc2f
...
...
@@ -4,7 +4,7 @@ import React from 'react';
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
import
config
from
'
configs/app
'
;
//
import SwaggerUI from 'ui/apiDocs/SwaggerUI';
import
SwaggerUI
from
'
ui/apiDocs/SwaggerUI
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
const
Page
:
NextPage
=
()
=>
{
...
...
@@ -13,7 +13,7 @@ const Page: NextPage = () => {
<
PageTitle
title=
{
config
.
meta
.
seo
.
enhancedDataEnabled
?
`${ config.chain.name } API documentation`
:
'
API documentation
'
}
/>
{
/* <SwaggerUI/> */
}
<
SwaggerUI
/>
</
PageNextJs
>
);
};
...
...
pages/graphiql.tsx
View file @
c647fc2f
...
...
@@ -8,10 +8,10 @@ import config from 'configs/app';
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
//
const GraphQL = dynamic(() => import('ui/graphQL/GraphQL'), {
//
loading: () => <ContentLoader/>,
//
ssr: false,
//
});
const
GraphQL
=
dynamic
(()
=>
import
(
'
ui/graphQL/GraphQL
'
),
{
loading
:
()
=>
<
ContentLoader
/>,
ssr
:
false
,
});
const
Page
:
NextPage
=
()
=>
{
...
...
@@ -20,7 +20,7 @@ const Page: NextPage = () => {
<
PageTitle
title=
{
config
.
meta
.
seo
.
enhancedDataEnabled
?
`GraphiQL ${ config.chain.name } interface`
:
'
GraphQL playground
'
}
/>
{
/* <GraphQL/> */
}
<
GraphQL
/>
</
PageNextJs
>
);
};
...
...
toolkit/theme/foundations/semanticTokens.ts
View file @
c647fc2f
...
...
@@ -453,10 +453,10 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
DEFAULT
:
{
value
:
'
{colors.gray.400}
'
},
_dark
:
{
value
:
'
{colors.gray.500}
'
},
},
error
:
{
DEFAULT
:
{
value
:
'
{colors.red.500}
'
},
_dark
:
{
value
:
'
{colors.red.500}
'
},
},
//
error: {
//
DEFAULT: { value: '{colors.red.500}' },
//
_dark: { value: '{colors.red.500}' },
//
},
// dialog_bg: {
// DEFAULT: { value: '{colors.white}' },
// _dark: { value: '{colors.gray.900}' },
...
...
ui/apiDocs/SwaggerUI.tsx
View file @
c647fc2f
...
...
@@ -5,7 +5,7 @@ const SwaggerUIReact = dynamic(() => import('swagger-ui-react'), {
});
import
type
{
SystemStyleObject
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
use
ColorModeValue
,
use
Token
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
useToken
}
from
'
@chakra-ui/react
'
;
import
dynamic
from
'
next/dynamic
'
;
import
React
from
'
react
'
;
...
...
@@ -29,84 +29,84 @@ const NeverShowInfoPlugin = () => {
};
const
SwaggerUI
=
()
=>
{
const
mainColor
=
useColorModeValue
(
'
blackAlpha.800
'
,
'
whiteAlpha.800
'
)
;
const
mainColor
=
{
_light
:
'
blackAlpha.800
'
,
_dark
:
'
whiteAlpha.800
'
}
;
const
borderColor
=
useToken
(
'
colors
'
,
'
border.divider
'
);
const
mainBgColor
=
useColorModeValue
(
'
blackAlpha.100
'
,
'
whiteAlpha.200
'
)
;
const
mainBgColor
=
{
_light
:
'
blackAlpha.100
'
,
_dark
:
'
whiteAlpha.200
'
}
;
const
swaggerStyle
:
SystemStyleObject
=
{
'
.swagger-ui .scheme-container,
.opblock-tag
'
:
{
'
& .swagger-ui .scheme-container, &
.opblock-tag
'
:
{
display
:
'
none
'
,
},
'
.swagger-ui
'
:
{
'
&
.swagger-ui
'
:
{
color
:
mainColor
,
},
'
.swagger-ui .opblock-summary-control:focus
'
:
{
'
&
.swagger-ui .opblock-summary-control:focus
'
:
{
outline
:
'
none
'
,
},
// eslint-disable-next-line max-len
'
.swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-description, .swagger-ui div, .swagger-ui p, .swagger-ui h5, .swagger-ui .response-col_links, .swagger-ui h4, .swagger-ui table thead tr th, .swagger-ui table thead tr td, .swagger-ui .parameter__name, .swagger-ui .parameter__type, .swagger-ui .response-col_status, .swagger-ui .tab li,
.swagger-ui .opblock .opblock-section-header h4
'
:
{
'
& .swagger-ui .opblock .opblock-summary-path, & .swagger-ui .opblock .opblock-summary-description, & .swagger-ui div, & .swagger-ui p, & .swagger-ui h5, & .swagger-ui .response-col_links, & .swagger-ui h4, & .swagger-ui table thead tr th, & .swagger-ui table thead tr td, & .swagger-ui .parameter__name, & .swagger-ui .parameter__type, & .swagger-ui .response-col_status, & .swagger-ui .tab li, &
.swagger-ui .opblock .opblock-section-header h4
'
:
{
color
:
'
unset
'
,
},
'
.swagger-ui input
'
:
{
'
&
.swagger-ui input
'
:
{
color
:
'
blackAlpha.800
'
,
},
'
.swagger-ui .opblock .opblock-section-header
'
:
{
background
:
useColorModeValue
(
'
whiteAlpha.800
'
,
'
blackAlpha.800
'
)
,
'
&
.swagger-ui .opblock .opblock-section-header
'
:
{
background
:
{
_light
:
'
whiteAlpha.800
'
,
_dark
:
'
blackAlpha.800
'
}
,
},
'
.swagger-ui .response-col_description__inner p,
.swagger-ui .parameters-col_description p
'
:
{
'
& .swagger-ui .response-col_description__inner p, &
.swagger-ui .parameters-col_description p
'
:
{
margin
:
0
,
},
'
.swagger-ui .wrapper
'
:
{
'
&
.swagger-ui .wrapper
'
:
{
padding
:
0
,
},
'
.swagger-ui .prop-type
'
:
{
color
:
useColorModeValue
(
'
blue.600
'
,
'
blue.400
'
)
,
'
&
.swagger-ui .prop-type
'
:
{
color
:
{
_light
:
'
blue.600
'
,
_dark
:
'
blue.400
'
}
,
},
'
.swagger-ui .btn.try-out__btn
'
:
{
borderColor
:
useToken
(
'
colors
'
,
'
link
'
),
color
:
useToken
(
'
colors
'
,
'
link
'
),
'
&
.swagger-ui .btn.try-out__btn
'
:
{
borderColor
:
useToken
(
'
colors
'
,
'
link
.primary
'
),
color
:
useToken
(
'
colors
'
,
'
link
.primary
'
),
borderRadius
:
'
sm
'
,
},
'
.swagger-ui .btn.try-out__btn:hover
'
:
{
'
&
.swagger-ui .btn.try-out__btn:hover
'
:
{
boxShadow
:
'
none
'
,
borderColor
:
useToken
(
'
colors
'
,
'
link
_hovered
'
),
color
:
useToken
(
'
colors
'
,
'
link
_hovered
'
),
borderColor
:
useToken
(
'
colors
'
,
'
link
.primary.hover
'
),
color
:
useToken
(
'
colors
'
,
'
link
.primary.hover
'
),
},
'
.swagger-ui .btn.try-out__btn.cancel
'
:
{
borderColor
:
useToken
(
'
colors
'
,
'
error
'
),
color
:
useToken
(
'
colors
'
,
'
error
'
),
'
&
.swagger-ui .btn.try-out__btn.cancel
'
:
{
borderColor
:
useToken
(
'
colors
'
,
'
text.
error
'
),
color
:
useToken
(
'
colors
'
,
'
text.
error
'
),
},
'
.swagger-ui .btn.try-out__btn.cancel:hover
'
:
{
borderColor
:
useColorModeValue
(
'
red.600
'
,
'
red.500
'
)
,
color
:
useColorModeValue
(
'
red.500
'
,
'
red.400
'
)
,
'
&
.swagger-ui .btn.try-out__btn.cancel:hover
'
:
{
borderColor
:
{
_light
:
'
red.600
'
,
_dark
:
'
red.500
'
}
,
color
:
{
_light
:
'
red.500
'
,
_dark
:
'
red.400
'
}
,
},
// MODELS
'
.swagger-ui section.models
'
:
{
'
&
.swagger-ui section.models
'
:
{
borderColor
:
borderColor
,
},
'
.swagger-ui section.models h4
'
:
{
'
&
.swagger-ui section.models h4
'
:
{
color
:
mainColor
,
},
'
.swagger-ui section.models .model-container
'
:
{
'
&
.swagger-ui section.models .model-container
'
:
{
bgColor
:
mainBgColor
,
},
'
.swagger-ui .model-title
'
:
{
'
&
.swagger-ui .model-title
'
:
{
wordBreak
:
'
break-all
'
,
color
:
mainColor
,
},
'
.swagger-ui .model
'
:
{
'
&
.swagger-ui .model
'
:
{
color
:
mainColor
,
},
'
.swagger-ui .model-box-control:focus
'
:
{
'
&
.swagger-ui .model-box-control:focus
'
:
{
outline
:
'
none
'
,
},
'
.swagger-ui .model-toggle
'
:
{
bgColor
:
useColorModeValue
(
'
transparent
'
,
'
whiteAlpha.700
'
)
,
'
&
.swagger-ui .model-toggle
'
:
{
bgColor
:
{
_light
:
'
transparent
'
,
_dark
:
'
whiteAlpha.700
'
}
,
borderRadius
:
'
sm
'
,
},
'
.swagger-ui .model .property.primitive
'
:
{
color
:
useToken
(
'
colors
'
,
'
text_secondary
'
),
'
&
.swagger-ui .model .property.primitive
'
:
{
color
:
useToken
(
'
colors
'
,
'
text_
.
secondary
'
),
wordBreak
:
'
break-all
'
,
},
};
...
...
@@ -132,7 +132,7 @@ const SwaggerUI = () => {
}
return
(
<
Box
sx
=
{
swaggerStyle
}
>
<
Box
css
=
{
swaggerStyle
}
>
<
SwaggerUIReact
url=
{
feature
.
specUrl
}
plugins=
{
[
NeverShowInfoPlugin
]
}
...
...
ui/graphQL/GraphQL.tsx
View file @
c647fc2f
import
{
Box
,
useColorMode
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
{
createGraphiQLFetcher
}
from
'
@graphiql/toolkit
'
;
import
{
GraphiQL
}
from
'
graphiql
'
;
import
React
from
'
react
'
;
...
...
@@ -7,6 +7,7 @@ import config from 'configs/app';
import
buildUrl
from
'
lib/api/buildUrl
'
;
import
'
graphiql/graphiql.css
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
import
{
useColorMode
}
from
'
toolkit/chakra/color-mode
'
;
const
feature
=
config
.
features
.
graphqlApiDocs
;
...
...
@@ -61,8 +62,8 @@ const GraphQL = () => {
});
return
(
<
Box
h=
"100vh"
overflowX=
"scroll"
sx
=
{
graphQLStyle
}
>
<
Box
h=
"100vh"
minW=
"900px"
sx
=
{
graphQLStyle
}
>
<
Box
h=
"100vh"
overflowX=
"scroll"
css
=
{
graphQLStyle
}
>
<
Box
h=
"100vh"
minW=
"900px"
css
=
{
graphQLStyle
}
>
<
GraphiQL
fetcher=
{
fetcher
}
defaultQuery=
{
initialQuery
}
key=
{
colorModeState
}
/>
</
Box
>
</
Box
>
...
...
ui/pages/Chakra.tsx
View file @
c647fc2f
...
...
@@ -18,6 +18,7 @@ import LoadersShowcase from 'ui/showcases/Loaders';
import
MenuShowcase
from
'
ui/showcases/Menu
'
;
import
PaginationShowcase
from
'
ui/showcases/Pagination
'
;
import
PinInputShowcase
from
'
ui/showcases/PinInput
'
;
import
PopoverShowcase
from
'
ui/showcases/Popover
'
;
import
ProgressCircleShowcase
from
'
ui/showcases/ProgressCircle
'
;
import
RadioShowcase
from
'
ui/showcases/Radio
'
;
import
SelectShowcase
from
'
ui/showcases/Select
'
;
...
...
@@ -53,6 +54,7 @@ const tabs = [
{
label
:
'
Progress Circle
'
,
value
:
'
progress-circle
'
,
component
:
<
ProgressCircleShowcase
/>
},
{
label
:
'
Radio
'
,
value
:
'
radio
'
,
component
:
<
RadioShowcase
/>
},
{
label
:
'
Pin input
'
,
value
:
'
pin-input
'
,
component
:
<
PinInputShowcase
/>
},
{
label
:
'
Popover
'
,
value
:
'
popover
'
,
component
:
<
PopoverShowcase
/>
},
{
label
:
'
Select
'
,
value
:
'
select
'
,
component
:
<
SelectShowcase
/>
},
{
label
:
'
Table
'
,
value
:
'
table
'
,
component
:
<
TableShowcase
/>
},
{
label
:
'
Tabs
'
,
value
:
'
tabs
'
,
component
:
<
TabsShowcase
/>
},
...
...
@@ -79,7 +81,7 @@ const ChakraShowcases = () => {
<
TabsTrigger
key=
{
tab
.
value
}
value=
{
tab
.
value
}
>
{
tab
.
label
}
</
TabsTrigger
>
))
}
</
TabsList
>
{
tabs
.
map
((
tab
)
=>
tab
.
component
)
}
{
tabs
.
map
((
tab
)
=>
<
React
.
Fragment
key=
{
tab
.
value
}
>
{
tab
.
component
}
</
React
.
Fragment
>
)
}
</
TabsRoot
>
</>
);
...
...
ui/showcases/Popover.tsx
0 → 100644
View file @
c647fc2f
import
React
from
'
react
'
;
import
{
Button
}
from
'
toolkit/chakra/button
'
;
import
{
PopoverRoot
,
PopoverTrigger
,
PopoverContent
,
PopoverBody
}
from
'
toolkit/chakra/popover
'
;
import
{
Section
,
Container
,
SectionHeader
,
SamplesStack
,
Sample
}
from
'
./parts
'
;
const
PopoverShowcase
=
()
=>
{
return
(
<
Container
value=
"popover"
>
<
Section
>
<
SectionHeader
>
Size
</
SectionHeader
>
<
SamplesStack
>
<
Sample
label=
"size: sm"
>
<
PopoverRoot
>
<
PopoverTrigger
>
<
Button
variant=
"dropdown"
>
Trigger
</
Button
>
</
PopoverTrigger
>
<
PopoverContent
>
<
PopoverBody
>
Popover content
</
PopoverBody
>
</
PopoverContent
>
</
PopoverRoot
>
</
Sample
>
</
SamplesStack
>
</
Section
>
</
Container
>
);
};
export
default
React
.
memo
(
PopoverShowcase
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment