nfg_ui 0.12.3 → 0.12.7

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: b45c3d32a180df2da86ae37f687850785b8a5c22833c4b70b0e0371f48e1b3cc
4
- data.tar.gz: ab34a149c78bf3b596ddc5ea990ab3bd27372fd340166908b47aefe5df519d85
3
+ metadata.gz: a35bf8e810bef7ab9c4ac1dca95a6ca9e236b5f4606ef6c63614fa941fd510c8
4
+ data.tar.gz: 1d007a905113a5bbb89a4dd3fc486639d72b0be1a4c466f07b7f3a70cbb1e37e
5
5
  SHA512:
6
- metadata.gz: 44f3894e5054710f58a2198ca37c0a5ffbdb6e1a96c6c90d7d71363afbbd70ebee58b6d855b55ef0fcf90c03c5af04df8f2ecd5fe2dd401cf6223b168183d25f
7
- data.tar.gz: b3dc49d58c96fe8ee3020d561c27d93950513c862b15174f92b1a45ec197af8d803691bf48eab1b948e06aec10ebe62b7247874feefbddbe9a9b3b11ade5cc8f
6
+ metadata.gz: f7a91b7232e34eb6f7a2b68eb1d7c279858d1e62b4a95ac811f3c45922690790eefa993fb5a0c82f9d2be4dc496aea796b0cac99946b1bc5def7764502bb52d0
7
+ data.tar.gz: d4e2fc74dcd4244490bc2455a4f30b1a9fd04e73d91373865b87e3ae431563614e2841f83491979a999e5be0d0f668c3e1b47b02454bb210b4d560d1c357c864
@@ -8,6 +8,7 @@
8
8
 
9
9
  // Plugins
10
10
  @import 'nfg_ui/network_for_good/core/plugins/intercom';
11
+ @import 'nfg_ui/network_for_good/core/plugins/multi';
11
12
  @import 'nfg_ui/network_for_good/core/plugins/turbolinks';
12
13
  @import 'nfg_ui/network_for_good/core/plugins/twitter_typeahead';
13
14
 
@@ -0,0 +1,64 @@
1
+ //** Multi plugin used in export contacts/donations modal in DM
2
+
3
+ .multi-wrapper {
4
+ border: $border-width solid $border-color;
5
+ border-radius: $border-radius;
6
+ width: 100%;
7
+ .search-input {
8
+ border: 0;
9
+ border-bottom: $border-width solid $border-color;
10
+ border-radius: 0;
11
+ display: block;
12
+ font-size: $font-size-base;
13
+ margin: 0;
14
+ outline: 0;
15
+ padding: $input-btn-padding-y $input-btn-padding-x;
16
+ width: 100%;
17
+ box-sizing: border-box;
18
+ }
19
+ .item {
20
+ cursor: pointer;
21
+ display: block;
22
+ position: relative;
23
+ padding: ($spacer * .25);
24
+ border-radius: $border-radius;
25
+ &:hover { background: $gray-200; }
26
+ }
27
+ .non-selected-wrapper, .selected-wrapper {
28
+ box-sizing: border-box;
29
+ display: inline-block;
30
+ height: ($spacer * 8);
31
+ overflow-y: scroll;
32
+ padding: ($spacer * .5);
33
+ vertical-align: top;
34
+ width: 50%;
35
+ }
36
+ .non-selected-wrapper {
37
+ background: $body-bg;
38
+ border-right: $border-width solid $border-color;
39
+ .item.selected {
40
+ padding-right: $spacer;
41
+ color: inherit;
42
+ background: $gray-200;
43
+ opacity: 0.5;
44
+ &:hover {
45
+ background: $gray-200;
46
+ cursor: inherit;
47
+ }
48
+ &:after {
49
+ position: absolute;
50
+ top: ($spacer * .25);
51
+ right: 0;
52
+ width: $spacer;
53
+ font-family: "FontAwesome";
54
+ font-size: $font-size-base;
55
+ line-height: 1.5;
56
+ color: inherit;
57
+ text-align: center;
58
+ content: '\f00c';
59
+ z-index: 5;
60
+ }
61
+ }
62
+ }
63
+ .selected-wrapper { background: $white; }
64
+ }
@@ -16,6 +16,14 @@ module NfgUi
16
16
  options.fetch(:heading, nil)
17
17
  end
18
18
 
19
+ def button
20
+ options.fetch(:button, nil)
21
+ end
22
+
23
+ def href
24
+ options.fetch(:href, nil)
25
+ end
26
+
19
27
  def component_family
20
28
  :tile
21
29
  end
@@ -28,7 +36,7 @@ module NfgUi
28
36
  super do
29
37
  if render_in_body
30
38
  if title.present?
31
- concat(NfgUi::Components::Patterns::TileHeader.new({ title: title, icon: icon, collapsible: collapsible, collapse: ("#collapse_#{id}" if collapsible) }, view_context).render)
39
+ concat(NfgUi::Components::Patterns::TileHeader.new({ title: title, subtitle: subtitle, button: button, href: href, icon: icon, collapsible: collapsible, collapsed: collapsed, collapse: ("#collapse_#{id}" if collapsible) }, view_context).render)
32
40
  end
33
41
  if collapsible
34
42
  concat(NfgUi::Components::Patterns::Collapse.new({ id: "collapse_#{id}", collapsed: collapsed }, view_context).render {
@@ -47,10 +55,14 @@ module NfgUi
47
55
  end
48
56
  end
49
57
 
58
+ def subtitle
59
+ options.fetch(:subtitle, nil)
60
+ end
61
+
50
62
  private
51
63
 
52
64
  def non_html_attribute_options
53
- super.push(:heading, :render_in_body)
65
+ super.push(:heading, :render_in_body, :subtitle, :button, :href)
54
66
  end
55
67
  end
56
68
  end
@@ -14,23 +14,57 @@ module NfgUi
14
14
  :tile
15
15
  end
16
16
 
17
+ def button
18
+ options.fetch(:button, nil)
19
+ end
20
+
21
+ def href
22
+ options.fetch(:href, nil)
23
+ end
24
+
25
+ def subtitle
26
+ options.fetch(:subtitle, nil)
27
+ end
28
+
17
29
  def render
18
30
  super do
19
- if collapsible && title
20
- concat(NfgUi::Components::Elements::Button.new({ traits: [:link, :block], collapse: collapse, class: 'no-link-color p-0 m-0', data: { collapse_icon: collapse_icon, collapsed_icon: collapsed_icon } }, view_context).render {
21
- content_tag(:div, class: 'row align-items-center') do
22
- concat(content_tag(:div, class: 'col-10 text-left') {
23
- NfgUi::Components::Foundations::Typeface.new({ heading: title, icon: icon, class: 'h4' }, view_context).render
24
- })
25
- concat(content_tag(:div, class: 'col-2 text-right') {
26
- NfgUi::Components::Foundations::Icon.new({ traits: ["#{contextual_collapsible_icon} fw"], tooltip: 'Show / hide additional information' }, view_context).render
27
- })
31
+ if title
32
+ concat(content_tag(:div, class: 'row') do
33
+ concat(content_tag(:div, class: "col") do
34
+ content_tag(:div, class: 'row') do
35
+ concat(content_tag(:div, class: 'col-12 col-md') do
36
+ concat(NfgUi::Components::Foundations::Typeface.new({ heading: title, icon: icon, class: 'h4' }, view_context).render)
37
+ if subtitle
38
+ concat(NfgUi::Components::Foundations::Typeface.new({ body: subtitle, traits: [:muted], class: 'mt-1 mb-0' }, view_context).render)
39
+ end
40
+ end)
41
+
42
+ if button
43
+ concat(content_tag(:div, class: 'col-12 col-md-auto mt-md-0 mt-2') do
44
+ NfgUi::Components::Elements::Button.new({theme: :secondary, href: href, body: button}, view_context).render
45
+
46
+ end)
47
+ end
48
+ end
49
+ end)
50
+
51
+ if collapsible
52
+ concat(content_tag(:div, class: 'col-auto pl-0') do
53
+ NfgUi::Components::Elements::Button.new({ traits: [:link], collapse: collapse, data: { collapse_icon: collapse_icon, collapsed_icon: collapsed_icon } }, view_context).render do
54
+
55
+ # The button cannot host a data-toggle for tooltip
56
+ # and a data-toggle for collapse
57
+
58
+ # In order to accomodate the tooltip, we have to
59
+ # render the icon manually without using the button's
60
+ # options so that we're applying the tooltip on the
61
+ # icon and not the button.
62
+ NfgUi::Components::Foundations::Icon.new({ traits: ["#{contextual_collapsible_icon} fw"], tooltip: 'Show / hide additional information' }, view_context).render
63
+ end
64
+ end)
28
65
  end
29
- })
30
- elsif title
31
- concat(NfgUi::Components::Foundations::Typeface.new({ heading: title, icon: icon, class: 'h4' }, view_context).render)
66
+ end)
32
67
  end
33
-
34
68
  concat((block_given? ? yield : body))
35
69
  end
36
70
  end
@@ -49,6 +83,10 @@ module NfgUi
49
83
  def collapsed_icon
50
84
  'caret-down'
51
85
  end
86
+
87
+ def non_html_attribute_options
88
+ super.push(:subtitle, :button, :href)
89
+ end
52
90
  end
53
91
  end
54
92
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '0.12.3'
4
+ VERSION = '0.12.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfg_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Roehm
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-07 00:00:00.000000000 Z
12
+ date: 2021-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap
@@ -149,14 +149,14 @@ dependencies:
149
149
  requirements:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 1.10.4
152
+ version: 1.11.4
153
153
  type: :runtime
154
154
  prerelease: false
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 1.10.4
159
+ version: 1.11.4
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: browser
162
162
  requirement: !ruby/object:Gem::Requirement
@@ -530,6 +530,7 @@ files:
530
530
  - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_datepicker.scss
531
531
  - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_datetimepicker.scss
532
532
  - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_intercom.scss
533
+ - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_multi.scss
533
534
  - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_select2.scss
534
535
  - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_sticky_div.scss
535
536
  - app/assets/stylesheets/nfg_ui/network_for_good/core/plugins/_turbolinks.scss