Coder Social home page Coder Social logo

andreasbm / weightless Goto Github PK

View Code? Open in Web Editor NEW
376.0 14.0 31.0 16.12 MB

High-quality web components with a small footprint

Home Page: http://weightless.dev

License: MIT License

JavaScript 0.65% HTML 0.63% CSS 23.16% TypeScript 75.55%
web-components custom-elements lit-element lit-html ui-library ui elements components lit-html-element

weightless's Introduction

Logo

Downloads per month NPM Version Dependencies Contributors Published on webcomponents.org

High-quality Web Components with a small footprint
Thank you so much for showing interest in this project! If you want to help us feed our Octocat you should definitely become a stargazer. These web components are built to be used. They are lightweight, have a simple API and are easy to extend and compose. Go here to see a demo https://weightless.dev/elements.


  • High-quality: Centered around the best practices.
  • Testable: Hundreds of test-cases makes sure the library is stable.
  • Easy-to-use: But with a simple and understandable API.
  • Accessible: All components has been build with accessibility in mind.
  • Single-responsibility: Each component does one thing really well. This makes them really easy to extend and compose.

-----------------------------------------------------

➤ Table of Contents

-----------------------------------------------------

➤ Demo

Go here to try the demo.

-----------------------------------------------------

➤ Installation

$ npm i weightless

If you want to get started super quickly you can use the CLI.

$ npm init web-config new my-project --lit

If you prefer to use the umd bundle you can import https://unpkg.com/weightless/umd/weightless.min.js. Keep in mind that this imports all elements, so it is recommended that you only use it for test purposes.

<script src="https://unpkg.com/weightless/umd/weightless.min.js"></script>

-----------------------------------------------------

➤ Elements

Name Tag Description Documentation Demo
Backdrop wl-backdrop Dark layer to use behind overlayed elements. Documentation Demo
Banner wl-banner Display a non-interruptive message and related optional actions. Documentation Demo
Button wl-button Allow users to take actions, and make choices, with a single tap. Documentation Demo
Card wl-card Group related content and action. Documentation Demo
Checkbox wl-checkbox Turn an option on or off. Documentation Demo
Dialog wl-dialog Highly interruptive messages. Documentation Demo
Divider wl-divider Thin line that groups content in lists and layouts. Documentation Demo
Expansion wl-expansion Provide an expandable details-summary view. Documentation Demo
Icon wl-icon Symbols for common actions and items. Documentation Demo
Label wl-label Make form elements more accessible. Documentation Demo
List Item wl-list-item Display an item in a list. Documentation Demo
Nav wl-nav Provide access to destinations in your app. Documentation Demo
Popover wl-popover Contextual anchored elements Documentation Demo
Popover Card wl-popover-card Give popovers a contextual flair. Documentation Demo
Progress Bar wl-progress-bar Fills a bar from 0% to 100%. Documentation Demo
Progress Spinner wl-progress-spinner Fills a circle from 0% to 100%. Documentation Demo
Radio wl-radio Select one option from a set. Documentation Demo
Ripple wl-ripple Indicate touch actions. Documentation Demo
Select wl-select Select one or more values from a set of options. Documentation Demo
Slider wl-slider Make selections from a range of values. Documentation Demo
Snackbar wl-snackbar Provide brief messages at the bottom of the screen. Documentation Demo
Switch wl-switch Turn an option on or off. Documentation Demo
Tab wl-tab Organize navigation between groups of content. Documentation Demo
Tab Group wl-tab-group Organize navigation between groups of content. Documentation Demo
Text wl-text Group text into paragraphs. Documentation Demo
Textarea wl-textarea Multiline text fields. Documentation Demo
Textfield wl-textfield Singleline text fields. Documentation Demo
Title wl-title Indicate the start of a new section. Documentation Demo
Tooltip wl-tooltip Informative context related text. Documentation Demo

-----------------------------------------------------

➤ Roadmap

There's lots of exciting things on the roadmap. Until v1.0.0 you can expect the API to be fairly stable but refactoring might still happen and break the backwards compatibility. You are very welcome to use the library, create pull requests or add issues.

-----------------------------------------------------

➤ Contributing guide

You are more than welcome to contribute to this repository! Below are some instructions on how to setup the project for development.

  1. Clone this repository by running git clone https://github.com/andreasbm/weightless.git.
  2. Run npm i to install all dependencies.
  3. Spin up the development server with npm run s. The browser should automatically be opened at the correct url. If not, you can open your browser and go to http://localhost:1350.
  4. Run tests with npm run test.
  5. Lint the files with npm run lint.
  6. Compile the documentation by running npm run docs.

The elements are written in Typescript and the stylesheets are written in SASS. All of the web components uses lit-element.

If you want to know more about how you can help you should definitely check out the CONTRIBUTING.md file. All contributors will be added to the contributors section below.

-----------------------------------------------------

➤ Contributors

Andreas Mehlsen You?
Andreas Mehlsen You?

-----------------------------------------------------

➤ License

Licensed under MIT.

weightless's People

Contributors

andreasbm avatar eskan avatar rwestlund avatar tehshrike 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

weightless's Issues

form behavior invalid regex

Using 0.0.34 in Chromium 73.
In my component:

import 'weightless/textfield';
// ...
<wl-textfield></wl-textfield>

It errors on the first keystroke:

Pattern attribute value part => {                  form-element-behavior.js? [sm]:25
  if (value === undefined && part instanceof AttributePart) {
    if (value !== part.value) {
      const name = part.committer.name;
      part.committer.element.removeAttribute(name);
    }
  } else {
    part.setValue(value);
  }
} is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /part => {
  if (value === undefined && part instanceof AttributePart) {
    if (value !== part.value) {
      const name = part.committer.name;
      part.committer.element.removeAttribute(name);
    }
  } else {
    part.setValue(value);
  }
}/: Incomplete quantifier
get valid	@	form-element-behavior.js? [sm]:25
refreshAttributes	@	input-behavior.js? [sm]:89
onInput	@	input-behavior.js? [sm]:77
cb	@	event.js? [sm]:6


Ensure that all elements follow the same styling standard

We want the following styles for all elements:

  • color (eg. --button-color) - Default color
  • background (eg. --button-bg) - Default color
  • disabled color (eg. --button-color-disabled) - Grey color
  • disabled background (eg. --button-bg-disabled) - Grey color
  • hover/focus color (eg. --button-color-hover) - Lighter color
  • hover/focus background (eg. --button-bg-hover) - Lighter color

Only applies if the element have some sort of active style (eg. checked, active, selected)

  • active color (eg --button-color-active) - Default color or some kind of highlight.
  • active background (eg. --button-color-active) - Default background or some kind of highlight.
  • active+hover/focus color (eg --button-color-active-hover) - Darker color
  • active+hover/focus background (eg. --button-bg-active-hover) - Darker color
  • opacity when disabled (eg. --button-opacity-disabled) - Opacity when the element is disabled. This makes sense instead of having all variants of the colors as disabled.

wl-expansion text is not selectable

Hi,

first of all thank you for the really great library!

I have a small issue I don't get solved. The text inside the wl-expansion box is not selectable (these blue selection background when hover-clicking over the text).

Is this intended? Or is there a way to fix this?

Thanks,
Robert

Split component request

Hi Andreas,

I use the following webcomponent in my project quiet havely:
https://www.webcomponents.org/element/split-me

Unfortunatelly the component has a lot of dependecyies and is not following the weightless approach.

Please close this request of you are not interested in such a component.
But I think it would enhance the functionality of this library.

Thanks,
Robert

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.