curo-material-interface 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b794f9b95baa005bc18e6ab27e57663955d9e74
4
- data.tar.gz: 55f703a12dffe299d571ac75dd2501cd5fbb720b
3
+ metadata.gz: e007150e2826e86bbe0dc6e4b7b369598e6bc236
4
+ data.tar.gz: 3c3d7db47aa54c482c7fceed924c5f95ca8d3857
5
5
  SHA512:
6
- metadata.gz: 2e1b622dad79390f61bb9310c9b703f7dc17ee7194fc4896263942b872daaa62682629156375c7c1a5387f574e109a99e644de2ae3a4cd7cca553e5f71f3231b
7
- data.tar.gz: 6a1afd21c5b559707967f0e93d46278526e0a31f7ab13e2ec06cc6b1a3a0bd7120dfa883e14478f8ad9f23e78dd17ba36303c88e70fa77f08278abd1008abd79
6
+ metadata.gz: d6a59cdb1b433c91b4a3cee64f45841599fa7e16f0c5bd71e0ca1f26ee70dab89a687f44efd90562b745c4fd7f8116d27be71c27b0f7c5d13b97facd23d75e23
7
+ data.tar.gz: d94d6b3c128f773ef2e02e5eef29b2a5766d0700b25eb1261100716fc159cbe4121e0e647e1c5d959b7a2d1b4375dbf9c9b7b0c460b557f9e888e9b83c4f0c60
data/README.md CHANGED
@@ -1,5 +1,118 @@
1
+ http://wonderweblabs.github.io/curo-material-interface/
1
2
 
3
+ Curo Material Interface is an extraction of the wonderweblabs Curo CMS which is used in the client projects (https://curocms.com - soon available). Since we want to reuse the design patterns in other projects, we'll continuously move those implementation in this repo.
2
4
 
3
- # Middleman
5
+ Most parts of the implementation are loosely based on the Google Material Design concept (http://www.google.com/design/spec/material-design/introduction.html). Feel free to fork this repo and continue your own interpretation of the google material design concept.
4
6
 
5
- ln -s [path/to/cmi]/lib/assets [path/to/cmi]/gh-pages-middleman/source/
7
+ As icon set we use google material design icons (https://github.com/google/material-design-icons).
8
+
9
+ ## Installation
10
+
11
+ ### Middleman & Rails
12
+
13
+ ```ruby
14
+ gem 'curo-material-interface'
15
+ ```
16
+
17
+ ### Include styles
18
+
19
+ We decided to keep things as open as possible - not like other libraries that include many files by default. Instead, you need to care about the inclusion on your own:
20
+
21
+ ```sass
22
+ @import cmi/libs
23
+
24
+ // !!! Important
25
+ // To use curo material interface fonts and icons,
26
+ // you need to provide the font-face loading mixin.
27
+ @import ./font_mixin
28
+
29
+ // config
30
+ @import cmi/colors
31
+ @import cmi/variables
32
+ @import cmi/mixins
33
+ @import cmi/extensions
34
+
35
+ // basic curo material interface files
36
+ @import cmi/reset
37
+ @import cmi/global
38
+
39
+ // fonts / typo
40
+ @import cmi/roboto
41
+ @import cmi/icons
42
+ @import cmi/typography
43
+
44
+ // components
45
+ @import cmi/components/navbar
46
+ @import cmi/components/buttons
47
+ @import cmi/components/flex-modal
48
+ @import cmi/components/loading-indicator
49
+ @import cmi/components/ripples
50
+ @import cmi/components/tabs
51
+ @import cmi/form_components/text_field
52
+ @import cmi/form_components/checkbox
53
+ ```
54
+
55
+ At "@import ./font_mixin" you need to implement the right font font-face call for middleman or rails for your application:
56
+
57
+ **Rails**
58
+
59
+ ```sass
60
+ @font-face
61
+ font-family: "Material-Design-Icons"
62
+ src: asset-url("mdi/Material-Design-Icons.eot?-g7cqhn")
63
+ src: asset-url("mdi/Material-Design-Icons.eot?#iefix-g7cqhn") format("embedded-opentype"), asset-url("mdi/Material-Design-Icons.woff?-g7cqhn") format("woff"), asset-url("mdi/Material-Design-Icons.ttf?-g7cqhn") format("truetype"), asset-url("mdi/Material-Design-Icons.svg?-g7cqhn#Material-Design-Icons") format("svg")
64
+ font-weight: normal
65
+ font-style: normal
66
+
67
+ =font-face-helper($family, $fileBaseName, $weight, $style)
68
+ @font-face
69
+ font-family: $family
70
+ src: asset-url($fileBaseName + '.eot')
71
+ src: asset-url($fileBaseName + '.eot?#iefix') format('embedded-opentype'), asset-url($fileBaseName + '.woff') format('woff'), asset-url($fileBaseName + '.ttf') format('truetype'), asset-url($fileBaseName + '.svg#robotothin') format('svg')
72
+ font-weight: $weight
73
+ font-style: $style
74
+ ```
75
+
76
+
77
+ **Middleman**
78
+
79
+ ```sass
80
+ @font-face
81
+ font-family: "Material-Design-Icons"
82
+ src: font-url("mdi/Material-Design-Icons.eot?-g7cqhn")
83
+ src: font-url("mdi/Material-Design-Icons.eot?#iefix-g7cqhn") format("embedded-opentype"), font-url("mdi/Material-Design-Icons.woff?-g7cqhn") format("woff"), font-url("mdi/Material-Design-Icons.ttf?-g7cqhn") format("truetype"), font-url("mdi/Material-Design-Icons.svg?-g7cqhn#Material-Design-Icons") format("svg")
84
+ font-weight: normal
85
+ font-style: normal
86
+
87
+ =font-face-helper($family, $fileBaseName, $weight, $style)
88
+ @font-face
89
+ font-family: $family
90
+ src: font-path($fileBaseName + '.eot')
91
+ src: font-path($fileBaseName + '.eot?#iefix') format('embedded-opentype'), font-path($fileBaseName + '.woff') format('woff'), font-path($fileBaseName + '.ttf') format('truetype'), font-path($fileBaseName + '.svg#robotothin') format('svg')
92
+ font-weight: $weight
93
+ font-style: $style
94
+ ```
95
+
96
+ ### Usage
97
+
98
+ CMI is completely scoped - meaning that the classes won't work unless you add a container with ```class="cmi"``` somewhere around your implementation. We need that behavior for our cms.
99
+
100
+ ```haml
101
+ %body
102
+ // won't work:
103
+ %a.cmi-btn
104
+ My Button
105
+
106
+ // works:
107
+ .cmi
108
+ %a.cmi-btn
109
+ My Button
110
+ ```
111
+
112
+ The easiest way is to assign cmi class to the body tag, if scoping of the implementation is not important for you:
113
+
114
+ ```haml
115
+ %body.cmi
116
+ %a.cmi-btn
117
+ My Button
118
+ ```
@@ -0,0 +1,24 @@
1
+ window.CMI or= {}
2
+
3
+ #
4
+ # Will triggers method "onCumaCheckboxClick: (targetLabel)" on
5
+ # the view if method is defined.
6
+ #
7
+ class CMI.FormCheckboxBehavior extends Marionette.Behavior
8
+
9
+ ui:
10
+ checkboxLabels: '.cmi-checkbox-container label'
11
+
12
+ events:
13
+ 'click @ui.checkboxLabels': 'onLabelClick'
14
+
15
+ onRender: ->
16
+ @ui.checkboxLabels.each ->
17
+ CMI.FormComponents.Checkbox.reset($(this))
18
+
19
+ onLabelClick: (event) ->
20
+ event.preventDefault()
21
+ target = $(event.currentTarget)
22
+ CMI.FormComponents.Checkbox.click(target)
23
+
24
+ @view.triggerMethod('cmi:checkbox:click', target)
@@ -0,0 +1,30 @@
1
+ window.CMI or= {}
2
+
3
+ class CMI.FormTextFieldBehavior extends Marionette.Behavior
4
+
5
+ @inputSelectors: ->
6
+ '.cmi-text-input input,
7
+ .cmi-text-input textarea'
8
+
9
+ ui:
10
+ inputs: "#{@inputSelectors()}"
11
+
12
+ events:
13
+ 'change @ui.inputs': 'onInputChange'
14
+ 'focus @ui.inputs': 'onInputFocus'
15
+ 'blur @ui.inputs': 'onInputBlur'
16
+
17
+ onRender: ->
18
+ if @ui.inputs? == true && @ui.inputs.length > 0
19
+ @ui.inputs.each ->
20
+ CMI.FormComponents.TextField.reset($(this))
21
+
22
+ onInputChange: (event) ->
23
+ CMI.FormComponents.TextField.animateChange($(event.currentTarget))
24
+
25
+ onInputFocus: (event) ->
26
+ CMI.FormComponents.TextField.animateFocus($(event.currentTarget))
27
+
28
+ onInputBlur: (event) ->
29
+ CMI.FormComponents.TextField.animateBlur($(event.currentTarget))
30
+
@@ -0,0 +1,40 @@
1
+ window.CMI or= {}
2
+
3
+ class CMI.FormTextareaBehavior extends Marionette.Behavior
4
+
5
+ behaviors:
6
+ CMITextFields:
7
+ behaviorClass: CMI.FormTextFieldBehavior
8
+
9
+ ui:
10
+ textareas: '.cmi-text-input textarea'
11
+
12
+ events:
13
+ 'keyup @ui.textareas': 'onKeyUp'
14
+ 'keydown @ui.textareas': 'onKeyDown'
15
+
16
+ onRender: ->
17
+ reference = @.$el
18
+
19
+ @ui.textareas.each ->
20
+ CMI.FormComponents.Textarea.animateHeight reference, $(this)
21
+
22
+ onKeyUp: (event) ->
23
+ target = $(event.currentTarget)
24
+ CMI.FormComponents.Textarea.animateHeight @.$el, target
25
+
26
+ onKeyDown: (event) ->
27
+ target = $(event.currentTarget)
28
+ CMI.FormComponents.Textarea.animateHeight @.$el, target
29
+
30
+
31
+ #
32
+ # If you outside implementation works with hiding elements that
33
+ # contain textareas, the textareas won't be resized after showing
34
+ # those elements since the calculation fails.
35
+ #
36
+ # To fix this, call triggerMethod('cmi:textarea:refresh') on
37
+ # the view implementing the textarea behavior to resize correctly.
38
+ #
39
+ onCmiTextareaRefresh: ->
40
+ @onRender()
@@ -0,0 +1,12 @@
1
+ window.CMI or= {}
2
+
3
+ class CMI.RipplesBehavior extends Marionette.Behavior
4
+
5
+ ui:
6
+ rippleButton: '.cmi-ripples'
7
+
8
+ events:
9
+ 'click @ui.rippleButton': 'onRipplesClick'
10
+
11
+ onRipplesClick: (event) ->
12
+ CMI.Ripples.animate($(event.currentTarget), event.pageX, event.pageY)
@@ -0,0 +1,34 @@
1
+ window.CMI or= {}
2
+
3
+ #
4
+ # Will triggers method "onCmiTabsClick: (target)" on
5
+ # the view if method is defined.
6
+ #
7
+ # Attention: It does not automatically mean, there is a
8
+ # new tab visible. It just triggers on navbar
9
+ # tab click.
10
+ #
11
+ class CMI.TabsBehavior extends Marionette.Behavior
12
+
13
+ ui:
14
+ tabs: '.cmi-tabs > li > a'
15
+ tabActive: '.cmi-tabs > li.cmi-active > a'
16
+
17
+ events:
18
+ 'click @ui.tabs': 'onTabClick'
19
+
20
+ onRender: ->
21
+ @activate(@ui.tabActive)
22
+
23
+ onShow: ->
24
+ @activate(@ui.tabActive)
25
+
26
+ onTabClick: (event, b) ->
27
+ event.preventDefault()
28
+ target = $(event.currentTarget)
29
+
30
+ @activate(target)
31
+ @view.triggerMethod 'cmi:tabs:click', target
32
+
33
+ activate: (domElement) ->
34
+ CMI.Tabs.activate(domElement)
@@ -0,0 +1,36 @@
1
+ window.CMI or= {}
2
+ window.CMI.FormComponents or= {}
3
+
4
+ class CMI.FormComponents.Checkbox
5
+
6
+ @reset: (domElement) ->
7
+ checkbox = $('input[type="checkbox"]', domElement)
8
+ @_animate(domElement, checkbox.prop('checked'))
9
+
10
+ @click: (domElement) ->
11
+ checkbox = $('input[type="checkbox"]', domElement)
12
+ checkbox.prop('checked', !checkbox.prop('checked'))
13
+ @_ripples(domElement)
14
+ @_animate(domElement, checkbox.prop('checked'))
15
+
16
+
17
+ # ---------------------------------------------
18
+ # private
19
+
20
+ @_animate: (domElement, checked) ->
21
+ parent = domElement if domElement.hasClass('.cmi-checkbox')
22
+ parent or= domElement.parents('.cmi-checkbox-container')
23
+
24
+ if checked == true
25
+ parent.addClass('cmi-active')
26
+ else
27
+ parent.removeClass('cmi-active')
28
+
29
+ @_ripples: (domElement) ->
30
+ parent = domElement if domElement.hasClass('.cmi-checkbox')
31
+ parent or= domElement.parents('.cmi-checkbox-container')
32
+
33
+ animation = parent.find('.cmi-animation')
34
+ x = animation.offset().left + animation.outerWidth() / 2
35
+ y = animation.offset().top + animation.outerHeight() / 2
36
+ CMI.Ripples.animate(animation, x, y)
@@ -0,0 +1,49 @@
1
+ window.CMI or= {}
2
+ window.CMI.FormComponents or= {}
3
+
4
+ class CMI.FormComponents.TextField
5
+
6
+ @reset: (domElement) ->
7
+ if domElement.val().length > 0
8
+ domElement.parents(@_getInputBoxSelector()).addClass('cmi-active')
9
+ else
10
+ domElement.parents(@_getInputBoxSelector()).removeClass('cmi-active')
11
+
12
+ @animateChange: (domElement) ->
13
+ domElement.parents(@_getInputBoxSelector()).addClass('cmi-active') if domElement.val().length != 0
14
+ @validate_field(domElement, domElement.parents(@_getInputBoxSelector()))
15
+
16
+ @animateFocus: (domElement) ->
17
+ domElement.parents(@_getInputBoxSelector()).addClass('cmi-active')
18
+
19
+ @animateBlur: (domElement) ->
20
+ domElement.parents(@_getInputBoxSelector()).removeClass('cmi-active') if domElement.val().length == 0
21
+ @validate_field(domElement, domElement.parents(@_getInputBoxSelector()))
22
+
23
+ @formReset: (domFormElement) ->
24
+ domElement.parents(@_getInputBoxSelector()).removeClass('cmi-valid').removeClass('cmi-invalid')
25
+
26
+ domFormElement.find('select.cmi-initialized').each ->
27
+ reset_text = domFormElement.find('option[selected]').text()
28
+ domFormElement.siblings('input.cmi-select-dropdown').val(reset_text)
29
+
30
+
31
+ # ---------------------------------------------
32
+ # helper
33
+
34
+ @validate_field: (domElement, parentDomElement) ->
35
+ if domElement.val().length == 0
36
+ if parentDomElement.hasClass('cmi-validate')
37
+ parentDomElement.removeClass('cmi-valid')
38
+ parentDomElement.removeClass('cmi-invalid')
39
+ else if parentDomElement.hasClass('cmi-validate')
40
+ if domElement.is(':valid')
41
+ parentDomElement.removeClass('invalid')
42
+ parentDomElement.addClass('cmi-valid')
43
+ else
44
+ parentDomElement.removeClass('cmi-valid')
45
+ parentDomElement.addClass('cmi-invalid')
46
+
47
+ @_getInputBoxSelector: ->
48
+ '.cmi-text-input'
49
+
@@ -0,0 +1,21 @@
1
+ window.CMI or= {}
2
+ window.CMI.FormComponents or= {}
3
+
4
+ class CMI.FormComponents.Textarea
5
+
6
+ @animateHeight: (entryPoint, domElement) ->
7
+ # add reference
8
+ entryPoint.append('<div class="cmi-hidden-textarea-reference"></div>')
9
+
10
+ # set reference values
11
+ reference = $('.cmi-hidden-textarea-reference', entryPoint)
12
+ reference.css('width', domElement.width())
13
+ reference.html(domElement.val().replace(/\n/g, '<br/>'))
14
+
15
+ # set new height
16
+ domElement.css('height', reference.height())
17
+
18
+ # clear hidden
19
+ reference.remove()
20
+
21
+
@@ -0,0 +1,67 @@
1
+ window.CMI or= {}
2
+
3
+ class CMI.LoadingIndicator extends Backbone.View
4
+
5
+ className: 'cmi-loading-indicator'
6
+
7
+ initialize: (options = {}) ->
8
+ @_options = _.extend(@_defaultOptions(), options)
9
+ @render()
10
+
11
+ render: ->
12
+ @.$el.html(@_getInnerHtml())
13
+
14
+ if @_options.background == 'dark'
15
+ @.$el.addClass('cmi-loading-indicator-background-dark')
16
+ else if @_options.background == 'light'
17
+ @.$el.addClass('cmi-loading-indicator-background-light')
18
+ else if @_options.background? == true && @_options.background.length > 0
19
+ @.$el.addClass(@_options.background)
20
+
21
+ @
22
+
23
+ domElement: ->
24
+ @.$el
25
+
26
+ fadeIn: ->
27
+ @_attach() if @_isAttached() == false
28
+ @.$el.addClass('cmi-loading-fade')
29
+ @
30
+
31
+ fadeOut: ->
32
+ @.$el.removeClass('cmi-loading-fade')
33
+ _.delay($.proxy(@, '_detach'), 300) if @_options.detachAfterFadeOut
34
+ @
35
+
36
+
37
+
38
+ # ---------------------------------------------
39
+ # private methods
40
+
41
+ _getInnerHtml: ->
42
+ $('<div class="cmi-loading-indicator-inside">
43
+ <svg class="circular">
44
+ <circle class="path" cx="50" cy="50" fill="none" r="20" stroke-miterlimit="10" stroke-width="3"></circle>
45
+ </svg>
46
+ </div>')
47
+
48
+ _detach: ->
49
+ @.$el.detach()
50
+ @_attached = false
51
+
52
+ _attach: ->
53
+ return if @_options.parent? == false
54
+ @_options.parent.append(@.$el)
55
+ @_attached = true
56
+
57
+ _isAttached: ->
58
+ @_attached or= false
59
+
60
+ _defaultOptions: ->
61
+ {
62
+ background: null
63
+ parent: null
64
+ detachAfterFadeOut: true
65
+ }
66
+
67
+
@@ -0,0 +1,25 @@
1
+ window.CMI or= {}
2
+
3
+ class CMI.Ripples
4
+
5
+ @animateClick: (domElement, event) ->
6
+ @animate(domElement, event.pageX, event.pageY)
7
+
8
+ @animate: (domElement, x, y) ->
9
+ # create ink element if doesn't exist
10
+ domElement.prepend('<span class="cmi-ink"></span>') if domElement.find('.cmi-ink').length == 0
11
+ ink = domElement.find('.cmi-ink')
12
+
13
+ # stop previous animation
14
+ ink.removeClass('cmi-animate')
15
+
16
+ # set size of .ink
17
+ if !ink.height() && !ink.width()
18
+ d = Math.max(domElement.outerWidth(), domElement.outerHeight())
19
+ ink.css({ width: d, height: d })
20
+
21
+ # position .ink
22
+ x = x - domElement.offset().left - ink.width()/2
23
+ y = y - domElement.offset().top - ink.height()/2
24
+ ink.css({ top: "#{y}px", left: "#{x}px" })
25
+ ink.addClass('cmi-animate')
@@ -0,0 +1,46 @@
1
+ window.CMI or= {}
2
+
3
+ class CMI.Tabs
4
+
5
+ @activate: (domElement) ->
6
+ domElement = $(domElement) unless domElement instanceof jQuery
7
+ return if domElement? == false || domElement.length <= 0
8
+
9
+ # load tabs
10
+ tabs = domElement.parents('.cmi-tabs')
11
+ @_ensureActiveIndicator(tabs)
12
+ indicator = tabs.find('.cmi-tabs-active-indicator')
13
+
14
+ # new position
15
+ position = domElement.offsetParent().position()
16
+ left = position.left
17
+ right = tabs.innerWidth() - left - domElement.outerWidth()
18
+
19
+ # moving direction
20
+ indicator.removeClass('cmi-tabs-animate-right').removeClass('cmi-tabs-animate-left')
21
+ if left < indicator.position().left
22
+ indicator.addClass('cmi-tabs-animate-left')
23
+ else
24
+ indicator.addClass('cmi-tabs-animate-right')
25
+
26
+ # animate indicator
27
+ indicator.css({ left: "#{left}px", right: "#{right}px" })
28
+
29
+ # set link active
30
+ tabs.find('li').removeClass('cmi-tabs-active')
31
+ domElement.parents('li').addClass('cmi-tabs-active')
32
+
33
+ # switch tab
34
+ tabsContainer = $(tabs.data('cmi-tabs-container'))
35
+ element = document.getElementById(domElement.attr('href').replace('#', ''))
36
+ if element? == true && element.className.indexOf('cmi-tabs-active') < 0
37
+ tabsContainer.find('.cmi-tabs-tab').removeClass('cmi-tabs-active')
38
+ element.className += ' cmi-tabs-active'
39
+
40
+
41
+ # ---------------------------------------------
42
+ # private
43
+
44
+ @_ensureActiveIndicator: (tabsElement) ->
45
+ return if tabsElement.find('.cmi-tabs-active-indicator').length > 0
46
+ tabsElement.append('<li class="cmi-tabs-active-indicator"></li>')
@@ -1,9 +1,10 @@
1
- @font-face
2
- font-family: "Material-Design-Icons"
3
- src: asset-url("mdi/Material-Design-Icons.eot?-g7cqhn")
4
- src: asset-url("mdi/Material-Design-Icons.eot?#iefix-g7cqhn") format("embedded-opentype"), asset-url("mdi/Material-Design-Icons.woff?-g7cqhn") format("woff"), asset-url("mdi/Material-Design-Icons.ttf?-g7cqhn") format("truetype"), asset-url("mdi/Material-Design-Icons.svg?-g7cqhn#Material-Design-Icons") format("svg")
5
- font-weight: normal
6
- font-style: normal
1
+
2
+ // @font-face
3
+ // font-family: "Material-Design-Icons"
4
+ // src: font-url("mdi/Material-Design-Icons.eot?-g7cqhn")
5
+ // src: font-url("mdi/Material-Design-Icons.eot?#iefix-g7cqhn") format("embedded-opentype"), font-url("mdi/Material-Design-Icons.woff?-g7cqhn") format("woff"), font-url("mdi/Material-Design-Icons.ttf?-g7cqhn") format("truetype"), font-url("mdi/Material-Design-Icons.svg?-g7cqhn#Material-Design-Icons") format("svg")
6
+ // font-weight: normal
7
+ // font-style: normal
7
8
 
8
9
  [class^="mdi-"], [class*=" mdi-"]
9
10
  font-family: "Material-Design-Icons"
@@ -1,21 +1,21 @@
1
1
  // roboto
2
- +font-face-helper('Roboto', 'roboto/Roboto-Thin-webfont', 100, normal)
3
- +font-face-helper('Roboto', 'roboto/Roboto-ThinItalic-webfont', 100, italic)
4
- +font-face-helper('Roboto', 'roboto/Roboto-Light-webfont', 200, normal)
5
- +font-face-helper('Roboto', 'roboto/Roboto-LightItalic-webfont', 200, italic)
6
- +font-face-helper('Roboto', 'roboto/Roboto-Regular-webfont', 400, normal)
7
- +font-face-helper('Roboto', 'roboto/Roboto-Italic-webfont', 400, italic)
8
- +font-face-helper('Roboto', 'roboto/Roboto-Medium-webfont', 500, normal)
9
- +font-face-helper('Roboto', 'roboto/Roboto-MediumItalic-webfont', 500, italic)
10
- +font-face-helper('Roboto', 'roboto/Roboto-Bold-webfont', 600, normal)
11
- +font-face-helper('Roboto', 'roboto/Roboto-BoldItalic-webfont', 600, italic)
12
- +font-face-helper('Roboto', 'roboto/Roboto-Black-webfont', 700, normal)
13
- +font-face-helper('Roboto', 'roboto/Roboto-BlackItalic-webfont', 700, italic)
2
+ +font-face-helper('Roboto', 'roboto/Roboto-Thin-webfont', 100, normal, 'robotothin')
3
+ +font-face-helper('Roboto', 'roboto/Roboto-ThinItalic-webfont', 100, italic, 'robotothin_italic')
4
+ +font-face-helper('Roboto', 'roboto/Roboto-Light-webfont', 200, normal, 'robotolight')
5
+ +font-face-helper('Roboto', 'roboto/Roboto-LightItalic-webfont', 200, italic, 'robotolight_italic')
6
+ +font-face-helper('Roboto', 'roboto/Roboto-Regular-webfont', 400, normal, 'robotoregular')
7
+ +font-face-helper('Roboto', 'roboto/Roboto-Italic-webfont', 400, italic, 'robotoitalic')
8
+ +font-face-helper('Roboto', 'roboto/Roboto-Medium-webfont', 500, normal, 'robotomedium')
9
+ +font-face-helper('Roboto', 'roboto/Roboto-MediumItalic-webfont', 500, italic, 'robotomedium_italic')
10
+ +font-face-helper('Roboto', 'roboto/Roboto-Bold-webfont', 600, normal, 'robotobold')
11
+ +font-face-helper('Roboto', 'roboto/Roboto-BoldItalic-webfont', 600, italic, 'robotobold_italic')
12
+ +font-face-helper('Roboto', 'roboto/Roboto-Black-webfont', 700, normal, 'robotoblack')
13
+ +font-face-helper('Roboto', 'roboto/Roboto-BlackItalic-webfont', 700, italic, 'robotoblack_italic')
14
14
 
15
15
  // roboto condensed
16
- +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Light-webfont', 200, normal)
17
- +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-LightItalic-webfont', 200, italic)
18
- +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Regular-webfont', 400, normal)
19
- +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Italic-webfont', 400, italic)
20
- +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Bold-webfont', 600, normal)
21
- +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-BoldItalic-webfont', 600, italic)
16
+ +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Light-webfont', 200, normal, 'roboto_condensedlight')
17
+ +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-LightItalic-webfont', 200, italic, 'roboto_condensedlight_italic')
18
+ +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Regular-webfont', 400, normal, 'roboto_condensedregular')
19
+ +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Italic-webfont', 400, italic, 'roboto_condenseditalic')
20
+ +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-Bold-webfont', 600, normal, 'roboto_condensedbold')
21
+ +font-face-helper('Roboto Condensed', 'roboto/RobotoCondensed-BoldItalic-webfont', 600, italic, 'roboto_condensedbold_italic')
@@ -0,0 +1,200 @@
1
+ body.cmi-flex-modal-open
2
+ overflow: hidden
3
+
4
+ // base modal structure
5
+ .cmi
6
+ &.cmi-flex-modal
7
+ +position(fixed, 0 0 0 0)
8
+ +backface-visibility(hidden)
9
+ display: block
10
+ overflow: hidden
11
+ outline: 0
12
+ z-index: $modal-z-index
13
+ background-color: $modal-backdrop-color
14
+
15
+ .cmi-flex-modal-dialog,
16
+ .cmi-flex-modal-dialog-inner
17
+ overflow: hidden
18
+ z-index: 0
19
+ margin: 0
20
+ padding: 0
21
+ outline: 0
22
+ +display(flex)
23
+ +flex-direction(column)
24
+ +flex-wrap(nowrap)
25
+ +align-items(stretch)
26
+ +border-radius(3px)
27
+
28
+ .cmi-flex-modal-dialog
29
+ +position(absolute, 5% 5% auto 5%)
30
+ max-height: 90%
31
+ @extend .z-depth-5
32
+
33
+ .cmi-flex-modal-dialog-inner
34
+ position: relative
35
+
36
+ .cmi-flex-modal-dialog,
37
+ .cmi-flex-modal-dialog-inner
38
+ > header,
39
+ > main,
40
+ > footer
41
+ position: relative
42
+
43
+ > header,
44
+ > footer
45
+ overflow: hidden
46
+ z-index: 10
47
+ +display(flex)
48
+ +flex-shrink(0)
49
+
50
+ > header
51
+ height: $modal-header-height
52
+ background-color: $modal-header-bgcolor
53
+ +border-top-radius(3px)
54
+
55
+ > main
56
+ overflow: scroll
57
+ overflow-x: hidden
58
+ overflow-y: scroll
59
+ z-index: 1
60
+ background-color: $modal-main-bgcolor
61
+ +display(flex)
62
+ +flex-direction(column)
63
+ +flex-shrink(1)
64
+
65
+ > footer
66
+ height: $modal-footer-height
67
+ background-color: $modal-footer-bgcolor
68
+ +border-bottom-radius(3px)
69
+
70
+ .cmi-flex-modal-main-inside
71
+ position: relative
72
+ height: auto
73
+ display: -webkit-box
74
+ +display(flex)
75
+ +flex-direction(row)
76
+ +flex-wrap(nowrap)
77
+ +flex-grow(1)
78
+ +flex-shrink(0)
79
+ +align-items(stretch)
80
+
81
+ > aside,
82
+ > section
83
+ position: relative
84
+
85
+ > aside
86
+ width: $modal-sidebar-width
87
+ min-width: $modal-sidebar-width
88
+ background-color: $modal-sidebar-bgcolor
89
+ +flex-grow(0)
90
+ > section
91
+ +flex-grow(1)
92
+
93
+ // modal additional content styling
94
+ .cmi
95
+ .cmi-flex-modal-dialog,
96
+ .cmi-flex-modal-dialog-inner
97
+ > header,
98
+ > footer
99
+ .cmi-pull-left
100
+ a.btn
101
+ margin-right: 8px
102
+ .cmi-pull-right
103
+ a.btn
104
+ margin-left: 8px
105
+ .cmi-flex-modal-back
106
+ position: relative
107
+ overflow: visible
108
+ min-width: 0
109
+ height: auto
110
+ padding: 4px 6px 2px 6px
111
+ line-height: 1.3
112
+ letter-spacing: 0
113
+ i
114
+ font-size: 15px
115
+ .btn
116
+ height: auto
117
+
118
+ .cmi-flex-modal-header-inside
119
+ position: relative
120
+ display: block
121
+ width: 100%
122
+ padding: 8px
123
+ +clearfix
124
+
125
+ h1,
126
+ h2,
127
+ h3,
128
+ h4,
129
+ h5
130
+ margin: 5px
131
+ font-weight: 200
132
+ font-size: 16px
133
+ line-height: 1.2
134
+ color: #e5e5e5
135
+
136
+ .cmi-flex-modal-close
137
+ position: relative
138
+ overflow: visible
139
+ min-width: 0
140
+ height: auto
141
+ margin: 0
142
+ padding: 4px 6px 2px 6px
143
+ line-height: 1.3
144
+ letter-spacing: 0
145
+
146
+ .cmi-flex-modal-back,
147
+ .cmi-flex-modal-close
148
+ margin: 0
149
+ color: #e5e5e5
150
+ border: 1px solid #606060
151
+ background-color: $modal-header-bgcolor
152
+ i
153
+ color: #ccc
154
+ &:hover
155
+ background-color: darken($modal-header-bgcolor, 5%)
156
+ i
157
+ color: #fff
158
+
159
+ .cmi-flex-modal-footer-inside
160
+ position: relative
161
+ display: block
162
+ width: 100%
163
+ padding: 0px 8px
164
+ +clearfix
165
+
166
+ .cmi-flex-modal-back
167
+ margin: 13px 0
168
+ color: #e5e5e5
169
+ border: 1px solid #cccccc
170
+ background-color: $modal-footer-bgcolor
171
+ i
172
+ color: #999999
173
+ &:hover
174
+ background-color: darken($modal-footer-bgcolor, 5%)
175
+ i
176
+ color: #333
177
+
178
+ ul.cmi-flex-modal-aside-tab-list
179
+ margin: 8px 0 8px 8px
180
+ padding: 0
181
+ list-style: none
182
+ li
183
+ margin-bottom: 4px
184
+ a
185
+ position: relative
186
+ display: block
187
+ padding: 8px 20px
188
+ font-size: 13px
189
+ text-align: right
190
+ color: $modal-sidebar-tab-link-color
191
+ +border-left-radius(3px)
192
+ &:hover
193
+ color: #000
194
+ cursor: pointer
195
+ text-decoration: none
196
+ background-color: darken($modal-sidebar-bgcolor, 5%)
197
+ li.active > a,
198
+ a.active
199
+ color: $color-primary
200
+ background-color: #fff
@@ -0,0 +1,47 @@
1
+ .cmi-loading-indicator
2
+ +position(absolute, 0 0 0 0)
3
+ z-index: 100
4
+ margin: 0
5
+ padding: 0
6
+ opacity: 0
7
+ +transition(opacity .4s linear)
8
+ &.cmi-loading-indicator-background-dark
9
+ background-color: rgba(#000, 0.7)
10
+ &.cmi-loading-indicator-background-light
11
+ background-color: rgba(#fff, 0.8)
12
+ &.cmi-loading-fade
13
+ opacity: 1
14
+ +transition(opacity .4s linear)
15
+ .cmi-loading-indicator-inside
16
+ position: absolute
17
+ width: $loading-diameter
18
+ height: $loading-diameter
19
+ left: 50%
20
+ top: 50%
21
+ margin: ($loading-diameter * -0.5) 0 0 ($loading-diameter * -0.5)
22
+ .circular
23
+ position: relative
24
+ height: $loading-diameter
25
+ width: $loading-diameter
26
+ +animation(cumaLoadingRotate 2s linear infinite)
27
+ .path
28
+ stroke-dasharray: 1, 200
29
+ stroke-dashoffset: 0
30
+ stroke-linecap: round
31
+ stroke: $loading-color
32
+ +animation(cumaLoadingDash 1.5s ease-in-out infinite)
33
+
34
+ +keyframes(cumaLoadingRotate)
35
+ 100%
36
+ +transform(rotate(360deg))
37
+
38
+ +keyframes(cumaLoadingDash)
39
+ 0%
40
+ stroke-dasharray: 1, 200
41
+ stroke-dashoffset: 0
42
+ 50%
43
+ stroke-dasharray: 89, 200
44
+ stroke-dashoffset: -35
45
+ 100%
46
+ stroke-dasharray: 89, 200
47
+ stroke-dashoffset: -124
@@ -0,0 +1,26 @@
1
+ .cmi
2
+ .cmi-ripples,
3
+ .cmi-ripples-standalone
4
+ .cmi-ink
5
+ position: absolute
6
+ display: block
7
+ transform: scale(0)
8
+ background: $ripples-color-default
9
+ opacity: 1
10
+ +border-radius(100%)
11
+ &.cmi-animate
12
+ +animation(cmiRipple 0.4s linear)
13
+
14
+ &.cmi-ripples-dark
15
+ .cmi-ink
16
+ background: $ripples-color-dark
17
+
18
+ &.cmi-ripples-primary
19
+ .cmi-ink
20
+ background: $ripples-color-primary
21
+
22
+
23
+ +keyframes(cmiRipple)
24
+ 100%
25
+ opacity: 0
26
+ +transform(scale(2.5))
@@ -0,0 +1,41 @@
1
+ .cmi-tabs
2
+ position: relative
3
+ margin: 0
4
+ padding: 0
5
+ list-style: none
6
+ font-size: 16px
7
+ font-size: 1rem
8
+ +clearfix
9
+ a
10
+ display: block
11
+ padding: 0.8rem 1em 0.7rem 1em
12
+ font-size: 0.875em
13
+ text-transform: uppercase
14
+ text-decoration: none
15
+ line-height: 1.2
16
+ color: $tabs-color-font
17
+ &:hover
18
+ text-decoration: none
19
+ background-color: $tabs-color-hover-bg
20
+ li
21
+ position: relative
22
+ overflow: hidden
23
+ float: left
24
+ li.cmi-tabs-active
25
+ a
26
+ color: $tabs-color-link-active
27
+ li.cmi-tabs-active-indicator
28
+ position: absolute
29
+ float: none
30
+ height: 3px
31
+ bottom: 0
32
+ background-color: $tabs-color-link-active
33
+ &.cmi-tabs-animate-right
34
+ +transition(right 0.15s ease, left 0.25s ease 0.05s)
35
+ &.cmi-tabs-animate-left
36
+ +transition(left 0.15s ease, right 0.25s ease 0.05s)
37
+
38
+ .cmi-tabs-tab
39
+ display: none
40
+ &.cmi-tabs-active
41
+ display: block
@@ -0,0 +1,87 @@
1
+ .cmi-checkbox-container
2
+ position: relative
3
+ z-index: 0
4
+ display: block
5
+ margin: 0.875rem 0
6
+ font-size: 14px
7
+ font-size: 0.875rem
8
+ +backface-visibility(hidden)
9
+ label
10
+ position: relative
11
+ display: inline-block
12
+ max-width: 100%
13
+ min-height: 20px
14
+ margin-bottom: 0
15
+ padding-left: 10px
16
+ font-size: 1em
17
+ color: $checkbox-color-label
18
+ cursor: pointer
19
+ vertical-align: top
20
+ +user-select(none)
21
+ input[type="checkbox"]
22
+ position: absolute
23
+ opacity: 0
24
+ visibility: hidden
25
+ margin-left: -9999px
26
+ span
27
+ left: 0px
28
+ +transition-duration(0.2s)
29
+ span.cmi-animation
30
+ position: absolute
31
+ display: block
32
+ overflow: hidden
33
+ z-index: 0
34
+ height: 36px
35
+ width: 36px
36
+ top: -7px
37
+ margin: 0
38
+ content: ""
39
+ visibility: hidden
40
+ opacity: 0
41
+ background-color: rgba(#000, 0.07)
42
+ +border-radius(100%)
43
+ span.cmi-checkbox
44
+ position: relative
45
+ display: inline-block
46
+ overflow: hidden
47
+ z-index: 1
48
+ width: 16px
49
+ height: 16px
50
+ top: 3px
51
+ margin-right: 11px
52
+ border: 2px solid rgba(#000, 0.5)
53
+ +border-radius(2px)
54
+ &:before
55
+ position: relative
56
+ content: "\e899"
57
+ top: -2px
58
+ left: -2px
59
+ font-size: 0px
60
+ font-family: "Material-Design-Icons"
61
+ line-height: 15px
62
+ color: #fff
63
+ &.cmi-valid
64
+ label
65
+ color: $checkbox-color-valid
66
+ &.cmi-invalid
67
+ label
68
+ color: $checkbox-color-invalid
69
+ p.cmi-hint
70
+ margin: 0 0 0 40px
71
+ font-size: 0.86em
72
+ color: $checkbox-color-hint
73
+ &.cmi-valid
74
+ color: $checkbox-color-valid
75
+ &.cmi-invalid
76
+ color: $checkbox-color-invalid
77
+ label:hover
78
+ .cmi-animation
79
+ visibility: visible
80
+ opacity: 1
81
+ +transition(all 0.1s linear)
82
+ &.cmi-active
83
+ span.cmi-checkbox
84
+ border-color: $checkbox-color-check
85
+ background-color: $checkbox-color-check
86
+ span.cmi-checkbox:before
87
+ font-size: 15px
@@ -0,0 +1,100 @@
1
+ .cmi-text-input
2
+ position: relative
3
+ margin: 1.25rem 0 1.5rem 0
4
+ font-size: 14px
5
+ font-size: 0.875rem
6
+ label
7
+ position: absolute
8
+ left: 0
9
+ font-size: 1em
10
+ color: color("grey", "lighten-1")
11
+ pointer-events: none
12
+ cursor: text
13
+ +transition(.2s ease-out all)
14
+ input
15
+ font-size: 1em
16
+ height: 2em
17
+ padding: 0
18
+ + label
19
+ top: 0.3em
20
+ textarea
21
+ width: 100%
22
+ min-height: 2rem
23
+ padding: 0.6em 0 0.7em 0
24
+ font-size: 1em
25
+ background-color: transparent
26
+ overflow: hidden
27
+ + label
28
+ top: 0.5em
29
+ &.cmi-growing-textarea
30
+ textarea
31
+ resize: none
32
+ +transition(height 0.05s ease)
33
+ .cmi-hidden-textarea-reference
34
+ position: absolute
35
+ opacity: 0
36
+ top: 9999px
37
+ left: 9999px
38
+
39
+ input,
40
+ textarea
41
+ background-color: transparent
42
+ border: none
43
+ border-bottom: 1px solid $input-color-border
44
+ outline: none
45
+ width: 100%
46
+ margin: 0
47
+ +box-shadow(none)
48
+ +box-sizing(content-box)
49
+ +transition(border-bottom .3s ease)
50
+ &:focus
51
+ border-bottom: 1px solid $input-color-focus
52
+ +box-shadow(0 1px 0 0 $input-color-focus)
53
+
54
+ &.cmi-active,
55
+ input:focus,
56
+ textarea:focus
57
+ label
58
+ top: 0
59
+ font-size: 0.8125em
60
+ font-weight: 300
61
+ +transform(translateY(-80%))
62
+
63
+ &.cmi-active
64
+ label
65
+ color: color("grey", "base")
66
+
67
+ input:focus,
68
+ textarea:focus
69
+ + label
70
+ color: $input-color-focus
71
+
72
+ &.cmi-valid
73
+ label
74
+ color: $input-color-valid
75
+ input,
76
+ textarea
77
+ border-bottom: 1px solid $input-color-valid
78
+ +box-shadow(0 1px 0 0 $input-color-valid)
79
+
80
+ &.cmi-invalid
81
+ label
82
+ color: $input-color-invalid
83
+ input,
84
+ textarea
85
+ border-bottom: 1px solid $input-color-invalid
86
+ +box-shadow(0 1px 0 0 $input-color-invalid)
87
+
88
+ // hints
89
+ p.cmi-hint
90
+ margin: 3px 0 0 0
91
+ font-size: 0.85em
92
+ font-weight: 300
93
+ text-align: right
94
+ color: color("grey", "lighten-1")
95
+ p.cmi-hint.cmi-valid
96
+ color: $input-color-valid
97
+ p.cmi-hint.cmi-invalid
98
+ color: $input-color-invalid
99
+
100
+
@@ -1,3 +1,3 @@
1
1
  module CuroMaterialInterface
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curo-material-interface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sascha Hillig
@@ -130,6 +130,17 @@ files:
130
130
  - lib/assets/fonts/roboto/RobotoCondensed-Regular-webfont.svg
131
131
  - lib/assets/fonts/roboto/RobotoCondensed-Regular-webfont.ttf
132
132
  - lib/assets/fonts/roboto/RobotoCondensed-Regular-webfont.woff
133
+ - lib/assets/javascripts/cmi/behaviors/form_checkbox_behavior.coffee
134
+ - lib/assets/javascripts/cmi/behaviors/form_text_field_behavior.coffee
135
+ - lib/assets/javascripts/cmi/behaviors/form_textarea_behavior.coffee
136
+ - lib/assets/javascripts/cmi/behaviors/ripples_behavior.coffee
137
+ - lib/assets/javascripts/cmi/behaviors/tabs_behavior.coffee
138
+ - lib/assets/javascripts/cmi/form_components/checkbox.coffee
139
+ - lib/assets/javascripts/cmi/form_components/text_field.coffee
140
+ - lib/assets/javascripts/cmi/form_components/textarea.coffee
141
+ - lib/assets/javascripts/cmi/loading_indicator.coffee
142
+ - lib/assets/javascripts/cmi/ripples.coffee
143
+ - lib/assets/javascripts/cmi/tabs.coffee
133
144
  - lib/assets/stylesheets/cmi/_colors.scss
134
145
  - lib/assets/stylesheets/cmi/_extensions.sass
135
146
  - lib/assets/stylesheets/cmi/_global.sass
@@ -141,7 +152,13 @@ files:
141
152
  - lib/assets/stylesheets/cmi/_typography.sass
142
153
  - lib/assets/stylesheets/cmi/_variables.sass
143
154
  - lib/assets/stylesheets/cmi/components/_buttons.sass
155
+ - lib/assets/stylesheets/cmi/components/_flex-modal.sass
156
+ - lib/assets/stylesheets/cmi/components/_loading-indicator.sass
144
157
  - lib/assets/stylesheets/cmi/components/_navbar.sass
158
+ - lib/assets/stylesheets/cmi/components/_ripples.sass
159
+ - lib/assets/stylesheets/cmi/components/_tabs.sass
160
+ - lib/assets/stylesheets/cmi/form_components/_checkbox.sass
161
+ - lib/assets/stylesheets/cmi/form_components/_text_field.sass
145
162
  - lib/curo-material-interface.rb
146
163
  - lib/curo_material_interface/engine.rb
147
164
  - lib/curo_material_interface/roboto_files.rb