1
1
import { useRouter } from "next/router"
2
2
import type { HTMLAttributes } from "react"
3
- import {
4
- Badge ,
5
- Box ,
6
- type BoxProps ,
7
- Flex ,
8
- type FlexProps ,
9
- type ListProps ,
10
- OrderedList as ChakraOrderedList ,
11
- UnorderedList as ChakraUnorderedList ,
12
- useToken ,
13
- } from "@chakra-ui/react"
3
+ import { Badge } from "@chakra-ui/react"
14
4
15
5
import { ChildOnlyProp } from "@/lib/types"
16
6
import type { DocsFrontmatter , MdPageContent } from "@/lib/interfaces"
@@ -27,47 +17,33 @@ import FeedbackCard from "@/components/FeedbackCard"
27
17
import FileContributors from "@/components/FileContributors"
28
18
import GlossaryTooltip from "@/components/Glossary/GlossaryTooltip"
29
19
import InfoBanner from "@/components/InfoBanner"
30
- import Link from "@/components/Link"
31
20
import MainArticle from "@/components/MainArticle"
32
21
import {
33
22
Heading1 as MdHeading1 ,
34
23
Heading2 as MdHeading2 ,
35
24
Heading3 as MdHeading3 ,
36
25
Heading4 as MdHeading4 ,
37
- Paragraph ,
38
26
} from "@/components/MdComponents"
39
27
import RollupProductDevDoc from "@/components/RollupProductDevDoc"
40
28
import SideNav from "@/components/SideNav"
41
29
import SideNavMobile from "@/components/SideNavMobile"
42
30
import TableOfContents from "@/components/TableOfContents"
43
31
import Translation from "@/components/Translation"
44
32
import { Divider } from "@/components/ui/divider"
33
+ import InlineLink from "@/components/ui/Link"
45
34
import { mdxTableComponents } from "@/components/ui/Table"
46
35
import YouTube from "@/components/YouTube"
47
36
48
37
import { cn } from "@/lib/utils/cn"
49
38
import { getEditPath } from "@/lib/utils/editPath"
50
39
51
- const Page = ( props : ChildOnlyProp & Pick < FlexProps , "dir" > ) => (
52
- < Flex
53
- direction = "column"
54
- w = "full"
55
- borderBottom = "1px"
56
- borderColor = "border"
57
- { ...props }
58
- />
40
+ const Page = ( props : HTMLAttributes < HTMLDivElement > ) => (
41
+ < div className = "flex w-full flex-col border-b" { ...props } />
59
42
)
60
43
61
- type ContentContainerProps = Pick < BoxProps , "children" | "dir" >
62
-
63
- const ContentContainer = ( props : ContentContainerProps ) => (
64
- < Flex
65
- justify = { "space-between" }
66
- w = "full"
67
- py = { 0 }
68
- ps = { 0 }
69
- pe = { { base : 0 , lg : 8 } }
70
- backgroundColor = "ednBackground"
44
+ const ContentContainer = ( props : HTMLAttributes < HTMLDivElement > ) => (
45
+ < div
46
+ className = "flex justify-between bg-background-highlight lg:pe-8"
71
47
{ ...props }
72
48
/>
73
49
)
@@ -101,61 +77,28 @@ const H4 = (props: HTMLAttributes<HTMLHeadingElement>) => (
101
77
< MdHeading4 className = { baseSubHeadingClasses } { ...props } />
102
78
)
103
79
104
- const UnorderedList = ( props : ListProps ) => (
105
- < ChakraUnorderedList ms = "1.45rem" { ...props } />
106
- )
107
- const OrderedList = ( props : ListProps ) => (
108
- < ChakraOrderedList ms = "1.45rem" { ...props } />
109
- )
110
-
111
- // Apply styles for classes within markdown here
112
80
const Content = ( props : ChildOnlyProp ) => {
113
- const mdBreakpoint = useToken ( "breakpoints" , "md" )
114
-
115
81
return (
116
- < Box
117
- as = { MainArticle }
118
- flex = { `1 1 ${ mdBreakpoint } ` }
119
- w = { { base : "full" , lg : "0" } }
120
- pt = { { base : 8 , md : 12 } }
121
- pb = { { base : 8 , md : 16 } }
122
- px = { { base : 8 , md : 16 } }
123
- m = "0 auto"
124
- sx = { {
125
- ".citation" : {
126
- p : {
127
- color : "text200" ,
128
- } ,
129
- } ,
130
- } }
82
+ < MainArticle
83
+ className = "min-w-0 flex-1 px-8 pb-8 pt-8 md:px-16 md:pb-16 md:pt-12"
131
84
{ ...props }
132
85
/>
133
86
)
134
87
}
135
88
136
89
const BackToTop = ( props : ChildOnlyProp ) => (
137
- < Flex
138
- display = { { lg : "none" } }
139
- mt = { 12 }
140
- pt = { 8 }
141
- borderTop = "1px"
142
- borderColor = "border"
143
- { ...props }
144
- >
145
- < Link href = "#top" >
90
+ < div className = "display-none mt-12 flex border-t pt-8" { ...props } >
91
+ < InlineLink href = "#top" >
146
92
< Translation id = "back-to-top" /> ↑
147
- </ Link >
148
- </ Flex >
93
+ </ InlineLink >
94
+ </ div >
149
95
)
150
96
151
97
export const docsComponents = {
152
98
h1 : H1 ,
153
99
h2 : H2 ,
154
100
h3 : H3 ,
155
101
h4 : H4 ,
156
- p : Paragraph ,
157
- ul : UnorderedList ,
158
- ol : OrderedList ,
159
102
pre : Codeblock ,
160
103
...mdxTableComponents ,
161
104
Badge,
0 commit comments