GithubHelp home page GithubHelp logo

pborreli / ebayui-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebay/ebayui-core

0.0 2.0 0.0 254 KB

Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.

License: MIT License

HTML 9.95% JavaScript 87.89% CSS 2.16%

ebayui-core's Introduction

eBayUI Core

Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.

The eBayUI components are Marko custom tags that follow the core principles of HTML. For example:

  • Input attributes can only be of type String or Boolean
  • State can be manipulated directly from the DOM node
  • Events are fired through both Marko and the DOM

For more information, please read Building a UI Component in 2017 and Beyond.

Requirements

NOTE: Marko v3 also requires Marko Widgets.

Components

Getting Started

The eBayUI core components are available as the @ebay/ebayui-core package on NPM.

Use npm or yarn to add the package dependency to your project:

yarn add @ebay/ebayui-core

Custom Tags

Once the package dependency is added, the eBay customs tags are now available for use in your Marko templates. For example, to use an ebay-menu component:

template.marko

<ebay-menu label="Sort" type="radio">
    <ebay-menu-item>Price</ebay-menu-item>
    <ebay-menu-item>Time</ebay-menu-item>
    <ebay-menu-item>Distance</ebay-menu-item>
</ebay-menu>

On Marko v3, remember to include the component's resources in your browser.json file.

browser.json

{
    "dependencies": [
        "@ebay/ebayui-core/ebay-menu"
    ]
}

Attributes

Attributes provide initial state for a component. We can see that the menu has label and type attributes:

template.marko

<ebay-menu label="Sort" type="radio">
    <ebay-menu-item>Price</ebay-menu-item>
    <ebay-menu-item>Time</ebay-menu-item>
    <ebay-menu-item>Distance</ebay-menu-item>
</ebay-menu>

Some attributes are stateful and can be updated via the DOM. The label attribute, for example:

var menu = document.querySelector('.menu');
menu.label = 'Sortieren';

NOTE: Undocumented attributes are assumed to be HTML and will be applied to the root element of the custom tag.

Events

Events can be handled via the DOM. For example, the menu emits a menu-change event:

menu.addEventListener('menu-change', onMenuChange);

Events can also be handled using Marko syntax:

template.marko

<ebay-menu label="Sort" type="radio" w-onchange("onMenuChange")>
    <ebay-menu-item>Price</ebay-menu-item>
    <ebay-menu-item>Time</ebay-menu-item>
    <ebay-menu-item>Distance</ebay-menu-item>
</ebay-menu>

Note: when using DOM events, you should also handle event destruction and delegation as needed.

Releases & Milestones

For upcoming roadmap and release history, please refer to our releases and milestones pages.

Versioning

The ebayui-core package follows strict Semantic Versioning.

Given a version number MAJOR.MINOR.PATCH:

  • MAJOR version is incremented when we make incompatible API changes
  • MINOR version is incremented when we add functionality in a backwards-compatible manner
  • PATCH version is incremented when we make backwards-compatible bug fixes.

Issues

Please use our issues page to ask questions, report issues or submit feature requests.

To help track your issue, our admins will assign it with one or more coloured labels:

  • Black: Issue Type (e.g. bug, question, test case)
  • White: Resolution (e.g. wont fix, invalid, duplicate)
  • Gray: Status (e.g. backlog, in progress, help wanted)
  • Red: Blocker (e.g. dependency, discussion, design)
  • Green: Module (e.g. button, radio, dialog)
  • Blue: Aspect (e.g. build, documentation, website)
  • Yellow: Semver Guidance (e.g. breaking change, backwards compatible)
  • Purple: Sprint (e.g. sprint 1, sprint 2, etc)

Contributing

Looking to contribute to eBay UI? Please visit our contributing page for more information.

License

Copyright (c) 2018 eBay Inc.

Use of this source code is governed by a MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

ebayui-core's People

Contributors

dylanpiercey avatar ianmcburnie avatar seangates avatar sharma46bhawana avatar yomed avatar

Watchers

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