diff --git a/src/components.js b/src/components.js index 77e25eefd5..34044bd9f1 100644 --- a/src/components.js +++ b/src/components.js @@ -1,3 +1,5 @@ +export * from 'ionic2/components/action-menu/action-menu' +export * from 'ionic2/components/alert/alert' export * from 'ionic2/components/aside/aside' export * from 'ionic2/components/checkbox/checkbox' export * from 'ionic2/components/content/content' diff --git a/src/components/action-menu/action-menu.js b/src/components/action-menu/action-menu.js index e69de29bb2..6f08f95c4c 100644 --- a/src/components/action-menu/action-menu.js +++ b/src/components/action-menu/action-menu.js @@ -0,0 +1,43 @@ +import {NgElement, Component, Template, Parent} from 'angular2/angular2' +import {ComponentConfig} from 'ionic2/config/component-config' + +export let ActionMenuConfig = new ComponentConfig('action-menu') + +@Component({ + selector: 'ion-action-menu', + services: [ActionMenuConfig] +}) +@Template({ + inline: ` +
+
+ +
+
Action Menu Label
+ + +
+ +
+
Action Menu Label
+ + +
+ +
+ +
+ +
` +}) +export class ActionMenu { + constructor( + configFactory: ActionMenuConfig, + @NgElement() ngElement:NgElement + ) { + this.domElement = ngElement.domElement + this.domElement.classList.add('pane') + this.domElement.classList.add('pane-overlay') + this.config = configFactory.create(this) + } +} diff --git a/src/components/action-menu/action-menu.scss b/src/components/action-menu/action-menu.scss index df39da3d55..96691386d7 100644 --- a/src/components/action-menu/action-menu.scss +++ b/src/components/action-menu/action-menu.scss @@ -2,7 +2,6 @@ // Action Menu // -------------------------------------------------- -$action-menu-group-margin: 15px !default; $action-menu-background-color: rgba(243,243,243,.95) !default; $action-menu-button-text-color: #007aff !default; @@ -15,21 +14,12 @@ $action-menu-button-text-color: #007aff !default; width: 100%; } -.action-menu-group { - margin: $action-menu-group-margin; -} - .action-menu-group .action-menu-label { display: block; width: 100%; - text-align: center; - background: $action-menu-background-color; } .action-menu-group .action-menu-button { display: block; width: 100%; - text-align: center; - background: $action-menu-background-color; - color: $action-menu-button-text-color; } diff --git a/src/components/action-menu/extensions/ios.scss b/src/components/action-menu/extensions/ios.scss new file mode 100644 index 0000000000..a300f5a262 --- /dev/null +++ b/src/components/action-menu/extensions/ios.scss @@ -0,0 +1,79 @@ + +// iOS Action Menu +// -------------------------------------------------- + +$action-menu-ios-group-margin: 8px !default; +$action-menu-ios-background-color: rgba(243,243,243,.95) !default; + +$action-menu-ios-border-color: #d2d2d6 !default; +$action-menu-ios-border-radius: 4px !default; + +$action-menu-ios-label-color: #8a8a8a !default; +$action-menu-ios-label-font-size: 1.3rem !default; + +$action-menu-ios-button-color: #007aff !default; +$action-menu-ios-button-font-size: 2rem !default; + + +.action-menu-ios { + text-align: center; + + .action-menu-group { + margin: $action-menu-ios-group-margin; + } + + .action-menu-label, + .action-menu-button { + position: relative; + @include flex-display(); + @include flex-justify-content(center); + @include flex-align-items(center); + + border: 0; + min-height: 44px; + + background: $action-menu-ios-background-color; + font-weight: 400; + + &:after { + position: absolute; + top: auto; + right: auto; + bottom: 0; + left: 0; + z-index: $z-index-list-border; + display: block; + + width: 100%; + height: 1px; + @include transform-origin(50%, 0); + + background-color: $action-menu-ios-border-color; + + content: ''; + } + } + + .action-menu-label { + font-size: $action-menu-ios-label-font-size; + color: $action-menu-ios-label-color; + } + + .action-menu-button { + font-size: $action-menu-ios-button-font-size; + color: $action-menu-ios-button-color; + } + + .action-menu-label:first-child, + .action-menu-button:first-child { + border-top-left-radius: $action-menu-ios-border-radius; + border-top-right-radius: $action-menu-ios-border-radius; + } + + .action-menu-label:last-child, + .action-menu-button:last-child { + border-bottom-left-radius: $action-menu-ios-border-radius; + border-bottom-right-radius: $action-menu-ios-border-radius; + } + +} diff --git a/src/components/action-menu/test/basic/main.html b/src/components/action-menu/test/basic/main.html index b8ed156c81..c225943164 100644 --- a/src/components/action-menu/test/basic/main.html +++ b/src/components/action-menu/test/basic/main.html @@ -1,26 +1,4 @@ -
+ -
- -
- -
-
Action Menu Label
-
Button 1
-
Button 2
-
- -
-
Action Menu Label
-
Button 1
-
Button 2
-
- -
-
Button 1
-
- -
- -
+ diff --git a/src/components/action-menu/test/basic/main.js b/src/components/action-menu/test/basic/main.js index d0bbf22754..c0bac17c9c 100644 --- a/src/components/action-menu/test/basic/main.js +++ b/src/components/action-menu/test/basic/main.js @@ -1,12 +1,12 @@ import {bootstrap} from 'angular2/core'; import {Component, Template} from 'angular2/angular2'; -import {View} from 'ionic2/components/view/view'; -import {Content} from 'ionic2/components/content/content'; +import {ActionMenu} from 'ionic2/components/action-menu/action-menu'; + @Component({ selector: '[ion-app]' }) @Template({ url: 'main.html', - directives: [View, Content] + directives: [ActionMenu] }) class IonicApp { constructor() { diff --git a/src/components/alert/alert.js b/src/components/alert/alert.js index e69de29bb2..daa1cc1c72 100644 --- a/src/components/alert/alert.js +++ b/src/components/alert/alert.js @@ -0,0 +1,35 @@ +import {NgElement, Component, Template, Parent} from 'angular2/angular2' +import {ComponentConfig} from 'ionic2/config/component-config' + +export let AlertConfig = new ComponentConfig('alert') + +@Component({ + selector: 'ion-alert', + services: [AlertConfig] +}) +@Template({ + inline: ` +
+
+ +
+ Do you like cookies? +
+ +
+ +
+ +
` +}) +export class Alert { + constructor( + configFactory: AlertConfig, + @NgElement() ngElement:NgElement + ) { + this.domElement = ngElement.domElement + this.domElement.classList.add('pane') + this.domElement.classList.add('pane-overlay') + this.config = configFactory.create(this) + } +} diff --git a/src/components/alert/alert.scss b/src/components/alert/alert.scss index d3774427ac..772f1b180b 100644 --- a/src/components/alert/alert.scss +++ b/src/components/alert/alert.scss @@ -2,33 +2,20 @@ // Alert // -------------------------------------------------- -$alert-width: 270px !default; -$alert-min-height: 100px !default; -$alert-padding: 15px !default; -$alert-background-color: #fff !default; - -.pane > .pane-container.alert-container { +.alert-container { position: absolute; z-index: $z-index-alert; display: block; - top: 40%; + top: 35%; left: 50%; - width: $alert-width; - margin-left: -$alert-width / 2; - - background: $alert-background-color; } -.alert-content { - margin: 0; - padding: $alert-padding; - min-height: $alert-min-height; -} - -.alert-action { +.alert-buttons { @include flex-display(); + @include flex-justify-content(center); + overflow: hidden; .button { @include flex-display(); diff --git a/src/components/alert/extensions/ios.scss b/src/components/alert/extensions/ios.scss new file mode 100644 index 0000000000..0a1aa1290a --- /dev/null +++ b/src/components/alert/extensions/ios.scss @@ -0,0 +1,63 @@ + +// Alert +// -------------------------------------------------- + +$alert-ios-width: 270px !default; +$alert-ios-min-height: 100px !default; +$alert-ios-padding: 15px !default; +$alert-ios-background-color: #e8e8e8 !default; +$alert-ios-border-radius: 15px !default; +$alert-ios-button-color: #007aff !default; +$alert-ios-button-font-size: 2rem !default; + + +.alert-ios { + + .alert-container { + width: $alert-ios-width; + margin-left: -$alert-ios-width / 2; + } + + .alert-content { + position: relative; + padding: $alert-ios-padding; + min-height: $alert-ios-min-height; + border-top-left-radius: $alert-ios-border-radius; + border-top-right-radius: $alert-ios-border-radius; + background: $alert-ios-background-color; + + &:after { + position: absolute; + top: auto; + right: auto; + bottom: 0; + left: 0; + z-index: $z-index-list-border; + display: block; + + width: 100%; + height: 1px; + @include transform-origin(50%, 0); + + background-color: #b5b5b5; + + content: ''; + } + } + + .alert-buttons { + min-height: 44px; + background: $alert-ios-background-color; + border-bottom-left-radius: $alert-ios-border-radius; + border-bottom-right-radius: $alert-ios-border-radius; + + .button { + border: 0; + background: transparent; + font-size: $alert-ios-button-font-size; + font-weight: 400; + color: $alert-ios-button-color; + } + } + +} diff --git a/src/components/alert/test/basic/main.html b/src/components/alert/test/basic/main.html index 2ca793ee89..b7ec13fdde 100644 --- a/src/components/alert/test/basic/main.html +++ b/src/components/alert/test/basic/main.html @@ -1,19 +1,4 @@ -
+ -
- -
- -
-
Do you like cookies?
-
- -
- - -
- -
- -
+ diff --git a/src/components/alert/test/basic/main.js b/src/components/alert/test/basic/main.js index d0bbf22754..430942b137 100644 --- a/src/components/alert/test/basic/main.js +++ b/src/components/alert/test/basic/main.js @@ -1,12 +1,12 @@ import {bootstrap} from 'angular2/core'; import {Component, Template} from 'angular2/angular2'; -import {View} from 'ionic2/components/view/view'; -import {Content} from 'ionic2/components/content/content'; +import {Alert} from 'ionic2/components/alert/alert'; + @Component({ selector: '[ion-app]' }) @Template({ url: 'main.html', - directives: [View, Content] + directives: [Alert] }) class IonicApp { constructor() { diff --git a/src/components/app/ionic.scss b/src/components/app/ionic.scss index 235db51812..bce4c31c2f 100644 --- a/src/components/app/ionic.scss +++ b/src/components/app/ionic.scss @@ -50,6 +50,8 @@ // iOS Components @import + "../action-menu/extensions/ios", + "../alert/extensions/ios", "../card/extensions/ios", "../checkbox/extensions/ios", "../content/extensions/ios", diff --git a/src/components/tabs/test/basic/main.js b/src/components/tabs/test/basic/main.js index 92e9530d16..337d466152 100644 --- a/src/components/tabs/test/basic/main.js +++ b/src/components/tabs/test/basic/main.js @@ -1,6 +1,7 @@ import {bootstrap} from 'angular2/core'; import {Component, Template} from 'angular2/angular2'; -import {View, Tabs} from 'ionic2/components'; +import {View} from 'ionic2/components/view/view'; +import {Tabs} from 'ionic2/components/tabs/tabs'; @Component({ selector: '[ion-app]' })