-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from route06inc/2710/mdx-doc
feat: Implemented MDX component management for enhanced documentation capabilities.
- Loading branch information
Showing
36 changed files
with
196 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "next/typescript"] | ||
"extends": ["next/core-web-vitals", "next/typescript"], | ||
"rules": { | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"paths": [ | ||
{ | ||
"name": "next-contentlayer/hooks", | ||
"importNames": ["useMDXComponent"], | ||
"message": "Please use `import { MDXContent } from \"@/libs/contentlayer\"`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,7 @@ next-env.d.ts | |
.contentlayer | ||
|
||
# Storybook | ||
storybook-static | ||
storybook-static | ||
|
||
# typed-css-modules | ||
*.css.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
frontend/apps/service-site/src/contents/components/Callout/Callout.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.wrapper { | ||
width: 100%; | ||
padding: var(--spacing-4, 1rem); | ||
color: var(--callout-default-text, #bebfc1); | ||
background: var(--callout-default-background, rgba(255, 255, 255, 0.05)); | ||
} | ||
|
||
.danger { | ||
color: var(--callout-danger-text, #ea928e); | ||
background: var(--callout-danger-background, rgba(247, 80, 73, 0.1)); | ||
} |
22 changes: 22 additions & 0 deletions
22
frontend/apps/service-site/src/contents/components/Callout/Callout.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import { Callout } from './' | ||
|
||
const StoryComponent = () => { | ||
return ( | ||
<Callout> | ||
No-code platforms are breaking down the barriers to innovation, allowing | ||
anyone with an idea to bring it to life without needing to write a single | ||
line of code. | ||
</Callout> | ||
) | ||
} | ||
|
||
const meta = { | ||
component: StoryComponent, | ||
} satisfies Meta<typeof StoryComponent> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
22 changes: 22 additions & 0 deletions
22
frontend/apps/service-site/src/contents/components/Callout/Callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import clsx from 'clsx' | ||
import type { FC, PropsWithChildren } from 'react' | ||
import styles from './Callout.module.css' | ||
|
||
type Props = { | ||
type?: 'default' | 'danger' | ||
} | ||
|
||
export const Callout: FC<PropsWithChildren<Props>> = ({ | ||
type = 'default', | ||
children, | ||
}) => { | ||
return ( | ||
<div | ||
className={clsx(styles.wrapper, { | ||
[styles.danger]: type === 'danger', | ||
})} | ||
> | ||
{children} | ||
</div> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/apps/service-site/src/contents/components/Callout/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Callout' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Callout' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
frontend/apps/service-site/src/libs/contentlayer/MDXContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Callout } from '@/contents/components' | ||
import type { MDXComponents } from 'mdx/types' | ||
// eslint-disable-next-line no-restricted-imports | ||
import { useMDXComponent } from 'next-contentlayer/hooks' | ||
import type { FC } from 'react' | ||
|
||
const mdxComponents: MDXComponents = { | ||
Callout: (props) => <Callout {...props} />, | ||
} | ||
|
||
type Props = { | ||
code: string | ||
} | ||
|
||
export const MDXContent: FC<Props> = ({ code }) => { | ||
const Content = useMDXComponent(code) | ||
|
||
return <Content components={mdxComponents} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './MDXContent' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,9 @@ | |
}, | ||
"packageManager": "[email protected]+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b", | ||
"devDependencies": { | ||
"concurrently": "^9.0.1", | ||
"syncpack": "^13.0.0", | ||
"turbo": "^2.1.2", | ||
"@turbo/gen": "^2.1.2" | ||
} | ||
} | ||
} |
Oops, something went wrong.