mirror of
https://github.com/zhigang1992/docz.git
synced 2026-04-29 01:45:54 +08:00
chore: move react native examples and plugin to a new repo
This commit is contained in:
@@ -83,14 +83,14 @@ Documenting our things is one of the most important and heavy processes when you
|
||||
- **[css](https://github.com/pedronauck/docz-plugin-css)** - Parse css files inside your documents
|
||||
- **[babel6](https://github.com/pedronauck/docz/blob/master/packages/docz-plugin-babel6)** - Use this plugin to use older babel version **[DEPRECATED]** ⚠️
|
||||
- **[netlify](https://github.com/nicholasess/docz-plugin-netlify)** - Deploy your documentation to [Netlify](http://netlify.com/)
|
||||
- **[react-native](https://github.com/pedronauck/docz/blob/master/packages/docz-plugin-react-native)** - Allow you to use docz with React Native
|
||||
- **[react-native](https://github.com/pedronauck/docz-plugin-react-native)** - Allow you to use docz with React Native
|
||||
- **[svgr](https://github.com/pedronauck/docz/blob/master/packages/docz-plugin-svgr)** - Allow you to parse svg using svgr
|
||||
|
||||
## 🗃 Examples
|
||||
|
||||
- **[basic](https://github.com/pedronauck/docz/tree/master/examples/basic)** - Some basic example
|
||||
- **[babel 6](https://github.com/pedronauck/docz/tree/master/examples/babel6)** - Using docz with Babel@6 **[DEPRECATED]** ⚠️
|
||||
- **[react native](https://github.com/pedronauck/docz/tree/master/examples/react-native)** - Using in a React Native project
|
||||
- **[react native](https://github.com/pedronauck/docz-plugin-react-native/tree/master/example)** - Using in a React Native project
|
||||
- **[with typescript](https://github.com/pedronauck/docz/tree/master/examples/typescript)** - Using docz with Typescript
|
||||
- **[with flow](https://github.com/pedronauck/docz/tree/master/examples/flow)** - Using docz with Flow
|
||||
- **[with sass](https://github.com/pedronauck/docz-plugin-css/tree/master/examples/css-sass)** - Using docz parsing css with Sass
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# ⚠️ [MOVED REPO](https://github.com/pedronauck/docz-plugin-css/tree/master/examples)
|
||||
|
||||
To avoid some performances issues, we moved all css examples to some new repo!
|
||||
To avoid some performances issues, we move all css examples to a new repo!
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"presets": ["react-native"]
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://github.com/pedronauck/docz/compare/v0.10.3...v0.11.0) (2018-09-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* integration with react native ([#271](https://github.com/pedronauck/docz/issues/271)) ([ac359ce](https://github.com/pedronauck/docz/commit/ac359ce))
|
||||
3
examples/react-native/README.md
Normal file
3
examples/react-native/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# ⚠️ [MOVED REPO](https://github.com/pedronauck/docz-plugin-react-native/tree/master/example)
|
||||
|
||||
To avoid some performances issues, we move this example to a new repo!
|
||||
6
examples/react-native/doczrc.js
vendored
6
examples/react-native/doczrc.js
vendored
@@ -1,6 +0,0 @@
|
||||
import { reactNative } from 'docz-plugin-react-native'
|
||||
|
||||
export default {
|
||||
title: 'React Native',
|
||||
plugins: [reactNative()],
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "docz-example-react-native",
|
||||
"version": "0.11.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "docz dev",
|
||||
"build": "docz build"
|
||||
},
|
||||
"dependencies": {
|
||||
"prop-types": "15.6.2",
|
||||
"react": "^16.5.0",
|
||||
"react-dom": "^16.5.0",
|
||||
"styled-components": "^3.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"docz": "^0.11.0",
|
||||
"docz-plugin-react-native": "^0.11.0"
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
import React, { Fragment } from 'react'
|
||||
import { Text as BaseText } from 'react-native'
|
||||
import styled from 'styled-components/native'
|
||||
import * as t from 'prop-types'
|
||||
|
||||
const kinds = {
|
||||
info: '#5352ED',
|
||||
positive: '#2ED573',
|
||||
negative: '#FF4757',
|
||||
warning: '#FFA502',
|
||||
}
|
||||
|
||||
const AlertStyled = styled.View`
|
||||
padding: 15px 20px;
|
||||
background: white;
|
||||
border-radius: 3px;
|
||||
background: ${({ kind = 'info' }) => kinds[kind]};
|
||||
`
|
||||
|
||||
export const Text = styled(BaseText)`
|
||||
color: white;
|
||||
`
|
||||
|
||||
export const Alert = ({ kind = 'info', ...props }: AlertProps) => (
|
||||
<AlertStyled {...props} kind={kind} />
|
||||
)
|
||||
|
||||
Alert.propTypes = {
|
||||
kind: t.oneOf(['info', 'positive', 'negative', 'warning']),
|
||||
}
|
||||
|
||||
Alert.defaultProps = {
|
||||
kind: 'info',
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
name: Alert
|
||||
menu: Components
|
||||
---
|
||||
|
||||
import { Playground, PropsTable } from 'docz'
|
||||
import { Alert, Text } from './Alert'
|
||||
|
||||
# Alert
|
||||
|
||||
## Properties
|
||||
|
||||
<PropsTable of={Alert} />
|
||||
|
||||
## Basic usage
|
||||
|
||||
<Playground>
|
||||
<Alert>
|
||||
<Text>Hello world</Text>
|
||||
</Alert>
|
||||
</Playground>
|
||||
|
||||
## Using different kinds
|
||||
|
||||
<Playground>
|
||||
<Alert kind="info"><Text>Some message</Text></Alert>
|
||||
<Alert kind="positive"><Text>Some message</Text></Alert>
|
||||
<Alert kind="negative"><Text>Some message</Text></Alert>
|
||||
<Alert kind="warning"><Text>Some message</Text></Alert>
|
||||
</Playground>
|
||||
|
||||
|
||||
## Use with children as a function
|
||||
|
||||
<Playground>
|
||||
{() => {
|
||||
const message = 'Hello world'
|
||||
|
||||
return (
|
||||
<Alert><Text>{message}</Text></Alert>
|
||||
)
|
||||
}}
|
||||
</Playground>
|
||||
@@ -1,78 +0,0 @@
|
||||
import React from 'react'
|
||||
import styled from 'styled-components/native'
|
||||
import * as t from 'prop-types'
|
||||
|
||||
const scales = {
|
||||
small: `
|
||||
width: 100px;
|
||||
padding: 5px 10px;
|
||||
font-size: 14;
|
||||
`,
|
||||
normal: `
|
||||
width: 130px;
|
||||
padding: 10px 20px;
|
||||
font-size: 16;
|
||||
`,
|
||||
big: `
|
||||
width: 180px;
|
||||
padding: 20px 30px;
|
||||
font-size: 18;
|
||||
`,
|
||||
}
|
||||
|
||||
const kind = (bg, color) => `
|
||||
background: ${bg};
|
||||
border-color: red;
|
||||
color: ${color};
|
||||
transition: all .3s;
|
||||
`
|
||||
|
||||
const kinds = {
|
||||
primary: kind('#1FB6FF', 'white'),
|
||||
secondary: kind('#5352ED', 'white'),
|
||||
cancel: kind('#FF4949', 'white'),
|
||||
dark: kind('#273444', 'white'),
|
||||
gray: kind('#8492A6', 'white'),
|
||||
}
|
||||
|
||||
const getScale = ({ scale = 'normal' }) => scales[scale]
|
||||
const getKind = ({ kind = 'primary' }) => kinds[kind]
|
||||
|
||||
const ButtonStyled = styled.TouchableOpacity`
|
||||
${getKind};
|
||||
${getScale};
|
||||
cursor: pointer;
|
||||
margin: 3px 5px;
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
`
|
||||
|
||||
const Text = styled.Text`
|
||||
${getScale};
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
color: white;
|
||||
text-align: center;
|
||||
color: ${p => kinds[p.outline]};
|
||||
`
|
||||
|
||||
export const Button = ({
|
||||
scale = 'normal',
|
||||
kind = 'primary',
|
||||
outline = false,
|
||||
children,
|
||||
}: ButtonProps) => (
|
||||
<ButtonStyled scale={scale} kind={kind} outline={outline}>
|
||||
<Text scale={scale}>{children}</Text>
|
||||
</ButtonStyled>
|
||||
)
|
||||
|
||||
Button.propTypes = {
|
||||
scales: t.oneOf(['small', 'normal', 'big']),
|
||||
kind: t.oneOf(['primary', 'secondary', 'cancel', 'dark', 'gray']),
|
||||
}
|
||||
|
||||
Button.defaultProps = {
|
||||
scales: 'normal',
|
||||
kind: 'primary',
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
---
|
||||
name: Button
|
||||
menu: Components
|
||||
---
|
||||
|
||||
import { Playground, PropsTable } from 'docz'
|
||||
import { Button } from './Button'
|
||||
|
||||
# Button
|
||||
|
||||
Buttons make common actions more obvious and help users more easily perform them. Buttons use labels and sometimes icons to communicate the action that will occur when the user touches them.
|
||||
|
||||
### Best practices
|
||||
|
||||
- Group buttons logically into sets based on usage and importance.
|
||||
- Ensure that button actions are clear and consistent.
|
||||
- The main action of a group set can be a primary button.
|
||||
- Select a single button variation and do not mix them.
|
||||
|
||||
## Properties
|
||||
|
||||
<PropsTable of={Button} />
|
||||
|
||||
## Basic usage
|
||||
|
||||
<Playground>
|
||||
<Button>Click me</Button>
|
||||
</Playground>
|
||||
|
||||
## With different sizes
|
||||
|
||||
<Playground>
|
||||
<Button scale="small">Click me</Button>
|
||||
<Button scale="normal">Click me</Button>
|
||||
<Button scale="big">Click me</Button>
|
||||
</Playground>
|
||||
|
||||
## With different colors
|
||||
|
||||
<Playground>
|
||||
<Button kind="primary">Click me</Button>
|
||||
<Button kind="secondary">Click me</Button>
|
||||
<Button kind="cancel">Click me</Button>
|
||||
<Button kind="dark">Click me</Button>
|
||||
<Button kind="gray">Click me</Button>
|
||||
</Playground>
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
name: Getting Started
|
||||
route: /
|
||||
order: 1
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
|
||||
Design systems enable teams to build better products faster by making design reusable—reusability makes scale possible. This is the heart and primary value of design systems. A design system is a collection of reusable components, guided by clear standards, that can be assembled together to build any number of applications.
|
||||
|
||||
Regardless of the technologies and tools behind them, a successful design system follows these guiding principles:
|
||||
|
||||
- **It’s consistent**. The way components are built and managed follows a predictable pattern.
|
||||
- **It’s self-contained**. Your design system is treated as a standalone dependency.
|
||||
- **It’s reusable**. You’ve built components so they can be reused in many contexts.
|
||||
- **It’s accessible**. Applications built with your design system are usable by as many people as possible, no matter how they access the web.
|
||||
- **It’s robust**. No matter the product or platform to which your design system is applied, it should perform with grace and minimal bugs.
|
||||
|
||||
## Consistency
|
||||
|
||||
Your first, most important task when starting out is to define the rules of your system, document them, and ensure that everyone follows them. When you have clearly documented code standards and best practices in place, designers and developers from across your organization can easily use and, more importantly, contribute to your design system.
|
||||
@@ -1,12 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://github.com/pedronauck/docz/compare/v0.10.3...v0.11.0) (2018-09-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* integration with react native ([#271](https://github.com/pedronauck/docz/issues/271)) ([ac359ce](https://github.com/pedronauck/docz/commit/ac359ce))
|
||||
@@ -1,19 +1,3 @@
|
||||
# docz-plugin-react-native
|
||||
# docz-plugin-react-native [MOVED]
|
||||
|
||||
Use your React Native components inside docz
|
||||
|
||||
> We're using [react-native-web](https://github.com/necolas/react-native-web) to make this integration possible. So, maybe you can have some caveats.
|
||||
|
||||
## Instalation
|
||||
|
||||
Just add and use the plugin inside your `doczrc.js`
|
||||
|
||||
```js
|
||||
import { reactNative } from 'docz-plugin-react-native'
|
||||
|
||||
export default {
|
||||
plugins: [reactNative()]
|
||||
}
|
||||
```
|
||||
|
||||
That's it 🙌🏻
|
||||
Since this package has some big dependencies, we moved it to [another repo](https://github.com/pedronauck/docz-plugin-react-native) in order to improve monorepo performance!
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"name": "docz-plugin-react-native",
|
||||
"version": "0.11.0",
|
||||
"description": "Plugin that allow you to use React Native with docz",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"umd:main": "dist/index.umd.js",
|
||||
"module": "dist/index.m.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"source": "src/index.ts",
|
||||
"files": [
|
||||
"dist/",
|
||||
"package.json",
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "libundler watch --ts -e all",
|
||||
"build": "libundler build --ts -e all --c",
|
||||
"fix": "run-s fix:*",
|
||||
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" --write",
|
||||
"fix:tslint": "tslint --fix --project .",
|
||||
"tslint": "tslint --project ."
|
||||
},
|
||||
"dependencies": {
|
||||
"docz-core": "^0.11.0",
|
||||
"react-art": "^16.5.0",
|
||||
"react-native-web": "^0.8.9"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { createPlugin } from 'docz-core'
|
||||
|
||||
export const reactNative = () =>
|
||||
createPlugin({
|
||||
modifyBundlerConfig: config => {
|
||||
config.resolve.alias = {
|
||||
...(config.resolve.alias || {}),
|
||||
'react-native$': `react-native-web`,
|
||||
}
|
||||
|
||||
return config
|
||||
},
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declaration": true,
|
||||
"types": ["node"],
|
||||
"typeRoots": ["node_modules/@types"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules/**"]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "../../tslint.json"
|
||||
}
|
||||
Reference in New Issue
Block a user