diff --git a/lib/shared/components/Zippy/zippy.html b/lib/shared/components/Zippy/zippy.html index d0bc8c09..5ba42121 100644 --- a/lib/shared/components/Zippy/zippy.html +++ b/lib/shared/components/Zippy/zippy.html @@ -1,11 +1,13 @@ -
-
- {{ visible ? '▾' : '▸' }} +
+
+ + + + + {{title}}
-
-
- -
+
+
diff --git a/lib/shared/components/Zippy/zippy.scss b/lib/shared/components/Zippy/zippy.scss index 05087ed3..ac767131 100644 --- a/lib/shared/components/Zippy/zippy.scss +++ b/lib/shared/components/Zippy/zippy.scss @@ -38,19 +38,42 @@ $zippy-redirect-bg-color: rgba($zippy-redirect-color, .08); background-color: $zippy-info-bg-color; } } +.zippy-indicator svg { + height: 1.2em; + vertical-align: middle; + transition: all 0.3s ease; + transform: rotateZ(-180deg); +} + +.zippy-hidden > .zippy-title svg { + transform: rotateZ(0); +} + +.zippy-title polygon { + .zippy-success > & { + fill: $zippy-success-color; + } + .zippy-error > & { + fill: $zippy-error-color; + } + + .zippy-redirect > & { + fill: $zippy-redirect-color; + } + + .zippy-info > & { + fill: $zippy-info-color; + } +} span.zippy-indicator { + width: 1em; font-size: 1.2em; - margin-right: 0.2em; - position: relative; - top: 0; + text-align: center; + display: inline-block; } .zippy-content { - overflow: hidden; -} - -.zippy-content-wrap { padding: 15px 0; } @@ -60,7 +83,13 @@ span.zippy-indicator { } .zippy-indicator { - display: none; + svg { + display: none; + } + &:before { + content: "—"; + font-weight: bold; + } } .zippy-content { @@ -68,7 +97,7 @@ span.zippy-indicator { } } -.zippy-hidden { +.zippy-hidden > .zippy-content { overflow: hidden; visibility: hidden; height: 0; diff --git a/lib/shared/components/Zippy/zippy.ts b/lib/shared/components/Zippy/zippy.ts index 7ffa180b..43102f32 100644 --- a/lib/shared/components/Zippy/zippy.ts +++ b/lib/shared/components/Zippy/zippy.ts @@ -1,31 +1,20 @@ 'use strict'; -import { Component, EventEmitter, Output, Input, - trigger, state, animate, transition, style } from '@angular/core'; +import { Component, EventEmitter, Output, Input } from '@angular/core'; import { CORE_DIRECTIVES } from '@angular/common'; @Component({ selector: 'zippy', templateUrl: './zippy.html', styleUrls: ['./zippy.css'], - directives: [CORE_DIRECTIVES], - animations: [ - trigger('openClose', [ - state('collapsed, void', - style({ height: '0px' })), - state('expanded', - style({ height: '*' })), - transition('collapsed <=> expanded', [ - animate(200) - ]) - ]) - ], + directives: [CORE_DIRECTIVES] }) export class Zippy { @Input() type = 'general'; @Input() visible = false; @Input() empty = false; @Input() title; + @Input() headless: boolean = false; @Output() open = new EventEmitter(); @Output() close = new EventEmitter(); toggle() {