form-jekyll 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e45546fe7f704b3781861c946e21f369761d572724f1476977df834ccb63b5e
4
- data.tar.gz: 1bb01c8be4ee7a95d3e2089e7ab0d72210a0f6307fbd426233faf016076a0738
3
+ metadata.gz: 9d4eedf7d115d897a02d59f493e7119a4f67af9f789986fd8960399e97dc87c7
4
+ data.tar.gz: c4608e50096dc277fa83b97bb80bd077e89c32c6bf48a518455bbb07af0a2fbf
5
5
  SHA512:
6
- metadata.gz: eedf2b33692e184c218042aa7d6cdb82e6d635c2fad2f35cb65172772fdabc0a6f80b00e8d030ee22dbef1e67de77ca8e2f557de305e7a1a32c108b5096763b9
7
- data.tar.gz: 69a48cb0d587dafd55a1802a2c03049e11702c2f9b5674b8d3a6f5f85cfca06bf5f2f44366ea3c0506fd734d32d361c48607a3e51d114766173f215de3d262fc
6
+ metadata.gz: 52ee297c15aae4ac4a3e1ed27c924daf55ecf7e79ea7b95eb34c2821e36618999bbc6d39ca9aa039c0231b5d752e156eceb1430f2e1c5cb0794c83e1aadea695
7
+ data.tar.gz: 19b70cc8bd8f7ae572935aca6cce0fa3ada77b8c06b2acdba860816ac4617cccae0a152c1f1c76dce7f1227ecb53730c4033cddb69fd170a61a178a45ed84ee1
@@ -1,3 +1,3 @@
1
- {% if annotation %}
2
- <div class="field-annotation">{{ annotation | markdownify | improve}}</div>
1
+ {% if include.annotation %}
2
+ <div class="field-annotation">{{ include.annotation | markdownify | improve}}</div>
3
3
  {% endif %}
@@ -7,6 +7,7 @@
7
7
  {% if options %}
8
8
  {% for option in options %}
9
9
  <label class="checkbox">
10
+ {% include elements/annotation.html annotation=option.annotation %}
10
11
  <input type="checkbox" value="{{ option.label }}" name="{{ name }}"
11
12
  {% if option.checked %}checked="checked"{% endif %}
12
13
  {% if option.shows %} data-shows="{{ option.shows }}"{% endif %}
@@ -5,6 +5,7 @@
5
5
  <div class="field-container valtype" data-valtype="radios">
6
6
  {% for option in options %}
7
7
  <label class="radio">
8
+ {% include elements/annotation.html annotation=option.annotation %}
8
9
  <input type="radio" value="{{ option.label }}" name="{{ name }}"
9
10
  {% if option.checked %} checked="checked"{% endif %}
10
11
  {% if option.shows %} data-shows="{{ option.shows }}"{% endif %}
@@ -44,16 +44,16 @@
44
44
  {% elsif field.type == 'link' %}
45
45
  {% include {{ includepath }} %}
46
46
  {% elsif field.type == 'address' %}
47
- <div class="field-address {% if field.hidden %}field-hidden{% endif %}">
47
+ <div class="field-address" {% if field.hidden %}data-hidden="true"{% endif %}>
48
48
 
49
- {% include elements/annotation.html %}
49
+ {% include elements/annotation.html annotation=annotation %}
50
50
  {% include {{ includepath }} %}
51
51
 
52
52
  </div>
53
53
  {% else %}
54
- <div class="form-group field-{{ field.type }} {% if field.hidden %}field-hidden{% endif %}">
54
+ <div class="form-group field-{{ field.type }}" {% if field.hidden %}data-hidden="true"{% endif %}>
55
55
 
56
- {% include elements/annotation.html %}
56
+ {% include elements/annotation.html annotation=annotation %}
57
57
 
58
58
  {% if field.type %}
59
59
  {% include {{ includepath }} %}
@@ -1,19 +1,35 @@
1
1
  {% capture currentform %}{{ include.form }}{% endcapture %}
2
2
 
3
- {% for page in site.data[currentform] %}
3
+ {% for currentpage in site.data[currentform] %}
4
4
 
5
- {% assign fields = page.fields %}
6
- {% assign label = page.title %}
5
+ {% assign fields = currentpage.fields %}
6
+ {% assign label = currentpage.title %}
7
7
 
8
- <div class="form-section"{% if page.group %} data-group="{{ page.group }}"{% endif %}>
8
+ {% assign length = forloop.length %}
9
9
 
10
- {% comment %} Page headers {% endcomment %}
11
- <header class="hero-banner default">
10
+ {% assign percentdone = forloop.index | times: '100' | divided_by: forloop.length %}
11
+
12
+ <div class="form-section"{% if currentpage.group %} data-group="{{ currentpage.group }}"{% endif %}>
13
+
14
+ <header class="hero-banner default" id="page-{{ forloop.index }}">
15
+ <div class="form-header-meta">
16
+ {% comment %} Form title {% endcomment %}
17
+ <h2>{{ page.title }}</h2>
18
+
19
+ <div class="form-progress">
20
+ {% if length < 6 %}
21
+ <div class="form-progress-bubble">Page {{ forloop.index }} of {{ length }}</div>
22
+ {% else %}
23
+ {% comment %} Progress bar {% endcomment %}
24
+ <div class="form-progress-bar form-progress-bar-{{ percentdone }}">{{ percentdone }}% done</div>
25
+ {% endif %}
26
+ </div>
27
+ </div>
12
28
  <h1>
13
29
  {{ label | markdownify | remove: '<p>' | remove: '</p>' }}
14
30
  </h1>
15
- {% if page.description %}
16
- {{ page.description | markdownify | improve }}
31
+ {% if currentpage.description %}
32
+ {{ currentpage.description | markdownify | improve }}
17
33
  {% endif %}
18
34
  </header>
19
35
 
@@ -23,7 +39,7 @@
23
39
  <div class="nav-on-top">
24
40
  {% include pagination.html %}
25
41
  </div>
26
- {% comment %} Render fields in the page {% endcomment %}
42
+ {% comment %} Render fields in the currentpage {% endcomment %}
27
43
  {% include render_field.html %}
28
44
 
29
45
  {% include pagination.html %}
@@ -1,4 +1,4 @@
1
- <header role="banner">
1
+ <header role="banner" id="sfgov-header">
2
2
  <div class="sfgov-nav-container">
3
3
  <div class="sfgov-nav-container__content">
4
4
  <div class="sfgov-logo__container">
@@ -587,23 +587,34 @@ option:not(:checked) {
587
587
  @include line-height-to-rem(27);
588
588
  }
589
589
 
590
- h1 {
590
+ @mixin display-2 {
591
+ font-weight: $t-light;
592
+ @include font-size-to-rem(50);
593
+ @include line-height-to-rem(59);
594
+ letter-spacing: -1px;
595
+ }
596
+
597
+ .t-display-2 {
598
+ @include display-2;
599
+ }
600
+
601
+ h1, .h1 {
591
602
  @include h1;
592
603
  }
593
604
 
594
- h2 {
605
+ h2, .h2 {
595
606
  @include h2;
596
607
  }
597
608
 
598
- h3 {
609
+ h3, .h3 {
599
610
  @include h3;
600
611
  }
601
612
 
602
- h4 {
613
+ h4, .h4 {
603
614
  @include h4;
604
615
  }
605
616
 
606
- h5 {
617
+ h5, .h5 {
607
618
  @include h5;
608
619
  }
609
620
 
@@ -627,6 +638,13 @@ h5 {
627
638
  @include contain-1090;
628
639
  }
629
640
 
641
+ .form-header-meta {
642
+ position: relative;
643
+ margin-bottom: 1.5rem;
644
+ }
645
+
646
+ .form-header-meta,
647
+ .form-section h1,
630
648
  .form-content-inner {
631
649
  max-width: 38rem;
632
650
  }
@@ -768,7 +786,7 @@ h5 {
768
786
  }
769
787
  }
770
788
 
771
- .field-hidden {
789
+ div[data-hidden] {
772
790
  position: absolute;
773
791
  width: 1px;
774
792
  height: 1px;
@@ -902,8 +920,65 @@ h5 {
902
920
  }
903
921
  }
904
922
 
905
- // Field length
923
+ // Progress
924
+
925
+ .form-progress {
926
+ position: absolute;
927
+ top: 0;
928
+ right: 0;
929
+ }
930
+
931
+ .form-progress-bubble {
932
+ background: $purple-1;
933
+ padding: 0.25rem 1rem;
934
+ border-radius: 1.5rem;
935
+ position: relative;
936
+ top: -0.25rem;
937
+ font-size: 1rem;
938
+ }
939
+
940
+ .form-progress-bar {
941
+ font-size: 0;
942
+ color: transparent;
943
+ background: $purple-1;
944
+ height: 0.75rem;
945
+ display: inline-block;
946
+ width: 10rem;
947
+ position: relative;
948
+ top: -0.125rem;
949
+ border-radius: 0.375rem;
950
+ &::before {
951
+ content: '';
952
+ background: #6b8292;
953
+ height: 0.75rem;
954
+ border-radius: 0.375rem 0 0 0.375rem;
955
+ position: absolute;
956
+ top: 0;
957
+ left: 0;
958
+ }
959
+ }
906
960
 
961
+ @for $i from 1 to 90 {
962
+ .form-progress-bar-#{$i}::before {
963
+ width: $i * 1%;
964
+ }
965
+ }
966
+
967
+ @for $i from 91 to 99 {
968
+ .form-progress-bar-#{$i} {
969
+ background: #6b8292;
970
+ &::before {
971
+ background: $purple-1;
972
+ left: auto;
973
+ right: 0;
974
+ border-radius: 0 0.375rem 0.375rem 0;
975
+ width: (100% - ($i * 1%));
976
+ }
977
+ }
978
+ }
979
+
980
+
981
+ // Field length
907
982
 
908
983
  @for $i from 1 to 16 {
909
984
  .length-#{$i} {
@@ -912,4 +987,12 @@ h5 {
912
987
  }
913
988
  }
914
989
 
990
+ // Header
991
+
992
+ .hero-banner h2 {
993
+ font-size: 1rem;
994
+ font-weight: $t-normal;
995
+ margin-bottom: 0.25rem;
996
+ }
997
+
915
998
  @import 'sfgov';
@@ -148,6 +148,12 @@ $shadow: 0 1px 4px rgba(#000, 0.06);
148
148
  z-index: 20;
149
149
  border-radius: 2px;
150
150
 
151
+ .radio &,
152
+ .checkbox & {
153
+ left: 8rem;
154
+ top: 0;
155
+ }
156
+
151
157
  p {
152
158
  margin: 0 0 0.25rem;
153
159
 
@@ -201,7 +207,7 @@ $shadow: 0 1px 4px rgba(#000, 0.06);
201
207
  }
202
208
  }
203
209
 
204
- .show-hidden .field-hidden {
210
+ .show-hidden div[data-hidden] {
205
211
  position: static;
206
212
  width: inherit;
207
213
  height: inherit;
@@ -76,6 +76,9 @@ $(document).ready(function(){
76
76
  } else {
77
77
  // If the page is visible, show it
78
78
  activePage.addClass('active');
79
+
80
+ // Scroll to the top of the page
81
+ document.getElementById("sfgov-header").scrollIntoView();
79
82
  }
80
83
  }
81
84
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: form-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Rubenoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-05 00:00:00.000000000 Z
11
+ date: 2019-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll