Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 0534903

Browse files
committed
🚚 chore: 优化目录结构
1 parent c6d5ce5 commit 0534903

File tree

10 files changed

+57
-45
lines changed

10 files changed

+57
-45
lines changed

config/menu.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,35 @@ export const menus = {
22
'/components': [
33
{
44
title: '说明',
5+
56
children: ['components.md'],
67
},
78
{
8-
title: '通用组件',
9-
children: [
10-
'preloader',
11-
'page-loading',
12-
'float-label-input',
13-
'macos-traffic-light',
14-
'sortable-list',
15-
],
9+
title: '信息展示',
10+
children: ['preloader', 'page-loading'],
1611
},
1712
{
18-
title: '业务组件',
19-
children: [
20-
'asset-gallery',
21-
'journey-map',
22-
'mindflow',
23-
'heatmap-calendar',
24-
'user-panel',
25-
],
13+
title: '用户操作',
14+
children: ['macos-traffic-light', 'sortable-list'],
2615
},
2716
{
28-
title: 'LayoutKit 布局组件',
17+
title: '布局 | LayoutKit',
2918
children: ['flexbox'],
3019
},
20+
{
21+
title: '暂不分类',
22+
children: ['float-label-input'],
23+
},
24+
],
25+
'/biz-components': [
26+
{
27+
title: '说明',
28+
children: ['biz-components.md'],
29+
},
30+
{
31+
title: '业务组件',
32+
children: ['asset-gallery', 'journey-map', 'mindflow', 'heatmap-calendar', 'user-panel'],
33+
},
3134
],
3235
'/guide': [
3336
{

docs/biz-components.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 说明
3+
order: 1
4+
nav:
5+
title: 高阶组件
6+
order: 2
7+
---
8+
9+
## 高阶组件
10+
11+
高阶组件基本上都是一些业务组件,具有很明确的特定领域属性。

docs/components.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
title: 组件分类
2+
title: 说明
33
order: 1
44
nav:
5-
title: 组件库
5+
title: 基础组件
66
order: 2
77
---
88

9-
## 组件分类
9+
## 基础组件
1010

11-
我将组件库分为两类:
11+
一些简单的基础组件, 在特定的一些场景下做到了基本上可以直接拿来就用。
1212

13-
- **通用组件**: 在大部分场景下可以通用的组件, 基本上可以直接拿来就用
14-
- **业务组件**: 针对某类特定场景下的组件
13+
通用组件的开发主要目的是为了满足自己使用的诉求,并做个组件资产沉淀。因为有些组件是 antd 肯定不会准备做的(例如 macOSTrafficLight),但是在一些特定的场景中会反复用到(例如 Electron)。

docs/guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ nav:
1515
- 业务组件如果可以沉淀,那么未来可以给自己复用
1616
- 终身计划的一环
1717

18-
首要目的不是给外部使用,而是作为我个人设计资源的整理
18+
首要目的不是给外部使用,而是作为我个人设计资源的整理

packages/asset-gallery/src/asset-gallery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: AssetGallery 资产画廊
33
group:
44
path: /
55
nav:
6-
path: /components
6+
path: /biz-components
77
---
88

99
# AssetGallery 资产画廊

packages/heatmap-calendar/src/heatmap-calendar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: HeatmapCalendar 活跃日历
33
group:
44
path: /
55
nav:
6-
path: /components
6+
path: /biz-components
77
---
88

99
# HeatmapCalendar 活跃日历

packages/journey-map/src/journey-map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: JourneyMap 用户旅程地图
33
group:
44
path: /
55
nav:
6-
path: /components
6+
path: /biz-components
77
---
88

99
# Journey Map 用户旅程地图

packages/layout-kit/src/Flexbox.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import type { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
22
import styled from 'styled-components';
33

4-
import {
5-
getCssValue,
6-
getFlexDirection,
7-
isHorizontal,
8-
isVertical,
9-
} from './utils';
10-
import type {
11-
ContentDistribution,
12-
ContentPosition,
13-
FlexDirection,
14-
} from './type';
4+
import { getCssValue, getFlexDirection, isHorizontal, isVertical } from './utils';
5+
import type { ContentDistribution, ContentPosition, FlexDirection } from './type';
156

167
export type CommonSpaceNumber = 2 | 4 | 8 | 12 | 16 | 24;
178

189
export interface IFlexbox {
10+
// 语法糖 api
11+
/**
12+
* 是否横向
13+
*/
1914
horizontal?: boolean;
15+
/**
16+
* 横向居中
17+
*/
18+
horizontalCenter?: boolean;
19+
20+
// 基础 api
21+
2022
direction?: FlexDirection;
2123
distribution?: ContentDistribution;
2224
align?: ContentPosition;
@@ -49,9 +51,7 @@ export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
4951
if (
5052
isHorizontal(props.direction, props.horizontal) &&
5153
!props.width &&
52-
['space-between', 'space-around', 'space-evenly'].includes(
53-
props.distribution,
54-
)
54+
['space-between', 'space-around', 'space-evenly'].includes(props.distribution)
5555
)
5656
return '100%';
5757
@@ -63,8 +63,7 @@ export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
6363
6464
> *:not(:last-child) {
6565
margin-right: ${(props) =>
66-
isHorizontal(props.direction, props.horizontal) &&
67-
getCssValue(props.gap)};
66+
isHorizontal(props.direction, props.horizontal) && getCssValue(props.gap)};
6867
margin-bottom: ${(props) =>
6968
isVertical(props.direction, props.horizontal) && getCssValue(props.gap)};
7069
}

packages/mindflow/src/mindflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ order: 1
44
group:
55
path: /
66
nav:
7-
path: /components
7+
path: /biz-components
88
---
99

1010
# Mindflow 思流

packages/user-panel/src/user-panel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: UserPanel 用户面板
33
group:
44
path: /
55
nav:
6-
path: /components
6+
path: /biz-components
77
---
88

99
# UserPanel 用户面板

0 commit comments

Comments
 (0)