polymer-paper-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +69 -0
- data/Rakefile +1 -0
- data/app/assets/components/core/animation/web-animations.html.erb +1 -0
- data/app/assets/components/core/animation/web-animations.js +5666 -0
- data/app/assets/components/core/icon/core-icon.css +25 -0
- data/app/assets/components/core/icon/core-icon.html.erb +126 -0
- data/app/assets/components/core/iconset/core-iconset.html.erb +236 -0
- data/app/assets/components/core/input/core-input.css +35 -0
- data/app/assets/components/core/input/core-input.html.erb +385 -0
- data/app/assets/components/core/list/core-list.css +20 -0
- data/app/assets/components/core/list/core-list.html.erb +403 -0
- data/app/assets/components/core/media-query/core-media-query.html +86 -0
- data/app/assets/components/core/menu/core-menu.css +18 -0
- data/app/assets/components/core/menu/core-menu.html.erb +62 -0
- data/app/assets/components/core/menu/core-submenu.css +29 -0
- data/app/assets/components/core/menu/core-submenu.html.erb +106 -0
- data/app/assets/components/core/meta/core-meta.html +143 -0
- data/app/assets/components/core/overlay/core-key-helper.html +17 -0
- data/app/assets/components/core/overlay/core-overlay-layer.html +112 -0
- data/app/assets/components/core/overlay/core-overlay.html.erb +661 -0
- data/app/assets/components/core/range/core-range.html +106 -0
- data/app/assets/components/core/selection/core-selection.html +148 -0
- data/app/assets/components/core/selector/core-selector.html.erb +423 -0
- data/app/assets/components/core/style/core-style.html +386 -0
- data/app/assets/components/core/transition/core-transition-css.html.erb +76 -0
- data/app/assets/components/core/transition/core-transition-overlay.css +46 -0
- data/app/assets/components/core/transition/core-transition.html.erb +44 -0
- data/app/assets/components/paper-button/paper-button.css +115 -0
- data/app/assets/components/paper-button/paper-button.html.erb +210 -0
- data/app/assets/components/paper-checkbox/paper-checkbox.css +262 -0
- data/app/assets/components/paper-checkbox/paper-checkbox.html.erb +104 -0
- data/app/assets/components/paper-dialog/paper-dialog-transition.css +59 -0
- data/app/assets/components/paper-dialog/paper-dialog-transition.html.erb +27 -0
- data/app/assets/components/paper-dialog/paper-dialog.css +0 -0
- data/app/assets/components/paper-dialog/paper-dialog.html.erb +176 -0
- data/app/assets/components/paper-fab/paper-fab.css +27 -0
- data/app/assets/components/paper-fab/paper-fab.html.erb +55 -0
- data/app/assets/components/paper-focusable/paper-focusable.html +144 -0
- data/app/assets/components/paper-icon-button/paper-icon-button.css +17 -0
- data/app/assets/components/paper-icon-button/paper-icon-button.html.erb +87 -0
- data/app/assets/components/paper-input/error-100.png +0 -0
- data/app/assets/components/paper-input/error-200.png +0 -0
- data/app/assets/components/paper-input/paper-input.html.erb +398 -0
- data/app/assets/components/paper-input/paper-input.scss +203 -0
- data/app/assets/components/paper-item/paper-item.css +30 -0
- data/app/assets/components/paper-item/paper-item.html.erb +103 -0
- data/app/assets/components/paper-menu-button/paper-menu-button-overlay.html.erb +86 -0
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.css +19 -0
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.html.erb +118 -0
- data/app/assets/components/paper-menu-button/paper-menu-button.css +86 -0
- data/app/assets/components/paper-menu-button/paper-menu-button.html.erb +128 -0
- data/app/assets/components/paper-progress/paper-progress.css +35 -0
- data/app/assets/components/paper-progress/paper-progress.html.erb +98 -0
- data/app/assets/components/paper-radio-button/paper-radio-button.css +98 -0
- data/app/assets/components/paper-radio-button/paper-radio-button.html.erb +148 -0
- data/app/assets/components/paper-radio-group/paper-radio-group.html.erb +68 -0
- data/app/assets/components/paper-ripple/paper-ripple.html +426 -0
- data/app/assets/components/paper-shadow/paper-shadow.css +81 -0
- data/app/assets/components/paper-shadow/paper-shadow.html.erb +212 -0
- data/app/assets/components/paper-slider/paper-slider.css +193 -0
- data/app/assets/components/paper-slider/paper-slider.html.erb +310 -0
- data/app/assets/components/paper-tabs/paper-tab.css +49 -0
- data/app/assets/components/paper-tabs/paper-tab.html.erb +66 -0
- data/app/assets/components/paper-tabs/paper-tabs.css +57 -0
- data/app/assets/components/paper-tabs/paper-tabs.html.erb +127 -0
- data/app/assets/components/paper-toast/paper-toast.css +0 -0
- data/app/assets/components/paper-toast/paper-toast.html.erb +258 -0
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +61 -0
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html.erb +125 -0
- data/lib/polymer-paper-rails/engine.rb +4 -0
- data/lib/polymer-paper-rails/version.rb +3 -0
- data/lib/polymer-paper-rails.rb +2 -0
- metadata +158 -0
@@ -0,0 +1,86 @@
|
|
1
|
+
/*
|
2
|
+
Copyright 2013 The Polymer Authors. All rights reserved.
|
3
|
+
Use of this source code is governed by a BSD-style
|
4
|
+
license that can be found in the LICENSE file.
|
5
|
+
*/
|
6
|
+
|
7
|
+
:host {
|
8
|
+
display: inline-block;
|
9
|
+
padding: 8px;
|
10
|
+
position: relative;
|
11
|
+
background-image: none;
|
12
|
+
outline: none;
|
13
|
+
user-select: none;
|
14
|
+
-webkit-user-select: none;
|
15
|
+
cursor: pointer;
|
16
|
+
overflow: hidden;
|
17
|
+
}
|
18
|
+
|
19
|
+
:host([disabled]) {
|
20
|
+
cursor: auto;
|
21
|
+
}
|
22
|
+
|
23
|
+
core-icon {
|
24
|
+
position: relative;
|
25
|
+
}
|
26
|
+
|
27
|
+
core-icon::shadow svg {
|
28
|
+
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
29
|
+
-webkit-transition: -webkit-transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
30
|
+
transform-origin: 50% 50%;
|
31
|
+
-webkit-transform-origin: 50% 50%;
|
32
|
+
}
|
33
|
+
|
34
|
+
:host(:hover) core-icon::shadow svg {
|
35
|
+
transform: scale(1.2);
|
36
|
+
-webkit-transform: scale(1.2);
|
37
|
+
}
|
38
|
+
|
39
|
+
:host([disabled]:hover) core-icon::shadow svg {
|
40
|
+
transform: none;
|
41
|
+
-webkit-transform: none;
|
42
|
+
}
|
43
|
+
|
44
|
+
:host([disabled]) core-icon::shadow path {
|
45
|
+
fill: #c9c9c9;
|
46
|
+
}
|
47
|
+
|
48
|
+
#overlay {
|
49
|
+
display: block;
|
50
|
+
position: fixed;
|
51
|
+
border-radius: 3px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.paper-menu-button-overlay-ink {
|
55
|
+
position: absolute;
|
56
|
+
top: 0;
|
57
|
+
left: 0;
|
58
|
+
width: 40px;
|
59
|
+
height: 40px;
|
60
|
+
border-radius: 20px;
|
61
|
+
background: #fff;
|
62
|
+
opacity: 0;
|
63
|
+
transform: scale(0);
|
64
|
+
-webkit-transform: scale(0);
|
65
|
+
}
|
66
|
+
|
67
|
+
:host([halign="right"]) .paper-menu-button-overlay-ink {
|
68
|
+
left: auto;
|
69
|
+
right: 0;
|
70
|
+
}
|
71
|
+
|
72
|
+
.paper-menu-button-overlay-bg {
|
73
|
+
position: absolute;
|
74
|
+
top: 0;
|
75
|
+
left: 0;
|
76
|
+
bottom: 0;
|
77
|
+
right: 0;
|
78
|
+
border-radius: 3px;
|
79
|
+
background: #fff;
|
80
|
+
opacity: 0;
|
81
|
+
}
|
82
|
+
|
83
|
+
#menu {
|
84
|
+
position: relative;
|
85
|
+
margin: 0;
|
86
|
+
}
|
@@ -0,0 +1,128 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
-->
|
9
|
+
<!--
|
10
|
+
A `paper-menu-button` is a `paper-icon-button` that opens a drop down menu when tapped.
|
11
|
+
|
12
|
+
Example:
|
13
|
+
|
14
|
+
<paper-menu-button icon="menu">
|
15
|
+
<div>Menu Item 1</div>
|
16
|
+
<div>Menu Item 2</div>
|
17
|
+
<div>Menu Item 3</div>
|
18
|
+
</paper-menu-button>
|
19
|
+
|
20
|
+
@group Paper Elements
|
21
|
+
@element paper-menu-button
|
22
|
+
@extends paper-focusable
|
23
|
+
-->
|
24
|
+
|
25
|
+
<%= html_import_tag "core/icon/core-icon" %>
|
26
|
+
<%= html_import_tag "core/menu/core-menu" %>
|
27
|
+
<%= html_import_tag "paper-focusable/paper-focusable" %>
|
28
|
+
<%= html_import_tag "paper-shadow/paper-shadow" %>
|
29
|
+
<%= html_import_tag "paper-menu-button/paper-menu-button-overlay" %>
|
30
|
+
<%= html_import_tag "paper-menu-button/paper-menu-button-transition" %>
|
31
|
+
|
32
|
+
<polymer-element name="paper-menu-button-overlay-container" noscript>
|
33
|
+
<template>
|
34
|
+
<content></content>
|
35
|
+
</template>
|
36
|
+
</polymer-element>
|
37
|
+
|
38
|
+
<polymer-element name="paper-menu-button" extends="paper-focusable" attributes="src icon opened halign valign slow" on-tap="{{tapAction}}">
|
39
|
+
<template>
|
40
|
+
<%= stylesheet_link_tag "paper-menu-button/paper-menu-button" %>
|
41
|
+
<paper-menu-button-overlay target="{{$.overlay}}" relatedTarget="{{}}" halign="{{halign}}" valign="{{valign}}" opened="{{opened}}" transition="paper-menu-button-transition-top-{{halign}}{{slow ? '-slow' : ''}}"></paper-menu-button-overlay>
|
42
|
+
<paper-menu-button-overlay-container id="overlay">
|
43
|
+
<paper-shadow target="{{$.overlayBg}}" z="0" hasPosition></paper-shadow>
|
44
|
+
<div class="paper-menu-button-overlay-ink"></div>
|
45
|
+
<div id="overlayBg" class="paper-menu-button-overlay-bg"></div>
|
46
|
+
<core-menu id="menu">
|
47
|
+
<content></content>
|
48
|
+
</core-menu>
|
49
|
+
</paper-menu-button-overlay-container>
|
50
|
+
<core-icon src="{{src}}" icon="{{icon}}"></core-icon>
|
51
|
+
</template>
|
52
|
+
<script>
|
53
|
+
Polymer('paper-menu-button', {
|
54
|
+
|
55
|
+
publish: {
|
56
|
+
|
57
|
+
/**
|
58
|
+
* If true, this menu is currently visible.
|
59
|
+
*
|
60
|
+
* @attribute opened
|
61
|
+
* @type boolean
|
62
|
+
* @default false
|
63
|
+
*/
|
64
|
+
opened: { value: false, reflect: true },
|
65
|
+
|
66
|
+
/**
|
67
|
+
* The horizontal alignment of the pulldown menu relative to the button.
|
68
|
+
*
|
69
|
+
* @attribute halign
|
70
|
+
* @type 'left' | 'right'
|
71
|
+
* @default 'left'
|
72
|
+
*/
|
73
|
+
halign: { value: 'left', reflect: true },
|
74
|
+
|
75
|
+
/**
|
76
|
+
* The vertical alignment of the pulldown menu relative to the button.
|
77
|
+
*
|
78
|
+
* @attribute valign
|
79
|
+
* @type 'bottom' | 'top'
|
80
|
+
* @default 'top'
|
81
|
+
*/
|
82
|
+
valign: {value: 'top', reflect: true}
|
83
|
+
},
|
84
|
+
|
85
|
+
/**
|
86
|
+
* The URL of an image for the icon. Should not use `icon` property
|
87
|
+
* if you are using this property.
|
88
|
+
*
|
89
|
+
* @attribute src
|
90
|
+
* @type string
|
91
|
+
* @default ''
|
92
|
+
*/
|
93
|
+
src: '',
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Specifies the icon name or index in the set of icons available in
|
97
|
+
* the icon set. Should not use `src` property if you are using this
|
98
|
+
* property.
|
99
|
+
*
|
100
|
+
* @attribute icon
|
101
|
+
* @type string
|
102
|
+
* @default ''
|
103
|
+
*/
|
104
|
+
icon: '',
|
105
|
+
|
106
|
+
slow: false,
|
107
|
+
|
108
|
+
tapAction: function() {
|
109
|
+
if (this.disabled) {
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
|
113
|
+
this.super();
|
114
|
+
this.toggle();
|
115
|
+
},
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Toggle the opened state of the menu.
|
119
|
+
*
|
120
|
+
* @method toggle
|
121
|
+
*/
|
122
|
+
toggle: function() {
|
123
|
+
this.opened = !this.opened;
|
124
|
+
}
|
125
|
+
|
126
|
+
});
|
127
|
+
</script>
|
128
|
+
</polymer-element>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
*/
|
9
|
+
|
10
|
+
:host {
|
11
|
+
display: inline-block;
|
12
|
+
width: 200px;
|
13
|
+
height: 4px;
|
14
|
+
}
|
15
|
+
|
16
|
+
#progressContainer {
|
17
|
+
position: relative;
|
18
|
+
height: 100%;
|
19
|
+
background-color: #c8c8c8;
|
20
|
+
}
|
21
|
+
|
22
|
+
#activeProgress, #secondaryProgress {
|
23
|
+
position: absolute;
|
24
|
+
top: 0;
|
25
|
+
left: 0;
|
26
|
+
bottom: 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
#activeProgress {
|
30
|
+
background-color: #0f9d58;
|
31
|
+
}
|
32
|
+
|
33
|
+
#secondaryProgress {
|
34
|
+
background-color: #87ceac;
|
35
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
-->
|
9
|
+
|
10
|
+
<!--
|
11
|
+
The progress bars are for situations where the percentage completed can be
|
12
|
+
determined. They give users a quick sense of how much longer an operation
|
13
|
+
will take.
|
14
|
+
|
15
|
+
Example:
|
16
|
+
|
17
|
+
<paper-progress value="10"></paper-progress>
|
18
|
+
|
19
|
+
There is also a secondary progress which is useful for displaying intermediate
|
20
|
+
progress, such as the buffer level during a streaming playback progress bar.
|
21
|
+
|
22
|
+
Example:
|
23
|
+
|
24
|
+
<paper-progress value="10" secondaryProgesss="30"></paper-progress>
|
25
|
+
|
26
|
+
Styling progress bar:
|
27
|
+
|
28
|
+
To change the active progress bar color:
|
29
|
+
|
30
|
+
paper-progress::shadow #activeProgress {
|
31
|
+
background-color: #e91e63;
|
32
|
+
}
|
33
|
+
|
34
|
+
To change the secondary progress bar color:
|
35
|
+
|
36
|
+
paper-progress::shadow #secondaryProgress {
|
37
|
+
background-color: #f8bbd0;
|
38
|
+
}
|
39
|
+
|
40
|
+
To change the progress bar background color:
|
41
|
+
|
42
|
+
paper-progress::shadow #progressContainer {
|
43
|
+
background-color: #64ffda;
|
44
|
+
}
|
45
|
+
|
46
|
+
@group Paper Elements
|
47
|
+
@element paper-progress
|
48
|
+
@extends core-range
|
49
|
+
@homepage github.io
|
50
|
+
-->
|
51
|
+
|
52
|
+
<%= html_import_tag "core/range/core-range" %>
|
53
|
+
|
54
|
+
<polymer-element name="paper-progress" extends="core-range" attributes="secondaryProgress">
|
55
|
+
|
56
|
+
<template>
|
57
|
+
|
58
|
+
<%= stylesheet_link_tag "paper-progress/paper-progress" %>
|
59
|
+
|
60
|
+
<div id="progressContainer" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="{{min}}" aria-valuemax="{{max}}">
|
61
|
+
|
62
|
+
<div id="secondaryProgress" style="width: {{secondaryRatio}}%;"></div>
|
63
|
+
<div id="activeProgress" style="width: {{ratio}}%;"></div>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
</template>
|
68
|
+
|
69
|
+
<script>
|
70
|
+
|
71
|
+
Polymer('paper-progress', {
|
72
|
+
|
73
|
+
/**
|
74
|
+
* The number that represents the current secondary progress.
|
75
|
+
*
|
76
|
+
* @attribute secondaryProgress
|
77
|
+
* @type number
|
78
|
+
* @default 0
|
79
|
+
*/
|
80
|
+
secondaryProgress: 0,
|
81
|
+
|
82
|
+
step: 0,
|
83
|
+
|
84
|
+
observe: {
|
85
|
+
'value secondaryProgress min max': 'update'
|
86
|
+
},
|
87
|
+
|
88
|
+
update: function() {
|
89
|
+
this.super();
|
90
|
+
this.secondaryProgress = this.clampValue(this.secondaryProgress);
|
91
|
+
this.secondaryRatio = this.calcRatio(this.secondaryProgress) * 100;
|
92
|
+
}
|
93
|
+
|
94
|
+
});
|
95
|
+
|
96
|
+
</script>
|
97
|
+
|
98
|
+
</polymer-element>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
*/
|
9
|
+
|
10
|
+
:host {
|
11
|
+
display: inline-block;
|
12
|
+
white-space: nowrap;
|
13
|
+
}
|
14
|
+
|
15
|
+
:host(:focus) {
|
16
|
+
outline: none;
|
17
|
+
}
|
18
|
+
|
19
|
+
#radioContainer {
|
20
|
+
position: relative;
|
21
|
+
width: 16px;
|
22
|
+
height: 16px;
|
23
|
+
cursor: pointer;
|
24
|
+
}
|
25
|
+
|
26
|
+
#radioContainer.labeled {
|
27
|
+
display: inline-block;
|
28
|
+
vertical-align: middle;
|
29
|
+
}
|
30
|
+
|
31
|
+
#ink {
|
32
|
+
position: absolute;
|
33
|
+
top: -17px;
|
34
|
+
left: -17px;
|
35
|
+
width: 50px;
|
36
|
+
height: 50px;
|
37
|
+
color: #5a5a5a;
|
38
|
+
}
|
39
|
+
|
40
|
+
#ink[checked] {
|
41
|
+
color: #0f9d58;
|
42
|
+
}
|
43
|
+
|
44
|
+
#offRadio {
|
45
|
+
position: absolute;
|
46
|
+
top: 0px;
|
47
|
+
left: 0px;
|
48
|
+
width: 12px;
|
49
|
+
height: 12px;
|
50
|
+
border-radius: 50%;
|
51
|
+
border: solid 2px;
|
52
|
+
border-color: #5a5a5a;
|
53
|
+
}
|
54
|
+
|
55
|
+
#onRadio {
|
56
|
+
position: absolute;
|
57
|
+
top: 0;
|
58
|
+
left: 0;
|
59
|
+
width: 16px;
|
60
|
+
height: 16px;
|
61
|
+
border-radius: 50%;
|
62
|
+
background-color: #0f9d58;
|
63
|
+
-webkit-transform: scale(0);
|
64
|
+
transform: scale(0);
|
65
|
+
transition: -webkit-transform ease 0.28s;
|
66
|
+
transition: transform ease 0.28s;
|
67
|
+
}
|
68
|
+
|
69
|
+
#onRadio.fill {
|
70
|
+
-webkit-transform: scale(1.1);
|
71
|
+
transform: scale(1.1);
|
72
|
+
}
|
73
|
+
|
74
|
+
#radioLabel {
|
75
|
+
position: relative;
|
76
|
+
display: inline-block;
|
77
|
+
vertical-align: middle;
|
78
|
+
margin-left: 10px;
|
79
|
+
white-space: normal;
|
80
|
+
pointer-events: none;
|
81
|
+
}
|
82
|
+
|
83
|
+
#radioLabel[hidden] {
|
84
|
+
display: none;
|
85
|
+
}
|
86
|
+
|
87
|
+
/* disabled state */
|
88
|
+
:host([disabled]) {
|
89
|
+
pointer-events: none;
|
90
|
+
}
|
91
|
+
|
92
|
+
:host([disabled]) #offRadio {
|
93
|
+
border-color: #eaeaea !important;
|
94
|
+
}
|
95
|
+
|
96
|
+
:host([disabled]) #onRadio {
|
97
|
+
background-color: #eaeaea !important;
|
98
|
+
}
|