@coffic/cosy-ui 0.8.28 → 0.9.1
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/index-collection.ts +85 -84
- package/dist/src/utils/i18n.ts +0 -6
- package/dist/src/utils/language.ts +80 -101
- package/dist/src-astro/entities/CourseDoc.ts +75 -74
- package/dist/src-astro/entities/SidebarItem.ts +67 -65
- package/dist/src-astro/footer/Footer.astro +9 -14
- package/dist/src-astro/footer/FooterCopyright.astro +29 -0
- package/dist/src-astro/footer/FooterSection.astro +3 -0
- package/dist/src-astro/header/Header.astro +3 -3
- package/dist/src-astro/language-switcher/LanguageSwitcher.astro +42 -33
- package/dist/src-astro/language-switcher/index.ts +1 -9
- package/dist/src-astro/language-switcher/switcher_util.ts +40 -0
- package/dist/src-astro/layout-dashboard/DashboardLayout.astro +21 -2
- package/dist/src-astro/layout-dashboard/types.ts +2 -2
- package/dist/src-astro/link/Link.astro +6 -1
- package/dist/src-astro/list/ListItem.astro +58 -11
- package/dist/src-astro/{sidebar-nav → sidebar}/SidebarNav.astro +17 -0
- package/dist/src-astro/sidebar/index.ts +2 -9
- package/dist/src-astro/types/header.ts +66 -71
- package/dist/src-astro/types/sidebar.ts +28 -24
- package/package.json +1 -1
- package/dist/src-astro/language-switcher/LanguageSwitcherBasic.astro +0 -7
- package/dist/src-astro/sidebar/SidebarBasic.astro +0 -0
- package/dist/src-astro/sidebar-nav/SidebarNavBasic.astro +0 -32
- package/dist/src-astro/sidebar-nav/index.ts +0 -11
@@ -1,87 +1,82 @@
|
|
1
1
|
import type { INavItem } from './nav';
|
2
2
|
|
3
3
|
export interface IHeaderProps {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
/**
|
5
|
+
* 侧边栏是否默认展开
|
6
|
+
* @default false
|
7
|
+
*/
|
8
|
+
defaultSidebarOpen?: boolean;
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
/**
|
11
|
+
* 导航栏高度
|
12
|
+
* @default "md"
|
13
|
+
*/
|
14
|
+
height?: '3xs' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
/**
|
17
|
+
* Logo图片元数据
|
18
|
+
*/
|
19
|
+
logo?: ImageMetadata;
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
/**
|
22
|
+
* Logo 链接地址
|
23
|
+
* @default "/"
|
24
|
+
*/
|
25
|
+
logoHref?: string;
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
logoHref?: string;
|
27
|
+
/**
|
28
|
+
* 导航菜单项
|
29
|
+
*/
|
30
|
+
navItems?: INavItem[];
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
/**
|
33
|
+
* 导航栏位置
|
34
|
+
* @default "start"
|
35
|
+
*/
|
36
|
+
navPosition?: 'start' | 'center' | 'end';
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
/**
|
39
|
+
* 水平内边距
|
40
|
+
* @default "md"
|
41
|
+
*/
|
42
|
+
paddingHorizontal?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
/**
|
45
|
+
* 垂直内边距
|
46
|
+
* @default "md"
|
47
|
+
*/
|
48
|
+
paddingVertical?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
/**
|
51
|
+
* 圆角大小
|
52
|
+
* @default "md"
|
53
|
+
*/
|
54
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
/**
|
57
|
+
* 是否显示侧边栏切换按钮
|
58
|
+
* @default false
|
59
|
+
*/
|
60
|
+
showSidebarToggle?: boolean;
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
/**
|
63
|
+
* 是否显示主题切换按钮
|
64
|
+
* @default false
|
65
|
+
*/
|
66
|
+
showThemeSwitcher?: boolean;
|
66
67
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
/**
|
69
|
+
* 社交媒体链接列表
|
70
|
+
*/
|
71
|
+
socialLinks?: Array<{
|
72
|
+
name: string;
|
73
|
+
url: string;
|
74
|
+
icon: any;
|
75
|
+
}>;
|
72
76
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
url: string;
|
79
|
-
icon: any;
|
80
|
-
}>;
|
81
|
-
|
82
|
-
/**
|
83
|
-
* 是否固定在顶部
|
84
|
-
* @default true
|
85
|
-
*/
|
86
|
-
sticky?: boolean;
|
77
|
+
/**
|
78
|
+
* 是否固定在顶部
|
79
|
+
* @default true
|
80
|
+
*/
|
81
|
+
sticky?: boolean;
|
87
82
|
}
|
@@ -2,35 +2,39 @@
|
|
2
2
|
* 侧边栏项目
|
3
3
|
*/
|
4
4
|
export interface ISidebarItem {
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
href: string;
|
6
|
+
text: string;
|
7
|
+
items?: ISidebarItem[];
|
8
|
+
/**
|
9
|
+
* 可选徽标内容
|
10
|
+
*/
|
11
|
+
badge?: string | number;
|
8
12
|
}
|
9
13
|
|
10
14
|
/**
|
11
15
|
* 侧边栏配置
|
12
16
|
*/
|
13
17
|
export interface ISidebarProps {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
/**
|
19
|
+
* 侧边栏项目
|
20
|
+
*/
|
21
|
+
sidebarItems: ISidebarItem[];
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
/**
|
24
|
+
* 桌面端类名
|
25
|
+
*/
|
26
|
+
class?: string;
|
23
27
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
/**
|
29
|
+
* 是否开启调试模式,显示边框
|
30
|
+
* @default false
|
31
|
+
*/
|
32
|
+
debug?: boolean;
|
29
33
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
+
/**
|
35
|
+
* 侧边栏顶部外边距
|
36
|
+
*/
|
37
|
+
marginTop?:
|
34
38
|
| 'xs'
|
35
39
|
| 'sm'
|
36
40
|
| 'md'
|
@@ -42,10 +46,10 @@ export interface ISidebarProps {
|
|
42
46
|
| '5xl'
|
43
47
|
| string;
|
44
48
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
/**
|
50
|
+
* 侧边栏底部外边距
|
51
|
+
*/
|
52
|
+
marginBottom?:
|
49
53
|
| 'xs'
|
50
54
|
| 'sm'
|
51
55
|
| 'md'
|
package/package.json
CHANGED
File without changes
|
@@ -1,32 +0,0 @@
|
|
1
|
-
---
|
2
|
-
import SidebarNav from './SidebarNav.astro';
|
3
|
-
import type { ISidebarItem } from '../types/sidebar';
|
4
|
-
|
5
|
-
const sidebarItems: ISidebarItem[] = [
|
6
|
-
{
|
7
|
-
text: '入门指南',
|
8
|
-
href: '/docs/getting-started',
|
9
|
-
items: [
|
10
|
-
{ href: '/docs/getting-started/installation', text: '安装' },
|
11
|
-
{ href: '/docs/getting-started/quick-start', text: '快速开始' },
|
12
|
-
],
|
13
|
-
},
|
14
|
-
{
|
15
|
-
text: '基础组件',
|
16
|
-
href: '/docs/components',
|
17
|
-
items: [
|
18
|
-
{ href: '/docs/components/button', text: 'Button 按钮' },
|
19
|
-
{ href: '/docs/components/alert', text: 'Alert 提示' },
|
20
|
-
{ href: '/docs/components/card', text: 'Card 卡片' },
|
21
|
-
],
|
22
|
-
},
|
23
|
-
];
|
24
|
-
---
|
25
|
-
|
26
|
-
<div class="cosy:w-64 cosy:bg-base-100">
|
27
|
-
<SidebarNav
|
28
|
-
sidebarItems={sidebarItems}
|
29
|
-
currentPath="/docs/getting-started/installation"
|
30
|
-
debug={false}
|
31
|
-
/>
|
32
|
-
</div>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import SidebarNav from './SidebarNav.astro';
|
2
|
-
import SidebarNavBasic from './SidebarNavBasic.astro';
|
3
|
-
import BasicSourceCode from './SidebarNavBasic.astro?raw';
|
4
|
-
import { extractSimpleExample } from '../../src/utils/component';
|
5
|
-
|
6
|
-
export { SidebarNav, SidebarNavBasic };
|
7
|
-
|
8
|
-
// 导出示例源代码
|
9
|
-
export const SidebarNavExampleCodes = {
|
10
|
-
Basic: extractSimpleExample(BasicSourceCode, 'SidebarNav'),
|
11
|
-
};
|