amis2/examples/components/CssDocs.tsx

794 lines
21 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: '/style/index',
2020-11-30 00:37:09 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(['../../docs/style/index.md'], (doc: any) => {
cb(null, makeMarkdownRenderer(doc));
})
2020-11-30 14:50:04 +08:00
},
{
label: 'CSS 变量',
path: '/style/css-vars',
2020-11-30 14:50:04 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(['../../docs/style/css-vars.md'], (doc: any) => {
cb(null, makeMarkdownRenderer(doc));
})
2020-11-30 14:50:04 +08:00
},
{
label: '辅助类 - 响应式设计',
path: '/style/responsive-design',
2020-11-30 14:50:04 +08:00
getComponent: (location: any, cb: any) =>
(require as any)(
['../../docs/style/responsive-design.md'],
2020-11-30 14:50:04 +08:00
(doc: any) => {
cb(null, makeMarkdownRenderer(doc));
}
)
},
{
label: '辅助类 - 状态样式',
path: '/style/state',
getComponent: (location: any, cb: any) =>
(require as any)(['../../docs/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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 Size',
path: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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: '/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
})}
</>
);
}
}