This repository has been archived by the owner on Jun 24, 2020. It is now read-only.
forked from dreammmr/paper-fab-menu
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: updating component to use LitElement
- Loading branch information
Showing
25 changed files
with
12,032 additions
and
10,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coverage/ | ||
_site/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,5 +55,4 @@ $RECYCLE.BIN/ | |
.nfs* | ||
|
||
node_modules | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coverage/ | ||
_site/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
Oops, something went wrong.