Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Commit

Permalink
refactor: updating component to use LitElement
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodek committed Jul 17, 2019
1 parent 61fd0e3 commit 4648ae3
Show file tree
Hide file tree
Showing 25 changed files with 12,032 additions and 10,300 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
@@ -0,0 +1,3 @@
coverage/
_site/
dist/
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -55,5 +55,4 @@ $RECYCLE.BIN/
.nfs*

node_modules
build
coverage
10 changes: 6 additions & 4 deletions .npmignore
@@ -1,11 +1,13 @@
coverage/
test/
demo/
gen-tsd.json
wct.conf.json
CONTRIBUTING.md
analysis.json
demo/
bower.json
.travis.yml
index.html
polymer.json
karma.*
husky.*
commitlint.*
.*
*.config.*
3 changes: 3 additions & 0 deletions .prettierignore
@@ -0,0 +1,3 @@
coverage/
_site/
dist/
17 changes: 5 additions & 12 deletions .travis.yml
@@ -1,22 +1,15 @@
language: node_js
node_js: 8
node_js: stable
sudo: required
before_script: npm install -g polymer-cli @advanced-rest-client/wct-istanbub
addons:
firefox: latest
apt:
sources:
- google-chrome
- google-chrome
packages:
- google-chrome-stable
sauce_connect: true
- google-chrome-stable
script:
- npm run lint
- xvfb-run polymer test --module-resolution=node --npm --plugin local
- >-
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test
--module-resolution=node --npm --plugin sauce --job-name
"paper-fab-menu:${TRAVIS_BRANCH}" --build-number=${TRAVIS_BUILD_NUMBER}; fi
- npm test
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run test:sl; fi
env:
global:
- secure: >-
Expand Down
81 changes: 59 additions & 22 deletions README.md
@@ -1,32 +1,69 @@
[![Build Status](https://travis-ci.org/advanced-rest-client/api-url-data-model.svg?branch=stage)](https://travis-ci.org/advanced-rest-client/paper-fab-menu)
[![Published on NPM](https://img.shields.io/npm/v/@advanced-rest-client/paper-fab-menu.svg)](https://www.npmjs.com/package/@advanced-rest-client/paper-fab-menu)

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/advanced-rest-client/paper-fab-menu)
[![Build Status](https://travis-ci.org/advanced-rest-client/paper-fab-menu.svg?branch=stage)](https://travis-ci.org/advanced-rest-client/paper-fab-menu)

# paper-fab-menu
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/@advanced-rest-client/paper-fab-menu)

A material design floating action button with menu items for Polymer 2.0.
# <paper-fab-menu>

<!---
```
<custom-element-demo>
<template>
<link rel="import" href="paper-fab-menu.html">
<link rel="import" href="paper-fab-menu-item.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<next-code-block></next-code-block>
</template>
</custom-element-demo>
```
-->
Material design:
[Floating Action Button](https://www.google.com/design/spec/components/buttons-floating-action-button.html)

A floating action button represents the primary action in an application.

Use the `<paper-fab-menu>` to display menu-like fab buttons and to promote actions.

### Example

```html
<paper-fab-menu color="#2196F3" icon="add" class="left">
<paper-fab-menu-item color="red" title="Polymer" icon="polymer"></paper-fab-menu-item>
<paper-fab-menu-item color="#9C27B0" title="Favorites" icon="star"></paper-fab-menu-item>
<paper-fab-menu-item color="#2196F3" title="Refresh" icon="refresh"></paper-fab-menu-item>
<paper-fab-menu icon="add">
<paper-fab mini title="Favorites" icon="star"></paper-fab>
<paper-fab mini title="Refresh" icon="refresh"></paper-fab>
<paper-fab mini title="Text label" label="D"></paper-fab>
</paper-fab-menu>
```

### API components
### In a LitElement template

```javascript
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/paper-fab-menu/paper-fab-menu.js';

class SampleElement extends LitElement {
render() {
return html`
<paper-fab-menu icon="add">
<paper-fab mini title="Favorites" icon="star"></paper-fab>
<paper-fab mini title="Refresh" icon="refresh"></paper-fab>
<paper-fab mini title="Text label" label="D"></paper-fab>
</paper-fab-menu>
`;
}
}
customElements.define('sample-element', SampleElement);
```

### Styling
Style the menu using `<paper-fab>` variables.

This components is a part of [API components ecosystem](https://elements.advancedrestclient.com/)
The element uses `--paper-fab-menu-background-color` variable to set a
background color or the main `<paper-fab>` element.

### Development

```sh
git clone https://github.com/@advanced-rest-client/paper-fab-menu
cd paper-fab-menu
npm install
```

### Running the demo locally

```sh
npm start
```

### Running the tests
```sh
npm test
```

0 comments on commit 4648ae3

Please sign in to comment.