lion/packages/overlays
CircleCI c49a82fec9 chore: release new versions
- @lion/button@0.4.0
 - @lion/calendar@0.5.0
 - @lion/dialog@0.2.3
 - @lion/input-datepicker@0.6.0
 - @lion/overlays@0.8.0
 - @lion/popup@0.4.3
 - @lion/select-rich@0.8.0
 - @lion/switch@0.3.10
 - @lion/tooltip@0.5.0
2019-12-04 07:44:37 +00:00
..
docs fix: no longer use overlay templates 2019-12-01 16:03:04 +01:00
src feat: integrate and pass automated a11y testing 2019-12-03 15:15:01 +01:00
stories fix: no longer use overlay templates 2019-12-01 16:03:04 +01:00
test fix: no longer use overlay templates 2019-12-01 16:03:04 +01:00
test-helpers feat(overlays): release new overlay system 2019-10-10 17:14:24 +02:00
test-suites fix: no longer use overlay templates 2019-12-01 16:03:04 +01:00
translations fix: support Chinese language 2019-07-17 10:11:32 +02:00
CHANGELOG.md chore: release new versions 2019-12-04 07:44:37 +00:00
index.js chore: refactor OverlayMixin, remove redundant lion-popup 2019-11-29 17:34:19 +01:00
package.json chore: release new versions 2019-12-04 07:44:37 +00:00
README.md fix: no longer use overlay templates 2019-12-01 16:03:04 +01:00

Overlays System

Supports different types of overlays like dialogs, toasts, tooltips, dropdown, etc.

Manages their position on the screen relative to other elements, including other overlays.

Exports lion-overlay, which is a generic component wrapping OverlayController. Its purpose is to make it easy to use our Overlay System declaratively. It can be easily extended where needed, to override event listeners and more.

Features

  • lion-overlay web component:

    • Show content when clicking the invoker
    • Have a .config object to set or update the OverlayController's configuration
  • OverlaysManager, a global repository keeping track of all different types of overlays

  • OverlayController, a single controller class for handling overlays

  • OverlayMixin, a mixin that can be used to create webcomponents that use the OverlayController under the hood

How to use

Installation

npm i --save @lion/overlays

Example

import '@lion/overlays/lion-overlay.js';

html`
  <lion-overlay .config=${{
    placementMode: 'global',
    viewportConfig: { placement: 'bottom-right' },
  }}>
    <div slot="content">
      This is an overlay
      <button
        @click=${e => e.target.dispatchEvent(new Event('hide', { bubbles: true }))}
      >x</button>
    <div>
    <button slot="invoker">
      Click me
    </button>
  </lion-overlay>
`;

Or by creating a controller yourself

import { OverlayController } from '@lion/overlays';

const ctrl = new OverlayController({
  ...withModalDialogConfig(),
  invokerNode,
  contentNode,
});

Rationales

For rationales, please check the docs folder, where we go more in-depth.

Aria roles

  • No aria-controls as support for it is not quite there yet
  • No aria-haspopup. People knowing the haspop up and hear about it dont expect a dialog to open (at this moment in time) but expect a sub-menu. Until support for the dialog value has better implementation, its probably best to not use aria-haspopup on the element that opens the modal dialog.