myg 2.6.0 → 2.7.0

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
  SHA256:
3
- metadata.gz: 66ef34aff3aa0db415984360e708fec7e9ef1e9a51f2ee8e8586df1d8c439536
4
- data.tar.gz: f88a8fc86c73d011ea1eafd9ab54e067e372330e7a0652905cb9b778bf42c0e7
3
+ metadata.gz: 46652e6ad7944576ea5cd122a5eaf0c07e0a698b5d3326451e07cf2ade54e5da
4
+ data.tar.gz: 821c2dcf533c86ba2d21260a2a658043fe6fe539baec4fb350dfd426f4e73d54
5
5
  SHA512:
6
- metadata.gz: c12b67b108bb9e46e551353a0b1914ea0d5981f0dee9eb7d686b0eb171fa51ca32459ba242c406a8130326ad865dac1f417b8d411bc99ce0a5e8bb8ddd9228d3
7
- data.tar.gz: '09894914422a24c4e4ade92cf4e8c2bb7c363704e9f56bd171f467e8dd8c47b94ed8143ca6cd21f9d33cf5eaf8dde2bca8ec1238bfee1429cf8eb372e741def2'
6
+ metadata.gz: 8241de5af2e7f67df4249462bf8fa70730a4b9631672831fb1abe705d88fc3f8ee6a3b034103156765d0d4847e1a12c8708ff3d093e772ccb029ae5c0fbd7ee2
7
+ data.tar.gz: e1180b08215359428d6e98d68dc133c49bb452b746d46a56cf29d40369e5a947b5225549a629ad2c8646aedadd0c5b6b243ce3ef5efbafecdb7440d2dc61b529
@@ -4,6 +4,14 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 2.7.0 - 2018/03/16
8
+
9
+ * features
10
+ * add `hint` component
11
+ * add `progress` component
12
+ * enhancements
13
+ * added `id` option to `tabs` component
14
+
7
15
  ### 2.6.0 - 2018/03/07
8
16
 
9
17
  * features
data/README.md CHANGED
@@ -77,8 +77,10 @@ These are the components currently supported by Myg on Rails:
77
77
  * [`checkbox`](components/myg/checkbox.md)
78
78
  * [`drawer`](components/myg/drawer.md)
79
79
  * [`form-field`](components/myg/form-field.md)
80
+ * [`hint`](components/myg/hint.md)
80
81
  * [`input`](components/myg/input.md)
81
82
  * [`label`](components/myg/label.md)
83
+ * [`progress`](components/myg/progress.md)
82
84
  * [`radio`](components/myg/radio.md)
83
85
  * [`slider`](components/myg/slider.md)
84
86
  * [`switch`](components/myg/switch.md)
@@ -4,13 +4,14 @@
4
4
  <% if options[:floating_label] %><% input_html = {
5
5
  class_name: options[:class_name],
6
6
  attribute: options[:attribute],
7
- type: ('file' if options[:file]),
8
7
  placeholder: options[:floating_label]
9
8
  } %><% else %><% input_html = {
10
9
  class_name: options[:class_name],
11
- attribute: options[:attribute],
12
- type: ('file' if options[:file])
10
+ attribute: options[:attribute]
13
11
  } %><% end %>
12
+ <% input_defaults = {
13
+ type: ('file' if options[:file])
14
+ } %>
14
15
  <% label_html = {
15
16
  class_name: options[:class_name],
16
17
  attribute: options[:attribute]
@@ -36,11 +37,11 @@
36
37
  <% end %>
37
38
  <% if options[:floating_label] %>
38
39
  <%= content_tag 'div', class: 'myg-input--container' do %>
39
- <%= component "myg/#{options[:as]}", (options[:input_html] || {}).merge(input_html) %>
40
+ <%= component "myg/#{options[:as]}", input_defaults.merge((options[:input_html] || {}).merge(input_html)) %>
40
41
  <%= component 'myg/label', (options[:label_html] || {}).merge(label_html) do %><%= options[:floating_label] %><% end %>
41
42
  <% end %>
42
43
  <% else %>
43
- <%= component "myg/#{options[:as]}", (options[:input_html] || {}).merge(input_html) %>
44
+ <%= component "myg/#{options[:as]}", input_defaults.merge((options[:input_html] || {}).merge(input_html)) %>
44
45
  <% if options[:file] %><%= component 'myg/label', (options[:label_html] || {}).merge(label_html) do %><%= options[:file] %><% end %><% end %>
45
46
  <% end %>
46
47
  <% if options[:inline_label] %>
@@ -54,4 +55,7 @@
54
55
  <% end %>
55
56
  <% end %>
56
57
  <% end %>
58
+ <% if options[:hint] %>
59
+ <%= component 'myg/hint', options[:hint_html] || {} do %><%= options[:hint].html_safe %><% end %>
60
+ <% end %>
57
61
  <% end %>
@@ -0,0 +1,7 @@
1
+ <% html = {
2
+ class: ['myg-hint', options[:class]].join(' ')
3
+ } %>
4
+
5
+ <%= content_tag 'div', options.merge(html) do %>
6
+ <%= block.html_safe %>
7
+ <% end %>
@@ -1,11 +1,11 @@
1
- <% class_name = options.delete :class_name %>
2
- <% attribute = options.delete :attribute %>
3
- <% id = class_name ? "#{class_name.to_s.downcase}_#{attribute}" : "#{attribute}" %>
4
- <% html = {
5
- class: ['myg-label', options[:class]].join(' '),
6
- for: id
7
- } %>
8
-
9
- <%= content_tag 'label', options.merge(html) do %>
10
- <%= block %>
11
- <% end %>
1
+ <% class_name = options.delete :class_name %>
2
+ <% attribute = options.delete :attribute %>
3
+ <% id = class_name ? "#{class_name.to_s.downcase}_#{attribute}" : "#{attribute}" %>
4
+ <% html = {
5
+ class: ['myg-label', options[:class]].join(' '),
6
+ for: id
7
+ } %>
8
+
9
+ <%= content_tag 'label', options.merge(html) do %>
10
+ <%= block.html_safe %>
11
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% html = {
2
+ class: ['myg-progress mdc-linear-progress', ('mdc-linear-progress--indeterminate' if options.delete(:indeterminate)), options[:class]].join(' '),
3
+ role: 'progressbar'
4
+ } %>
5
+
6
+ <%= content_tag 'div', options.merge(html) do %>
7
+ <div class="mdc-linear-progress__buffering-dots"></div>
8
+ <div class="mdc-linear-progress__buffer"></div>
9
+ <div class="mdc-linear-progress__bar mdc-linear-progress__primary-bar">
10
+ <span class="mdc-linear-progress__bar-inner"></span>
11
+ </div>
12
+ <div class="mdc-linear-progress__bar mdc-linear-progress__secondary-bar">
13
+ <span class="mdc-linear-progress__bar-inner"></span>
14
+ </div>
15
+ <% end %>
@@ -10,11 +10,11 @@
10
10
  <% tab_html = {
11
11
  class: ['mdc-tab', options.dig(:tab_html, :class), ('mdc-tab--active' if tab[:active])].join(' '),
12
12
  aria: {
13
- controls: tab[:name].underscore
13
+ controls: tab[:id] || tab[:name].underscore
14
14
  },
15
15
  role: 'tab'
16
16
  } %>
17
- <%= link_to tab[:name], tab[:href] || "##{tab[:name].underscore}", (options[:tab_html] || {}).merge(tab_html) %>
17
+ <%= link_to tab[:name], tab[:href] || "##{tab[:id] || tab[:name].underscore}", (options[:tab_html] || {}).merge(tab_html) %>
18
18
  <% end %>
19
19
  <span class="mdc-tab-bar__indicator"></span>
20
20
  <% end %>
@@ -29,7 +29,7 @@
29
29
  <% options[:tabs]&.each do |tab| %>
30
30
  <% panel_html = {
31
31
  class: ['myg-tabs--panel', options.dig(:panel_html, :class), ('myg-tabs--shown' if tab[:active])].join(' '),
32
- id: tab[:name].underscore,
32
+ id: tab[:id] || tab[:name].underscore,
33
33
  role: 'tabpanel',
34
34
  aria: {
35
35
  hidden: (tab[:active] ? false : true)
@@ -19,6 +19,7 @@
19
19
  // @import "myg-footer/footer"
20
20
  // @import "myg-form-field/form-field"
21
21
  // @import "myg-grid/grid"
22
+ // @import "myg-hint/hint"
22
23
  // @import "myg-icon/fonts/myg/myg"
23
24
  // @import "myg-icon/fonts/myg-o/myg-o"
24
25
  // @import "myg-icon/fonts/google/google"
@@ -59,6 +60,8 @@
59
60
  // +myg-input--classes
60
61
  // +myg-label--classes
61
62
  // +myg-layout--classes
63
+ // +myg-list--classes
64
+ // +myg-progress--classes
62
65
  // +myg-radio--classes
63
66
  // +myg-switch--classes
64
67
  // +myg-tabs--classes
@@ -9,8 +9,10 @@ module Myg
9
9
  config.define_component 'myg/checkbox'
10
10
  config.define_component 'myg/drawer'
11
11
  config.define_component 'myg/form-field'
12
+ config.define_component 'myg/hint'
12
13
  config.define_component 'myg/input'
13
14
  config.define_component 'myg/label'
15
+ config.define_component 'myg/progress', indeterminate: false
14
16
  config.define_component 'myg/radio'
15
17
  config.define_component 'myg/slider', discrete: false, disabled: false, value: 0, min: 0, max: 50, label: 'Select value'
16
18
  config.define_component 'myg/switch'
@@ -1,5 +1,5 @@
1
1
  module Myg
2
2
 
3
- VERSION = '2.6.0'
3
+ VERSION = '2.7.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myg
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-07 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -109,8 +109,10 @@ files:
109
109
  - app/views/mozaic/myg/_checkbox.html.erb
110
110
  - app/views/mozaic/myg/_drawer.html.erb
111
111
  - app/views/mozaic/myg/_form-field.html.erb
112
+ - app/views/mozaic/myg/_hint.html.erb
112
113
  - app/views/mozaic/myg/_input.html.erb
113
114
  - app/views/mozaic/myg/_label.html.erb
115
+ - app/views/mozaic/myg/_progress.html.erb
114
116
  - app/views/mozaic/myg/_radio.html.erb
115
117
  - app/views/mozaic/myg/_slider.html.erb
116
118
  - app/views/mozaic/myg/_switch.html.erb