Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/popular-bags-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@devup-ui/react": patch
---

Add group selector
5 changes: 5 additions & 0 deletions .changeset/strong-parents-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@devup-ui/wasm": patch
---

Add group selector, Support conditional expression for typography
183 changes: 82 additions & 101 deletions apps/landing/src/app/(detail)/docs/LeftMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,109 +1,90 @@
import { Box, Flex, Image, Text, VStack } from '@devup-ui/react'
import { VStack } from '@devup-ui/react'

import { URL_PREFIX } from '../../../constants'
import { MenuItem } from './MenuItem'

export function LeftMenu() {
return (
<VStack gap="6px" h="1008px" p="20px 16px" w="220px">
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
개요
</Text>
</Flex>
<Flex
alignItems="center"
bg="$menuActive"
borderRadius="6px"
gap="10px"
p="6px 10px"
<MenuItem to={URL_PREFIX + '/docs/overview'}>Overview</MenuItem>
<MenuItem to={URL_PREFIX + '/docs/installation'}>Installation</MenuItem>
<MenuItem to={URL_PREFIX + '/docs/features'}>Features</MenuItem>
<MenuItem
subMenu={[
{
to: URL_PREFIX + '/docs/api/box',
children: 'Box',
},
{
to: URL_PREFIX + '/docs/api/button',
children: 'Button',
},
{
to: URL_PREFIX + '/docs/api/input',
children: 'Input',
},
{
to: URL_PREFIX + '/docs/api/input',
children: 'Text',
},
{
to: URL_PREFIX + '/docs/api/image',
children: 'Image',
},
{
to: URL_PREFIX + '/docs/api/flex',
children: 'Flex',
},
{
to: URL_PREFIX + '/docs/api/v-stack',
children: 'VStack',
},
{
to: URL_PREFIX + '/docs/api/center',
children: 'Center',
},
{
to: URL_PREFIX + '/docs/api/css',
children: 'css',
},
{
to: URL_PREFIX + '/docs/api/style-props',
children: 'Style Props',
},
{
to: URL_PREFIX + '/docs/api/selector',
children: 'Selector',
},
{
to: URL_PREFIX + '/docs/api/group-selector',
children: 'Group Selector',
},
]}
>
API
</MenuItem>
<MenuItem
subMenu={[
{
to: URL_PREFIX + '/docs/devup/devup-json',
children: 'What is devup?',
},
{
to: URL_PREFIX + '/docs/devup/colors',
children: 'Colors',
},
{
to: URL_PREFIX + '/docs/devup/typography',
children: 'Typography',
},
{
to: URL_PREFIX + '/docs/devup/breakpoints',
children: 'Breakpoints',
},
]}
>
<Box bg="$primary" boxSize="8px" />
<Text flex="1" typography="buttonS">
설치
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" gap="10px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
개념
</Text>
<Image boxSize="16px" src="/menu-arrow.svg" />
</Flex>
<Flex gap="8px">
<Box borderColor="$border" w="10px" />
<VStack flex="1" gap="6px">
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
유틸리티 퍼스트
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
하이브리드 접근 방식
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
헤드리스 컴포넌트
</Text>
</Flex>
</VStack>
</Flex>
<Flex alignItems="center" borderRadius="6px" gap="10px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
구성 요소
</Text>
<Image boxSize="16px" src="/menu-arrow.svg" />
</Flex>
<Flex alignItems="center" borderRadius="6px" gap="10px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
API
</Text>
<Image boxSize="16px" src="/menu-arrow.svg" />
</Flex>
<Flex gap="8px">
<Box borderColor="$border" w="10px" />
<VStack flex="1" gap="6px">
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
스타일이 지정됨
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
CSS
</Text>
</Flex>
</VStack>
</Flex>
<Flex alignItems="center" borderRadius="6px" gap="10px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
테마
</Text>
<Image boxSize="16px" src="/menu-arrow.svg" />
</Flex>
<Flex gap="8px">
<Box borderColor="$border" w="10px" />
<VStack flex="1" gap="6px">
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
테마 사용자 정의
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
테마 토큰
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
중단점
</Text>
</Flex>
<Flex alignItems="center" borderRadius="6px" p="6px 10px">
<Text flex="1" opacity="0.8" typography="buttonSmid">
구성 요소 테마
</Text>
</Flex>
</VStack>
</Flex>
Devup
</MenuItem>
</VStack>
)
}
52 changes: 52 additions & 0 deletions apps/landing/src/app/(detail)/docs/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Box, css, Flex, Image, Text } from '@devup-ui/react'
import Link from 'next/link'

import { OpenMenuItem } from './OpenMenuItem'

export interface MenuItemProps {
selected?: boolean
children?: React.ReactNode
to?: string
subMenu?: {
selected?: boolean
children?: React.ReactNode
to?: string
}[]
}

export function MenuItem(props: MenuItemProps) {
const { selected, children, to, subMenu } = props
if (subMenu) return <OpenMenuItem {...props} subMenu={subMenu} />
const inner = (
<Flex
alignItems="center"
bg={selected ? '$menuActive' : undefined}
borderRadius="6px"
gap="10px"
p="6px 10px"
>
{selected && <Box bg="$primary" borderRadius="100%" boxSize="8px" />}
<Text
color={selected ? '$title' : '$text'}
flex="1"
opacity={selected ? '1' : '0.8'}
typography={selected ? 'buttonS' : 'buttonSmid'}
>
{children}
</Text>
{subMenu && <Image boxSize="16px" src="/menu-arrow.svg" />}
</Flex>
)
return to ? (
<Link
className={css({
textDecoration: 'none',
})}
href={to}
>
{inner}
</Link>
) : (
inner
)
}
83 changes: 83 additions & 0 deletions apps/landing/src/app/(detail)/docs/OpenMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
'use client'
import { Box, css, Flex, Image, Text, VStack } from '@devup-ui/react'
import Link from 'next/link'
import { Fragment, useReducer } from 'react'

import { MenuItemProps } from './MenuItem'

export function OpenMenuItem({
selected,
children,
subMenu,
}: Omit<MenuItemProps, 'subMenu' | 'to'> &
Required<Pick<MenuItemProps, 'subMenu'>>) {
const [open, handleOpen] = useReducer((state) => !state, false)
return (
<>
<Flex
alignItems="center"
bg={selected ? '$menuActive' : undefined}
borderRadius="6px"
cursor="pointer"
gap="10px"
onClick={handleOpen}
p="6px 10px"
>
{selected && <Box bg="$primary" borderRadius="100%" boxSize="8px" />}
<Text
color={selected ? '$title' : '$text'}
flex="1"
opacity={selected ? '1' : '0.8'}
typography={selected ? 'buttonS' : 'buttonSmid'}
>
{children}
</Text>
{subMenu && (
<Image
boxSize="16px"
src="/menu-arrow.svg"
transform={open ? 'rotate(0deg)' : 'rotate(-90deg)'}
transition="transform 0.2s"
/>
)}
</Flex>
{open && (
<Flex gap="8px">
<Box borderRight="1px solid var(--border, #E0E0E0)" w="10px" />
<VStack flex="1" gap="4px">
{subMenu.map(({ children, to }, idx) => {
const inner = (
<Flex
alignItems="center"
bg="$menuActive"
borderRadius="6px"
gap="10px"
p="10px"
>
<Box bg="$primary" borderRadius="100%" boxSize="8px" />
<Text color="$text" flex="1" typography="buttonS">
{children}
</Text>
</Flex>
)

return to ? (
<Link
key={idx}
className={css({
textDecoration: 'none',
})}
href={to}
>
{inner}
</Link>
) : (
<Fragment key={idx}>{inner}</Fragment>
)
})}
</VStack>
</Flex>
)}
</>
)
}
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/box/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Box
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/button/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Button
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/center/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Center
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/css/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# css
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/flex/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Flex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Group Selector
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/image/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Image
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/input/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Input
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/selector/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Selector
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Style Props
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/text/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Text
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/api/v-stack/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# VStack
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Breakpoints
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/devup/colors/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Colors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# devup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Typography
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/features/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Features
6 changes: 6 additions & 0 deletions apps/landing/src/app/(detail)/docs/installation/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Installation


```bash
npm install @deuvp-ui/react
```
6 changes: 3 additions & 3 deletions apps/landing/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default function HomePage() {
</Text>
</VStack>
<Link
className={css`
text-decoration: none;
`}
className={css({
textDecoration: 'none',
})}
href={URL_PREFIX + '/docs/overview'}
>
<Flex
Expand Down
Loading
Loading