summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/notification_card.html
blob: 641766b19229cf36fec2d6e79b3de87e5f3b36bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
     Use of this source code is governed by a BSD-style license that can be
     found in the LICENSE file. -->

<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">

<!--
  A simple notification card with a button, link (optional) and icon (optional).
  Example:
    <notification-card button-label="OK" link-label="What?" type="success">
      Great success!
    </notification-card>

  Atributes:
   'button-label' - label displayed on the button. If empty or not set, the
                   button is hidden.
   'link-label' - text of the link. If empty or not set, the link is hidden.
   'type' - icon type. Can be either 'success' or 'fail'. If not set, no icon
            is displayed.

  Events:
    'buttonclick' - fired on button click.
    'linkclick' - fired on link click.

-->
<dom-module name="notification-card">
  <link rel="stylesheet" href="notification_card.css">

  <template>
    <div id="container" class="vertical layout center fit">
      <div class="flex vertical layout center center-justified">
        <template is="dom-if" if="[[type]]">
          <div id="icon-container" class="vertical layout center">
            <iron-icon icon$="[[iconNameByType_(type)]]">
            </iron-icon>
          </div>
        </template>
        <div id="text-container">
          <content></content>
        </div>
      </div>
      <div class="self-stretch horizontal-reverse layout justified center">
        <gaia-button id="submitButton" on-tap="buttonClicked_"
            hidden$="[[!buttonLabel]]">
          <span>[[buttonLabel]]</span>
        </gaia-button>
        <a href="#" on-click="linkClicked_" hidden$="{{!linkLabel}}">
          <span>[[linkLabel]]</span>
        </a>
      </div>
    </div>
  </template>
</dom-module>