Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/landing/devup.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"footerText": "#51575F",
"menuHover": "#F6F4FF",
"menuActive": "#EAE8FC",
"captionBold": "#878594",
"captionBold": "#7C7B8E",
"search": "#9C50FF",
"kakaoButton": "#DE9800",
"kakaoButtonHover": "#C98900",
Expand Down Expand Up @@ -67,7 +67,7 @@
"footerText": "#FFFFFF",
"menuHover": "#3C404B",
"menuActive": "#283259",
"captionBold": "#878594",
"captionBold": "#9C9BA9",
"search": "#6FA4FF",
"kakaoButton": "#A3740D",
"kakaoButtonHover": "#C98900",
Expand Down Expand Up @@ -526,6 +526,14 @@
"fontSize": "12px",
"lineHeight": 1.4,
"letterSpacing": "-0.03em"
},
"bodyBold": {
"fontFamily": "Pretendard",
"fontStyle": "normal",
"fontWeight": 700,
"fontSize": "16px",
"lineHeight": 1.5,
"letterSpacing": "-0.03em"
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion apps/landing/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { DevupUI } from '@devup-ui/next-plugin'
import createMDX from '@next/mdx'
import remarkGfm from 'remark-gfm'

const withMDX = createMDX({})
const withMDX = createMDX({
options: {
remarkPlugins: [remarkGfm],
},
extension: /\.mdx?$/,
})

export default withMDX(
DevupUI(
Expand Down
13 changes: 8 additions & 5 deletions apps/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,31 @@
"lint": "eslint"
},
"dependencies": {
"body-scroll-lock": "3.1.5",
"@devup-ui/react": "workspace:*",
"@devup-ui/components": "workspace:*",
"@devup-ui/react": "workspace:*",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@next/mdx": "^15.3.4",
"@types/mdx": "^2.0.13",
"body-scroll-lock": "3.1.5",
"clsx": "^2.1.1",
"next": "^15.3.4",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-markdown": "8.0.6",
"react-syntax-highlighter": "^15.6.1",
"remark-gfm": "^4.0.1",
"sanitize.css": "^13.0.0"
},
"devDependencies": {
"@types/body-scroll-lock": "^3.1.2",
"@devup-ui/next-plugin": "workspace:*",
"@types/body-scroll-lock": "^3.1.2",
"@types/node": "^24",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/react-syntax-highlighter": "^15.5.13",
"typescript": "^5",
"glob": "^11.0.3",
"remark": "^15.0.1"
"remark": "^15.0.1",
"typescript": "^5"
}
}
9 changes: 8 additions & 1 deletion apps/landing/src/app/(detail)/components/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { VStack } from '@devup-ui/react'

export default function Card({ children }: { children: React.ReactNode }) {
export default function Card({
children,
className,
...props
}: React.ComponentProps<'div'>) {
return (
<VStack
_active={{
Expand All @@ -13,8 +17,11 @@ export default function Card({ children }: { children: React.ReactNode }) {
bg="$containerBackground"
border="1px solid $border"
borderRadius="10px"
className={className}
cursor="pointer"
styleOrder={1}
transition="all 0.2s ease"
{...props}
>
{children}
</VStack>
Expand Down
54 changes: 26 additions & 28 deletions apps/landing/src/app/(detail)/components/LeftMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,43 @@ export function LeftMenu() {
<MenuItem to="/components/overview">Overview</MenuItem>
<MenuItem
subMenu={[
{ to: '/components/form/button', children: 'Button' },
{ to: '/components/form/text-box', children: 'Text box' },
{ to: '/components/form/text-area', children: 'Text area' },
{ to: '/components/form/dropdown', children: 'Dropdown' },
{ to: '/components/form/radio', children: 'Radio' },
{ to: '/components/form/checkbox', children: 'Checkbox' },
{ to: '/components/form/stepper', children: 'Stepper' },
{ to: '/components/form/toggle', children: 'Toggle' },
{ to: '/components/form/slider', children: 'Slider' },
{ to: '/components/form/date-picker', children: 'Date picker' },
{ to: '/components/form/color-picker', children: 'Color picker' },
{ to: '/components/form/uploader', children: 'Uploader' },
{ to: '/components/form/pagination', children: 'Pagination' },
{ to: '/components/form/progress-bar', children: 'Progress Bar' },
{ to: '/components/form/search', children: 'Search' },
{ to: '/components/form/select', children: 'Select' },
{ to: '/components/form/label', children: 'Label' },
{ to: '/components/button', children: 'Button' },
{ to: '/components/text-box', children: 'Text box' },
{ to: '/components/text-area', children: 'Text area' },
{ to: '/components/dropdown', children: 'Dropdown' },
{ to: '/components/radio', children: 'Radio' },
{ to: '/components/checkbox', children: 'Checkbox' },
{ to: '/components/stepper', children: 'Stepper' },
{ to: '/components/toggle', children: 'Toggle' },
{ to: '/components/slider', children: 'Slider' },
{ to: '/components/date-picker', children: 'Date picker' },
{ to: '/components/color-picker', children: 'Color picker' },
{ to: '/components/uploader', children: 'Uploader' },
{ to: '/components/pagination', children: 'Pagination' },
{ to: '/components/progress-bar', children: 'Progress Bar' },
{ to: '/components/search', children: 'Search' },
{ to: '/components/select', children: 'Select' },
{ to: '/components/label', children: 'Label' },
]}
>
Form
</MenuItem>
<MenuItem
subMenu={[
{ to: '/components/layout/footer', children: 'Footer' },
{ to: '/components/layout/tooltip', children: 'Tooltip' },
{ to: '/components/layout/tab', children: 'Tab' },
{ to: '/components/layout/menu', children: 'Menu' },
{ to: '/components/layout/header', children: 'Header' },
{ to: '/components/layout/confirm', children: 'Confirm' },
{ to: '/components/layout/snackbar', children: 'Snackbar' },
{ to: '/components/layout/bottom-sheet', children: 'Bottom sheet' },
{ to: '/components/footer', children: 'Footer' },
{ to: '/components/tooltip', children: 'Tooltip' },
{ to: '/components/tab', children: 'Tab' },
{ to: '/components/menu', children: 'Menu' },
{ to: '/components/header', children: 'Header' },
{ to: '/components/confirm', children: 'Confirm' },
{ to: '/components/snackbar', children: 'Snackbar' },
{ to: '/components/bottom-sheet', children: 'Bottom sheet' },
]}
>
Layout
</MenuItem>
<MenuItem
subMenu={[
{ to: '/components/theme/theme-button', children: 'Theme Button' },
]}
subMenu={[{ to: '/components/theme-button', children: 'Theme Button' }]}
>
Theme
</MenuItem>
Expand Down
73 changes: 73 additions & 0 deletions apps/landing/src/app/(detail)/components/MdxCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { readFile } from 'node:fs/promises'
import { join } from 'node:path'

import { Box, css, VStack } from '@devup-ui/react'
import ReactMarkdown from 'react-markdown'

import { Code } from '@/components/Code'
import { _components } from '@/mdx-components'

import Card from './Card'
import MdxCardFooter from './MdxCardFooter'

export default async function MdxCard({
src,
demo,
}: {
children: React.ReactNode
src: string
demo: React.ReactNode
}) {
const content = await readFile(
join(
process.cwd(),
'src/app/(detail)/components',
src ?? 'button/demo/Variants.tsx',
),
{
encoding: 'utf-8',
},
)
// extract comment
const comment = content.match(/\/\*\*[\s\S]*?\*\//)?.[0]
const code = content.replace('\n' + comment!, '')
const normalizedComment = comment
?.replace(/\/\*\*|\*\//g, '')
?.replace(/^\s*\*\s*/gm, '')

return (
<Card
className={css({
_active: {
transform: 'none',
},
_hover: {
boxShadow: 'none',
},
borderRadius: '10px',
border: '1px solid $border',
bg: '$containerBackground',
maxWidth: '100%',
flexShrink: 0,
cursor: 'default',
marginBottom: '20px',
_lastChild: {
marginBottom: '0',
},
typography: 'bodyReg',
color: '$text',
whiteSpace: 'pre-wrap',
})}
>
<VStack gap="30px" px="24px" py="32px">
<Box>{demo}</Box>
<ReactMarkdown components={_components}>
{normalizedComment ?? ''}
</ReactMarkdown>
</VStack>
<MdxCardFooter>
<Code language="tsx" value={code} />
</MdxCardFooter>
</Card>
)
}
57 changes: 57 additions & 0 deletions apps/landing/src/app/(detail)/components/MdxCardFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
'use client'

import { Box, Center, Flex, Text, VStack } from '@devup-ui/react'
import { useState } from 'react'

import IconCode from '@/components/icons/IconCode'

export default function MdxCardFooter({
children,
}: {
children: React.ReactNode
}) {
const [isOpen, setIsOpen] = useState(false)
return (
<>
<VStack justifyContent="flex-end" maxH="600px" maxW="100%">
<Flex
borderTop="1px solid $border"
justifyContent="flex-end"
px="24px"
py="10px"
w="100%"
>
<Center
_active={{
bg: '$menuActive',
}}
_hover={{
bg: '$menuHover',
}}
borderRadius="4px"
color="$captionBold"
cursor="pointer"
gap="8px"
onClick={() => setIsOpen(!isOpen)}
p="8px"
transition="all 0.2s ease-in-out"
w="fit-content"
>
<IconCode isOpen={isOpen} />
<Text>Show Code</Text>
</Center>
</Flex>
{isOpen && (
<Box
borderTop="1px solid $border"
overflow="auto"
px="24px"
py="16px"
>
{children}
</Box>
)}
</VStack>
</>
)
}
62 changes: 62 additions & 0 deletions apps/landing/src/app/(detail)/components/Table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Box } from '@devup-ui/react'

export function Table(props: React.ComponentProps<'table'>) {
return (
<Box
as="table"
border="none"
selectors={{
'& th, & td': {
border: 'none',
minWidth: '200px',
},
}}
styleOrder={1}
{...props}
/>
)
}

export function Tr(props: React.ComponentProps<'tr'>) {
return (
<Box
as="tr"
borderBottom="1px solid $border"
borderTop="1px solid $border"
{...props}
/>
)
}

export function Td(props: React.ComponentProps<'td'>) {
return (
<Box
as="td"
border="none"
px="20px"
py="14px"
styleOrder={1}
width="fit-content"
{...props}
/>
)
}

export function Th(props: React.ComponentProps<'th'>) {
return (
<Box
as="th"
bg="$cardBg"
border="none"
borderBottom="1px solid $border"
borderTop="1px solid $border"
color="$captionBold"
px="20px"
py="14px"
styleOrder={1}
textAlign="left"
typography="bodyBold"
{...props}
/>
)
}
13 changes: 13 additions & 0 deletions apps/landing/src/app/(detail)/components/button/Api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###### API
`Button` props extends the button HTML attributes.

<div style={{ width: '100%', overflow: 'auto'}}>
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| **variant** | The variant of the button | `'primary' \| 'default'` | `'default'` |
| **colors** | The color variables of the button, i.e. `var(--primary)` | ```{<br> primary?: string<br> error?: string<br> text?: string<br> border?: string<br> inputBackground?: string<br> primaryFocus?: string<br>}``` | `undefined` |
| **danger** | Signals that it should be used with caution. It is often used in a delete button or to show the error status. | `boolean` | `false` |
| **size** | The size of the button | `'sm' \| 'md' \| 'lg'` | `'md'` |
| **icon** | Icon of the button passed in as a form of ReactNode | `React.ReactNode` | `undefined` |
| **ellipsis** | Whether the button text should be truncated with an ellipsis. The button should have a width to be able to truncate the text. | `boolean` | `false` |
</div>
5 changes: 5 additions & 0 deletions apps/landing/src/app/(detail)/components/button/Button.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**Button**

#### Button

`Button` component is used to handle user interactions.
Loading