# @crollalowis/cl-ui

> [![Coverage Status](https://coveralls.io/repos/github/crollalowis/cl-ui/badge.svg?branch=master)](https://coveralls.io/github/crollalowis/cl-ui?branch=master)

Latest version **0.3.10** (published 2020-03-31) · 0 weekly downloads

## Install

```sh
npm install @crollalowis/cl-ui
pnpm add @crollalowis/cl-ui
yarn add @crollalowis/cl-ui
bun add @crollalowis/cl-ui
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.10 |
| Published | 2020-03-31 |
| First published | 2020-03-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 157.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rhoffmann |

## Links

- npm: https://www.npmjs.com/package/@crollalowis/cl-ui
- npm.io page: https://npm.io/package/@crollalowis/cl-ui

## Dependencies (15)

- [react](https://npm.io/package/react.md) ^16.10.2
- [date-fns](https://npm.io/package/date-fns.md) ^2.4.1
- [polished](https://npm.io/package/polished.md) ^3.4.1
- [coveralls](https://npm.io/package/coveralls.md) ^3.0.6
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [react-dom](https://npm.io/package/react-dom.md) ^16.10.2
- [react-image](https://npm.io/package/react-image.md) ^2.2.0
- [react-scripts](https://npm.io/package/react-scripts.md) ^3.2.0
- [@material-ui/core](https://npm.io/package/@material-ui/core.md) ^4.7.1
- [styled-components](https://npm.io/package/styled-components.md) ^4.4.0
- [@material-ui/icons](https://npm.io/package/@material-ui/icons.md) ^4.5.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^9.3.0
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^4.1.1
- [react-intersection-observer](https://npm.io/package/react-intersection-observer.md) ^8.26.0
- [storybook-addon-react-docgen](https://npm.io/package/storybook-addon-react-docgen.md) ^1.2.28

## Recent versions

- 0.3.10 (latest) — 2020-03-31

## README

# CL-UI Component System

[![Coverage Status](https://coveralls.io/repos/github/crollalowis/cl-ui/badge.svg?branch=master)](https://coveralls.io/github/crollalowis/cl-ui?branch=master)

[![Build Status](https://travis-ci.com/crollalowis/cl-ui.svg?branch=master)](https://travis-ci.com/crollalowis/cl-ui)

## Setup

```
yarn
```

copy `example.env` as `.env`

## Development

run:

```
yarn start
```

To run tests:

```
yarn test
```

Open http://localhost:6006 in your browser. It is your Storybook with CL-UI components.

## Process of creating a component

When creating a new component, decide on where the component should reside. As a general rule, very simple components that do not use other components, put it into the `core` folder, more complex components probably using multiple single components (from MUI) into the `compound` folder.

**Folder Structure**

| Folder            | Rule                                                  |
| ----------------- | ----------------------------------------------------- |
| `src/components/` | for simple core components                            |

**Component Files**

```
  src/core/MyCoreComponent
    index.js
    MyCoreComponent.jsx
    MyCoreComponent.notes.md
    MyCoreComponent.stories.{js,mdx}
    MyCoreComponent.test.js
```

---

Each component folder defines a seperated and isolated component, containing the implementation, a story explainin the use cases and a test, which tests the functionaliy of the component. Naming is important here. Always start components with an Uppercase Letter. If it contains JSX, end it with `.jsx`. There is always an `index.js` which exports the component itself as a default, but also maybe different variants or necessary side modules or helpers as named exports.

Each component should have a corresponding `.stories.js` file for usage in the storybook. The stories should represent and document all the necessary information to know _how_ and _why_ to use this component, and which Parameters affect it in what way. The `.notes.md` File can be used to add additional MDX documentation as 'notes'.

Component storis should be written using the new [Component Story Format](https://storybook.js.org/docs/formats/component-story-format/) (CSF).

Alternatively you can use [MDX flavoured CSF](https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/mdx.md) directly when using the `.stories.mdx` extension.

Each component should also be tested in a way that edge cases are represented. (No inputs, long inputs, short inputs, weird inputs)

## Testing

_unit testing_: testing an isolated part of your app, usually done in combination with shallow rendering. example: a component renders with the default props.

_integration testing_: testing if different parts work or integrate with each other. Usually done with mounting or rendering a component. example: test if a child component can update context state in a parent.

_e to e testing_: Stands for end to end. Usually a multi step test combining multiple unit and integration tests into one big test. Usually very little is mocked or stubbed. Tests are done in a simulated browser, there may or may not be a UI while the test is running. example: testing an entire authentication flow.

## Rules for Hooks

Don't think in lifecycles.

The question is not "when does this effect run" the question is "with which state does this effect synchronize with"

```
useEffect(fn) // all state
useEffect(fn, []) // no state
useEffect(fn, [these, states])
```

— Ryan Florence (@ryanflorence) May 5, 2019

---
_Source: https://npm.io/package/@crollalowis/cl-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
