Skip to content

Commit e4dad2b

Browse files
committed
radix-vue 迁移到 reka-ui
1 parent 28a5322 commit e4dad2b

File tree

107 files changed

+331
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+331
-278
lines changed

components.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"baseColor": "neutral",
99
"cssVariables": true
1010
},
11-
"framework": "vite",
1211
"aliases": {
1312
"components": "@/ui/shadcn",
14-
"utils": "@/utils"
13+
"utils": "@/utils",
14+
"lib": "@/utils"
1515
}
1616
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"type": "module",
3+
"packageManager": "[email protected]",
34
"engines": {
45
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
56
},
@@ -54,7 +55,7 @@
5455
"print-js": "^1.6.0",
5556
"qrcode": "^1.5.4",
5657
"qs": "^6.14.0",
57-
"radix-vue": "^1.9.17",
58+
"reka-ui": "^2.0.2",
5859
"scule": "^1.3.0",
5960
"splitpanes": "^3.1.8",
6061
"swiper": "^11.2.4",

pnpm-lock.yaml

+25-60
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/layouts/components/Topbar/Toolbar/ColorScheme/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function toggleColorScheme(event: MouseEvent) {
3737
</script>
3838

3939
<template>
40-
<FaButton variant="ghost" size="icon" @click="toggleColorScheme">
40+
<FaButton variant="ghost" size="icon" class="size-9" @click="toggleColorScheme">
4141
<FaIcon
4242
:name="{
4343
light: 'i-ri:sun-line',

src/layouts/components/Topbar/Toolbar/Fullscreen/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { isFullscreen, toggle } = useFullscreen()
1212
</script>
1313

1414
<template>
15-
<FaButton v-if="settingsStore.mode === 'pc'" variant="ghost" size="icon" @click="toggle">
15+
<FaButton v-if="settingsStore.mode === 'pc'" variant="ghost" size="icon" class="size-9" @click="toggle">
1616
<FaIcon :name="isFullscreen ? 'i-ri:fullscreen-exit-line' : 'i-ri:fullscreen-line'" class="size-4" />
1717
</FaButton>
1818
</template>

src/layouts/components/Topbar/Toolbar/NavSearch/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const isShow = ref(false)
1212
</script>
1313

1414
<template>
15-
<FaButton :variant="settingsStore.mode === 'pc' ? 'outline' : 'ghost'" :size="settingsStore.mode === 'pc' ? undefined : 'icon'" :class="{ 'mx-2 px-3': settingsStore.mode === 'pc' }" @click="isShow = true">
15+
<FaButton :variant="settingsStore.mode === 'pc' ? 'outline' : 'ghost'" :size="settingsStore.mode === 'pc' ? undefined : 'icon'" :class="{ 'mx-2 px-3 h-9': settingsStore.mode === 'pc', 'size-9': settingsStore.mode !== 'pc' }" @click="isShow = true">
1616
<FaIcon name="i-ri:search-line" class="size-4" />
1717
<template v-if="settingsStore.mode === 'pc'">
1818
<span class="text-sm text-muted-foreground/60 transition group-hover-text-muted-foreground">搜索</span>

src/layouts/components/Topbar/Toolbar/PageReload/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function handleCtrlClick() {
4141
<p>可切换为浏览器原生刷新</p>
4242
</div>
4343
</template>
44-
<FaButton variant="ghost" size="icon" @click.exact="handleClick" @click.ctrl.exact="handleCtrlClick" @animationend="isAnimating = false">
44+
<FaButton variant="ghost" size="icon" class="size-9" @click.exact="handleClick" @click.ctrl.exact="handleCtrlClick" @animationend="isAnimating = false">
4545
<FaIcon name="i-iconoir:refresh-double" class="size-4" :class="{ animation: isAnimating }" />
4646
</FaButton>
4747
</FaTooltip>

src/ui/components/FaAvatar/avatar/Avatar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { HTMLAttributes } from 'vue'
33
import type { AvatarVariants } from '.'
44
import { cn } from '@/utils'
5-
import { AvatarRoot } from 'radix-vue'
5+
import { AvatarRoot } from 'reka-ui'
66
import { avatarVariant } from '.'
77
88
const props = withDefaults(defineProps<{

src/ui/components/FaAvatar/avatar/AvatarFallback.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type { AvatarFallbackProps } from 'radix-vue'
3-
import { AvatarFallback } from 'radix-vue'
2+
import type { AvatarFallbackProps } from 'reka-ui'
3+
import { AvatarFallback } from 'reka-ui'
44
55
const props = defineProps<AvatarFallbackProps>()
66
</script>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<script setup lang="ts">
2-
import type { AvatarImageProps } from 'radix-vue'
3-
import { AvatarImage } from 'radix-vue'
2+
import type { AvatarImageProps } from 'reka-ui'
3+
import { AvatarImage } from 'reka-ui'
44
55
const props = defineProps<AvatarImageProps>()
66
</script>
77

88
<template>
9-
<AvatarImage v-bind="props" class="h-full w-full object-cover" />
9+
<AvatarImage v-bind="props" class="h-full w-full object-cover">
10+
<slot />
11+
</AvatarImage>
1012
</template>

src/ui/components/FaButton/button/Button.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
2-
import type { PrimitiveProps } from 'radix-vue'
2+
import type { PrimitiveProps } from 'reka-ui'
33
import type { HTMLAttributes } from 'vue'
44
import type { ButtonVariants } from '.'
55
import { cn } from '@/utils'
6-
import { Primitive } from 'radix-vue'
6+
import { Primitive } from 'reka-ui'
77
import { buttonVariants } from '.'
88
99
interface Props extends PrimitiveProps {

src/ui/components/FaButton/button/index.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@ export const buttonVariants = cva(
88
{
99
variants: {
1010
variant: {
11-
default:
12-
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
11+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
1312
destructive:
14-
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
13+
'bg-destructive text-destructive-foreground hover:bg-destructive/90',
1514
outline:
16-
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
15+
'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
1716
secondary:
18-
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
17+
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
1918
ghost: 'hover:bg-accent hover:text-accent-foreground',
2019
link: 'text-primary underline-offset-4 hover:underline',
2120
},
2221
size: {
23-
default: 'h-9 px-4 py-2',
24-
sm: 'h-8 rounded-md px-3 text-xs',
25-
lg: 'h-10 rounded-md px-8',
26-
icon: 'h-9 w-9',
22+
default: 'h-10 px-4 py-2',
23+
sm: 'h-9 rounded-md px-3',
24+
lg: 'h-11 rounded-md px-8',
25+
icon: 'h-10 w-10',
2726
},
2827
},
2928
defaultVariants: {

src/ui/components/FaCheckbox/checkbox/Checkbox.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
2-
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue'
2+
import type { CheckboxRootEmits, CheckboxRootProps } from 'reka-ui'
33
import type { HTMLAttributes } from 'vue'
44
import { cn } from '@/utils'
55
import { Check } from 'lucide-vue-next'
6-
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'radix-vue'
6+
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'reka-ui'
77
import { computed } from 'vue'
88
99
const props = defineProps<CheckboxRootProps & { class?: HTMLAttributes['class'] }>()

src/ui/components/FaContextMenu/context-menu/ContextMenu.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
3-
import { ContextMenuRoot, useForwardPropsEmits } from 'radix-vue'
2+
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'reka-ui'
3+
import { ContextMenuRoot, useForwardPropsEmits } from 'reka-ui'
44
55
const props = defineProps<ContextMenuRootProps>()
66
const emits = defineEmits<ContextMenuRootEmits>()

src/ui/components/FaContextMenu/context-menu/ContextMenuCheckboxItem.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<script setup lang="ts">
2-
import type { ContextMenuCheckboxItemEmits, ContextMenuCheckboxItemProps } from 'radix-vue'
2+
import type { ContextMenuCheckboxItemEmits, ContextMenuCheckboxItemProps } from 'reka-ui'
33
import type { HTMLAttributes } from 'vue'
44
import { cn } from '@/utils'
55
import { Check } from 'lucide-vue-next'
66
import {
77
ContextMenuCheckboxItem,
8-
98
ContextMenuItemIndicator,
109
useForwardPropsEmits,
11-
} from 'radix-vue'
10+
} from 'reka-ui'
1211
import { computed } from 'vue'
1312
1413
const props = defineProps<ContextMenuCheckboxItemProps & { class?: HTMLAttributes['class'] }>()

src/ui/components/FaContextMenu/context-menu/ContextMenuContent.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<script setup lang="ts">
2-
import type { ContextMenuContentEmits, ContextMenuContentProps } from 'radix-vue'
2+
import type { ContextMenuContentEmits, ContextMenuContentProps } from 'reka-ui'
33
import type { HTMLAttributes } from 'vue'
44
import { cn } from '@/utils'
55
import {
66
ContextMenuContent,
7-
87
ContextMenuPortal,
98
useForwardPropsEmits,
10-
} from 'radix-vue'
9+
} from 'reka-ui'
1110
import { computed } from 'vue'
1211
1312
const props = defineProps<ContextMenuContentProps & { class?: HTMLAttributes['class'] }>()

src/ui/components/FaContextMenu/context-menu/ContextMenuGroup.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type { ContextMenuGroupProps } from 'radix-vue'
3-
import { ContextMenuGroup } from 'radix-vue'
2+
import type { ContextMenuGroupProps } from 'reka-ui'
3+
import { ContextMenuGroup } from 'reka-ui'
44
55
const props = defineProps<ContextMenuGroupProps>()
66
</script>

src/ui/components/FaContextMenu/context-menu/ContextMenuItem.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<script setup lang="ts">
2-
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'radix-vue'
2+
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'reka-ui'
33
import type { HTMLAttributes } from 'vue'
44
import { cn } from '@/utils'
55
import {
66
ContextMenuItem,
7-
87
useForwardPropsEmits,
9-
} from 'radix-vue'
8+
} from 'reka-ui'
109
import { computed } from 'vue'
1110
1211
const props = defineProps<ContextMenuItemProps & { class?: HTMLAttributes['class'], inset?: boolean }>()

0 commit comments

Comments
 (0)