File tree Expand file tree Collapse file tree 6 files changed +55
-5
lines changed
app/(docs)/docs/[[...slug]] Expand file tree Collapse file tree 6 files changed +55
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { format } from "date-fns";
55import MDX from "@/components/MDX" ;
66import { Text } from "@/packages/ui" ;
77import { Metadata } from "next" ;
8+ import { MoveRightIcon , MoveUpRightIcon } from "lucide-react" ;
89
910interface IProps {
1011 params : { slug : string [ ] } ;
@@ -45,9 +46,31 @@ export default function page({ params }: IProps) {
4546
4647 return (
4748 < div className = "space-y-12 py-8" >
48- < div className = "border-b border-black pb-4 " >
49+ < div className = "border-b border-black pb-6 " >
4950 < Text as = "h2" > { doc . title } </ Text >
5051 < p className = "text-lg text-muted" > { doc . description } </ p >
52+ { doc . links && (
53+ < div className = "flex space-x-4 text-sm mt-4" >
54+ { doc . links ?. api_reference && (
55+ < a
56+ className = "flex items-center bg-gray-200 px-1.5 py-.5"
57+ href = { doc . links . api_reference }
58+ target = "_blank"
59+ >
60+ API Reference < MoveUpRightIcon className = "h-3 w-3 ml-1" />
61+ </ a >
62+ ) }
63+ { doc . links && doc . links ?. source && (
64+ < a
65+ className = "flex items-center bg-gray-200 px-1.5 py-.5"
66+ href = { doc . links . source }
67+ target = "_blank"
68+ >
69+ Source < MoveUpRightIcon className = "h-3 w-3 ml-1" />
70+ </ a >
71+ ) }
72+ </ div >
73+ ) }
5174 </ div >
5275 < div >
5376 < MDX code = { doc . body . code } />
Original file line number Diff line number Diff line change 22title : Accordion
33description : This collapsible component let's your users read only the content they care about. 😌
44lastUpdated : 19 Oct, 2024
5+ links :
6+ api_reference : https://www.radix-ui.com/primitives/docs/components/accordion#api-reference
7+ source : https://github.com/Logging-Stuff/RetroUI/blob/main/packages/ui/Accordions/Accordion.tsx
58---
69
710<ComponentShowcase name = " accordion-style-default" />
Original file line number Diff line number Diff line change 11---
22title : Button
33description : This bold button makes sure your users click on it and perform the actions you want! 🚀
4- lastUpdated : 13 Oct, 2024
4+ lastUpdated : 04 Nov, 2024
5+ links :
6+ source : https://github.com/Logging-Stuff/RetroUI/blob/main/packages/ui/Buttons/Button.tsx
57---
68
79<ComponentShowcase name = " button-style-default" />
Original file line number Diff line number Diff line change 11---
22title : Dialog
33description : An impactful dialog that ensures your important messages and actions get the attention they deserve! 💬✨
4- lastUpdated : 26 Oct, 2024
4+ lastUpdated : 04 Nov, 2024
5+ links :
6+ api_reference : https://www.radix-ui.com/primitives/docs/components/dialog#api-reference
7+ source : https://github.com/Logging-Stuff/RetroUI/blob/main/packages/ui/Dialog/Dialog.tsx
58---
69
710<ComponentShowcase name = " dialog-style-default" />
Original file line number Diff line number Diff line change 11import path from "path" ;
22import fs from "fs" ;
3- import { defineDocumentType , makeSource } from "contentlayer/source-files" ;
3+ import {
4+ defineDocumentType ,
5+ defineNestedType ,
6+ makeSource ,
7+ } from "contentlayer/source-files" ;
48import { visit } from "unist-util-visit" ;
59import rehypePrettyCode from "rehype-pretty-code" ;
610import rehypeSlug from "rehype-slug" ;
711import { u } from "unist-builder" ;
812import { UnistNode } from "./types/unist" ;
913import { componentConfig } from "./config" ;
1014
15+ const Links = defineNestedType ( ( ) => {
16+ return {
17+ name : "Links" ,
18+ fields : {
19+ source : { type : "string" , required : false } ,
20+ api_reference : { type : "string" , required : false } ,
21+ } ,
22+ } ;
23+ } ) ;
24+
1125export const Doc = defineDocumentType ( ( ) => ( {
1226 name : "Doc" ,
1327 filePathPattern : `docs/**/*.mdx` ,
@@ -16,6 +30,11 @@ export const Doc = defineDocumentType(() => ({
1630 title : { type : "string" , required : true } ,
1731 description : { type : "string" , required : true } ,
1832 lastUpdated : { type : "date" , required : true } ,
33+ links : {
34+ type : "nested" ,
35+ of : Links ,
36+ required : false ,
37+ } ,
1938 } ,
2039 computedFields : {
2140 url : {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import React, { HTMLAttributes } from "react";
55const badgeVariants = cva ( "font-semibold " , {
66 variants : {
77 variant : {
8- default : "bg-gray-300 text-gray-700" ,
8+ default : "bg-gray-200 text-gray-700" ,
99 outline : "outline outline-2 outline-black text-black" ,
1010 solid : "bg-black text-white" ,
1111 surface : "outline outline-2 bg-primary-300 text-black" ,
You can’t perform that action at this time.
0 commit comments