Skip to content

Commit

Permalink
🚚 chore: 优化目录结构
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Mar 20, 2022
1 parent c6d5ce5 commit 0534903
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 45 deletions.
37 changes: 20 additions & 17 deletions config/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@ export const menus = {
'/components': [
{
title: '说明',

children: ['components.md'],
},
{
title: '通用组件',
children: [
'preloader',
'page-loading',
'float-label-input',
'macos-traffic-light',
'sortable-list',
],
title: '信息展示',
children: ['preloader', 'page-loading'],
},
{
title: '业务组件',
children: [
'asset-gallery',
'journey-map',
'mindflow',
'heatmap-calendar',
'user-panel',
],
title: '用户操作',
children: ['macos-traffic-light', 'sortable-list'],
},
{
title: 'LayoutKit 布局组件',
title: '布局 | LayoutKit',
children: ['flexbox'],
},
{
title: '暂不分类',
children: ['float-label-input'],
},
],
'/biz-components': [
{
title: '说明',
children: ['biz-components.md'],
},
{
title: '业务组件',
children: ['asset-gallery', 'journey-map', 'mindflow', 'heatmap-calendar', 'user-panel'],
},
],
'/guide': [
{
Expand Down
11 changes: 11 additions & 0 deletions docs/biz-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: 说明
order: 1
nav:
title: 高阶组件
order: 2
---

## 高阶组件

高阶组件基本上都是一些业务组件,具有很明确的特定领域属性。
11 changes: 5 additions & 6 deletions docs/components.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
title: 组件分类
title: 说明
order: 1
nav:
title: 组件库
title: 基础组件
order: 2
---

## 组件分类
## 基础组件

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

- **通用组件**: 在大部分场景下可以通用的组件, 基本上可以直接拿来就用
- **业务组件**: 针对某类特定场景下的组件
通用组件的开发主要目的是为了满足自己使用的诉求,并做个组件资产沉淀。因为有些组件是 antd 肯定不会准备做的(例如 macOSTrafficLight),但是在一些特定的场景中会反复用到(例如 Electron)。
2 changes: 1 addition & 1 deletion docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ nav:
- 业务组件如果可以沉淀,那么未来可以给自己复用
- 终身计划的一环

首要目的不是给外部使用,而是作为我个人设计资源的整理
首要目的不是给外部使用,而是作为我个人设计资源的整理
2 changes: 1 addition & 1 deletion packages/asset-gallery/src/asset-gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: AssetGallery 资产画廊
group:
path: /
nav:
path: /components
path: /biz-components
---

# AssetGallery 资产画廊
Expand Down
2 changes: 1 addition & 1 deletion packages/heatmap-calendar/src/heatmap-calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: HeatmapCalendar 活跃日历
group:
path: /
nav:
path: /components
path: /biz-components
---

# HeatmapCalendar 活跃日历
Expand Down
2 changes: 1 addition & 1 deletion packages/journey-map/src/journey-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: JourneyMap 用户旅程地图
group:
path: /
nav:
path: /components
path: /biz-components
---

# Journey Map 用户旅程地图
Expand Down
31 changes: 15 additions & 16 deletions packages/layout-kit/src/Flexbox.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import type { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
import styled from 'styled-components';

import {
getCssValue,
getFlexDirection,
isHorizontal,
isVertical,
} from './utils';
import type {
ContentDistribution,
ContentPosition,
FlexDirection,
} from './type';
import { getCssValue, getFlexDirection, isHorizontal, isVertical } from './utils';
import type { ContentDistribution, ContentPosition, FlexDirection } from './type';

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

export interface IFlexbox {
// 语法糖 api
/**
* 是否横向
*/
horizontal?: boolean;
/**
* 横向居中
*/
horizontalCenter?: boolean;

// 基础 api

direction?: FlexDirection;
distribution?: ContentDistribution;
align?: ContentPosition;
Expand Down Expand Up @@ -49,9 +51,7 @@ export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
if (
isHorizontal(props.direction, props.horizontal) &&
!props.width &&
['space-between', 'space-around', 'space-evenly'].includes(
props.distribution,
)
['space-between', 'space-around', 'space-evenly'].includes(props.distribution)
)
return '100%';
Expand All @@ -63,8 +63,7 @@ export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
> *:not(:last-child) {
margin-right: ${(props) =>
isHorizontal(props.direction, props.horizontal) &&
getCssValue(props.gap)};
isHorizontal(props.direction, props.horizontal) && getCssValue(props.gap)};
margin-bottom: ${(props) =>
isVertical(props.direction, props.horizontal) && getCssValue(props.gap)};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mindflow/src/mindflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ order: 1
group:
path: /
nav:
path: /components
path: /biz-components
---

# Mindflow 思流
Expand Down
2 changes: 1 addition & 1 deletion packages/user-panel/src/user-panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: UserPanel 用户面板
group:
path: /
nav:
path: /components
path: /biz-components
---

# UserPanel 用户面板
Expand Down

1 comment on commit 0534903

@vercel
Copy link

@vercel vercel bot commented on 0534903 Mar 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.