Git Product home page Git Product logo

ebayui-core's Introduction

Build Status Coverage Status Dependency status devDependency status

eBayUI Core

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

Requirements

Note: eBayUI Core components utilize Marko flags and, therefore, require <lasso-page/> to be added to any page which will have core components.

Note: @ebay/skin/global and @ebay/skin/marketsans are required to be loaded by your app for all modules to load correctly.

Note: In order for spread attributes to work properly, [email protected] at least is required

Browser Policy

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

Accessibility (A11Y)

We take accessibility very seriously. Very seriously indeed. Therefore, all components are built in accordance to the eBay MIND Patterns. These patterns, in turn, build on from the specifications provided by the WAI-ARIA Authoring Practices.

Components are built in a layered, progressively enhanced fashion, utilizing the following resources:

Each layer does its bit to enforce and enhance accessibility. We consider this level of support to be one of our chief selling points, and we hope you do too!

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:

npm 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">
    <@item>Price</@item>
    <@item>Time</@item>
    <@item>Distance</@item>
</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">
    <@item>Price</@item>
    <@item>Time</@item>
    <@item>Distance</@item>
</ebay-menu>

Passing new attributes to an ebayui component will always reset it's internal state. If you want to persist this state yourself, events are exposed which allow you to synchronize the state into your own components, for example:

class {
    onCreate() {
        this.state = {
            dialogIsOpen: false
        }
    }

    handleDialogClose() {
        this.state.dialogIsOpen = false;
    }

    handleDialogOpen() {
        this.state.dialogIsOpen = true;
    }
}

<ebay-lightbox-dialog
    open=state.dialogIsOpen
    on-open('handleDialogOpen')
    on-close('handleDialogClose')>
    ...
</ebay-lightbox-dialog>

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 or form control, 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:

$ const myAttributes = { id: 'my-button' };
<ebay-button html-attributes=myAttributes/>

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

$ const myAttributes = { id: 'my-button' };
<ebay-button html-attributes=myAttributes type="submit"/>

Events

Events can also be handled using Marko syntax:

template.marko

<ebay-menu text="Sort" type="radio" on-change("onMenuChange")>
    <@item>Price</@item>
    <@item>Time</@item>
    <@item>Distance</@item>
</ebay-menu>

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.

Deprecations

Deprecations will be communicated via release notes, so please ensure that you read those carefully. In general, expect any deprecated feature to be removed in the next major version. However, in some cases we may wait a while longer.

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

agliga avatar austingardner avatar bhavinpatel04 avatar biaspro avatar cestdiego avatar chtitoon avatar dasarianudeep avatar dependabot[bot] avatar dkallus avatar dylanpiercey avatar etcaton avatar ianmcburnie avatar lokeshrishi avatar martin-ebay avatar mkchang avatar msendlakowski avatar partynuts avatar pborreli avatar phoenix727 avatar pranaykondekar avatar prashantashok avatar rachelvillamin avatar rajaramu avatar rajudandigam avatar seangates avatar sendlo avatar sharma46bhawana avatar tws2000 avatar yomed 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.