diff --git a/components/dialog/index.cjsx b/components/dialog/index.cjsx index 4e7316cc..2f7ca58f 100644 --- a/components/dialog/index.cjsx +++ b/components/dialog/index.cjsx @@ -1,4 +1,4 @@ -require './style' +localCSS = require './style' Button = require '../button' Navigation = require '../navigation' @@ -14,17 +14,18 @@ module.exports = React.createClass getDefaultProps: -> actions : [] - className : "normal" + className : 'normal' getInitialState: -> active : @props.active # -- Render render: -> - className = @props.className - className += " active" if @state.active -
-
+ className = "#{localCSS.root} #{@props.className}" + className += " #{@props.type}" if @props.type + className += ' active' if @state.active +
+
{

{@props.title}

} {@props.children} { if @props.actions.length > 0} diff --git a/components/dialog/style.styl b/components/dialog/style.styl index 1e022715..305a5066 100644 --- a/components/dialog/style.styl +++ b/components/dialog/style.styl @@ -1,6 +1,24 @@ @import "../constants.styl" -[data-component-dialog] +:local(.container) + margin : SPACE + padding : SPACE (SPACE * 1.5) + background-color : WHITE + border-radius : (SPACE / 5) + box-shadow : ZDEPTH_SHADOW_5 + transition-property : opacity, transform + transition-duration : ANIMATION_DURATION + transition-timing-function : ANIMATION_EASE + transition-delay : ANIMATION_DELAY + > h1 + margin-bottom : SPACE + > nav + margin-top : SPACE + text-align : right + > .raised + margin-left : SPACE + +:local(.root) z-index : 3 position : fixed left : 0 @@ -8,44 +26,25 @@ width : 100vw height : 100vh background-color : rgba(0,0,0,0.5) - transition-property opacity - transition-duration (ANIMATION_DURATION / 2) - transition-timing-function ANIMATION_EASE - // -- Children - > div - margin : SPACE - padding : SPACE (SPACE * 1.5) - background-color : WHITE - border-radius : (SPACE / 5) - box-shadow ZDEPTH_SHADOW_5 - transition-property opacity, transform - transition-duration ANIMATION_DURATION - transition-timing-function ANIMATION_EASE - transition-delay ANIMATION_DELAY - > h1 - margin-bottom : SPACE - > nav - margin-top : SPACE - text-align : right - > *:not(.transparent) - margin-left : SPACE - - // -- Styles - &.small > div + transition-property : opacity + transition-duration : (ANIMATION_DURATION / 2) + transition-timing-function : ANIMATION_EASE + // -- Overrides + &.small > :local(.container) width : 33vw - &.normal > div + &.normal > :local(.container) width : 50vw - &.large > div + &.large > :local(.container) width : 96vw &:not(.active) pointer-events : none opacity : 0 - transition-delay (ANIMATION_DELAY * 2) - > div + transition-delay : (ANIMATION_DELAY * 2) + > :local(.container) opacity : 0 - transform translateY(-(UNIT)) + transform : translateY(-(UNIT)) &.active opacity : 1 - > div + > :local(.container) opacity : 1 - transform translateY(0%) + transform : translateY(0%)