Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptec committed Aug 10, 2020
0 parents commit e8e57ff
Show file tree
Hide file tree
Showing 7 changed files with 14,605 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.docz
node_modules
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Raspihive Docs using Docz

## Using `create-docz-app`

```sh
npx create-docz-app docz-app-basic
# or
yarn create docz-app docz-app-basic
```

## Download manually

```sh
curl https://codeload.github.com/doczjs/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/basic
mv basic docz-basic-example
cd docz-basic-example
```

## Setup

```sh
yarn # npm i
```

## Run

```sh
yarn dev # npm run dev
```

## Build

```sh
yarn build # npm run build
```

## Serve built app

```sh
yarn serve # npm run serve
```
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Raspihive-Docs",
"version": "2.0.0",
"license": "MIT",
"scripts": {
"dev": "docz dev",
"build": "docz build",
"serve": "docz serve"
},
"dependencies": {
"docz": "latest",
"prop-types": "^15.7.2",
"react": "^16.11.0",
"react-dom": "^16.11.0"
}
}
35 changes: 35 additions & 0 deletions src/components/Alert.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react'
import t from 'prop-types'

const kinds = {
info: '#5352ED',
positive: '#2ED573',
negative: '#FF4757',
warning: '#FFA502',
}

export const Alert = ({ children, kind, ...rest }) => (
<div
style={{
padding: 20,
background: 'white',
borderRadius: 3,
color: 'white',
background: kinds[kind],
}}
{...rest}
>
{children}
</div>
)

Alert.propTypes = {
/**
* The kind prop is used to set the alert's background color
*/
kind: t.oneOf(['info', 'positive', 'negative', 'warning']),
}

Alert.defaultProps = {
kind: 'info',
}
28 changes: 28 additions & 0 deletions src/components/Alert.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Alert
menu: Components
---

import { Playground, Props } from 'docz'
import { Alert } from './Alert'

# Alert

## Properties

<Props of={Alert} />

## Basic usage

<Playground>
<Alert>Some message</Alert>
</Playground>

## Using different kinds

<Playground>
<Alert kind="info">Some message</Alert>
<Alert kind="positive">Some message</Alert>
<Alert kind="negative">Some message</Alert>
<Alert kind="warning">Some message</Alert>
</Playground>
20 changes: 20 additions & 0 deletions src/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Getting Started
route: /
---

# 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.
Loading

0 comments on commit e8e57ff

Please sign in to comment.