Skip to content

Commit 82caaf7

Browse files
authored
Merge pull request #51 from dev-five-git/fix-other-package-component
Fix other package component
2 parents 369c12b + 9909c9c commit 82caaf7

File tree

23 files changed

+1016
-962
lines changed

23 files changed

+1016
-962
lines changed

.changeset/hip-berries-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/wasm": patch
3+
---
4+
5+
Fix transforming component from other package

apps/landing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"@devup-ui/react": "workspace:*",
1414
"@mdx-js/loader": "^3.1.0",
1515
"@mdx-js/react": "^3.1.0",
16-
"@next/mdx": "^15.1.4",
16+
"@next/mdx": "^15.1.5",
1717
"@types/mdx": "^2.0.13",
18-
"next": "^15.1.4",
18+
"next": "^15.1.5",
1919
"react": "^19.0.0",
2020
"react-dom": "^19.0.0",
2121
"react-syntax-highlighter": "^15.6.1",

apps/landing/src/app/(detail)/docs/LeftMenu.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function LeftMenu() {
2424
children: 'Input',
2525
},
2626
{
27-
to: URL_PREFIX + '/docs/api/input',
27+
to: URL_PREFIX + '/docs/api/text',
2828
children: 'Text',
2929
},
3030
{
@@ -43,6 +43,10 @@ export function LeftMenu() {
4343
to: URL_PREFIX + '/docs/api/center',
4444
children: 'Center',
4545
},
46+
{
47+
to: URL_PREFIX + '/docs/api/grid',
48+
children: 'Grid',
49+
},
4650
{
4751
to: URL_PREFIX + '/docs/api/css',
4852
children: 'css',
@@ -81,6 +85,10 @@ export function LeftMenu() {
8185
to: URL_PREFIX + '/docs/devup/breakpoints',
8286
children: 'Breakpoints',
8387
},
88+
{
89+
to: URL_PREFIX + '/docs/devup/figma-plugin',
90+
children: 'Figma Plugin',
91+
},
8492
]}
8593
>
8694
Devup

apps/landing/src/app/(detail)/docs/MenuItem.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
'use client'
12
import { Box, css, Flex, Text } from '@devup-ui/react'
23
import Link from 'next/link'
4+
import { usePathname } from 'next/navigation'
35

46
import { OpenMenuItem } from './OpenMenuItem'
57

68
export interface MenuItemProps {
7-
selected?: boolean
89
children?: React.ReactNode
910
to?: string
1011
subMenu?: {
11-
selected?: boolean
1212
children?: React.ReactNode
1313
to?: string
1414
}[]
1515
}
1616

1717
export function MenuItem(props: MenuItemProps) {
18-
const { selected, children, to, subMenu } = props
18+
const { children, to, subMenu } = props
19+
const path = usePathname()
20+
const selected = to
21+
? path.startsWith(to)
22+
: !!subMenu?.some((item) => (item.to ? path.startsWith(item.to) : false))
23+
1924
if (subMenu) return <OpenMenuItem {...props} subMenu={subMenu} />
2025
const inner = (
2126
<Flex

apps/landing/src/app/(detail)/docs/OpenMenuItem.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
'use client'
22
import { Box, css, Flex, Image, Text, VStack } from '@devup-ui/react'
33
import Link from 'next/link'
4+
import { usePathname } from 'next/navigation'
45
import { Fragment, useReducer } from 'react'
56

67
import { URL_PREFIX } from '../../../constants'
78
import { MenuItemProps } from './MenuItem'
89

910
export function OpenMenuItem({
10-
selected,
1111
children,
1212
subMenu,
1313
}: Omit<MenuItemProps, 'subMenu' | 'to'> &
1414
Required<Pick<MenuItemProps, 'subMenu'>>) {
15-
const [open, handleOpen] = useReducer((state) => !state, false)
15+
const path = usePathname()
16+
const selected = subMenu.some((item) =>
17+
item.to ? path.startsWith(item.to) : false,
18+
)
19+
const [open, handleOpen] = useReducer((state) => !state, selected)
1620
return (
1721
<>
1822
<Flex
@@ -47,16 +51,24 @@ export function OpenMenuItem({
4751
<Box borderRight="1px solid var(--border, #E0E0E0)" w="10px" />
4852
<VStack flex="1" gap="4px">
4953
{subMenu.map(({ children, to }, idx) => {
54+
const selected = to ? path.startsWith(to) : false
5055
const inner = (
5156
<Flex
5257
alignItems="center"
53-
bg="$menuActive"
58+
bg={selected ? '$menuActive' : undefined}
5459
borderRadius="6px"
5560
gap="10px"
5661
p="10px"
5762
>
58-
<Box bg="$primary" borderRadius="100%" boxSize="8px" />
59-
<Text color="$text" flex="1" typography="buttonS">
63+
{selected && (
64+
<Box bg="$primary" borderRadius="100%" boxSize="8px" />
65+
)}
66+
<Text
67+
color={selected ? '$title' : '$text'}
68+
flex="1"
69+
opacity={selected ? '1' : '0.8'}
70+
typography={selected ? 'buttonS' : 'buttonSmid'}
71+
>
6072
{children}
6173
</Text>
6274
</Flex>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Grid

apps/landing/src/components/Header/HeaderWrap.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@ export function HeaderWrap({ children }: { children: React.ReactNode }) {
99
return (
1010
<Box
1111
pos={isRoot ? 'fixed' : 'sticky'}
12-
top={isRoot ? 5 : 0}
12+
pt={isRoot ? [null, null, 5] : undefined}
13+
px={[null, null, 4]}
14+
top="0"
1315
transition="all, 0.2s"
1416
w="100%"
1517
zIndex={1}
1618
>
1719
<Flex
1820
alignItems="center"
1921
bg="$containerBackground"
20-
borderRadius={isRoot ? '16px' : undefined}
22+
borderRadius={isRoot ? [null, null, '16px'] : undefined}
2123
boxShadow="0px 2px 8px 0px var(--shadow, rgba(135, 135, 135, 0.25))"
22-
h="70px"
24+
h={['50px', null, '70px']}
2325
justifyContent="space-between"
2426
maxW={isRoot ? '1440px' : '100%'}
2527
mx="auto"
26-
px="40px"
28+
px={[4, 5, '40px']}
2729
>
2830
{children}
2931
</Flex>

apps/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"react": "^19.0.0",
1414
"react-dom": "^19.0.0",
15-
"next": "^15.1.4",
15+
"next": "^15.1.5",
1616
"@devup-ui/react": "workspace:*"
1717
},
1818
"devDependencies": {

apps/vite-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"react": "^19.0.0",
1212
"@devup-ui/react": "workspace:*",
13-
"vite": "^6.0.7"
13+
"vite": "^6.0.11"
1414
},
1515
"devDependencies": {
1616
"vite-plugin-dts": "^4.5.0",

apps/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@devup-ui/vite-plugin": "workspace:*",
19-
"vite": "^6.0.7",
19+
"vite": "^6.0.11",
2020
"@vitejs/plugin-react": "^4.3.4",
2121
"typescript": "^5",
2222
"@types/node": "^22",

0 commit comments

Comments
 (0)