@coffic/cosy-ui 0.9.24 → 0.9.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +1 -1
- package/dist/index-astro.ts +0 -1
- package/dist/src/assets/iconData.ts +5 -0
- package/dist/src/utils/link.ts +1 -1
- package/dist/src/utils/theme.ts +99 -96
- package/dist/src-astro/article/Article.astro +1 -0
- package/dist/src-astro/container/Container.astro +9 -0
- package/dist/src-astro/footer/Footer.astro +16 -19
- package/dist/src-astro/footer/FooterCopyright.astro +8 -17
- package/dist/src-astro/footer/FooterICP.astro +18 -0
- package/dist/src-astro/footer/index.ts +1 -0
- package/dist/src-astro/footer/types.ts +27 -0
- package/dist/src-astro/header/Header.astro +53 -54
- package/dist/src-astro/header/HeaderCenter.astro +59 -0
- package/dist/src-astro/header/HeaderEnd.astro +90 -0
- package/dist/src-astro/header/HeaderStart.astro +78 -0
- package/dist/src-astro/header/MobileNav.astro +44 -0
- package/dist/src-astro/header/NavItems.astro +82 -0
- package/dist/src-astro/header/index.ts +6 -0
- package/dist/src-astro/icons/GlobeIcon.astro +28 -0
- package/dist/src-astro/icons/index.ts +1 -0
- package/dist/src-astro/language-switcher/LanguageSwitcher.astro +5 -2
- package/dist/src-astro/layout-app/AppHeader.astro +95 -0
- package/dist/src-astro/layout-app/AppLayout.astro +18 -26
- package/dist/src-astro/modal/Modal.astro +29 -4
- package/dist/src-astro/sidebar/DesktopSidebar.astro +123 -0
- package/dist/src-astro/sidebar/MobileSidebar.astro +91 -0
- package/dist/src-astro/sidebar/Sidebar.astro +45 -86
- package/dist/src-astro/sidebar/SidebarNav.astro +12 -3
- package/dist/src-astro/sidebar/index.ts +1 -2
- package/dist/src-astro/theme-switcher/ThemeItem.astro +43 -3
- package/dist/src-astro/theme-switcher/ThemeSwitcher.astro +6 -67
- package/dist/src-astro/theme-switcher/index.ts +1 -9
- package/dist/src-astro/types/footer.ts +5 -0
- package/dist/src-astro/types/header.ts +6 -0
- package/package.json +1 -1
- package/dist/src-astro/nav-item/NavItems.astro +0 -44
- package/dist/src-astro/nav-item/index.ts +0 -3
- package/dist/src-astro/sidebar/MobileNav.astro +0 -55
- package/dist/src-astro/theme-switcher/ThemeSwitcherBasic.astro +0 -7
@@ -1,55 +0,0 @@
|
|
1
|
-
---
|
2
|
-
/**
|
3
|
-
* MobileNav组件
|
4
|
-
*
|
5
|
-
* 移动端导航栏组件
|
6
|
-
*/
|
7
|
-
|
8
|
-
import { MenuIcon } from '../../index-astro';
|
9
|
-
import { isPathMatch } from '../../src/utils/path.ts';
|
10
|
-
import type { ISidebarItem } from '../types/sidebar.ts';
|
11
|
-
|
12
|
-
interface Props {
|
13
|
-
/**
|
14
|
-
* 侧边栏项目
|
15
|
-
*/
|
16
|
-
sidebarItems: ISidebarItem[];
|
17
|
-
|
18
|
-
/**
|
19
|
-
* 当前路径
|
20
|
-
*/
|
21
|
-
currentPath: string;
|
22
|
-
|
23
|
-
/**
|
24
|
-
* 是否开启调试模式
|
25
|
-
*/
|
26
|
-
debug?: boolean;
|
27
|
-
}
|
28
|
-
|
29
|
-
const { sidebarItems, currentPath, debug = false } = Astro.props;
|
30
|
-
|
31
|
-
const debugClass = debug ? 'cosy:border cosy:border-red-500' : '';
|
32
|
-
|
33
|
-
// 获取当前活动的一级导航项
|
34
|
-
const currentSection = sidebarItems.find((section) =>
|
35
|
-
section.items?.some((item) => isPathMatch(currentPath, item.href))
|
36
|
-
);
|
37
|
-
---
|
38
|
-
|
39
|
-
<div
|
40
|
-
class:list={[
|
41
|
-
'cosy:flex cosy:lg:hidden cosy:items-center cosy:justify-between cosy:px-4 cosy:py-2 cosy:border-b cosy:border-base-300 cosy:bg-base-100 cosy:relative cosy:z-10',
|
42
|
-
debugClass,
|
43
|
-
]}>
|
44
|
-
<div class="cosy:flex cosy:items-center cosy:gap-2">
|
45
|
-
<button
|
46
|
-
type="button"
|
47
|
-
class="cosy:p-2 cosy:btn cosy:btn-ghost cosy:btn-sm"
|
48
|
-
data-modal-target="mobile-sidebar">
|
49
|
-
<MenuIcon class="cosy:w-5 cosy:h-5" />
|
50
|
-
</button>
|
51
|
-
<span class="cosy:font-medium cosy:text-sm">
|
52
|
-
{currentSection?.text || '导航'}
|
53
|
-
</span>
|
54
|
-
</div>
|
55
|
-
</div>
|