mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
48
react-app/bower_components/paper-icon-button/.bower.json
vendored
Normal file
48
react-app/bower_components/paper-icon-button/.bower.json
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "paper-icon-button",
|
||||
"private": true,
|
||||
"version": "1.0.7",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "A material design icon button",
|
||||
"main": "paper-icon-button.html",
|
||||
"author": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"button",
|
||||
"icon",
|
||||
"control"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/paper-icon-button.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.1.0",
|
||||
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
|
||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
|
||||
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/paper-icon-button",
|
||||
"_release": "1.0.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.7",
|
||||
"commit": "7623d73efeb6e2e88e2abdb5e4d00641d39e400f"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-icon-button.git",
|
||||
"_target": "~1.0.7",
|
||||
"_originalSource": "PolymerElements/paper-icon-button",
|
||||
"_direct": true
|
||||
}
|
1
react-app/bower_components/paper-icon-button/.gitignore
vendored
Normal file
1
react-app/bower_components/paper-icon-button/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
bower_components
|
25
react-app/bower_components/paper-icon-button/.travis.yml
vendored
Normal file
25
react-app/bower_components/paper-icon-button/.travis.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: A+iEL5FUMQWkkaOduE26bo0jW49LYKxDwWGZOty9H9fCDpBNQSADOhIvLzScGtjE7Rr3jVmowVsDN0XfVSRpJneEIvj7+tHAXUFoVey8vDVklOmhlR25IH2OczEmCkOS+sAKRiSF54aptdPeJhmpbMH0FyZfuX+jJfhdonJ+YQg=
|
||||
- secure: Ps1Hy0fzmYRYF/ur2Myg7ol43HpzpooCoDvqzpMbIBWkXjXcN0KlPoNc6lEFlhjSpjddMFavdajKYIO0j9adAjZA7HYlf+BglhxV45lz13o04+QlNbDSADNyAlKJLrIvFacn9DE3VXlvBwBu83m+ndHUN/uMyHyZo0VE1/ad9Iw=
|
||||
- CXX=g++-4.8
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- g++-4.8
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
77
react-app/bower_components/paper-icon-button/CONTRIBUTING.md
vendored
Normal file
77
react-app/bower_components/paper-icon-button/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
If you edit this file, your changes will get overridden :)
|
||||
|
||||
You can however override the jsbin link with one that's customized to this
|
||||
specific element:
|
||||
|
||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
||||
-->
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
|
||||
|
||||
### Filing Issues
|
||||
|
||||
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
|
||||
|
||||
1. **Who will use the feature?** _“As someone filling out a form…”_
|
||||
2. **When will they use the feature?** _“When I enter an invalid value…”_
|
||||
3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
|
||||
|
||||
**If you are filing an issue to report a bug**, please provide:
|
||||
|
||||
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
|
||||
|
||||
```markdown
|
||||
The `paper-foo` element causes the page to turn pink when clicked.
|
||||
|
||||
## Expected outcome
|
||||
|
||||
The page stays the same color.
|
||||
|
||||
## Actual outcome
|
||||
|
||||
The page turns pink.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
3. Click the `paper-foo` element.
|
||||
```
|
||||
|
||||
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
|
||||
|
||||
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
|
||||
|
||||
### Submitting Pull Requests
|
||||
|
||||
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
|
||||
|
||||
When submitting pull requests, please provide:
|
||||
|
||||
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, fixes #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
||||
```markdown
|
||||
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
|
||||
```
|
||||
|
||||
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
|
||||
|
||||
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
|
79
react-app/bower_components/paper-icon-button/README.md
vendored
Normal file
79
react-app/bower_components/paper-icon-button/README.md
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
<!---
|
||||
|
||||
This README is automatically generated from the comments in these files:
|
||||
paper-icon-button.html
|
||||
|
||||
Edit those files, and our readme bot will duplicate them over here!
|
||||
Edit this file, and the bot will squash your changes :)
|
||||
|
||||
The bot does some handling of markdown. Please file a bug if it does the wrong
|
||||
thing! https://github.com/PolymerLabs/tedium/issues
|
||||
|
||||
-->
|
||||
|
||||
[](https://travis-ci.org/PolymerElements/paper-icon-button)
|
||||
|
||||
_[Demo and API docs](https://elements.polymer-project.org/elements/paper-icon-button)_
|
||||
|
||||
|
||||
##<paper-icon-button>
|
||||
|
||||
Material design: [Icon toggles](https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons)
|
||||
|
||||
`paper-icon-button` is a button with an image placed at the center. When the user touches
|
||||
the button, a ripple effect emanates from the center of the button.
|
||||
|
||||
`paper-icon-button` includes a default icon set. Use `icon` to specify which icon
|
||||
from the icon set to use.
|
||||
|
||||
```html
|
||||
<paper-icon-button icon="menu"></paper-icon-button>
|
||||
```
|
||||
|
||||
See [`iron-iconset`](iron-iconset) for more information about
|
||||
how to use a custom icon set.
|
||||
|
||||
Example:
|
||||
|
||||
```html
|
||||
<link href="path/to/iron-icons/iron-icons.html" rel="import">
|
||||
|
||||
<paper-icon-button icon="favorite"></paper-icon-button>
|
||||
<paper-icon-button src="star.png"></paper-icon-button>
|
||||
```
|
||||
|
||||
To use `paper-icon-button` as a link, wrap it in an anchor tag. Since `paper-icon-button`
|
||||
will already receive focus, you may want to prevent the anchor tag from receiving focus
|
||||
as well by setting its tabindex to -1.
|
||||
|
||||
```html
|
||||
<a href="https://www.polymer-project.org" tabindex="-1">
|
||||
<paper-icon-button icon="polymer"></paper-icon-button>
|
||||
</a>
|
||||
```
|
||||
|
||||
### Styling
|
||||
|
||||
Style the button with CSS as you would a normal DOM element. If you are using the icons
|
||||
provided by `iron-icons`, they will inherit the foreground color of the button.
|
||||
|
||||
```html
|
||||
/* make a red "favorite" button */
|
||||
<paper-icon-button icon="favorite" style="color: red;"></paper-icon-button>
|
||||
```
|
||||
|
||||
By default, the ripple is the same color as the foreground at 25% opacity. You may
|
||||
customize the color using the `--paper-icon-button-ink-color` custom property.
|
||||
|
||||
The following custom properties and mixins are available for styling:
|
||||
|
||||
| Custom property | Description | Default |
|
||||
| --- | --- | --- |
|
||||
| `--paper-icon-button-disabled-text` | The color of the disabled button | `--disabled-text-color` |
|
||||
| `--paper-icon-button-ink-color` | Selected/focus ripple color | `--primary-text-color` |
|
||||
| `--paper-icon-button` | Mixin for a button | `{}` |
|
||||
| `--paper-icon-button-disabled` | Mixin for a disabled button | `{}` |
|
||||
| `--paper-icon-button-hover` | Mixin for button on hover | `{}` |
|
||||
|
||||
|
37
react-app/bower_components/paper-icon-button/bower.json
vendored
Normal file
37
react-app/bower_components/paper-icon-button/bower.json
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "paper-icon-button",
|
||||
"private": true,
|
||||
"version": "1.0.7",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "A material design icon button",
|
||||
"main": "paper-icon-button.html",
|
||||
"author": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"button",
|
||||
"icon",
|
||||
"control"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/paper-icon-button.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.1.0",
|
||||
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
|
||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
|
||||
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": []
|
||||
}
|
103
react-app/bower_components/paper-icon-button/demo/index.html
vendored
Normal file
103
react-app/bower_components/paper-icon-button/demo/index.html
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>paper-icon-button demo</title>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../../iron-icons/iron-icons.html">
|
||||
<link rel="import" href="../../paper-styles/color.html">
|
||||
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
|
||||
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
|
||||
<link rel="import" href="../paper-icon-button.html">
|
||||
|
||||
<style is="custom-style" include="demo-pages-shared-styles">
|
||||
paper-icon-button {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body unresolved>
|
||||
<div class="vertical-section-container centered">
|
||||
<h3>Buttons can use iron-icons or external images, and can be disabled</h3>
|
||||
<demo-snippet class="centered-demo">
|
||||
<template>
|
||||
<paper-icon-button icon="favorite" title="heart"></paper-icon-button>
|
||||
<paper-icon-button src="https://assets-cdn.github.com/images/modules/logos_page/Octocat.png" alt="octocat" title="octocat"></paper-icon-button>
|
||||
<paper-icon-button disabled icon="reply" title="reply"></paper-icon-button>
|
||||
</template>
|
||||
</demo-snippet>
|
||||
|
||||
<h3>Buttons can hide the ripple effect using the <i>noink</i> attribute</h3>
|
||||
<demo-snippet class="centered-demo">
|
||||
<template>
|
||||
<paper-icon-button noink icon="find-in-page" title="find"></paper-icon-button>
|
||||
</template>
|
||||
</demo-snippet>
|
||||
|
||||
<h3>Buttons can be styled using regular CSS and custom properties</h3>
|
||||
<demo-snippet class="centered-demo">
|
||||
<template>
|
||||
<style is="custom-style">
|
||||
paper-icon-button.pink {
|
||||
color: var(--paper-pink-500);
|
||||
--paper-icon-button-ink-color: var(--paper-indigo-500);
|
||||
}
|
||||
paper-icon-button.pink:hover {
|
||||
background-color: var(--paper-pink-500);
|
||||
color: white;
|
||||
}
|
||||
paper-icon-button.blue {
|
||||
--paper-icon-button-ink-color: var(--paper-orange-500);
|
||||
background-color: var(--paper-light-blue-500);
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
<paper-icon-button icon="favorite" title="heart" class="pink"></paper-icon-button>
|
||||
<paper-icon-button icon="flight-takeoff" title="take off" class="blue"></paper-icon-button>
|
||||
</template>
|
||||
</demo-snippet>
|
||||
|
||||
<h3>Buttons can be resized</h3>
|
||||
<demo-snippet class="centered-demo">
|
||||
<template>
|
||||
<style is="custom-style">
|
||||
paper-icon-button.giant {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<paper-icon-button icon="alarm-on" title="wake up" class="giant"></paper-icon-button>
|
||||
</template>
|
||||
</demo-snippet>
|
||||
|
||||
<h3>Buttons can be used as a link</h3>
|
||||
<demo-snippet class="centered-demo">
|
||||
<template>
|
||||
<a href="https://www.polymer-project.org" tabindex="-1">
|
||||
<paper-icon-button icon="polymer"></paper-icon-button>
|
||||
</a>
|
||||
<style>
|
||||
a paper-icon-button,
|
||||
a:active paper-icon-button,
|
||||
a:visited paper-icon-button {
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
||||
</template>
|
||||
</demo-snippet>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
23
react-app/bower_components/paper-icon-button/index.html
vendored
Normal file
23
react-app/bower_components/paper-icon-button/index.html
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
173
react-app/bower_components/paper-icon-button/paper-icon-button.html
vendored
Normal file
173
react-app/bower_components/paper-icon-button/paper-icon-button.html
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-icon/iron-icon.html">
|
||||
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
|
||||
<link rel="import" href="../paper-styles/default-theme.html">
|
||||
|
||||
<!--
|
||||
Material design: [Icon toggles](https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons)
|
||||
|
||||
`paper-icon-button` is a button with an image placed at the center. When the user touches
|
||||
the button, a ripple effect emanates from the center of the button.
|
||||
|
||||
`paper-icon-button` includes a default icon set. Use `icon` to specify which icon
|
||||
from the icon set to use.
|
||||
|
||||
<paper-icon-button icon="menu"></paper-icon-button>
|
||||
|
||||
See [`iron-iconset`](iron-iconset) for more information about
|
||||
how to use a custom icon set.
|
||||
|
||||
Example:
|
||||
|
||||
<link href="path/to/iron-icons/iron-icons.html" rel="import">
|
||||
|
||||
<paper-icon-button icon="favorite"></paper-icon-button>
|
||||
<paper-icon-button src="star.png"></paper-icon-button>
|
||||
|
||||
To use `paper-icon-button` as a link, wrap it in an anchor tag. Since `paper-icon-button`
|
||||
will already receive focus, you may want to prevent the anchor tag from receiving focus
|
||||
as well by setting its tabindex to -1.
|
||||
|
||||
<a href="https://www.polymer-project.org" tabindex="-1">
|
||||
<paper-icon-button icon="polymer"></paper-icon-button>
|
||||
</a>
|
||||
|
||||
### Styling
|
||||
|
||||
Style the button with CSS as you would a normal DOM element. If you are using the icons
|
||||
provided by `iron-icons`, they will inherit the foreground color of the button.
|
||||
|
||||
/* make a red "favorite" button */
|
||||
<paper-icon-button icon="favorite" style="color: red;"></paper-icon-button>
|
||||
|
||||
By default, the ripple is the same color as the foreground at 25% opacity. You may
|
||||
customize the color using the `--paper-icon-button-ink-color` custom property.
|
||||
|
||||
The following custom properties and mixins are available for styling:
|
||||
|
||||
Custom property | Description | Default
|
||||
----------------|-------------|----------
|
||||
`--paper-icon-button-disabled-text` | The color of the disabled button | `--disabled-text-color`
|
||||
`--paper-icon-button-ink-color` | Selected/focus ripple color | `--primary-text-color`
|
||||
`--paper-icon-button` | Mixin for a button | `{}`
|
||||
`--paper-icon-button-disabled` | Mixin for a disabled button | `{}`
|
||||
`--paper-icon-button-hover` | Mixin for button on hover | `{}`
|
||||
|
||||
@group Paper Elements
|
||||
@element paper-icon-button
|
||||
@demo demo/index.html
|
||||
-->
|
||||
|
||||
<dom-module id="paper-icon-button">
|
||||
<template strip-whitespace>
|
||||
<style>
|
||||
:host {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding: 8px;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
z-index: 0;
|
||||
line-height: 1;
|
||||
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
|
||||
/* Because of polymer/2558, this style has lower specificity than * */
|
||||
box-sizing: border-box !important;
|
||||
|
||||
@apply(--paper-icon-button);
|
||||
}
|
||||
|
||||
:host #ink {
|
||||
color: var(--paper-icon-button-ink-color, --primary-text-color);
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
:host([disabled]) {
|
||||
color: var(--paper-icon-button-disabled-text, --disabled-text-color);
|
||||
pointer-events: none;
|
||||
cursor: auto;
|
||||
|
||||
@apply(--paper-icon-button-disabled);
|
||||
}
|
||||
|
||||
:host(:hover) {
|
||||
@apply(--paper-icon-button-hover);
|
||||
}
|
||||
|
||||
iron-icon {
|
||||
--iron-icon-width: 100%;
|
||||
--iron-icon-height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'paper-icon-button',
|
||||
|
||||
hostAttributes: {
|
||||
role: 'button',
|
||||
tabindex: '0'
|
||||
},
|
||||
|
||||
behaviors: [
|
||||
Polymer.PaperInkyFocusBehavior
|
||||
],
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* The URL of an image for the icon. If the src property is specified,
|
||||
* the icon property should not be.
|
||||
*/
|
||||
src: {
|
||||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifies the icon name or index in the set of icons available in
|
||||
* the icon's icon set. If the icon property is specified,
|
||||
* the src property should not be.
|
||||
*/
|
||||
icon: {
|
||||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifies the alternate text for the button, for accessibility.
|
||||
*/
|
||||
alt: {
|
||||
type: String,
|
||||
observer: "_altChanged"
|
||||
}
|
||||
},
|
||||
|
||||
_altChanged: function(newValue, oldValue) {
|
||||
var label = this.getAttribute('aria-label');
|
||||
|
||||
// Don't stomp over a user-set aria-label.
|
||||
if (!label || oldValue == label) {
|
||||
this.setAttribute('aria-label', newValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
92
react-app/bower_components/paper-icon-button/test/a11y.html
vendored
Normal file
92
react-app/bower_components/paper-icon-button/test/a11y.html
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>paper-icon-button a11y tests</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
<link rel="import" href="../../iron-icons/iron-icons.html">
|
||||
<link rel="import" href="../paper-icon-button.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="A11yIconButtons">
|
||||
<template>
|
||||
<paper-icon-button id="iconButton1" icon="add"></paper-icon-button>
|
||||
<paper-icon-button id="iconButton2" icon="add" disabled></paper-icon-button>
|
||||
<paper-icon-button id="iconButton3" icon="add" aria-label="custom"></paper-icon-button>
|
||||
<paper-icon-button id="iconButton4" icon="add" alt="alt text"></paper-icon-button>
|
||||
<paper-icon-button id="iconButton5" icon="add" aria-label="custom" alt="alt text" ></paper-icon-button>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
var b1;
|
||||
var b2;
|
||||
var b3;
|
||||
var b4;
|
||||
var b5;
|
||||
|
||||
setup(function() {
|
||||
var iconButtons = fixture('A11yIconButtons');
|
||||
|
||||
b1 = iconButtons[0];
|
||||
b2 = iconButtons[1];
|
||||
b3 = iconButtons[2];
|
||||
b4 = iconButtons[3];
|
||||
b5 = iconButtons[4];
|
||||
});
|
||||
|
||||
test('aria role is a button', function() {
|
||||
assert.strictEqual(b1.getAttribute('role'), 'button');
|
||||
});
|
||||
|
||||
test('aria-disabled is set', function() {
|
||||
assert.strictEqual(b2.getAttribute('aria-disabled'), 'true');
|
||||
b2.removeAttribute('disabled');
|
||||
assert.strictEqual(b2.getAttribute('aria-disabled'), 'false');
|
||||
});
|
||||
|
||||
test('user-defined aria-label is preserved', function() {
|
||||
assert.strictEqual(b3.getAttribute('aria-label'), 'custom');
|
||||
b3.icon = 'arrow-forward';
|
||||
assert.strictEqual(b3.getAttribute('aria-label'), 'custom');
|
||||
});
|
||||
|
||||
test('alt attribute is used for the aria-label', function() {
|
||||
assert.strictEqual(b4.getAttribute('aria-label'), 'alt text');
|
||||
b4.icon = 'arrow-forward';
|
||||
assert.strictEqual(b4.getAttribute('aria-label'), 'alt text');
|
||||
});
|
||||
|
||||
test('aria-label wins over alt attribute', function() {
|
||||
assert.strictEqual(b5.getAttribute('aria-label'), 'custom');
|
||||
b5.icon = 'arrow-forward';
|
||||
b5.alt = 'other alt'
|
||||
assert.strictEqual(b5.getAttribute('aria-label'), 'custom');
|
||||
});
|
||||
|
||||
test('alt attribute can be updated', function() {
|
||||
assert.strictEqual(b4.getAttribute('aria-label'), 'alt text');
|
||||
b4.alt = 'alt again';
|
||||
assert.strictEqual(b4.getAttribute('aria-label'), 'alt again');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
75
react-app/bower_components/paper-icon-button/test/basic.html
vendored
Normal file
75
react-app/bower_components/paper-icon-button/test/basic.html
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>paper-icon-button basic tests</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
<link rel="import" href="../../iron-icons/iron-icons.html">
|
||||
<link rel="import" href="../paper-icon-button.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="TrivialIconButton">
|
||||
<template>
|
||||
<div style="line-height:30px;">
|
||||
<paper-icon-button id="fab1" icon="add"></paper-icon-button>
|
||||
</div>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="SrcIconButton">
|
||||
<template>
|
||||
<paper-icon-button src="add.png"></paper-icon-button>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
var b1;
|
||||
var b2;
|
||||
|
||||
function centerOf(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
return {left: rect.left + rect.width / 2, top: rect.top + rect.height / 2};
|
||||
}
|
||||
|
||||
function approxEqual(p1, p2) {
|
||||
return Math.abs(p1.left - p2.left) <= 2 && Math.abs(p1.top-p2.top) <= 2;
|
||||
}
|
||||
|
||||
setup(function() {
|
||||
b1 = fixture('TrivialIconButton').querySelector('#fab1');
|
||||
b2 = fixture('SrcIconButton');
|
||||
});
|
||||
|
||||
test('applies an icon specified by the `icon` attribute', function() {
|
||||
assert.strictEqual(!!b1.$.icon.src, false);
|
||||
assert.ok(Polymer.dom(b1.$.icon.root).querySelector('svg'));
|
||||
});
|
||||
|
||||
test('applies an icon specified by the `src` attribute', function() {
|
||||
|
||||
assert.strictEqual(!!b2.$.icon.src, true);
|
||||
assert.ok(b2.$.icon.src);
|
||||
});
|
||||
|
||||
test('renders correctly independent of line height', function() {
|
||||
assert.ok(approxEqual(centerOf(b1.$.icon), centerOf(b1)));
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
26
react-app/bower_components/paper-icon-button/test/index.html
vendored
Normal file
26
react-app/bower_components/paper-icon-button/test/index.html
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html><!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
--><html><head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>paper-icon-button tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'basic.html',
|
||||
'a11y.html',
|
||||
'basic.html?dom=shadow',
|
||||
'a11y.html?dom=shadow'
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
||||
</body></html>
|
Reference in New Issue
Block a user