nfg_ui 0.12.6 → 0.12.10

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: 5bbafc30ea4243b1b4053b0ea9556031985f5d9f13a0800542a45d8a92c6a854
4
- data.tar.gz: ea57532fe3f800a39722870962424ae6c11868d333c39292703c4df18266f8b0
3
+ metadata.gz: ab312817e5911978ad679f0a410978aeb6cf9c785fbbf7277ba485c4f3ddc3d4
4
+ data.tar.gz: cfb725daaaa0742fe89c9234b695953d1a2a9024f95486c35aac9475fe4e9e12
5
5
  SHA512:
6
- metadata.gz: b9642aa6a7d9b14a2523bd3ced6b4a8cfa2cb905fd614f3484ba748447fec2e1f96c3dbdffe42f0baf4e9f042b45ce49cdd455b6bba56c32cbda13383465aefd
7
- data.tar.gz: 65e30453eb0709ca978786c273751ad6116e823f1f5eae35439b0b832ce26f117afd010081baaf9ba8800dd0ca5d1c37e5be7736b508bad1556a854a5f17a80d
6
+ metadata.gz: 258c002448bb336e07e1a2b054805f618cf236b435c49d67a844d03ca6628371460029099491aebca56e1359d5424cc52cdac427dca6bf93af854f2d3777ea58
7
+ data.tar.gz: 2b6402b72750534f2be88a87aa28b99145326db73e91aab67cf779677777ba2af0522d086d1be106778db05fa2fcd42eec52c0c1380317173b2487bdc9385281
data/README.md CHANGED
@@ -18,6 +18,9 @@ This gem is an organic, evolving and ongoing work that is the loving result of 4
18
18
  With this gem, you can stand up a brand new rails app and it will seamlessly, from day 1, look, feel and be a Network for Good product. *Huzzah*
19
19
 
20
20
  ## Accessing Component Code Examples & Documentation:
21
+
22
+ Visit [NFG UI Display App](https://nfg-ui-display-app.herokuapp.com/) for examples.
23
+
21
24
  To review the documentation for the components, get code samples and browse the library, follow the instructions at the bottom for getting the gem setup locally. It has its own `test_app` so the documentation is hosted there and the gem doesn't need to be added to a seperate parent app (unless you want to). We intend to get this online in its own dedicated space... until then, that's your best bet for browsing docs.
22
25
 
23
26
  ## Configuration
@@ -21,7 +21,7 @@ $builder-preview-padding: ($spacer * 1.5);
21
21
  width: 100%;
22
22
  min-height: $builder-header-height;
23
23
  background-color: $blue-700;
24
- z-index: $zindex-fixed;
24
+ z-index: $zindex-fixed + 1;
25
25
  @include media-breakpoint-up(lg) {
26
26
  position: fixed;
27
27
  top: 0;
@@ -44,6 +44,12 @@
44
44
  color: $body-color !important;
45
45
  background-color: $body-bg;
46
46
  }
47
+ &.disabled,
48
+ &:disabled {
49
+ color: $primary;
50
+ background-color: $white;
51
+ border: $border-width solid $border-color;
52
+ }
47
53
  }
48
54
  .btn-link {
49
55
  font-weight: $btn-font-weight;
@@ -4,6 +4,7 @@
4
4
  }
5
5
  .redactor-box {
6
6
  margin-bottom: 0 !important;
7
+ min-height: ($spacer * 5);
7
8
  border: $border-width solid $border-color;
8
9
  }
9
10
  .redactor-toolbar {
@@ -277,3 +277,10 @@
277
277
  [data-action='togglePeriod']:after { content: 'Toggle AM/PM'; }
278
278
  [data-action='clear']:after { content: 'Clear the picker'; }
279
279
  [data-action='today']:after { content: 'Set the date to today'; }
280
+
281
+ body:not(.modal-open) {
282
+ .bootstrap-datetimepicker-widget { z-index: $zindex-dropdown + 1 !important; } // makes datetimepicker dropdown higher than select2
283
+ }
284
+ body.modal-open {
285
+ .modal .bootstrap-datetimepicker-widget { z-index: $zindex-modal + 3 !important; } // makes datetimepicker dropdown higher than redactor toolbar and select2 in modals
286
+ }
@@ -16,7 +16,6 @@ body.modal-open {
16
16
  .modal .select2-container { z-index: $zindex-modal + 2 !important; } // makes select2 dropdown higher than redactor toolbar in modals
17
17
  }
18
18
 
19
-
20
19
  .select2-container--default {
21
20
  &.select2-container--focus .select2-selection--multiple,
22
21
  &.select2-container--open .select2-selection--single {
@@ -11,6 +11,7 @@ module NfgUi
11
11
  include NfgUi::Components::Utilities::Traitable
12
12
  include NfgUi::Components::Utilities::Describable
13
13
  include NfgUi::Components::Utilities::Iconable
14
+ include NfgUi::Components::Utilities::Methodable
14
15
  include NfgUi::Components::Utilities::Renderable
15
16
 
16
17
  include NfgUi::Components::Traits::Active
@@ -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.6'
4
+ VERSION = '0.12.10'
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.6
4
+ version: 0.12.10
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-13 00:00:00.000000000 Z
12
+ date: 2021-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap