@affinidi/ui-core
TypeScript icon, indicating that this package has built-in type declarations

1.8.0 • Public • Published

UI Core

This is the Affinidi Core UI library. Exports a bunch of components and hooks for themeing their every aspect.

Made using React, SCSS for the components, Storybook for Documentation and rollup for bundling

Installation

$ npm i @affinidi/ui-core

Usage

Components

import {Button} from '@affinidi/ui-core'

const MyComponent = () => {
  return (
    ...
    <Button>Click Me!</Button>
    ...
  )
}

Palette Override

import { useUICoreTheme } from '@affinidi/ui-core'

const MyComponent = () => {
  useUICoreTheme({
    palette: {
      primary: {
        main: "darkblue"
      }
    }
  })

  return (
    ...
  )
}

Local Development

The library uses yalc for local development, bundling and testing. Make sure your machine has yalc installed by running npm i -g yalc

The following steps illustrate how to develop and test your local changes

  1. Do the required changes to the codebase. This can be creating new components(or updating older ones), writing hooks or any other changes that will affect the functioning of the library and ultimately the consumers
  2. Run npm run publish-local from the project root. This will run the build script and package the library into yalc's local registry acting like a pseudo npm store
  3. To test your changes in another library go to the consumer and run yalc add @affinidi/ui-core. This will create a local .yalc folder and a yalc.lock file to keep track of this local package. Then follow the usage guidelines above to test. We rinse and repeat till done.
  4. Once we're ready to commit we can cleanup the consumer by running yalc remove @affinidi/ui-core and removing the created files and folders from the previous step.
  5. Proceed with the commit.

Browsing Storybook

We dont host our storybook(yet), so one can clone the repository and browse through locally.

cd ui-core
npm i
npm run storybook

Documentation

All components have dedicated typings available but more concrete documentation would be available soon

Readme

Keywords

Package Sidebar

Install

npm i @affinidi/ui-core

Weekly Downloads

11

Version

1.8.0

License

ISC

Unpacked Size

142 kB

Total Files

44

Last publish

Collaborators

  • rohitjjw
  • maratsh-affinidi
  • robert-affinidi
  • standemchuk