Skip to content

Commit f4a6a0f

Browse files
committed
feat: support daisy v5
1 parent fac8f10 commit f4a6a0f

File tree

13 files changed

+173
-387
lines changed

13 files changed

+173
-387
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"vue-router": "catalog:frontend"
4141
},
4242
"devDependencies": {
43+
"@ameinhardt/unocss-preset-daisy": "catalog:build",
4344
"@commitlint/cli": "catalog:dev",
4445
"@commitlint/config-conventional": "catalog:dev",
4546
"@iconify-json/mdi": "catalog:dev",
@@ -62,7 +63,6 @@
6263
"typescript": "catalog:dev",
6364
"unocss": "catalog:build",
6465
"unocss-preset-chinese": "catalog:build",
65-
"unocss-preset-daisy": "catalog:build",
6666
"unocss-preset-ease": "catalog:build",
6767
"unplugin-auto-import": "catalog:build",
6868
"unplugin-icons": "catalog:build",

pnpm-lock.yaml

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

pnpm-workspace.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
packages: []
2-
32
catalogs:
43
build:
4+
"@ameinhardt/unocss-preset-daisy": ^1.1.6
55
"@intlify/unplugin-vue-i18n": ^6.0.5
66
"@unocss/eslint-config": ^66.1.0-beta.12
77
"@vitejs/plugin-vue": ^5.2.3
88
"@vue/compiler-dom": ^3.5.13
99
jsdom: ^26.1.0
1010
unocss: ^66.1.0-beta.12
1111
unocss-preset-chinese: ^0.3.3
12-
unocss-preset-daisy: ^7.0.0
1312
unocss-preset-ease: ^0.0.4
1413
unplugin: ^2.3.2
1514
unplugin-auto-import: ^19.1.2
@@ -40,7 +39,7 @@ catalogs:
4039
"@kirklin/logger": ^0.0.2
4140
"@kirklin/reset-css": ^0.0.6
4241
"@vueuse/core": ^13.1.0
43-
daisyui: ^3.9.4
42+
daisyui: ^5.0.27
4443
iso-639-1: ^3.1.5
4544
nprogress: ^0.2.0
4645
pinia: ^3.0.2

src/layouts/Footer/index.vue

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ defineOptions({
88

99
<template>
1010
<footer
11-
class="sticky bottom-0 border-t border-base-100 bg-base-200 px-4 pt-2 text-base-content opacity-90 footer footer-center"
11+
class="bg-base-200 text-base-content border-base-100 px-4 pt-2 border-t opacity-90 bottom-0 sticky footer footer-center"
1212
>
13-
<div class="max-w-6xl w-full flex flex-row items-center justify-between gap-6">
13+
<div class="flex flex-row gap-6 max-w-6xl w-full items-center justify-between">
1414
<a
1515
href="https://github.com/kirklin"
1616
target="_blank"
1717
rel="nofollow"
1818
class="inline-flex items-center justify-center hover:opacity-90"
1919
><div class="mr-3 avatar">
20-
<div class="h-14 w-14 bg-neutral p-px mask mask-squircle">
20+
<div class="p-px bg-neutral h-14 w-14 mask mask-squircle">
2121
<img
2222
width="54"
2323
height="54"
@@ -28,20 +28,20 @@ defineOptions({
2828
</div>
2929
</div>
3030
<div class="text-left">
31-
<p class="text-xs text-base-content text-opacity-50">Created by</p>
32-
<h2 class="text-lg text-base-content font-bold">Kirk Lin</h2>
31+
<p class="text-base-content text-xs text-opacity-50">Created by</p>
32+
<h2 class="text-base-content text-lg font-bold">Kirk Lin</h2>
3333
</div>
3434
</a>
35-
<div class="flex flex-col items-center gap-4 text-left sm:flex-row">
36-
<div class="flex gap-4 pb-4">
35+
<div class="text-left flex flex-col gap-4 items-center sm:flex-row">
36+
<div class="pb-4 flex gap-4">
3737
<a
3838
href="https://github.com/kirklin/boot-vue"
3939
target="_blank"
4040
rel="nofollow"
41-
class="w-[130px] flex flex-col items-center rounded bg-base-100"
41+
class="bg-base-100 rounded flex flex-col w-[130px] items-center"
4242
>
43-
<h3 class="p-2 text-xs text-base-content/50 font-bold">BootVue™</h3>
44-
<p class="px-1.5 py-2 text-xs text-base-content/50 tracking-tighter">
43+
<h3 class="text-base-content/50 text-xs font-bold p-2">BootVue™</h3>
44+
<p class="text-base-content/50 text-xs tracking-tighter px-1.5 py-2">
4545
All Rights Reserved.
4646
</p>
4747
</a>

src/layouts/Navbar/components/LocalesChange/index.vue

+10-12
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@ function ChangeLocales(lang: string) {
1616

1717
<template>
1818
<div title="Change Locales" class="dropdown dropdown-end">
19-
<div tabindex="0" class="gap-1 normal-case btn btn-ghost">
19+
<div tabindex="0" class="gap-1 btn btn-ghost btn-sm">
2020
<UnoCSSIconButton icon="i-tabler-language" />
2121
<span class="hidden md:inline" />
2222
<UnoCSSIconButton icon="i-tabler-chevron-down" />
2323
</div>
24-
<div class="dropdown-content top-px mt-16 w-56 overflow-y-auto bg-base-200 text-base-content shadow-2xl rounded-t-box rounded-b-box">
25-
<ul class="menu-compact gap-1 p-3 menu" tabindex="0">
26-
<li v-for="lang in availableLocales" :key="lang">
27-
<button class="flex" @click="ChangeLocales(lang)">
28-
<span class="flex flex-1 justify-between">
29-
{{ languagesNameList.find((item) => item.code === lang)?.nativeName }}
30-
<!-- <span class="badge-ghost badge badge-sm" /> -->
31-
</span>
32-
</button>
33-
</li>
34-
</ul>
24+
<div class="bg-base-200 mt-4 p-2 w-52 shadow-sm z-1 dropdown-content menu rounded-box" tabindex="0">
25+
<li v-for="lang in availableLocales" :key="lang">
26+
<button class="flex" @click="ChangeLocales(lang)">
27+
<span class="flex flex-1 justify-between">
28+
{{ languagesNameList.find((item) => item.code === lang)?.nativeName }}
29+
<!-- <span class="badge-ghost badge badge-sm" /> -->
30+
</span>
31+
</button>
32+
</li>
3533
</div>
3634
</div>
3735
</template>

src/layouts/Navbar/components/ThemeChange/data.ts

+24
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,28 @@ export const themeList: ThemeList[] = [
117117
name: "❄️ Winter",
118118
id: "winter",
119119
},
120+
{
121+
name: "🔅 Dim",
122+
id: "dim",
123+
},
124+
{
125+
name: "❄️ Nord",
126+
id: "nord",
127+
},
128+
{
129+
name: "🌅 Sunset",
130+
id: "sunset",
131+
},
132+
{
133+
name: "🍮 Caramellatte",
134+
id: "caramellatte",
135+
},
136+
{
137+
name: "🌊 Abyss",
138+
id: "abyss",
139+
},
140+
{
141+
name: "🧣 Silk",
142+
id: "silk",
143+
},
120144
];

src/layouts/Navbar/components/ThemeChange/index.vue

+36-53
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const { t } = useI18n();
1111
const mode = useColorMode<CustomTheme>({
1212
attribute: "data-theme",
1313
modes: {
14+
light: "light",
15+
dark: "dark",
1416
cupcake: "cupcake",
1517
bumblebee: "bumblebee",
1618
emerald: "emerald",
@@ -38,6 +40,12 @@ const mode = useColorMode<CustomTheme>({
3840
night: "night",
3941
coffee: "coffee",
4042
winter: "winter",
43+
dim: "dim",
44+
nord: "nord",
45+
sunset: "sunset",
46+
caramellatte: "caramellatte",
47+
abyss: "abyss",
48+
silk: "silk",
4149
},
4250
});
4351
@@ -89,69 +97,44 @@ function handleKeyDown(event: KeyboardEvent, theme: CustomTheme) {
8997

9098
<template>
9199
<div title="Change Theme" class="dropdown dropdown-end">
92-
<div tabindex="0" class="gap-1 normal-case btn btn-ghost">
100+
<div tabindex="0" role="button" class="gap-1 btn btn-ghost btn-sm" aria-label="Change Theme">
93101
<UnoCSSIconButton icon="i-tabler-color-swatch" />
94102
<span class="hidden md:inline">{{ t("Themes") }}</span>
95103
<UnoCSSIconButton icon="i-tabler-chevron-down" />
96104
</div>
97-
<div
98-
class="dropdown-content scrollbar top-px mt-16 h-[70vh] max-h-96 w-52 overflow-y-auto bg-base-200 text-base-content shadow-2xl rounded-t-box rounded-b-box"
99-
>
100-
<div class="grid grid-cols-1 gap-3 p-3" tabindex="0">
101-
<button
102-
v-for="theme in themeList"
103-
:key="theme.id"
104-
class="overflow-hidden rounded-lg text-left outline-2 outline-base-content outline-offset-2 hover:outline"
105-
:class="mode === theme.id ? 'outline' : ''"
106-
type="button"
107-
@click="changeTheme($event, theme.id)"
108-
@keydown="handleKeyDown($event, theme.id)"
109-
>
110-
<div
111-
:data-theme="theme.id"
112-
class="w-full cursor-pointer bg-base-100 text-base-content font-sans"
105+
<div tabindex="0" class="bg-base-200 text-base-content mt-16 outline-1 outline-black/5 border border-white/5 h-[30.5rem] max-h-[calc(100vh-8.6rem)] shadow-2xl top-px overflow-y-auto dropdown-content rounded-box">
106+
<ul class="w-56 menu">
107+
<li class="text-xs menu-title">
108+
{{ t("Themes") }}
109+
</li>
110+
<li v-for="theme in themeList" :key="theme.id">
111+
<button
112+
class="px-2 gap-3"
113+
:class="mode === theme.id ? '[&_svg]:visible' : ''"
114+
@click="changeTheme($event, theme.id)"
115+
@keydown="handleKeyDown($event, theme.id)"
113116
>
114-
<div class="grid grid-cols-5 grid-rows-3">
115-
<div class="col-span-5 row-span-3 row-start-1 flex gap-1 px-4 py-3">
116-
<div class="grow text-sm font-bold">
117-
{{ theme.id }}
118-
</div>
119-
<div class="flex shrink-0 flex-wrap gap-1">
120-
<div class="w-2 rounded bg-primary" />
121-
<div class="w-2 rounded bg-secondary" />
122-
<div class="w-2 rounded bg-accent" />
123-
<div class="w-2 rounded bg-neutral" />
124-
</div>
125-
</div>
117+
<div :data-theme="theme.id" class="bg-base-100 p-1 rounded-md shrink-0 gap-0.5 grid grid-cols-2 shadow-sm">
118+
<div class="bg-base-content rounded-full size-1" />
119+
<div class="bg-primary rounded-full size-1" />
120+
<div class="bg-secondary rounded-full size-1" />
121+
<div class="bg-accent rounded-full size-1" />
126122
</div>
127-
</div>
128-
</button>
129-
</div>
123+
<div class="w-32 truncate">
124+
{{ theme.id }}
125+
</div>
126+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" class="shrink-0 h-3 w-3 invisible">
127+
<path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" />
128+
</svg>
129+
</button>
130+
</li>
131+
<li />
132+
</ul>
130133
</div>
131134
</div>
132135
</template>
133136

134-
<style scoped>
135-
.scrollbar::-webkit-scrollbar {
136-
width: 20px;
137-
height: 20px;
138-
}
139-
140-
.scrollbar::-webkit-scrollbar-track {
141-
border-radius: 100vh;
142-
background: #f7f4ed;
143-
}
144-
145-
.scrollbar::-webkit-scrollbar-thumb {
146-
background: #e0cbcb;
147-
border-radius: 100vh;
148-
border: 3px solid #f6f7ed;
149-
}
150-
151-
.scrollbar::-webkit-scrollbar-thumb:hover {
152-
background: #c0a0b9;
153-
}
154-
137+
<style scoped>
155138
::view-transition-old(root),
156139
::view-transition-new(root) {
157140
animation: none;

src/layouts/Navbar/components/ThemeChange/types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import type { BasicColorSchema } from "@vueuse/core";
33
export declare type CustomTheme = "cupcake" | "bumblebee" | "emerald" | "corporate" | "synthwave"
44
| "retro" | "cyberpunk" | "valentine" | "halloween" | "garden" | "forest" | "aqua" |
55
"lofi" | "pastel" | "fantasy" | "wireframe" | "black" | "luxury" | "dracula" | "cmyk" |
6-
"autumn" | "business" | "acid" | "lemonade" | "night" | "coffee" | "winter" | BasicColorSchema;
6+
"autumn" | "business" | "acid" | "lemonade" | "night" | "coffee" | "winter" | "dim" |
7+
"nord" | "sunset" | "caramellatte" | "abyss" | "silk" | BasicColorSchema;
78
export interface ThemeList {
89
name: string;
910
id: CustomTheme;

src/layouts/Navbar/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defineOptions({
1010

1111
<template>
1212
<div
13-
class="sticky top-0 z-30 h-16 w-full flex justify-center text-base-content opacity-90 backdrop-blur transition-all duration-100"
13+
class="text-base-content opacity-90 flex h-16 w-full transition-all duration-100 top-0 justify-center sticky z-30 backdrop-blur"
1414
>
1515
<nav class="w-full navbar">
1616
<div class="flex flex-1 lg:gap-2 md:gap-1">
@@ -21,7 +21,7 @@ defineOptions({
2121
class="px-2 btn btn-ghost"
2222
>
2323
<div
24-
class="inline-flex text-lg text-primary transition-all duration-200 md:text-3xl"
24+
class="text-primary text-lg inline-flex transition-all duration-200 md:text-3xl"
2525
>
2626
<span class="text-accent">B<span class="lowercase">oot</span></span>
2727
<span class="text-base-content">V<span class="lowercase">ue</span></span>
@@ -40,7 +40,7 @@ defineOptions({
4040
aria-label="Github"
4141
target="_blank"
4242
href="https://github.com/kirklin/boot-vue"
43-
class="drawer-button normal-case btn btn-square btn-ghost"
43+
class="gap-1 btn btn-ghost btn-sm"
4444
>
4545
<UnoCSSIconButton icon="i-mdi-github" />
4646
</a>

src/pages/errorPages/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const errorCode = ref<number>(404);
77
</script>
88

99
<template>
10-
<div class="flex flex-col items-center gap-20 bg-base-100 py-20">
11-
<div class="w-96 bg-base-100 card">
10+
<div class="bg-base-100 py-20 flex flex-col gap-20 items-center">
11+
<div class="bg-base-100 w-96 card">
1212
<div class="card-body">
1313
<h2 class="card-title">
1414
Error {{ errorCode }}!

src/pages/home/components/Hero.vue

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ function testStore() {
99
</script>
1010

1111
<template>
12-
<div class="mt-[-4rem] min-h-screen text-primary-content hero">
13-
<!-- <div class="hero min-h-screen from-primary to-secondary" style="background-image: url(https://img.js.design/assets/Resources/background/home-bg-2.png);"> -->
14-
<div
15-
class="place-items-center from-primary to-base-100 bg-gradient-to-bl hero-overlay"
16-
/>
12+
<div class="bg-base-200 text-primary-content mt-[-4rem] min-h-screen hero">
1713
<div class="text-center hero-content">
1814
<div class="max-w-md">
19-
<h1 class="mb-5 text-5xl font-bold">
15+
<h1 class="text-5xl font-bold mb-5">
2016
Boot Vue
2117
</h1>
2218
<p class="mb-5">

src/pages/home/components/StoreTest.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import appStore from "~/store";
33
</script>
44

55
<template>
6-
<div class="flex flex-col items-center gap-20 bg-base-100 py-20">
6+
<div class="bg-base-100 py-20 flex flex-col gap-20 items-center">
77
<div class="mockup-phone">
8-
<div class="camera" />
9-
<div class="display">
10-
<div class="phone-1 artboard artboard-demo">
8+
<div class="mockup-phone-camera" />
9+
<div class="mockup-phone-display">
10+
<div class="text-center grid h-full place-content-center">
1111
<p class="text-xl font-medium tracking-wide uppercase">
1212
Counter:
1313
</p>

0 commit comments

Comments
 (0)