npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-ticketfly-accordion

v0.6.2

Published

An ARIA-compliant, dependency-free accordion system comprised of composable Ember components.

Downloads

48

Readme

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