GithubHelp home page GithubHelp logo

policygenius / athenaeum Goto Github PK

View Code? Open in Web Editor NEW
7.0 55.0 4.0 10.48 MB

The React Component Library with a living styleguide

License: MIT License

JavaScript 71.02% HTML 0.28% Shell 0.74% Dockerfile 0.13% SCSS 27.83%

athenaeum's Introduction

Caution

This library is now inactive and will not be actively developed any further

Athenaeum - A React Component Library (RCL)

Table of Contents

Purpose

The RCL is a tool to help create and maintain robust design systems, allowing a developer to roll out higher quality, more consistent User Interfaces (UI) faster.

To see it in action, visit: http://rcl.policygenius.com/latest/index.html

The RCL relies heavily on the following technologies. If you want to learn more about them and how to customize/configure the RCL, take a look at the documentation:

We use Babel to compile our JS, which allows us to use the latest features of the language.

Install the NPM package

The RCL is published as a package called "Athenaeum", which can be found here.

Install the package in your project with the package manager of your choice:

  • yarn add athenaeum
  • npm install athenaeum

Using the RCL locally

  1. Clone the repo:
  git clone [email protected]:policygenius/athenaeum.git
  1. Install dependencies:
  yarn
  1. Start the server:
  yarn start
  1. Visit http://localhost:6060 to view

Development with another project locally

If you want to work on the RCL and another repo simultaneously, you can symlink to Athenaeum from the repo you are working in.

  1. In your athenaeum repo, run:
  yarn link && yarn build:publish:watch
  1. In the repo you are working in, run:
  yarn link 'athenaeum'
  1. When you are finished, in the repo you are working in, run:
  yarn unlink 'athenaeum' && yarn
  1. In your athenaeum repo, run:
  yarn unlink

Using an RCL component

RCL components are React components, which are exported as a collection of modules you can import/require like you would any other JS dependency:

e.g.

import { TextComponent, Button, Layout, Col } from 'athenaeum';

function MyReactComponent( props ) {
return (
  <div>
    <Layout>
      <TextComponent type={6}>I am a header!</TextComponent>
      <Col>
        I am a column!
      </Col>
      <Button>Submit!</Button>
    </Layout>
  </div>
  )
}

export default MyReactComponent;

The RCL gets exported with a bundled JS file and a CSS file. To use the RCL stylesheet, you can either import them directly into your project:

import 'athenaeum/lib/assets/styles.css';

OR simply link to the latest version of the styles in your HTML:

<link href="http://rcl.policygenius.com/{{v5.5.2 or latest version}}/assets/styles.css" rel="stylesheet">

Running tests

Note: Test will be run automatically as part of a githook on git push

yarn test

OR

yarn test [filepath]

The RCL uses the following for testing. If you want to learn more about them and how to customize/configure the RCL, take a look at the documentation:

Finding your way around

/src
- atoms (Buttons, Icons, Text, etc.)
- molecules (Form Fields, Lists, Image Asides, etc.)
- organisms (Forms, Tables, etc.)
- templates (Headers, Navigators, Footers, etc.)

Our RCL is structured around the concepts put forth by Atomic Design. The smallest components are ATOMS, which are used to make MOLECULES, which are used to make ORGANISMS, which are lastly used to make TEMPLATES.

Adding New Icons

Upload the icons to our Google Cloud Bucket using these docs.

Add icon name to the list of possible icon values:

  1. Open src/atoms/Icon/constants.js
  2. Add the name of your icon in alphabetical order

Contributing

For more information on Contributing and issues, please view the athenaeum Github wiki.


The RCL and the Athenaeum project is a product by PolicyGenius.

Resources

athenaeum's People

Contributors

abehrman89 avatar antciccone avatar bradwheel avatar danielnovograd avatar dependabot-preview[bot] avatar dependabot-support avatar drewdrewthis avatar gummoe avatar j-clark avatar jdanz avatar jexeones24 avatar jl08 avatar jmcolella avatar jsonunger avatar kcnminus avatar kengorab avatar m1gd0npg avatar magcurt8 avatar maxnovak avatar mttrms avatar neelmay avatar p-duke avatar patrickkim avatar patrickskim avatar rahiparikh avatar randy-concepcion avatar randy-the-robot avatar showell215 avatar trevornelson avatar whitneychoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

athenaeum's Issues

Eslint Plugin Markdown yarn.lock issue

For our markdown linter, which lints the JS written in each component's Readme.md file, we use a customized version of the eslint-plugin-markdown package, which is currently forked on my (jmcolella) Github account.

For yarn to load the correct, customized module, the package.json points to the tarball on my Github for this package and the yarn.lock resolves a specific SHA for the tarball.

Occasionally, the SHA in the yarn.lock will not resolve properly and, as of now, needs to be updated manually. If you are experiencing any yarn issues on Buildkite, please follow the steps below to help solve the issue:

  1. Go to the list of commits for the tarball. Copy the most recent SHA (the full SHA, not the shortened version)
  2. Go to the yarn.lock file in athenaeum and find the eslint-plugin-markdown packaged. Where it says resolved, at the very end, replace the SHA that is already there with the one you copied.
  3. Run yarn
  4. An error will appear saying the SHA given in step 2 is incorrect and it will supply another one. The error will read something like: Expected #{wrong_sha}, but got #{correct_sha}.
  5. Replace the SHA in the yarn.lock with the correct_sha from step 4.
  6. Run yarn again to ensure all is good

I currently don't know another way to resolve this issue, hopefully we can spend time soon to get to the bottom of it.

Prevent undefined values in jest snapshots

Background
A number of RCL components do not have guards around props that are undefined and simply pass those down. This can not only present a problem in use but it also shows up in jest snapshots, which doesn't provide a great way to test the expected HTML structure of our components.

We will need to do a thorough documentation of all the components that do not have this guard and determine if one is needed. Best way to do this may just be to look at a few snapshots and find patterns.

Acceptance Criteria

  • Guards are put in place to prevent unwanted/unnecessary undefined values from being applied to RCL components

Tech Notes
Here is a list of known offenders:

  • <Text />
  • <Layout />
  • <Icon />
  • <Button />
  • <LinkWrapper />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.