Code Monkey home page Code Monkey logo

ember-ticketfly-accordion's Introduction

ember-ticketfly-accordion

An ARIA-compliant, easy-to-use accordion system built from composable Ember components -- with optional built-in animation through the Web Animations API.

Latest NPM release CircleCI Build Status Test Coverage Code Climate Ember Observer Score License Dependencies Dev Dependencies

View

Installing

ember install ember-ticketfly-accordion

Features

  • Full WAI-ARIA Compliance for Accessibility Winning.
  • A robust callback API for handling DOM events with closure actions.
  • Built-in (but configurable) buttery-smooth animation through the Web-Animations API and ember-web-animations-next-polyfill.
  • Semantic HTML
    • Tabs are comprised of <button> elements instead of plain <div>s.

Compatibility

This addon makes use of contextual components, and is therefore intended to support versions of Ember >= 2.3.0.

Usage

View the interactive documentation for usage information and tips.

Configuration

To provide ember-ticketfly-accordion with configuration options, define them in a hash on the 'ember-ticketfly-accordion' property of the object exported from your config/environment.js file:

ENV['ember-ticketfly-accordion'] = {
  // options go here
};

Supported Options

Toggling Animation

Animation is enabled by default, and includes a super-lightweight implementation of panel opening and closing built with the Web Animations API โ€” with support back to IE 10 thanks to the thanks to the W3C's web-animations-next polyfill (enabled in Ember by the ember-web-animations-next-polyfill addon).

To disable animation, simply set animatable to false on the root accordion component.

To customize animation, there are two approaches:

  1. Overriding the addon's default implementation by passing your own functions to the animatePanelOpen and animatePanelClosed properties on the root accordion component (One or both can be overridden).

  2. Configuring aspects of the addon's default implementation by setting addonAnimationSettings properties in config/environment.js like so (available settings are shown with their current defaults):

ENV['ember-ticketfly-accordion'] = {
  useAddonAnimations: true,
  addonAnimationSettings: {
    panelClose: {
      duration: 390
      easing: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)' // ease-in-out-cubic
    },
    panelOpen: {
      duration: 390
      easing: 'cubic-bezier(0.215, 0.610, 0.355, 1)' // ease-out-cubic
    }
  }
};

Working with ARIA Attributes

As part of its adherence to the WAI-ARIA accordion spec, each part of the component system contains the attributeBindings needed to automatically set proper values for attributes such as aria-expanded() aria-multiselectable(), aria-controls(), etc.

This behavior is built-in for free.

Some ARIA attribute values are arbitrary, however, and where it's appropriate, components will declare bindings for attributes that you can set directly. Currently, this includes:

tf-accordion-panel
  • aria-level: Since the panel functions as a "heading", but isn't any of the standard heading elements (<h1>, <h2>, etc), this value should be set on each panel in the accordion according to how you would define its heading level within your document. Since accordions can be used in just about any context, tf-accordion-panel makes no default assumptions about this in advance.

Collaborating

  • git clone <repository-url> this repository
  • cd ember-ticketfly-accordion
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

ember-ticketfly-accordion's People

Contributors

briansipple avatar ember-tomster avatar

Stargazers

Wester avatar Melanie Sumner avatar Tom Zellman avatar Damian Senn avatar Ilya Radchenko avatar Mohammed Zaghloul avatar Jason Tu avatar Stefan Rotariu avatar Will Raxworthy avatar  avatar CHEWTOYS avatar

Watchers

Jerome Thibaud avatar James Cloos avatar Carlos R. Feliz avatar Alex Bochannek avatar Vaibhav Ambuga avatar Prashant Tiwari avatar TFLY Bot avatar Brandon Nickell avatar ptrkdy avatar  avatar  avatar  avatar

ember-ticketfly-accordion's Issues

Remove Usage of Ember.K

#DeprecationAlert

Ember.K (Ember's no-op function) will be deprecated starting in Ember 2.12: emberjs/ember.js#14746

Going forward, noop-ing methods can be declared like so:

const obj = {
  foo() {}
};

Or, if using Ember.K was seen as a performance win (i.e., just having to initialize one function), a global noop util would be a pretty straightforward replacement as well.

Fix breaking changes in FastBoot 1.0

The current ember-cli-fastboot releases (1.0.0-rc.1 and above) introduce breaking changes. These will most likely break your current FastBoot implementation.

See ember-fastboot/ember-cli-fastboot#387 for more information and a guide on how to fix your addon. Also you may want to visit the -fastboot Slack channel to get help from other users.

Note: this issue has been created automatically, by searching for certain patterns in your code. If you think this has been falsely created, feel free to close!

Interactive Documentation

This addon is a perfect example of something that could have fully interactive documentation.

The dummy app would be the perfect place for it.

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.