0.2.2 • Published 2 years ago

@source-protocol-cosmos/sourceblocks v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

sourceblocks

Sourceswap verse UI library

NPM JavaScript Style Guide

Install

yarn add sourceblocks

Usage

import React, { Component } from 'react'
import { Button, Text, styled } from 'sourceblocks'

const StyledText = styled(Text, {
  textTransform: 'uppercase',
  // Access internal theme variables using tokens
  padding: '$2 0',
  // read more https://stitches.dev/docs/tokens
  color: '$textColor$success'
})

const Example = () => {
  return (
    <>
      <StyledText variant='hero'>Welcome to sourceblocks!</StyledText>
      <Button
        variant='primary'
        onClick={() => require('source').navigateToTheMoon()}
        css={{ marginTop: '$12' }}
      >
        Join our team here
      </Button>
    </>
  )
}

Storybook

Build sourceblocks locally and preview documented components using storybook.

yarn storybook

Dev mode

This application can be used in dev mode under the yarn link strategy.

For this you can run the following script, this will create a link to your application.

  yarn run link:app --path <path of your app>

Now you can start to code with dev mode

  yarn run dev

The changes you make to this code should be refresh in your application.

For more information visit this link https://classic.yarnpkg.com/en/docs/cli/link

When you finish run the following script to unlink packages

 yarn run unlink:app --path <path of your app>

Contributing

Please submit your suggestions, feature requests or bugs reports to the GitHub Issues.

License

MIT © Source-Protocol-Cosmos