amis2/examples/components/CssDocs.tsx

809 lines
22 KiB
TypeScript
Raw Normal View History

2020-11-30 00:37:09 +08:00
import React from 'react';
import makeMarkdownRenderer from './MdRenderer';
export const cssDocs = [
{
2020-12-01 12:12:19 +08:00
label: '开始',
2020-11-30 00:37:09 +08:00
children: [
{
2020-11-30 14:50:04 +08:00
label: '快速开始',
path: '/zh-CN/style/index',
2020-11-30 00:37:09 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(['../../docs/zh-CN/style/index.md'], (doc: any) => {
cb(null, makeMarkdownRenderer(doc));
})
2020-11-30 14:50:04 +08:00
},
{
label: 'CSS 变量',
path: '/zh-CN/style/css-vars',
2020-11-30 14:50:04 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../docs/zh-CN/style/css-vars.md'],
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
2020-11-30 14:50:04 +08:00
},
{
label: '辅助类 - 响应式设计',
path: '/zh-CN/style/responsive-design',
2020-11-30 14:50:04 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../docs/zh-CN/style/responsive-design.md'],
2020-11-30 14:50:04 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: '辅助类 - 状态样式',
path: '/zh-CN/style/state',
getComponent: (location: any, cb: any) =>
(require as any)(['../../docs/zh-CN/style/state.md'], (doc: any) => {
cb(null, makeMarkdownRenderer(doc));
})
2020-11-30 00:37:09 +08:00
}
]
},
{
// prefix: ({classnames: cx}) => <li className={cx('AsideNav-divider')} />,
2020-12-01 11:43:30 +08:00
label: 'Layout',
2020-11-30 00:37:09 +08:00
children: [
{
2020-12-01 11:43:30 +08:00
label: 'Box Sizing',
path: '/zh-CN/style/layout/box-sizing',
2020-11-30 00:37:09 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_box-sizing.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Display',
path: '/zh-CN/style/layout/display',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_display.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Floats',
path: '/zh-CN/style/layout/floats',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_float.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Clear',
path: '/zh-CN/style/layout/clear',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_clear.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Overflow',
path: '/zh-CN/style/layout/overflow',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_overflow.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Position',
path: '/zh-CN/style/layout/position',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_position.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Top / Right / Bottom / Left',
path: '/zh-CN/style/layout/top-right-bottom-left',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_top-right-bottom-left.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Visibility',
path: '/zh-CN/style/layout/visibility',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_visibility.scss'],
2020-12-01 11:43:30 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Z-Index',
path: '/zh-CN/style/layout/z-index',
2020-12-01 11:43:30 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/layout/_z-index.scss'],
2020-11-30 00:37:09 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
2020-12-01 12:12:19 +08:00
},
{
label: 'Flexbox',
children: [
{
label: 'Flex Direction',
path: '/zh-CN/style/flexbox/direction',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/flex/_direction.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Flex Wrap',
path: '/zh-CN/style/flexbox/wrap',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/flex/_wrap.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Flex',
path: '/zh-CN/style/flexbox/flex',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/flex/_flex.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Flex Grow',
path: '/zh-CN/style/flexbox/grow',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/flex/_grow.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Flex Shrink',
path: '/zh-CN/style/flexbox/shrink',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/flex/_shrink.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Flex Order',
path: '/zh-CN/style/flexbox/order',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/flex/_order.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'Grid',
children: [
{
label: 'Grid Template Columns',
path: '/zh-CN/style/grid/columns',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_columns.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Grid Column Start / End',
path: '/zh-CN/style/grid/column-start-end',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_column-start-end.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Grid Template Rows',
path: '/zh-CN/style/grid/rows',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_rows.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Grid Row Start / End',
path: '/zh-CN/style/grid/row-start-end',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_row-start-end.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Grid Auto Flow',
path: '/zh-CN/style/grid/auto-flow',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_auto-flow.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Grid Auto Columns',
path: '/zh-CN/style/grid/auto-columns',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_auto-columns.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Grid Auto Rows',
path: '/zh-CN/style/grid/auto-rows',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/grid/_auto-rows.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Gap',
path: '/zh-CN/style/grid/gap',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(['../../scss/helper/grid/_gap.scss'], (doc: any) => {
cb(null, makeMarkdownRenderer(doc));
})
2020-12-01 12:12:19 +08:00
}
]
},
{
label: 'Box Alignment',
children: [
{
label: 'Justify Content',
path: '/zh-CN/style/box-alignment/justify-content',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_justify-content.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Justify Items',
path: '/zh-CN/style/box-alignment/justify-items',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_justify-items.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Justify Self',
path: '/zh-CN/style/box-alignment/justify-self',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_justify-self.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Align Content',
path: '/zh-CN/style/box-alignment/align-content',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_align-content.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Align Items',
path: '/zh-CN/style/box-alignment/align-items',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_align-items.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Align Self',
path: '/zh-CN/style/box-alignment/align-self',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_align-self.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Place Content',
path: '/zh-CN/style/box-alignment/place-content',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_place-content.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Place Items',
path: '/zh-CN/style/box-alignment/place-items',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_place-items.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Place Self',
path: '/zh-CN/style/box-alignment/place-self',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/box-alignment/_place-self.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'Spacing',
children: [
{
label: 'Padding',
path: '/zh-CN/style/spacing/padding',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/spacing/_padding.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Margin',
path: '/zh-CN/style/spacing/margin',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/spacing/_margin.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Space Between',
path: '/zh-CN/style/spacing/space-between',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/spacing/_space-between.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'Sizing',
children: [
{
label: 'Width',
path: '/zh-CN/style/sizing/width',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/sizing/_width.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Height',
path: '/zh-CN/style/sizing/height',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/sizing/_height.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'Typography',
children: [
{
label: 'Font Family',
path: '/zh-CN/style/typography/font-family',
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_font-family.scss'],
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
2020-12-01 12:12:19 +08:00
{
label: 'Font Size',
path: '/zh-CN/style/typography/font-size',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_font-size.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Font style',
path: '/zh-CN/style/typography/font-style',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_font-style.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Font Weight',
path: '/zh-CN/style/typography/font-weight',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_font-weight.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Letter Spacing',
path: '/zh-CN/style/typography/letter-spacing',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_letter-spacing.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Line Height',
path: '/zh-CN/style/typography/line-height',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_line-height.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'List Style Type',
path: '/zh-CN/style/typography/list-style-type',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_list-style-type.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Text Alignment',
path: '/zh-CN/style/typography/text-align',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_text-align.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Text Color',
path: '/zh-CN/style/typography/text-color',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_text-color.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Text Decoration',
path: '/zh-CN/style/typography/text-decoration',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_text-decoration.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Text Transform',
path: '/zh-CN/style/typography/text-transform',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_text-transform.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Vertical Alignment',
path: '/zh-CN/style/typography/vertical-align',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_vertical-align.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Whitespace',
path: '/zh-CN/style/typography/whitespace',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_whitespace.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Word Break',
path: '/zh-CN/style/typography/word-break',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/typography/_word-break.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'Backgrounds',
children: [
{
label: 'Background Color',
path: '/zh-CN/style/background/background-color',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/background/_background-color.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'BORDERS',
children: [
{
label: 'Border Radius',
path: '/zh-CN/style/border/border-radius',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/border/_border-radius.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Border Width',
path: '/zh-CN/style/border/border-width',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/border/_border-width.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Border Color',
path: '/zh-CN/style/border/border-color',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/border/_border-color.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Border Style',
path: '/zh-CN/style/border/border-style',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/border/_border-style.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
},
{
label: 'Effect',
children: [
{
label: 'Box Shadow',
path: '/zh-CN/style/effect/box-shadow',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/effect/_box-shadow.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: 'Opacity',
path: '/zh-CN/style/effect/opacity',
2020-12-01 12:12:19 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../scss/helper/effect/_opacity.scss'],
2020-12-01 12:12:19 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
}
]
2020-11-30 00:37:09 +08:00
}
];
export default class CSSDocs extends React.PureComponent<any> {
componentDidMount() {
this.props.setNavigations(cssDocs);
}
componentDidUpdate() {
this.props.setNavigations(cssDocs);
}
render() {
return (
<>
{React.cloneElement(this.props.children as any, {
...(this.props.children as any).props,
theme: this.props.theme,
classPrefix: this.props.classPrefix,
locale: this.props.locale,
viewMode: this.props.viewMode,
offScreen: this.props.offScreen
})}
</>
);
}
}