Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fyndiq/fyndiq-ui

Library of reusable web frontend components for Fyndiq
https://github.com/fyndiq/fyndiq-ui

component-library design-systems fyndiq fyndiq-ui lerna react-components reusable-components storybook

Last synced: 4 months ago
JSON representation

Library of reusable web frontend components for Fyndiq

Awesome Lists containing this project

README

        

![fyndiq-ui logo](https://github.com/fyndiq/fyndiq-ui/blob/master/docs/logo.jpg?raw=true)

# fyndiq-ui

[![Build Status](https://travis-ci.org/fyndiq/fyndiq-ui.svg?branch=master)](https://travis-ci.org/fyndiq/fyndiq-ui) [![Sketch exports](https://img.shields.io/badge/%F0%9F%92%8E%20sketch-exports-eaa119.svg)](https://fyndiq.github.io/fyndiq-ui/?selectedKind=💎%20Sketch&selectedStory=default) [![Codecov](https://img.shields.io/codecov/c/github/fyndiq/fyndiq-ui.svg)](https://codecov.io/gh/fyndiq/fyndiq-ui) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

Library of reusable components for Fyndiq

# Usage

Install one of the provided packages (see list below) in your React project:

``` bash
npm i -S fyndiq-component-button
```

Every component provide their own style using CSSNext. Thus, you need to be able to import CSS files inside your project. Using Webpack2, you can have an entry similar to this:

``` js
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
importLoaders: 1,
sourceMap: true,
modules: true,
},
}, {
loader: 'postcss-loader',
options: {
plugins: () => ([
require('postcss-import'),
require('postcss-cssnext'),
]),
},
},
],
}),
},
],
},
```

You will need the following loaders:

``` bash
npm i -D postcss-loader css-loader style-loader extract-text-webpack-plugin postcss-import postcss-cssnext
```

# Packages

This git repository is a monorepo built using [Lerna](//lernajs.io). It contains several packages:

| Package | Version | Description |
|------|----|----|
| [`fyndiq-component-alert`](/packages/fyndiq-component-alert) | [![npm](https://img.shields.io/npm/v/fyndiq-component-alert.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-alert) | Alert component |
| [`fyndiq-component-article`](/packages/fyndiq-component-article) | [![npm](https://img.shields.io/npm/v/fyndiq-component-article.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-article) | Article component |
| [`fyndiq-component-brand`](/packages/fyndiq-component-brand) | [![npm](https://img.shields.io/npm/v/fyndiq-component-brand.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-brand) | Brand component |
| [`fyndiq-component-button`](/packages/fyndiq-component-button) | [![npm](https://img.shields.io/npm/v/fyndiq-component-button.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-button) | Button component |
| [`fyndiq-component-checkbox`](/packages/fyndiq-component-checkbox) | [![npm](https://img.shields.io/npm/v/fyndiq-component-checkbox.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-checkbox) | Checkbox component |
| [`fyndiq-component-dropdown`](/packages/fyndiq-component-dropdown) | [![npm](https://img.shields.io/npm/v/fyndiq-component-dropdown.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-dropdown) | Dropdown component |
| [`fyndiq-component-input`](/packages/fyndiq-component-input) | [![npm](https://img.shields.io/npm/v/fyndiq-component-input.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-input) | Input component |
| [`fyndiq-component-loader`](/packages/fyndiq-component-loader) | [![npm](https://img.shields.io/npm/v/fyndiq-component-loader.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-loader) | Loader component |
| [`fyndiq-component-message`](/packages/fyndiq-component-message) | [![npm](https://img.shields.io/npm/v/fyndiq-component-message.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-message) | Message component |
| [`fyndiq-component-modal`](/packages/fyndiq-component-modal) | [![npm](https://img.shields.io/npm/v/fyndiq-component-modal.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-modal) | Modal component |
| [`fyndiq-component-productcard`](/packages/fyndiq-component-productcard) | [![npm](https://img.shields.io/npm/v/fyndiq-component-productcard.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-productcard) | Product card component |
| [`fyndiq-component-productlist`](/packages/fyndiq-component-productlist) | [![npm](https://img.shields.io/npm/v/fyndiq-component-productlist.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-productlist) | Product list component |
| [`fyndiq-component-stars`](/packages/fyndiq-component-stars) | [![npm](https://img.shields.io/npm/v/fyndiq-component-stars.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-stars) | Stars component |
| [`fyndiq-component-table`](/packages/fyndiq-component-table) | [![npm](https://img.shields.io/npm/v/fyndiq-component-table.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-table) | Table component |
| [`fyndiq-component-timeline`](/packages/fyndiq-component-timeline) | [![npm](https://img.shields.io/npm/v/fyndiq-component-timeline.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-timeline) | Timeline component |
| [`fyndiq-component-tooltip`](/packages/fyndiq-component-tooltip) | [![npm](https://img.shields.io/npm/v/fyndiq-component-tooltip.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-component-tooltip) | Tooltip component |
| [`fyndiq-icons`](/packages/fyndiq-icons) | [![npm](https://img.shields.io/npm/v/fyndiq-icons.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-icons) | Icons |
| [`fyndiq-illustrations`](/packages/fyndiq-illustrations) | [![npm](https://img.shields.io/npm/v/fyndiq-illustrations.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-illustrations) | Illustrations |
| [`fyndiq-styles-colors`](/packages/fyndiq-styles-colors) | [![npm](https://img.shields.io/npm/v/fyndiq-styles-colors.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-styles-colors) | Default colors |
| [`fyndiq-styles-fonts`](/packages/fyndiq-styles-fonts) | [![npm](https://img.shields.io/npm/v/fyndiq-styles-fonts.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-styles-fonts) | Default Fonts and helpers |
| [`fyndiq-styles-medias`](/packages/fyndiq-styles-medias) | [![npm](https://img.shields.io/npm/v/fyndiq-styles-medias.svg?maxAge=3600)](https://www.npmjs.com/package/fyndiq-styles-medias) | Default media queries |

# Contribute

Clone the repository, then run

```
npm i
npm run bootstrap
npm run dev
```

The Storybook will be available on port `6006`.

To create a new component, create a new folder in the `packages/` directory and put your code in `src/`. Then, add your newly created package to the dependencies of `fyndiq-ui-test`'s package.json file, run `npm run bootstrap` and restart `npm run dev`.