Collection of core eBay widgets; considered to be the building blocks for all composite components, pages & apps.
Clone or download
Latest commit 5af1b7b Jan 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Created github issue templates (#195) May 23, 2018
demo Demo: update layout (#350) Aug 15, 2018
integration Run all tests with Marko v3 and v4 (#43) Mar 16, 2018
scripts Icon: map DS4 arrow-down to DS6 chevron-down-bold (#386) Aug 28, 2018
src Fix issue with YUI minification (#509) Jan 14, 2019
.babelrc Implement infinite scrolling / autoplay carousel. (#259) Jul 24, 2018
.browser-refresh-ignore Ignore all dot folders for browser-refresh (#187) May 24, 2018
.eslintignore Initial commit Mar 1, 2018
.eslintrc Tab Component (#307) Aug 7, 2018
.gitignore Update marko-cli and setup browserstack testing capabilities (#135) Jun 20, 2018
.npmrc Adding .npmrc and publishConfig (#32) Mar 8, 2018
.nycrc Icon: exclude generated symbols from coverage (#366) Aug 22, 2018
.stylelintrc Initial commit Mar 1, 2018
.travis.yml rebase with master to pick up Dylan's travis changes (#332) Aug 9, 2018
.yarnrc Initial commit Mar 1, 2018
CONTRIBUTING.md Contributing: minor update to releases section [skip ci] Jul 5, 2018
LICENSE.txt Initial commit Mar 1, 2018
README.md Updated to skin v6.1.0 Nov 9, 2018
karma.conf.js Initial commit Mar 1, 2018
marketplace.json Add ui marketplace config file. Aug 13, 2018
marko-cli.js rebase with master to pick up Dylan's travis changes (#332) Aug 9, 2018
marko.json New Component: Badge (#479) Nov 27, 2018
package.json 1.3.3 Jan 14, 2019
yarn.lock Updated skin to 6.2.0 Nov 27, 2018

README.md

Build Status Coverage Status Dependency status devDependency status

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 requires Marko Widgets v6
Marko v4 requires Marko Widgets v7

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 text="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 text and type attributes:

template.marko

<ebay-menu text="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 text attribute, for example:

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

Pass-Through Attributes

HTML attributes can be used on any component, and they will be passed through to the most prominent tag of the component. The most prominent tag is usually the root, but individual components will note if it varies for specific cases.

Example of static usage:

<ebay-button id="my-button"/>

For using pass-through attributes dynamically, they should be sent through the html-attributes attribute:

<!-- data.htmlAttributes = { id: 'my-button' } -->
<ebay-button html-attributes=data.htmlAttributes/>

Static and dynamic pass-through attributes can be used simulatenously (html-attributes takes precedence in conflicts):

<!-- data.htmlAttributes = { id: 'my-button' } -->
<ebay-button html-attributes=data.htmlAttributes type="submit"/>

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 text="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.

Browser Policy

All components are developed and tested cross-browser using BrowserStack, in accordance with our official eBay Browser Policy.

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.