Giter VIP home page Giter VIP logo

lightning-ui-components's Introduction

Lightning UI

This library contains shared Lightning components, you can view our live Storybook documentation to learn more about each component and how to leverage them in your application.

In order to facilitate the development process for our theming architecture we have converted this project into a monorepo using Yarn workspaces. This allows engineers to work across multiple packages without the need for npm link or yarn link. This also has some other benefits including easy visibility across different @lightningjs/ui packages, standardization, and better release management.

Three packages are currently maintained and released from this project.

  • @lightningjs/ui-components
  • @lightningjs/ui-components-test-utils
  • @lightningjs/ui-components-theme-base

Local Development

To run the repository locally, run:

yarn install
yarn start

This will launch Storybook at http://localhost:8000/.

Peer Dependencies

@lightningjs/ui-components has a peer dependency on @lightningjs/core^2.x. If you are stuck using the old Lightning, i.e. wpe-lightning^1.x, you will need to alias @lightningjs/core in your build process. If you are bundling your app using Webpack, you should add this to your config:

// in webpack.config.js
module.exports = {
  resolve: {
    alias: {
      '@lightningjs/core': path.resolve(__dirname, 'node_modules/wpe-lightning')
    }
  }
};

NOTE: aliasing @lightningjs/core to point to wpe-lightning is not guaranteed to work with everything! Consider updating your Lightning library as soon as possible.

Installation

Install from NPM:

npm install --save @lightningjs/ui-components

@lightningjs/ui-components has a peer dependency on the Lightning package

npm install -S @lightningjs/ui @lightningjs/core

Usage

You should import components using ES6 named imports, like so:

// App.js
import lng from '@lightningjs/core';
import { Button } from '@lightningjs/ui-components';

You should NOT use path imports like this:

// Do not use
import Button from '@lightningjs/ui-components/components/Button';

Since packages are now bundled with rollup this allows proper tree shaking behavior. For more information on tree shaking the @material/ui documentation has a great guide on development bundle size (note: this is external documentation otherwise unrelated to this project!).

Use components in your application

import { FocusManager } from '@lightningjs/ui-components';

class MyComponent extends lng.Component {
  static _template() {
    return {
      FocusManager: {
        type: FocusManager,
        direction: 'row',
        children: []
      }
    };
  }
  _getFocused() {
    return this.tag('FocusManager');
  }
};

Questions???

Submit a GitHub Issue or Join us on Slack!

lightning-ui-components's People

Contributors

almcaffee avatar anthony9187 avatar archaica avatar arwehrman avatar beejluig avatar betina-dalope avatar che-effe avatar chelseasimek avatar chiefcll avatar chrisarasin avatar dimaj avatar erautenberg avatar frank-weindel avatar harshita583 avatar hekillno16 avatar imcoolnowright avatar jazzyw avatar jbrisch avatar jbstocker avatar joshhowenstine avatar kvitsiks avatar michaelprograms avatar mpatelpa avatar patricklizon avatar rajanika avatar sabrinapowell avatar salhan12 avatar semantic-release-bot avatar soumyaloka avatar thoj13 avatar

Watchers

 avatar

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.