@coffic/cosy-ui 0.9.23 → 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.
Files changed (42) hide show
  1. package/dist/app.css +1 -1
  2. package/dist/index-astro.ts +0 -2
  3. package/dist/src/assets/iconData.ts +5 -0
  4. package/dist/src/utils/link.ts +1 -1
  5. package/dist/src/utils/theme.ts +99 -96
  6. package/dist/src-astro/article/Article.astro +1 -0
  7. package/dist/src-astro/container/Container.astro +9 -0
  8. package/dist/src-astro/footer/Footer.astro +16 -20
  9. package/dist/src-astro/footer/FooterCopyright.astro +8 -17
  10. package/dist/src-astro/footer/FooterICP.astro +18 -0
  11. package/dist/src-astro/footer/index.ts +1 -0
  12. package/dist/src-astro/footer/types.ts +27 -0
  13. package/dist/src-astro/header/Header.astro +53 -54
  14. package/dist/src-astro/header/HeaderCenter.astro +59 -0
  15. package/dist/src-astro/header/HeaderEnd.astro +90 -0
  16. package/dist/src-astro/header/HeaderStart.astro +78 -0
  17. package/dist/src-astro/header/MobileNav.astro +44 -0
  18. package/dist/src-astro/header/NavItems.astro +82 -0
  19. package/dist/src-astro/header/index.ts +6 -0
  20. package/dist/src-astro/icons/GlobeIcon.astro +28 -0
  21. package/dist/src-astro/icons/index.ts +1 -0
  22. package/dist/src-astro/language-switcher/LanguageSwitcher.astro +5 -2
  23. package/dist/src-astro/layout-app/AppHeader.astro +95 -0
  24. package/dist/src-astro/layout-app/AppLayout.astro +18 -26
  25. package/dist/src-astro/layout-basic/index.ts +1 -0
  26. package/dist/src-astro/{types → layout-basic}/layout.ts +5 -5
  27. package/dist/src-astro/modal/Modal.astro +39 -4
  28. package/dist/src-astro/sidebar/DesktopSidebar.astro +123 -0
  29. package/dist/src-astro/sidebar/MobileSidebar.astro +91 -0
  30. package/dist/src-astro/sidebar/Sidebar.astro +45 -86
  31. package/dist/src-astro/sidebar/SidebarNav.astro +12 -3
  32. package/dist/src-astro/sidebar/index.ts +1 -2
  33. package/dist/src-astro/theme-switcher/ThemeItem.astro +43 -3
  34. package/dist/src-astro/theme-switcher/ThemeSwitcher.astro +6 -67
  35. package/dist/src-astro/theme-switcher/index.ts +1 -9
  36. package/dist/src-astro/types/footer.ts +5 -0
  37. package/dist/src-astro/types/header.ts +6 -0
  38. package/package.json +1 -1
  39. package/dist/src-astro/nav-item/NavItems.astro +0 -44
  40. package/dist/src-astro/nav-item/index.ts +0 -3
  41. package/dist/src-astro/sidebar/MobileNav.astro +0 -55
  42. 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>
@@ -1,7 +0,0 @@
1
- ---
2
- import ThemeSwitcher from './ThemeSwitcher.astro';
3
- ---
4
-
5
- <div class="cosy:flex cosy:justify-center">
6
- <ThemeSwitcher />
7
- </div>