ui-components
portal-v2-ui repo. The example page has been moved to https://project44.github.io/portal-v2-ui/
This project has been archived and moved into theInstall
We are using GitHub as our registry for the time being, so the correct way to add ui-components
to your project is using the following syntax:
yarn add project44/ui-components#0.0.2
Change the version number to support your needs
Usage
You will need to reference the bundled styles in your application:
@import '~ui-components/dist/ant.css';
@import '~ui-components/dist/build.css';
Note: the ordering is important! Make sure
build.css
followsant.css
.
import React, { Component } from 'react';
import { MyComponent } from 'ui-components';
class Example extends Component {
render() {
return <MyComponent />;
}
}
Publishing
When you are ready to publish a new version of ui-components, follow the directions on the site, and and your new version should be published directly to GitHub, and viewable from the releases page of this repo.
- Run
yarn start
to generate the static assets. Once finished and termainl shows "waiting for changes",CMD+C
to kill the process. - commit the generated
/dist
files, and push them up to master - Run
yarn version --patch | --minor | --major | --new-version <version>
- Run
git push
andgit push --tags
- Run
yarn deploy
to publish new gh-pages
Local Development
- Run
yarn start
to build library in watch mode - Run
yarn example:start
to serve example site on http://localhost:4000
yalc can be used to test in a different project.
Contribution Guidelines
Code Style
Code style is enforced via prettier and eslint. Prettier and ESLint will automatically run on staged files every commit.
CSS Styles
Components should use styled-components for styles. Existing components that still use .scss
should be moved to use styled-components.
TypeScript
Currently types are exported in dist/index.d.ts
and should be updated as needed.
Adding New Components
- Create your component in
src/components
- Export your component in
src/index.js
- Add component typings to
dist/index.d.ts
- Add an example of your component
- Create example component in
example/src/components/components
- Add a new route for your example component in
example/routes.js
- Add your example component's route to
example/components/common/Components
- Add a link to your example component in
example/components/common/SideNav.js
- Create example component in