nfg_ui 6.16.2 → 6.17.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: 6d864361668c5317d82b786d3aa2279f6e994472e56f321662541ec987f8542c
4
- data.tar.gz: 3aba84161a5431ee9226a0e76a316efbbc4a924b555f2e3d91939a7193f3ff03
3
+ metadata.gz: 79a77fa158b8e65c640f998d3095a85401e0a21850a5b222bafbdfd392fdd89a
4
+ data.tar.gz: b8d6e582be486b664b523b6531cf8e9a4452fe3f891a357028c7a3dfe86607fa
5
5
  SHA512:
6
- metadata.gz: a30baaff6ae02c4c070a649b4bb90db13a9fd427629843b3a7eb82a2fffa85ce15c42e0f7df60fc69d34a9583223c6714172f6f34ce9156095af77dc07516c92
7
- data.tar.gz: 2badcf6d917cc015d9efb25904a548499924f82847b50282f88fb7789547dc91ee49100aa2a3c864267cf596c15dc61a6906dbfe16650c2d32d4e8ed83639ec8
6
+ metadata.gz: 5ce8219cfa1b71dda92e0e793809e98358d088a884b572ac65c7233d96bb43649719f3d2aaca7996921a81484b40346d8f1d341849cc8b0178c73e1ff10625e0
7
+ data.tar.gz: 0dde6820b59e8c0e7ced6efe7b308864948153fc190f183c26633174003e555aa10882748f86b5017941573ffbb22a9b73e1b304934b661bfd0b37ddd1c4c48d
@@ -27,3 +27,71 @@
27
27
  .option {
28
28
  &.ui-sortable-placeholder { margin-bottom: ($spacer * .25); }
29
29
  }
30
+
31
+
32
+ // Used for sorting images for auction items
33
+ .sortable-image {
34
+ padding: ($grid-gutter-width * .5);
35
+ border: $border-width dashed transparent;
36
+ &.sortable-ghost {
37
+ background-color: $body-bg;
38
+ border-color: $border-color;
39
+ border-radius: $border-radius;
40
+ }
41
+ @for $i from 0 through 20 {
42
+ &:nth-child(#{$i}) {
43
+ .sortable-item::after { content: '#{$i - 1}'; }
44
+ }
45
+ }
46
+ }
47
+ .sortable-item {
48
+ width: ($spacer * 5);
49
+ height: ($spacer * 5);
50
+ text-align: center;
51
+ background-color: $white;
52
+ border-radius: $border-radius;
53
+ overflow: hidden;
54
+ cursor: pointer;
55
+ transition: $transition-base;
56
+ &:hover {
57
+ box-shadow: $box-shadow-sm;
58
+ .delete-image-btn { bottom: 0; }
59
+ }
60
+ &::after {
61
+ position: absolute;
62
+ top: 0;
63
+ left: 0;
64
+ padding: ($spacer * .25) ($spacer * .5);
65
+ color: $body-color;
66
+ background-color: $white;
67
+ border-right: $border-width solid $border-color;
68
+ border-bottom: $border-width solid $border-color;
69
+ border-radius: $border-radius 0 $border-radius 0;
70
+ z-index: 10;
71
+ opacity: 0.9;
72
+ }
73
+ img { // keeps image scaled proportionally
74
+ position: absolute;
75
+ top: 0;
76
+ right: 0;
77
+ bottom: 0;
78
+ left: 0;
79
+ width: auto !important;
80
+ min-width: 0px !important;
81
+ max-width: 100%;
82
+ height: 100% !important;
83
+ max-height: 100%;
84
+ margin: auto;
85
+ z-index: 0;
86
+ }
87
+ .delete-image-btn {
88
+ position: absolute;
89
+ bottom: -(($spacer * 1.25) + 1rem);
90
+ right: 0;
91
+ left: 0;
92
+ z-index: 10;
93
+ background-color: $white;
94
+ transition: $transition-base;
95
+ border-top: $border-width solid $border-color;
96
+ }
97
+ }
@@ -1,5 +1,6 @@
1
+ //** Override styles for dropzone
1
2
  .dropzone-target {
2
- padding: $spacer !important;
3
+ padding: ($spacer * 1.25) !important;
3
4
  min-height: ($spacer * 6) !important;
4
5
  border: $border-width solid $border-color !important;
5
6
  background-color: $white;
@@ -13,3 +14,4 @@
13
14
  }
14
15
  [data-dz-remove] { cursor: pointer; }
15
16
  .dz-preview + .dz-preview { margin-top: $spacer; }
17
+ .dropzone .dz-message { margin: 0 !important; }
@@ -88,10 +88,12 @@
88
88
  }
89
89
  }
90
90
 
91
+ .trix-button-row { overflow-y: hidden !important; }
92
+
91
93
  // Editor similar to textarea
92
94
  trix-editor {
93
- padding: 20px;
94
- min-height: ($spacer * 5);
95
- border: $input-border-width solid $input-border-color;
96
- border-radius: $input-border-radius;
95
+ padding: $input-padding-y $input-padding-x !important;
96
+ min-height: ($spacer * 5) !important;
97
+ border: $input-border-width solid $input-border-color !important;
98
+ border-radius: $input-border-radius !important;
97
99
  }
@@ -12,10 +12,12 @@ module NfgUi
12
12
  end
13
13
 
14
14
  def bootstrap(component_name = nil, *traits, **options, &block)
15
+ traits, options = process_traits_and_options(*traits, **options)
15
16
  NfgUi::UI::Bootstrap.new(view_context, component_name, *traits, **options, &block).render_component
16
17
  end
17
18
 
18
19
  def nfg(component_name = nil, *traits, **options, &block)
20
+ traits, options = process_traits_and_options(*traits, **options)
19
21
  return unless render_nfg_component?(options)
20
22
  NfgUi::UI::NetworkForGood.new(view_context, component_name, *traits, **options, &block).render_component
21
23
  end
@@ -30,6 +32,19 @@ module NfgUi
30
32
  !options[:render_unless]
31
33
  end
32
34
  end
35
+
36
+ def process_traits_and_options(*traits, **options)
37
+ # In ruby 3 keyword arguments are separated from positional arguments
38
+ # Ensure traits is an array and default to an empty array if no elements are passed
39
+ traits = traits.empty? ? [] : traits
40
+
41
+ # Check if the last element of traits is a hash and merge it with options
42
+ if traits.last.is_a?(Hash)
43
+ options = traits.pop.merge(options)
44
+ end
45
+
46
+ [traits, options]
47
+ end
33
48
  end
34
49
  end
35
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '6.16.2'
4
+ VERSION = '6.17.0'
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: 6.16.2
4
+ version: 6.17.0
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: 2023-06-28 00:00:00.000000000 Z
12
+ date: 2024-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap
@@ -337,14 +337,56 @@ dependencies:
337
337
  requirements:
338
338
  - - "~>"
339
339
  - !ruby/object:Gem::Version
340
- version: '1.3'
340
+ version: '1.7'
341
341
  type: :development
342
342
  prerelease: false
343
343
  version_requirements: !ruby/object:Gem::Requirement
344
344
  requirements:
345
345
  - - "~>"
346
346
  - !ruby/object:Gem::Version
347
- version: '1.3'
347
+ version: '1.7'
348
+ - !ruby/object:Gem::Dependency
349
+ name: rubocop
350
+ requirement: !ruby/object:Gem::Requirement
351
+ requirements:
352
+ - - ">="
353
+ - !ruby/object:Gem::Version
354
+ version: '0'
355
+ type: :development
356
+ prerelease: false
357
+ version_requirements: !ruby/object:Gem::Requirement
358
+ requirements:
359
+ - - ">="
360
+ - !ruby/object:Gem::Version
361
+ version: '0'
362
+ - !ruby/object:Gem::Dependency
363
+ name: pry
364
+ requirement: !ruby/object:Gem::Requirement
365
+ requirements:
366
+ - - ">="
367
+ - !ruby/object:Gem::Version
368
+ version: '0'
369
+ type: :development
370
+ prerelease: false
371
+ version_requirements: !ruby/object:Gem::Requirement
372
+ requirements:
373
+ - - ">="
374
+ - !ruby/object:Gem::Version
375
+ version: '0'
376
+ - !ruby/object:Gem::Dependency
377
+ name: pry-byebug
378
+ requirement: !ruby/object:Gem::Requirement
379
+ requirements:
380
+ - - ">="
381
+ - !ruby/object:Gem::Version
382
+ version: '0'
383
+ type: :development
384
+ prerelease: false
385
+ version_requirements: !ruby/object:Gem::Requirement
386
+ requirements:
387
+ - - ">="
388
+ - !ruby/object:Gem::Version
389
+ version: '0'
348
390
  description: The embodied design system for Network for Good.
349
391
  email:
350
392
  - jonathan.roehm@networkforgood.com
@@ -859,7 +901,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
859
901
  - !ruby/object:Gem::Version
860
902
  version: '0'
861
903
  requirements: []
862
- rubygems_version: 3.1.6
904
+ rubygems_version: 3.5.18
863
905
  signing_key:
864
906
  specification_version: 4
865
907
  summary: NFG UI front-end design system code for rapid product building