polymer-paper-elements-rails 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +51 -0
  3. data/Rakefile +1 -0
  4. data/app/assets/components/iron-a11y-announcer/iron-a11y-announcer.html +125 -0
  5. data/app/assets/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html +418 -0
  6. data/app/assets/components/iron-autogrow-textarea/hero.svg +33 -0
  7. data/app/assets/components/iron-autogrow-textarea/iron-autogrow-textarea.html +263 -0
  8. data/app/assets/components/iron-behaviors/iron-button-state.html +195 -0
  9. data/app/assets/components/iron-behaviors/iron-control-state.html +102 -0
  10. data/app/assets/components/iron-fit-behavior/iron-fit-behavior.html +230 -0
  11. data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
  12. data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
  13. data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
  14. data/app/assets/components/iron-form-element-behavior/iron-form-element-behavior.html +50 -0
  15. data/app/assets/components/iron-icon/hero.svg +19 -0
  16. data/app/assets/components/iron-icon/iron-icon.html +187 -0
  17. data/app/assets/components/iron-icons/av-icons.html +73 -0
  18. data/app/assets/components/iron-icons/communication-icons.html +59 -0
  19. data/app/assets/components/iron-icons/device-icons.html +94 -0
  20. data/app/assets/components/iron-icons/editor-icons.html +70 -0
  21. data/app/assets/components/iron-icons/hardware-icons.html +61 -0
  22. data/app/assets/components/iron-icons/hero.svg +35 -0
  23. data/app/assets/components/iron-icons/image-icons.html +164 -0
  24. data/app/assets/components/iron-icons/iron-icons.html +303 -0
  25. data/app/assets/components/iron-icons/maps-icons.html +71 -0
  26. data/app/assets/components/iron-icons/notification-icons.html +62 -0
  27. data/app/assets/components/iron-icons/social-icons.html +40 -0
  28. data/app/assets/components/iron-iconset-svg/iron-iconset-svg.html +191 -0
  29. data/app/assets/components/iron-input/hero.svg +19 -0
  30. data/app/assets/components/iron-input/iron-input.html +235 -0
  31. data/app/assets/components/iron-media-query/hero.svg +29 -0
  32. data/app/assets/components/iron-media-query/iron-media-query.html +84 -0
  33. data/app/assets/components/iron-menu-behavior/iron-menu-behavior.html +214 -0
  34. data/app/assets/components/iron-menu-behavior/iron-menubar-behavior.html +65 -0
  35. data/app/assets/components/iron-meta/hero.svg +33 -0
  36. data/app/assets/components/iron-meta/iron-meta.html +352 -0
  37. data/app/assets/components/iron-overlay-behavior/iron-overlay-backdrop.html +132 -0
  38. data/app/assets/components/iron-overlay-behavior/iron-overlay-behavior.html +432 -0
  39. data/app/assets/components/iron-overlay-behavior/iron-overlay-manager.html +107 -0
  40. data/app/assets/components/iron-range-behavior/iron-range-behavior.html +101 -0
  41. data/app/assets/components/iron-resizable-behavior/iron-resizable-behavior.html +139 -0
  42. data/app/assets/components/iron-selector/iron-multi-selectable.html +120 -0
  43. data/app/assets/components/iron-selector/iron-selectable.html +307 -0
  44. data/app/assets/components/iron-selector/iron-selection.html +115 -0
  45. data/app/assets/components/iron-selector/iron-selector.html +71 -0
  46. data/app/assets/components/iron-validatable-behavior/iron-validatable-behavior.html +100 -0
  47. data/app/assets/components/neon-animation/animations/cascaded-animation.html +84 -0
  48. data/app/assets/components/neon-animation/animations/fade-in-animation.html +49 -0
  49. data/app/assets/components/neon-animation/animations/fade-out-animation.html +49 -0
  50. data/app/assets/components/neon-animation/animations/hero-animation.html +83 -0
  51. data/app/assets/components/neon-animation/animations/opaque-animation.html +46 -0
  52. data/app/assets/components/neon-animation/animations/ripple-animation.html +92 -0
  53. data/app/assets/components/neon-animation/animations/scale-down-animation.html +65 -0
  54. data/app/assets/components/neon-animation/animations/scale-up-animation.html +58 -0
  55. data/app/assets/components/neon-animation/animations/slide-down-animation.html +59 -0
  56. data/app/assets/components/neon-animation/animations/slide-from-left-animation.html +60 -0
  57. data/app/assets/components/neon-animation/animations/slide-from-right-animation.html +60 -0
  58. data/app/assets/components/neon-animation/animations/slide-left-animation.html +59 -0
  59. data/app/assets/components/neon-animation/animations/slide-right-animation.html +59 -0
  60. data/app/assets/components/neon-animation/animations/slide-up-animation.html +59 -0
  61. data/app/assets/components/neon-animation/animations/transform-animation.html +61 -0
  62. data/app/assets/components/neon-animation/guides/neon-animation.md +313 -0
  63. data/app/assets/components/neon-animation/neon-animatable-behavior.html +156 -0
  64. data/app/assets/components/neon-animation/neon-animatable.html +54 -0
  65. data/app/assets/components/neon-animation/neon-animated-pages.html +208 -0
  66. data/app/assets/components/neon-animation/neon-animation-behavior.html +88 -0
  67. data/app/assets/components/neon-animation/neon-animation-runner-behavior.html +110 -0
  68. data/app/assets/components/neon-animation/neon-animation.html +17 -0
  69. data/app/assets/components/neon-animation/neon-animations.html +25 -0
  70. data/app/assets/components/neon-animation/neon-shared-element-animatable-behavior.html +37 -0
  71. data/app/assets/components/neon-animation/neon-shared-element-animation-behavior.html +66 -0
  72. data/app/assets/components/neon-animation/web-animations.html +11 -0
  73. data/app/assets/components/paper-behaviors/paper-button-behavior.html +55 -0
  74. data/app/assets/components/paper-behaviors/paper-inky-focus-behavior.html +44 -0
  75. data/app/assets/components/paper-button/paper-button.html +177 -0
  76. data/app/assets/components/paper-checkbox/metadata.html +17 -0
  77. data/app/assets/components/paper-checkbox/paper-checkbox.css +149 -0
  78. data/app/assets/components/paper-checkbox/paper-checkbox.html +163 -0
  79. data/app/assets/components/paper-dialog-behavior/hero.svg +51 -0
  80. data/app/assets/components/paper-dialog-behavior/paper-dialog-behavior.html +236 -0
  81. data/app/assets/components/paper-dialog-behavior/paper-dialog-common.css +58 -0
  82. data/app/assets/components/paper-dialog-scrollable/hero.svg +69 -0
  83. data/app/assets/components/paper-dialog-scrollable/paper-dialog-scrollable.html +150 -0
  84. data/app/assets/components/paper-dialog/hero.svg +58 -0
  85. data/app/assets/components/paper-dialog/paper-dialog.html +122 -0
  86. data/app/assets/components/paper-drawer-panel/hero.svg +21 -0
  87. data/app/assets/components/paper-drawer-panel/paper-drawer-panel.css +142 -0
  88. data/app/assets/components/paper-drawer-panel/paper-drawer-panel.html +585 -0
  89. data/app/assets/components/paper-fab/paper-fab.html +159 -0
  90. data/app/assets/components/paper-header-panel/hero.svg +38 -0
  91. data/app/assets/components/paper-header-panel/paper-header-panel.html +496 -0
  92. data/app/assets/components/paper-icon-button/paper-icon-button.html +141 -0
  93. data/app/assets/components/paper-input/all-imports.html +12 -0
  94. data/app/assets/components/paper-input/hero.svg +19 -0
  95. data/app/assets/components/paper-input/paper-input-addon-behavior.html +43 -0
  96. data/app/assets/components/paper-input/paper-input-behavior.html +293 -0
  97. data/app/assets/components/paper-input/paper-input-char-counter.html +95 -0
  98. data/app/assets/components/paper-input/paper-input-container.html +495 -0
  99. data/app/assets/components/paper-input/paper-input-error.html +99 -0
  100. data/app/assets/components/paper-input/paper-input.html +126 -0
  101. data/app/assets/components/paper-input/paper-textarea.html +100 -0
  102. data/app/assets/components/paper-item/all-imports.html +13 -0
  103. data/app/assets/components/paper-item/paper-icon-item.html +86 -0
  104. data/app/assets/components/paper-item/paper-item-body.html +93 -0
  105. data/app/assets/components/paper-item/paper-item-shared.css +19 -0
  106. data/app/assets/components/paper-item/paper-item.html +95 -0
  107. data/app/assets/components/paper-material/paper-material.html +98 -0
  108. data/app/assets/components/paper-menu/hero.svg +35 -0
  109. data/app/assets/components/paper-menu/paper-menu.html +133 -0
  110. data/app/assets/components/paper-progress/hero.svg +21 -0
  111. data/app/assets/components/paper-progress/paper-progress.html +199 -0
  112. data/app/assets/components/paper-radio-button/hero.svg +22 -0
  113. data/app/assets/components/paper-radio-button/paper-radio-button.css +109 -0
  114. data/app/assets/components/paper-radio-button/paper-radio-button.html +148 -0
  115. data/app/assets/components/paper-radio-group/hero.svg +25 -0
  116. data/app/assets/components/paper-radio-group/paper-radio-group.html +186 -0
  117. data/app/assets/components/paper-ripple/hero.svg +30 -0
  118. data/app/assets/components/paper-ripple/paper-ripple.html +714 -0
  119. data/app/assets/components/paper-scroll-header-panel/hero.svg +41 -0
  120. data/app/assets/components/paper-scroll-header-panel/paper-scroll-header-panel.html +455 -0
  121. data/app/assets/components/paper-slider/hero.svg +20 -0
  122. data/app/assets/components/paper-slider/paper-slider.css +252 -0
  123. data/app/assets/components/paper-slider/paper-slider.html +449 -0
  124. data/app/assets/components/paper-spinner/hero.svg +27 -0
  125. data/app/assets/components/paper-spinner/paper-spinner.css +325 -0
  126. data/app/assets/components/paper-spinner/paper-spinner.html +222 -0
  127. data/app/assets/components/paper-styles/classes/global.html +96 -0
  128. data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
  129. data/app/assets/components/paper-styles/classes/shadow.html +39 -0
  130. data/app/assets/components/paper-styles/classes/typography.html +171 -0
  131. data/app/assets/components/paper-styles/color.html +333 -0
  132. data/app/assets/components/paper-styles/default-theme.html +39 -0
  133. data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
  134. data/app/assets/components/paper-styles/paper-styles.html +17 -0
  135. data/app/assets/components/paper-styles/shadow.html +61 -0
  136. data/app/assets/components/paper-styles/typography.html +240 -0
  137. data/app/assets/components/paper-tabs/hero.svg +23 -0
  138. data/app/assets/components/paper-tabs/paper-tab.html +158 -0
  139. data/app/assets/components/paper-tabs/paper-tabs-icons.html +18 -0
  140. data/app/assets/components/paper-tabs/paper-tabs.html +483 -0
  141. data/app/assets/components/paper-toast/hero.svg +20 -0
  142. data/app/assets/components/paper-toast/paper-toast.html +164 -0
  143. data/app/assets/components/paper-toggle-button/hero.svg +22 -0
  144. data/app/assets/components/paper-toggle-button/paper-toggle-button.css +108 -0
  145. data/app/assets/components/paper-toggle-button/paper-toggle-button.html +183 -0
  146. data/app/assets/components/paper-toolbar/paper-toolbar.html +375 -0
  147. data/app/assets/components/polymer-gestures/Gruntfile.js +60 -0
  148. data/app/assets/components/polymer-gestures/banner.txt +9 -0
  149. data/app/assets/components/polymer-gestures/build.json +17 -0
  150. data/app/assets/components/polymer-gestures/conf/karma.conf.js +39 -0
  151. data/app/assets/components/polymer-gestures/package.json +20 -0
  152. data/app/assets/components/polymer-gestures/polymer-gestures.html +21 -0
  153. data/app/assets/components/polymer-gestures/polymer-gestures.js +46 -0
  154. data/app/assets/components/polymer-gestures/src/dispatcher.js +474 -0
  155. data/app/assets/components/polymer-gestures/src/eventFactory.js +127 -0
  156. data/app/assets/components/polymer-gestures/src/hold.js +129 -0
  157. data/app/assets/components/polymer-gestures/src/mouse.js +135 -0
  158. data/app/assets/components/polymer-gestures/src/ms.js +80 -0
  159. data/app/assets/components/polymer-gestures/src/pinch.js +186 -0
  160. data/app/assets/components/polymer-gestures/src/platform-events.js +39 -0
  161. data/app/assets/components/polymer-gestures/src/pointer.js +68 -0
  162. data/app/assets/components/polymer-gestures/src/pointermap.js +67 -0
  163. data/app/assets/components/polymer-gestures/src/scope.js +10 -0
  164. data/app/assets/components/polymer-gestures/src/tap.js +103 -0
  165. data/app/assets/components/polymer-gestures/src/targetfind.js +244 -0
  166. data/app/assets/components/polymer-gestures/src/touch-action.js +60 -0
  167. data/app/assets/components/polymer-gestures/src/touch.js +341 -0
  168. data/app/assets/components/polymer-gestures/src/track.js +230 -0
  169. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
  170. data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
  171. data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
  172. data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
  173. data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
  174. data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
  175. data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
  176. data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
  177. data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
  178. data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
  179. data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
  180. data/app/assets/components/webcomponentsjs/package.json +31 -0
  181. data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
  182. data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
  183. data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
  184. data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
  185. data/lib/polymer-paper-elements-rails.rb +2 -0
  186. data/lib/polymer-paper-elements-rails/engine.rb +4 -0
  187. data/lib/polymer-paper-elements-rails/version.rb +3 -0
  188. metadata +272 -0
@@ -0,0 +1,149 @@
1
+ /*
2
+ Copyright (c) 2015 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
+ .hidden {
20
+ display: none;
21
+ }
22
+
23
+ #checkboxContainer {
24
+ display: inline-block;
25
+ position: relative;
26
+ width: 18px;
27
+ height: 18px;
28
+ cursor: pointer;
29
+ -webkit-transform: translateZ(0);
30
+ transform: translateZ(0);
31
+ vertical-align: middle;
32
+ }
33
+
34
+ :host #ink {
35
+ position: absolute;
36
+ top: -15px;
37
+ left: -15px;
38
+ width: 48px;
39
+ height: 48px;
40
+ color: var(--paper-checkbox-unchecked-ink-color);
41
+ opacity: 0.6;
42
+ }
43
+
44
+ :host #ink[checked] {
45
+ color: var(--paper-checkbox-checked-ink-color);
46
+ }
47
+
48
+ :host #checkbox {
49
+ position: relative;
50
+ box-sizing: border-box;
51
+ height: 100%;
52
+ border: solid 2px;
53
+ border-color: var(--paper-checkbox-unchecked-color);
54
+ border-radius: 2px;
55
+ pointer-events: none;
56
+ -webkit-transition: background-color 140ms, border-color 140ms;
57
+ transition: background-color 140ms, border-color 140ms;
58
+ }
59
+
60
+ /* checkbox checked animations */
61
+ #checkbox.checked #checkmark {
62
+ -webkit-animation: checkmark-expand 140ms ease-out forwards;
63
+ animation: checkmark-expand 140ms ease-out forwards;
64
+ }
65
+
66
+ @-webkit-keyframes checkmark-expand {
67
+ 0% {
68
+ top: 9px;
69
+ left: 6px;
70
+ width: 0px;
71
+ height: 0px;
72
+ }
73
+ 100% {
74
+ top: -1px;
75
+ left: 4px;
76
+ width: 5px;
77
+ height: 10px;
78
+ }
79
+ }
80
+
81
+ @keyframes checkmark-expand {
82
+ 0% {
83
+ top: 9px;
84
+ left: 6px;
85
+ width: 0px;
86
+ height: 0px;
87
+ }
88
+ 100% {
89
+ top: -1px;
90
+ left: 4px;
91
+ width: 5px;
92
+ height: 10px;
93
+ }
94
+ }
95
+
96
+ :host #checkbox.checked {
97
+ background-color: var(--paper-checkbox-checked-color);
98
+ border-color: var(--paper-checkbox-checked-color);
99
+ }
100
+
101
+ :host #checkmark {
102
+ -webkit-transform: rotate(45deg);
103
+ transform: rotate(45deg);
104
+ position: absolute;
105
+ top: -1px;
106
+ left: 4px;
107
+ width: 5px;
108
+ height: 10px;
109
+ border-style: solid;
110
+ border-top: none;
111
+ border-left: none;
112
+ border-right-width: 2px;
113
+ border-bottom-width: 2px;
114
+ border-color: white;
115
+ }
116
+
117
+ /* label */
118
+ #checkboxLabel {
119
+ position: relative;
120
+ display: inline-block;
121
+ vertical-align: middle;
122
+ padding-left: 8px;
123
+ white-space: normal;
124
+ pointer-events: none;
125
+ color: var(--paper-checkbox-label-color);
126
+ }
127
+
128
+ #checkboxLabel[hidden] {
129
+ display: none;
130
+ }
131
+
132
+ /* disabled state */
133
+ :host([disabled]) {
134
+ pointer-events: none;
135
+ }
136
+
137
+ :host([disabled]) #checkbox {
138
+ opacity: 0.5;
139
+ border-color: var(--paper-checkbox-unchecked-color);
140
+ }
141
+
142
+ :host([disabled][checked]) #checkbox {
143
+ background-color: var(--paper-checkbox-unchecked-color);
144
+ opacity: 0.5;
145
+ }
146
+
147
+ :host([disabled]) #checkboxLabel {
148
+ opacity: 0.65;
149
+ }
@@ -0,0 +1,163 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+
11
+ <link rel="import" href="../polymer/polymer.html">
12
+ <link rel="import" href="../paper-ripple/paper-ripple.html">
13
+ <link rel="import" href="../paper-styles/default-theme.html">
14
+ <link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
15
+
16
+ <!--
17
+
18
+ `paper-checkbox` is a button that can be either checked or unchecked. User
19
+ can tap the checkbox to check or uncheck it. Usually you use checkboxes
20
+ to allow user to select multiple options from a set. If you have a single
21
+ ON/OFF option, avoid using a single checkbox and use `paper-toggle-button`
22
+ instead.
23
+
24
+ Example:
25
+
26
+ <paper-checkbox>label</paper-checkbox>
27
+
28
+ <paper-checkbox checked> label</paper-checkbox>
29
+
30
+ ### Styling
31
+
32
+ The following custom properties and mixins are available for styling:
33
+
34
+ Custom property | Description | Default
35
+ ----------------|-------------|----------
36
+ `--paper-checkbox-unchecked-color` | Checkbox color when the input is not checked | `--primary-text-color`
37
+ `--paper-checkbox-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--primary-text-color`
38
+ `--paper-checkbox-checked-color` | Checkbox color when the input is checked | `--default-primary-color`
39
+ `--paper-checkbox-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
40
+ `--paper-checkbox-label-color` | Label color | `--primary-text-color`
41
+
42
+ @demo demo/index.html
43
+ -->
44
+
45
+ <style is="custom-style">
46
+ :root {
47
+ --paper-checkbox-unchecked-color: var(--primary-text-color);
48
+ --paper-checkbox-unchecked-ink-color: var(--primary-text-color);
49
+
50
+ --paper-checkbox-checked-color: var(--default-primary-color);
51
+ --paper-checkbox-checked-ink-color: var(--default-primary-color);
52
+
53
+ --paper-checkbox-label-color: var(--primary-text-color);
54
+ }
55
+ </style>
56
+
57
+ <dom-module id="paper-checkbox">
58
+ <link rel="import" type="css" href="paper-checkbox.css">
59
+
60
+ <template>
61
+
62
+ <div id="checkboxContainer">
63
+ <paper-ripple id="ink" class="circle" center checked$="[[checked]]"></paper-ripple>
64
+ <div id="checkbox" class$="[[_computeCheckboxClass(checked)]]">
65
+ <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div>
66
+ </div>
67
+ </div>
68
+
69
+ <div id="checkboxLabel" aria-hidden="true"><content></content></div>
70
+
71
+ </template>
72
+
73
+ <script>
74
+ Polymer({
75
+ is: 'paper-checkbox',
76
+
77
+ behaviors: [
78
+ Polymer.PaperInkyFocusBehavior
79
+ ],
80
+
81
+ hostAttributes: {
82
+ role: 'checkbox',
83
+ 'aria-checked': false,
84
+ tabindex: 0
85
+ },
86
+
87
+ properties: {
88
+ /**
89
+ * Fired when the checked state changes due to user interaction.
90
+ *
91
+ * @event change
92
+ */
93
+
94
+ /**
95
+ * Fired when the checked state changes.
96
+ *
97
+ * @event iron-change
98
+ */
99
+
100
+ /**
101
+ * Gets or sets the state, `true` is checked and `false` is unchecked.
102
+ */
103
+ checked: {
104
+ type: Boolean,
105
+ value: false,
106
+ reflectToAttribute: true,
107
+ notify: true,
108
+ observer: '_checkedChanged'
109
+ },
110
+
111
+ /**
112
+ * If true, the button toggles the active state with each tap or press
113
+ * of the spacebar.
114
+ */
115
+ toggles: {
116
+ type: Boolean,
117
+ value: true,
118
+ reflectToAttribute: true
119
+ }
120
+ },
121
+
122
+ ready: function() {
123
+ if (Polymer.dom(this).textContent == '') {
124
+ this.$.checkboxLabel.hidden = true;
125
+ } else {
126
+ this.setAttribute('aria-label', Polymer.dom(this).textContent);
127
+ }
128
+ this._isReady = true;
129
+ },
130
+
131
+ // button-behavior hook
132
+ _buttonStateChanged: function() {
133
+ if (this.disabled) {
134
+ return;
135
+ }
136
+ if (this._isReady) {
137
+ this.checked = this.active;
138
+ }
139
+ },
140
+
141
+ _checkedChanged: function(checked) {
142
+ this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
143
+ this.active = this.checked;
144
+ this.fire('iron-change');
145
+ },
146
+
147
+ _computeCheckboxClass: function(checked) {
148
+ if (checked) {
149
+ return 'checked';
150
+ }
151
+ return '';
152
+ },
153
+
154
+ _computeCheckmarkClass: function(checked) {
155
+ if (!checked) {
156
+ return 'hidden';
157
+ }
158
+ return '';
159
+ }
160
+ })
161
+ </script>
162
+
163
+ </dom-module>
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
6
+ <g id="background" display="none">
7
+ <rect display="inline" fill="#B0BEC5" width="225" height="126"/>
8
+ </g>
9
+ <g id="label">
10
+ </g>
11
+ <g id="art">
12
+ <g>
13
+ <polygon points="76.7,98 79.2,98 74,91.1 74,94.4 "/>
14
+ <polygon points="74,81.4 74,84.7 84.1,98 86.6,98 "/>
15
+ <polygon points="74,71.7 74,75 91.5,98 94,98 "/>
16
+ <polygon points="74,62 74,65.3 98.9,98 101.4,98 "/>
17
+ <polygon points="94.3,79 92,79 92,76 74,52.3 74,55.6 106.2,98 108.7,98 "/>
18
+ <polygon points="92,69.6 92,66.3 74,42.6 74,45.9 "/>
19
+ <polygon points="101.7,79 99.2,79 113.6,98 116.1,98 "/>
20
+ <polygon points="92,59.9 92,56.6 74,32.9 74,36.2 "/>
21
+ <polygon points="109.1,79 106.5,79 121,98 123.5,98 "/>
22
+ <polygon points="92,50.2 92,47 92.1,47 77.7,28 75.2,28 "/>
23
+ <polygon points="116.4,79 113.9,79 128.4,98 130.9,98 "/>
24
+ <polygon points="97,47 99.5,47 85,28 82.5,28 "/>
25
+ <polygon points="123.8,79 121.3,79 135.7,98 138.2,98 "/>
26
+ <polygon points="104.4,47 106.9,47 92.4,28 89.9,28 "/>
27
+ <polygon points="131.2,79 128.7,79 143.1,98 145.6,98 "/>
28
+ <polygon points="132,70.4 132,73.7 150,97.4 150,94.1 "/>
29
+ <polygon points="111.7,47 114.2,47 99.8,28 97.3,28 "/>
30
+ <polygon points="132,60.7 132,64 150,87.7 150,84.3 "/>
31
+ <polygon points="119.1,47 121.6,47 107.2,28 104.7,28 "/>
32
+ <polygon points="132,51 132,54.3 150,77.9 150,74.6 "/>
33
+ <polygon points="114.6,28 112,28 126.5,47 129,47 "/>
34
+ <polygon points="121.9,28 119.4,28 150,68.2 150,64.9 "/>
35
+ <polygon points="129.3,28 126.8,28 150,58.5 150,55.2 "/>
36
+ <polygon points="136.7,28 134.2,28 150,48.8 150,45.5 "/>
37
+ <polygon points="144.1,28 141.5,28 150,39.1 150,35.8 "/>
38
+ <polygon points="150,29.4 150,28 148.9,28 "/>
39
+ </g>
40
+ <path d="M133,80H91V46h42V80z M93,78h38V48H93V78z"/>
41
+ <path d="M151,99H73V27h78V99z M75,97h74V29H75V97z"/>
42
+ <circle cx="74" cy="28" r="4"/>
43
+ <circle cx="150" cy="28" r="4"/>
44
+ <circle cx="150" cy="98" r="4"/>
45
+ <circle cx="74" cy="98" r="4"/>
46
+ <g id="ic_x5F_add_x0D_">
47
+ </g>
48
+ </g>
49
+ <g id="Guides">
50
+ </g>
51
+ </svg>
@@ -0,0 +1,236 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+
11
+ <link rel="import" href="../polymer/polymer.html">
12
+ <link rel="import" href="../iron-overlay-behavior/iron-overlay-behavior.html">
13
+ <link rel="import" href="../paper-styles/paper-styles.html">
14
+
15
+ <script>
16
+
17
+ /*
18
+ Use `Polymer.PaperDialogBehavior` and `paper-dialog-common.css` to implement a Material Design
19
+ dialog.
20
+
21
+ For example, if `<paper-dialog-impl>` implements this behavior:
22
+
23
+ <paper-dialog-impl>
24
+ <h2>Header</h2>
25
+ <div>Dialog body</div>
26
+ <div class="buttons">
27
+ <paper-button dialog-dismiss>Cancel</paper-button>
28
+ <paper-button dialog-confirm>Accept</paper-button>
29
+ </div>
30
+ </paper-dialog-impl>
31
+
32
+ `paper-dialog-common.css` provide styles for a header, content area, and an action area for buttons.
33
+ Use the `<h2>` tag for the header and the `buttons` class for the action area. You can use the
34
+ `paper-dialog-scrollable` element (in its own repository) if you need a scrolling content area.
35
+
36
+ Use the `dialog-dismiss` and `dialog-confirm` attributes on interactive controls to close the
37
+ dialog. If the user dismisses the dialog with `dialog-confirm`, the `closingReason` will update
38
+ to include `confirmed: true`.
39
+
40
+ ### Styling
41
+
42
+ The following custom properties and mixins are available for styling.
43
+
44
+ Custom property | Description | Default
45
+ ----------------|-------------|----------
46
+ `--paper-dialog-background-color` | Dialog background color | `--primary-background-color`
47
+ `--paper-dialog-color` | Dialog foreground color | `--primary-text-color`
48
+ `--paper-dialog` | Mixin applied to the dialog | `{}`
49
+ `--paper-dialog-title` | Mixin applied to the title (`<h2>`) element | `{}`
50
+ `--paper-dialog-button-color` | Button area foreground color | `--default-primary-color`
51
+
52
+ ### Accessibility
53
+
54
+ This element has `role="dialog"` by default. Depending on the context, it may be more appropriate
55
+ to override this attribute with `role="alertdialog"`. The header (a `<h2>` element) will
56
+
57
+ If `modal` is set, the element will set `aria-modal` and prevent the focus from exiting the element.
58
+ It will also ensure that focus remains in the dialog.
59
+
60
+ The `aria-labelledby` attribute will be set to the header element, if one exists.
61
+
62
+ @hero hero.svg
63
+ @demo demo/index.html
64
+ @polymerBehavior Polymer.PaperDialogBehavior
65
+ */
66
+
67
+ Polymer.PaperDialogBehaviorImpl = {
68
+
69
+ hostAttributes: {
70
+ 'role': 'dialog',
71
+ 'tabindex': '-1'
72
+ },
73
+
74
+ properties: {
75
+
76
+ /**
77
+ * If `modal` is true, this implies `no-cancel-on-outside-click` and `with-backdrop`.
78
+ */
79
+ modal: {
80
+ observer: '_modalChanged',
81
+ type: Boolean,
82
+ value: false
83
+ },
84
+
85
+ _lastFocusedElement: {
86
+ type: Node
87
+ },
88
+
89
+ _boundOnFocus: {
90
+ type: Function,
91
+ value: function() {
92
+ return this._onFocus.bind(this);
93
+ }
94
+ },
95
+
96
+ _boundOnBackdropClick: {
97
+ type: Function,
98
+ value: function() {
99
+ return this._onBackdropClick.bind(this);
100
+ }
101
+ }
102
+
103
+ },
104
+
105
+ listeners: {
106
+ 'click': '_onDialogClick',
107
+ 'iron-overlay-opened': '_onIronOverlayOpened',
108
+ 'iron-overlay-closed': '_onIronOverlayClosed'
109
+ },
110
+
111
+ attached: function() {
112
+ this._observer = this._observe(this);
113
+ this._updateAriaLabelledBy();
114
+ },
115
+
116
+ detached: function() {
117
+ if (this._observer) {
118
+ this._observer.disconnect();
119
+ }
120
+ },
121
+
122
+ _observe: function(node) {
123
+ var observer = new MutationObserver(function() {
124
+ this._updateAriaLabelledBy();
125
+ }.bind(this));
126
+ observer.observe(node, {
127
+ childList: true,
128
+ subtree: true
129
+ });
130
+ return observer;
131
+ },
132
+
133
+ _modalChanged: function() {
134
+ if (this.modal) {
135
+ this.setAttribute('aria-modal', 'true');
136
+ } else {
137
+ this.setAttribute('aria-modal', 'false');
138
+ }
139
+ // modal implies noCancelOnOutsideClick and withBackdrop if true, don't overwrite
140
+ // those properties otherwise.
141
+ if (this.modal) {
142
+ this.noCancelOnOutsideClick = true;
143
+ this.withBackdrop = true;
144
+ }
145
+ },
146
+
147
+ _updateAriaLabelledBy: function() {
148
+ var header = Polymer.dom(this).querySelector('h2');
149
+ if (!header) {
150
+ this.removeAttribute('aria-labelledby');
151
+ return;
152
+ }
153
+ var headerId = header.getAttribute('id');
154
+ if (headerId && this.getAttribute('aria-labelledby') === headerId) {
155
+ return;
156
+ }
157
+ // set aria-describedBy to the header element
158
+ var labelledById;
159
+ if (headerId) {
160
+ labelledById = headerId;
161
+ } else {
162
+ labelledById = 'paper-dialog-header-' + new Date().getUTCMilliseconds();
163
+ header.setAttribute('id', labelledById);
164
+ }
165
+ this.setAttribute('aria-labelledby', labelledById);
166
+ },
167
+
168
+ _updateClosingReasonConfirmed: function(confirmed) {
169
+ this.closingReason = this.closingReason || {};
170
+ this.closingReason.confirmed = confirmed;
171
+ },
172
+
173
+ _onDialogClick: function(event) {
174
+ var target = event.target;
175
+ while (target !== this) {
176
+ if (target.hasAttribute('dialog-dismiss')) {
177
+ this._updateClosingReasonConfirmed(false);
178
+ this.close();
179
+ break;
180
+ } else if (target.hasAttribute('dialog-confirm')) {
181
+ this._updateClosingReasonConfirmed(true);
182
+ this.close();
183
+ break;
184
+ }
185
+ target = target.parentNode;
186
+ }
187
+ },
188
+
189
+ _onIronOverlayOpened: function() {
190
+ if (this.modal) {
191
+ document.body.addEventListener('focus', this._boundOnFocus, true);
192
+ this.backdropElement.addEventListener('click', this._boundOnBackdropClick);
193
+ }
194
+ },
195
+
196
+ _onIronOverlayClosed: function() {
197
+ document.body.removeEventListener('focus', this._boundOnFocus, true);
198
+ this.backdropElement.removeEventListener('click', this._boundOnBackdropClick);
199
+ },
200
+
201
+ _onFocus: function(event) {
202
+ if (this.modal) {
203
+ var target = event.target;
204
+ while (target && target !== this && target !== document.body) {
205
+ target = target.parentNode;
206
+ }
207
+ if (target) {
208
+ if (target === document.body) {
209
+ if (this._lastFocusedElement) {
210
+ this._lastFocusedElement.focus();
211
+ } else {
212
+ this._focusNode.focus();
213
+ }
214
+ } else {
215
+ this._lastFocusedElement = event.target;
216
+ }
217
+ }
218
+ }
219
+ },
220
+
221
+ _onBackdropClick: function() {
222
+ if (this.modal) {
223
+ if (this._lastFocusedElement) {
224
+ this._lastFocusedElement.focus();
225
+ } else {
226
+ this._focusNode.focus();
227
+ }
228
+ }
229
+ }
230
+
231
+ };
232
+
233
+ /** @polymerBehavior */
234
+ Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialogBehaviorImpl];
235
+
236
+ </script>