File tree Expand file tree Collapse file tree
apps/website/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ export const SidebarLinksData: SidebarLinks[] = [
149149 icon : CandyIcon ,
150150 href : "/docs/sugar-high/highlighter" ,
151151 } ,
152+ {
153+ title : "Line Numbers" ,
154+ icon : ListOrderedIcon ,
155+ href : "/docs/sugar-high/line-numbers" ,
156+ } ,
152157 ] ,
153158 } ,
154159] ;
Original file line number Diff line number Diff line change 1+ import {
2+ CodeBlock ,
3+ CodeBlockHeader ,
4+ CodeBlockContent ,
5+ CodeBlockGroup ,
6+ CodeBlockIcon ,
7+ } from "@/components/code-block/code-block" ;
8+
9+ import { CodeBlockSugarHigh } from "@/components/code-block/client/sugar-high" ;
10+ import { CopyButton } from "@/components/code-block/copy-button" ;
11+
12+ const code = `export default function App() {
13+ return (
14+ <>
15+ <h1 id="title">
16+ Hello
17+ <span> world</span>
18+ </h1>
19+ <div style={styles.bar} />
20+ </>
21+ )
22+ }` ;
23+
24+ const CodeBlockSugarHighExample = ( ) => {
25+ return (
26+ < CodeBlock >
27+ < CodeBlockHeader >
28+ < CodeBlockGroup >
29+ < CodeBlockIcon language = "ts" />
30+ < span > Code Block + Sugar High</ span >
31+ </ CodeBlockGroup >
32+ < CopyButton content = { code } />
33+ </ CodeBlockHeader >
34+ < CodeBlockContent >
35+ < CodeBlockSugarHigh lineNumbers = { true } code = { code } />
36+ </ CodeBlockContent >
37+ </ CodeBlock >
38+ ) ;
39+ } ;
40+
41+ export default CodeBlockSugarHighExample ;
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ const StoresFiles: RegistryComponent[] = [
8484 name : "package-manager-store" ,
8585 type : "registry:file" ,
8686 target : "src/stores/packageManager.ts" ,
87- dependencies : [ "zustand" ] ,
87+ dependencies : [ "zustand" ] ,
8888 } ,
8989 } ,
9090] ;
@@ -195,6 +195,21 @@ const UIComponents: RegistryComponent[] = [
195195 dependencies : [ "sugar-high" ] ,
196196 } ,
197197 } ,
198+ {
199+ title : "Code Block - Client Sugar High + Line Numbers" ,
200+ fileType : "tsx" ,
201+ fileSource : `${ codeblockComponent } /client/sugar-high.tsx` ,
202+ exampleFileSource : `${ componentsFolder } /previews/code-block-sugar-high-line-numbers-example.tsx` ,
203+ reactComponent : lazy (
204+ ( ) =>
205+ import ( "@/components/previews/code-block-sugar-high-line-numbers-example" ) ,
206+ ) ,
207+ shadcnRegistry : {
208+ name : "code-block-client-sugar-high-line-numbers" ,
209+ type : "registry:component" ,
210+ dependencies : [ "sugar-high" ] ,
211+ } ,
212+ } ,
198213 {
199214 title : "Copy Button" ,
200215 fileType : "tsx" ,
You can’t perform that action at this time.
0 commit comments