0.2.66396 • Published 6 years ago

@veracity/ui-react v0.2.66396

Weekly downloads
22
License
MIT
Repository
-
Last release
6 years ago

VERACITY Common Components Library (CCL)

A component library for building applications on the Veracity Platform.

Please read the Contribute page for information about reporting bugs and issues.

Installation

Install using node or yarn

npm i @veracity/ui-react
yarn add @veracity/ui-react

If you are using TypeScript in your client project you need to add

	"allowSyntheticDefaultImports": true

to your tsconfig.json file. We are currently only exporting es5 versions of this package for broader compatibility.

Requirements

  • Webpack, TypeScript or similar bundler
  • SASS

This library requires webpack or an equivalent bundler that understands JS and SCSS import statements. Styling of compoents is done through SCSS internally and your webpack config must therefore support bundling of such files.

Webpack support for SCSS

To support SCSS files in your webpack bundle you must install node-sass and sass-loader then add a rule for them within your webpack config.

npm i -D node-sass sass-loader css-loader
// In your webpack config add a rule for SCSS files that includes the node_modules folder.
{
	test: /\.scss$/,
	use: [
		{
			loader: 'sass-loader'
		}
	]
}
// Optionally if you want to use CSS modules locally you need to have a separate rule for this libraries scss files
// as they will not work correctly if they are modularized.
{ // CSS modules for local SCSS files
	test: /\.scss$/,
	exclude: /(node_modules|\.global\.scss)/,
	use: [
		{
			loader: 'css-loader',
			options: {
				modules: true,
				importLoaders: 1
			}
		},
		{
			loader: 'sass-loader'
		}
	]
},
{ // No CSS modules for files loader from node_modules
	test: /\/node_modules\/.+?\.scss$/,
	use: [
		{
			loader: 'sass-loader'
		}
	]
}

Usage

Simply import the component you require and use it as any other component.

import React from 'react';
import Button from '@veracity/ui-react/Button'; // Always use direct imports to minimize the final package size

export class MyComponent extends React.PureComponent{
	render(){
		return (
			<div>Hello world <Button>Click me</Button></div>
		)
	}
};

export default MyComponent;

Documentation and demo

The documentation and component demos have been combined into a single demo page. The demo is available here.

0.2.66396

6 years ago

0.2.66305

6 years ago

0.2.65507

6 years ago

0.2.65489

6 years ago

0.2.65141

6 years ago

0.2.64756

6 years ago

0.2.64732

6 years ago

0.2.63457

6 years ago

0.2.63072

6 years ago

0.2.63064

6 years ago

0.2.63050

6 years ago

0.2.63041

6 years ago

0.2.62936

6 years ago

0.2.62764

6 years ago

0.2.62743

6 years ago

0.2.62711

6 years ago

0.2.62582

6 years ago

0.2.55814

6 years ago

0.2.55757

6 years ago

0.2.55607

6 years ago

0.2.55457

6 years ago

0.2.54757

6 years ago

0.2.53496

6 years ago

0.2.52823

6 years ago

0.2.52775

6 years ago

0.2.52522

6 years ago

0.2.52514

6 years ago

0.2.52496

6 years ago

0.2.52458

6 years ago

0.2.52437

6 years ago

0.2.51804

6 years ago

0.2.51735

6 years ago

0.2.51394

6 years ago

0.2.51266

6 years ago

0.2.51224

6 years ago

0.2.51045

6 years ago

0.2.50283

6 years ago

0.2.49841

6 years ago

0.2.49830

6 years ago

0.2.49494

6 years ago

0.2.49449

6 years ago

0.2.49151

6 years ago

0.2.48838

6 years ago

0.2.48706

6 years ago

0.2.48670

6 years ago

0.2.48667

6 years ago

0.2.48559

6 years ago

0.2.48552

6 years ago

0.2.48536

6 years ago

0.2.48389

6 years ago

0.2.48382

6 years ago

0.2.48339

6 years ago

0.2.48018

6 years ago

0.2.48000

6 years ago

0.2.47960

6 years ago

0.2.47954

6 years ago

0.2.47803

6 years ago

0.2.47718

6 years ago

0.2.47698

6 years ago

0.2.47488

6 years ago

0.2.47455

6 years ago

0.2.47451

6 years ago

0.2.47330

6 years ago

0.2.47266

6 years ago

0.2.47263

6 years ago

0.2.47253

6 years ago

0.2.47246

6 years ago

0.2.47201

6 years ago

0.2.47185

6 years ago

0.2.46847

6 years ago

0.2.46839

6 years ago

0.2.46835

6 years ago

0.2.46706

6 years ago

0.1.46582

6 years ago

0.1.46321

6 years ago

0.1.46303

6 years ago

0.1.45394

6 years ago

0.1.45258

6 years ago

0.1.44991

6 years ago

0.1.44157

6 years ago

0.1.0

6 years ago