Git Product home page Git Product logo

lucid's Introduction

Lucid codecov

A UI component library from Xandr.

Install

Lucid can be installed with npm

  npm install --save lucid-ui

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from 'lucid-ui';

ReactDOM.render(<Button>Hello World</Button>, mountNode);

Lucid uses less for its stylesheets. If you use less, you can include the styles like so:

@import "node_modules/lucid-ui/src/index.less";

If you don't use less, you can use the precompiled css file node_modules/lucid-ui/dist/lucid.css.

Custom CSS Scope

There are some very rare situations where you might need to customize the prefix for all the css class names emitted by the library and less. If you find yourself in that unenviable position, you can do the following:

In your webpack config use the DefinePlugin to specify LUCID_CSS_NAMESPACE like so:

new webpack.DefinePlugin({
  LUCID_CSS_NAMESPACE: "'something-custom'",
});

When you render the less, make sure to set the prefix variable to the same thing you set in in your webpack config. E.g.

lessc node_modules/lucid-ui/src/index.less --modify-var='prefix=something-custom'

Dependencies

lucid-ui has several React peer dependencies. This means your application is responsible for declaring dependencies on compatible versions. Currently we support React 15 and 16.

Example package.json:

{
	"dependencies": {
		"lucid-ui": "^5.0.0",
		"react": "^16.0.0",
		"react-dom": "^16.0.0"
	}
}

To contribute to lucid, please see CONTRIBUTING.md.

Credits

  • BrowserStack for providing cross-browser testing infrastructure.
  • Travis CI for providing continuous integration infrastructure.
  • CodeCov for providing code coverage analysis infrastructure.

lucid's People

Contributors

alisonailea avatar andreepaul avatar celinrayen avatar danhahn avatar danvanhorn avatar dependabot[bot] avatar dreidn avatar dsusskind avatar jhsu avatar jondlm avatar kyle-mcguire avatar lancempoe avatar liliematia avatar miloofcroton avatar mute avatar nathaniellee avatar njlg avatar nyconfidential avatar ogupte avatar oliveiraddb avatar rcousineau-xandr avatar rsadres avatar scotthollandjr avatar sodiumjoe avatar strunkandwhite avatar tarun avatar trippygif avatar tsantef avatar velhala avatar yasskin avatar

Stargazers

 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  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

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

lucid's Issues

Labeled radio button component

Still discussing whether this should be a new LabeledRadioButton composite component that leverages RadioButton or some other approach (I think we're all in agreement that we don't want to add label as a prop to RadioButton).

Banner Component

Build a banner component

Related to jira ticket ANXR-194

  • create component
  • add tests

Fix up TextField

  • refactor out validation by creating another ValidatedTextField component
  • add reducers
  • add stateful example
  • ensure props can take over state when using the stateful version
  • add onSubmit callback with standard (value, { event, props }) => {} signature

Clean up variable names

  • Confirm that all variable are name correct.
  • Change less fade to tint and fix any hacks that are related to it
  • Move any reusable style in to mixins

Improve docs page

  • add sidebar for navigation
  • add code collapsing
  • differentiate "composite" components. I believe docgen already has Component.composes which suits our need.
  • support markdown in the description and put in on the page
  • support markdown in props descriptions
  • sort props alphabetically
  • show default prop values
  • add support for ordering examples
  • fix nav scroll overflow

RadioButton component

A toggle meant to be used as a replacement for a native radio button element.

Related Jira issue: ANXR-280

Clean up icons and icon docs

We don't need to show all the props for individual icons, they don't really make sense at that level.

Also, the icons need to be normalized to fit a 16px square box so we don't need to handle one off padding per icon.

Radio button tweaks

As per David Maloney:

Here's what needs to happen to it so it matches the checkboxes:

Container: Needs to increase in size to 16px x 16px
Dot: Needs to bump up it's left and top positions to 4px
Glow: Needs to bump up it's left and top positions to 4px

generic tests to check `displayName` and support required props

some components have requried props or children and generic-tests needs a way to pass those in. also generic-tests uses displayName all over the place but never tests that it exists in the first place, so it's confusing when an unrelated test breaks.

jsdom to be initialized before React for tests

describeWithDOM would lazily load and initialize jsdom when a test needed it, however it needs to be initialized before the React global is initialized or else React throws errors on render.

Label component

Label associated with a form control (similar concept to the native HTML label element).

Switch component

A toggle that uses the on/off switch visualization made popular by smartphone OSes to reflect its current state. This is meant to be used as a replacement for a native check box element.

Related Jira issue: ANXR-216

Add PR template

GitHub has a new PR template feature. We should add one that reminds people to test cross browsers, unit test, etc.

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.