@undrr/undrr-mangrove 1.3.3 → 1.4.1

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.
Files changed (166) hide show
  1. package/README.md +33 -29
  2. package/components/BarChart.js +2 -2
  3. package/components/BookCard.js +6 -0
  4. package/components/BookCard.js.LICENSE.txt +11 -0
  5. package/components/Breadcrumbs.js +6 -0
  6. package/components/Breadcrumbs.js.LICENSE.txt +9 -0
  7. package/components/Checkbox.js +6 -0
  8. package/components/Checkbox.js.LICENSE.txt +9 -0
  9. package/components/Chips.js +6 -0
  10. package/components/Chips.js.LICENSE.txt +9 -0
  11. package/components/CtaButton.js +6 -0
  12. package/components/CtaButton.js.LICENSE.txt +9 -0
  13. package/components/EmbedContainer.js +6 -0
  14. package/components/EmbedContainer.js.LICENSE.txt +9 -0
  15. package/components/Fetcher.js +2 -2
  16. package/components/Footer.js +6 -0
  17. package/components/Footer.js.LICENSE.txt +9 -0
  18. package/components/FormErrorSummary.js +6 -0
  19. package/components/FormErrorSummary.js.LICENSE.txt +9 -0
  20. package/components/FormGroup.js +6 -0
  21. package/components/FormGroup.js.LICENSE.txt +9 -0
  22. package/components/FullWidth.js +6 -0
  23. package/components/FullWidth.js.LICENSE.txt +9 -0
  24. package/components/Gallery.js +1 -1
  25. package/components/Hero.js +6 -0
  26. package/components/Hero.js.LICENSE.txt +9 -0
  27. package/components/HighlightBox.js +6 -0
  28. package/components/HighlightBox.js.LICENSE.txt +9 -0
  29. package/components/HorizontalBookCard.js +6 -0
  30. package/components/HorizontalBookCard.js.LICENSE.txt +11 -0
  31. package/components/HorizontalCard.js +6 -0
  32. package/components/HorizontalCard.js.LICENSE.txt +11 -0
  33. package/components/IconCard.js +2 -2
  34. package/components/Loader.js +6 -0
  35. package/components/Loader.js.LICENSE.txt +9 -0
  36. package/components/MapComponent.js +2 -2
  37. package/components/MegaMenu.js +2 -2
  38. package/components/PageHeader.js +6 -0
  39. package/components/PageHeader.js.LICENSE.txt +9 -0
  40. package/components/Pager.js +2 -2
  41. package/components/QuoteHighlight.js +1 -1
  42. package/components/Radio.js +6 -0
  43. package/components/Radio.js.LICENSE.txt +9 -0
  44. package/components/ScrollContainer.js +1 -1
  45. package/components/Select.js +6 -0
  46. package/components/Select.js.LICENSE.txt +9 -0
  47. package/components/ShareButtons.js +1 -1
  48. package/components/ShowMore.js +6 -0
  49. package/components/ShowMore.js.LICENSE.txt +9 -0
  50. package/components/StatsCard.js +2 -2
  51. package/components/SyndicationSearchWidget.js +2 -2
  52. package/components/Tab.js +6 -0
  53. package/components/Tab.js.LICENSE.txt +9 -0
  54. package/components/TextCta.js +6 -0
  55. package/components/TextCta.js.LICENSE.txt +11 -0
  56. package/components/TextInput.js +6 -0
  57. package/components/TextInput.js.LICENSE.txt +9 -0
  58. package/components/Textarea.js +6 -0
  59. package/components/Textarea.js.LICENSE.txt +9 -0
  60. package/components/VerticalCard.js +6 -0
  61. package/components/VerticalCard.js.LICENSE.txt +11 -0
  62. package/components/hydrate.js +1 -1
  63. package/css/style-delta.css +467 -0
  64. package/css/style-delta.css.map +1 -0
  65. package/css/style-gutenberg.css +21 -18
  66. package/css/style-gutenberg.css.map +1 -1
  67. package/css/style-irp-legacy.css +472 -0
  68. package/css/style-irp-legacy.css.map +1 -0
  69. package/css/style-irp.css +99 -103
  70. package/css/style-irp.css.map +1 -1
  71. package/css/style-legacy.css +465 -0
  72. package/css/style-legacy.css.map +1 -0
  73. package/css/style-mcr-legacy.css +472 -0
  74. package/css/style-mcr-legacy.css.map +1 -0
  75. package/css/style-mcr.css +99 -103
  76. package/css/style-mcr.css.map +1 -1
  77. package/css/style-preventionweb-legacy.css +472 -0
  78. package/css/style-preventionweb-legacy.css.map +1 -0
  79. package/css/style-preventionweb.css +99 -103
  80. package/css/style-preventionweb.css.map +1 -1
  81. package/css/style.css +99 -103
  82. package/css/style.css.map +1 -1
  83. package/error-pages/401.html +10 -11
  84. package/error-pages/403.html +11 -12
  85. package/error-pages/404.html +13 -14
  86. package/error-pages/429.html +12 -13
  87. package/error-pages/500.html +10 -11
  88. package/error-pages/502.html +12 -13
  89. package/error-pages/503.html +12 -13
  90. package/error-pages/504.html +10 -11
  91. package/error-pages/5xx.html +10 -11
  92. package/error-pages/challenge.html +12 -13
  93. package/error-pages/managed-challenge.html +12 -13
  94. package/js/README.md +57 -0
  95. package/js/__tests__/show-more.test.js +76 -0
  96. package/js/__tests__/table-of-contents.test.js +198 -0
  97. package/js/on-this-page-nav.js +531 -0
  98. package/js/show-more.js +24 -3
  99. package/js/table-of-contents.js +168 -0
  100. package/js/tabs.js +445 -83
  101. package/package.json +1 -1
  102. package/scss/Atom/BaseTypography/Blockquote/blockquote.scss +1 -8
  103. package/scss/Atom/BaseTypography/Cite/cite.scss +2 -2
  104. package/scss/Atom/Images/AuthorImage/author-image.scss +4 -4
  105. package/scss/Atom/Images/ImageCaptionCredit/image-caption-credit.scss +24 -28
  106. package/scss/Atom/Images/ImageCredit/image-credit.scss +1 -1
  107. package/scss/Atom/Layout/Container/container.scss +2 -2
  108. package/scss/Atom/Layout/Grid/grid.scss +1 -1
  109. package/scss/Atom/ReachElement/Details/details.scss +6 -6
  110. package/scss/Atom/ReachElement/Figcaption/figcaption.scss +1 -1
  111. package/scss/Atom/Table/table.scss +0 -8
  112. package/scss/Components/Boilerplate/boilerplate.scss +2 -2
  113. package/scss/Components/Breadcrumbs/breadcrumbs.scss +2 -9
  114. package/scss/Components/Buttons/Chips/chips.scss +5 -19
  115. package/scss/Components/Buttons/CtaButton/buttons.scss +3 -124
  116. package/scss/Components/Buttons/CtaButton/cta-button.scss +99 -0
  117. package/scss/Components/Buttons/ShareButtons/share-buttons.scss +2 -2
  118. package/scss/Components/Cards/Card/card.scss +45 -6
  119. package/scss/Components/Cards/StatsCard/stats-card.scss +2 -2
  120. package/scss/Components/ErrorPages/error-pages.scss +12 -12
  121. package/scss/Components/Footer/footer.scss +72 -4
  122. package/scss/Components/Forms/Select/select.scss +2 -2
  123. package/scss/Components/Forms/_form-base.scss +5 -5
  124. package/scss/Components/Forms/_form-legacy.scss +1 -1
  125. package/scss/Components/Gallery/gallery.scss +7 -7
  126. package/scss/Components/Hero/hero.scss +43 -23
  127. package/scss/Components/HighlightBox/highlight-box.scss +5 -5
  128. package/scss/Components/MegaMenu/mega-menu.scss +750 -0
  129. package/scss/Components/MegaMenu/megamenu.scss +3 -733
  130. package/scss/Components/OnThisPageNav/on-this-page-nav.scss +206 -0
  131. package/scss/Components/PageHeader/page-header.scss +5 -5
  132. package/scss/Components/Pagination/pagination.scss +2 -2
  133. package/scss/Components/ScrollContainer/scroll-container.scss +1 -1
  134. package/scss/Components/Snackbar/snackbar.scss +1 -1
  135. package/scss/Components/SyndicationSearchWidget/SyndicationSearchWidget.scss +3 -1480
  136. package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +1515 -0
  137. package/scss/Components/Tab/tab.scss +68 -9
  138. package/scss/Components/TableOfContents/TableOfContents.scss +3 -17
  139. package/scss/Components/TableOfContents/table-of-contents.scss +17 -0
  140. package/scss/Components/TextCta/text-cta.scss +139 -0
  141. package/scss/Components/TextCta/textcta.scss +3 -27
  142. package/scss/Molecules/ImageCaption/image-caption.scss +6 -16
  143. package/scss/Molecules/SectionHeader/section-header.scss +8 -0
  144. package/scss/Molecules/SectionHeader/sectionheader.scss +3 -8
  145. package/scss/Utilities/FullWidth/FullWidth.scss +3 -23
  146. package/scss/Utilities/FullWidth/full-width.scss +23 -0
  147. package/scss/Utilities/Loader/loader.scss +1 -1
  148. package/scss/Utilities/ShowMore/ShowMore.scss +3 -26
  149. package/scss/Utilities/ShowMore/show-more.scss +26 -0
  150. package/scss/assets/scss/_components.scss +15 -9
  151. package/scss/assets/scss/_foundational.scss +13 -7
  152. package/scss/assets/scss/_mixins.scss +9 -314
  153. package/scss/assets/scss/_utility.scss +19 -71
  154. package/scss/assets/scss/_variables-delta.scss +110 -0
  155. package/scss/assets/scss/_variables-irp.scss +1 -1
  156. package/scss/assets/scss/_variables-mcr.scss +1 -1
  157. package/scss/assets/scss/_variables-preventionweb.scss +1 -1
  158. package/scss/assets/scss/_variables.scss +101 -34
  159. package/scss/assets/scss/style-delta.scss +8 -0
  160. package/scss/assets/scss/style-gutenberg.scss +2 -2
  161. package/scss/assets/scss/style-irp-legacy.scss +20 -0
  162. package/scss/assets/scss/style-legacy.scss +20 -0
  163. package/scss/assets/scss/style-mcr-legacy.scss +20 -0
  164. package/scss/assets/scss/style-preventionweb-legacy.scss +20 -0
  165. package/scss/Components/BlockquoteComponent/blockquotecomp.scss +0 -31
  166. package/scss/Components/Buttons/CtaLink/cta-link.scss +0 -61
@@ -0,0 +1,206 @@
1
+ // On this page nav
2
+ // https://gitlab.com/undrr/web-backlog/-/issues/337
3
+ // A sticky horizontal navigation bar that links to page sections.
4
+ // Supports auto-detected headings or explicit author-provided links,
5
+ // with optional CTA button and scroll-spy active state.
6
+
7
+ .mg-on-this-page-nav {
8
+ // --mg-on-this-page-nav-offset: docking offset for fixed headers (default: 0px).
9
+ // Set this in your theme CSS to dock below a sticky MegaMenu or header.
10
+ position: sticky;
11
+ top: var(--mg-on-this-page-nav-offset, 0);
12
+ z-index: $mg-z-index-sticky; // above MegaMenu, below PageHeader
13
+ display: flex;
14
+ align-items: center;
15
+ background: $mg-color-neutral-0;
16
+ box-shadow: 0 2px 3px 0 rgb(51 51 51 / 0.31);
17
+ padding: 0 $mg-container-spacer;
18
+
19
+ // Full-bleed: break out of any parent container to span the viewport.
20
+ // Works even when nested inside an mg-container or Drupal content column.
21
+ width: 100vw;
22
+ margin-inline-start: calc(50% - 50vw);
23
+
24
+ // Un-stick on short viewports so the bar doesn't dominate the screen.
25
+ // GOV.UK accessibility research found sticky elements at 400% zoom consumed
26
+ // 30%+ of viewport — this prevents that. (technology.blog.gov.uk/2018/05/21)
27
+ @media screen and (height <= 400px) {
28
+ position: static;
29
+ box-shadow: none;
30
+ border-bottom: 1px solid $mg-color-neutral-50;
31
+ }
32
+
33
+ @media screen and (min-width: $mg-breakpoint-tablet) {
34
+ padding: 0 $mg-spacing-200;
35
+ }
36
+
37
+ &--hidden {
38
+ display: none;
39
+ }
40
+
41
+ &__list {
42
+ display: flex;
43
+ align-items: center;
44
+ list-style: none;
45
+ margin: 0;
46
+ padding: 0;
47
+ overflow-x: auto;
48
+ overscroll-behavior-x: contain;
49
+ flex: 1 1 auto;
50
+
51
+ // Fade gradient on the trailing edge signals more content is scrollable.
52
+ // Uses mask-image so the fade is transparent (works on any background).
53
+ // padding-inline-end gives the fade space so text isn't masked mid-character.
54
+ padding-inline-end: $mg-spacing-300;
55
+ -webkit-mask-image: linear-gradient(to right, #000 calc(100% - #{$mg-spacing-500}), transparent);
56
+ mask-image: linear-gradient(to right, #000 calc(100% - #{$mg-spacing-500}), transparent);
57
+
58
+ // Hide scrollbar but keep functional
59
+ scrollbar-width: none;
60
+
61
+ &::-webkit-scrollbar {
62
+ display: none;
63
+ }
64
+
65
+ // When content is scrolled left, also fade the leading edge so users know
66
+ // items are hidden behind the scroll button on that side.
67
+ .mg-on-this-page-nav--has-left-overflow & {
68
+ padding-inline-start: $mg-spacing-300;
69
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 #{$mg-spacing-500}, #000 calc(100% - #{$mg-spacing-500}), transparent);
70
+ mask-image: linear-gradient(to right, transparent, #000 #{$mg-spacing-500}, #000 calc(100% - #{$mg-spacing-500}), transparent);
71
+ }
72
+ }
73
+
74
+ &__item {
75
+ flex-shrink: 0;
76
+ display: flex;
77
+ }
78
+
79
+ &__link {
80
+ display: block;
81
+ padding: $mg-spacing-150 $mg-spacing-150;
82
+ font-family: $mg-font-family-condensed;
83
+ font-size: $mg-font-size-250;
84
+ font-weight: 600;
85
+ color: $mg-color-neutral-600;
86
+ text-decoration: none;
87
+ white-space: nowrap;
88
+ border-bottom: 3px solid transparent;
89
+ transition: color 0.2s ease, border-color 0.2s ease;
90
+
91
+ @media (prefers-reduced-motion: reduce) {
92
+ transition: none;
93
+ }
94
+
95
+ &:hover {
96
+ color: $mg-color-interactive-active;
97
+ border-bottom-color: $mg-color-interactive-active;
98
+ text-decoration: none;
99
+ }
100
+
101
+ &:focus-visible {
102
+ outline: 2px solid $mg-color-interactive;
103
+ outline-offset: -2px;
104
+ }
105
+
106
+ // Active state and active+hover — active wins over hover
107
+ &--active,
108
+ &--active:hover {
109
+ color: $mg-color-interactive;
110
+ border-bottom-color: $mg-color-interactive;
111
+ }
112
+ }
113
+
114
+ &__cta {
115
+ flex-shrink: 0;
116
+ margin-inline-start: auto;
117
+ padding: $mg-spacing-150 $mg-spacing-150;
118
+ font-family: $mg-font-family-condensed;
119
+ font-size: $mg-font-size-250;
120
+ font-weight: 600;
121
+ color: $mg-color-neutral-0;
122
+ background: $mg-color-interactive;
123
+ text-decoration: none;
124
+ white-space: nowrap;
125
+ border: 0;
126
+ cursor: pointer;
127
+ transition: background-color 0.2s ease;
128
+
129
+ @media (prefers-reduced-motion: reduce) {
130
+ transition: none;
131
+ }
132
+
133
+ &:hover {
134
+ background: $mg-color-interactive-active;
135
+ text-decoration: none;
136
+ color: $mg-color-neutral-0;
137
+ }
138
+
139
+ &:focus-visible {
140
+ outline: 2px solid $mg-color-interactive;
141
+ outline-offset: 2px;
142
+ }
143
+ }
144
+
145
+ // Scroll arrow buttons — injected by JS when the list overflows.
146
+ // hidden attribute is toggled by JS based on scroll position.
147
+ &__scroll-btn {
148
+ flex-shrink: 0;
149
+ align-self: stretch;
150
+ display: flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ min-width: $mg-spacing-250; // WCAG 2.5.8 minimum touch target (24px)
154
+ padding: 0 $mg-spacing-150;
155
+ border: 0;
156
+ background: $mg-color-neutral-0;
157
+ cursor: pointer;
158
+ color: $mg-color-neutral-600;
159
+ transition: color 0.2s ease;
160
+
161
+ // display:flex above would otherwise override the UA [hidden]{display:none} rule
162
+ // since author styles always beat the user-agent stylesheet.
163
+ &[hidden] {
164
+ display: none;
165
+ }
166
+
167
+ @media (prefers-reduced-motion: reduce) {
168
+ transition: none;
169
+ }
170
+
171
+ &:hover {
172
+ color: $mg-color-interactive-active;
173
+ }
174
+
175
+ &:focus-visible {
176
+ outline: 2px solid $mg-color-interactive;
177
+ outline-offset: -2px;
178
+ }
179
+
180
+ svg {
181
+ display: block;
182
+ pointer-events: none;
183
+ }
184
+
185
+ // In RTL, flex reversal places prevBtn on the right and nextBtn on the left,
186
+ // so the chevron icons point in the opposite physical direction from the scroll.
187
+ // Flip them so each icon still points toward its scroll destination.
188
+ [dir="rtl"] & {
189
+ svg { transform: scaleX(-1); }
190
+ }
191
+ }
192
+ }
193
+
194
+ // RTL: flex layout places prevBtn at the right (visual-start) edge and nextBtn
195
+ // at the left (visual-end) edge. The JS scrollBy direction, button visibility,
196
+ // and chevron icon direction are all RTL-aware. The mask-image gradient uses
197
+ // physical `to right` which fades the correct edge in LTR; RTL gradient
198
+ // correction is a known open item.
199
+
200
+ // Arabic font override
201
+ :lang(ar) {
202
+ .mg-on-this-page-nav__link,
203
+ .mg-on-this-page-nav__cta {
204
+ font-family: $mg-font-family-arabic-headings;
205
+ }
206
+ }
@@ -12,7 +12,7 @@
12
12
  url(//www.undrr.org/themes/custom/undrr_common/images/toolbar-background.png)
13
13
  no-repeat center center;
14
14
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.3);
15
- z-index: 22;
15
+ z-index: $mg-z-index-header;
16
16
 
17
17
  @media (width >= $mg-breakpoint-tablet) {
18
18
  .mg-page-header__container {
@@ -24,7 +24,7 @@
24
24
  &__region--toolbar {
25
25
  display: flex;
26
26
  align-items: center;
27
- gap: 1rem;
27
+ gap: mg-rem(10);
28
28
 
29
29
  a {
30
30
  color: #fff;
@@ -41,7 +41,7 @@
41
41
 
42
42
  &__block--logo {
43
43
  flex-grow: 1;
44
- padding: 0.5rem 0 0.5rem 0.1rem;
44
+ padding: mg-rem(5) 0 mg-rem(5) 1px;
45
45
  }
46
46
 
47
47
  &__logo-img {
@@ -85,11 +85,11 @@
85
85
  padding-right: 30px;
86
86
  border: none;
87
87
  border-radius: 0;
88
- font-size: 1.65rem;
88
+ font-size: $mg-font-size-300;
89
89
  background-color: transparent;
90
90
  color: #fff;
91
91
  direction: rtl;
92
- line-height: 2rem;
92
+ line-height: mg-rem(20);
93
93
 
94
94
  option {
95
95
  color: #333;
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  span {
23
- margin: 0 0.375rem;
23
+ margin: 0 mg-rem(4);
24
24
 
25
25
  &:last-of-type {
26
26
  margin-right: 0;
@@ -102,7 +102,7 @@
102
102
  span {
103
103
  &:last-of-type {
104
104
  margin-left: 0;
105
- margin-right: 0.375rem;
105
+ margin-right: mg-rem(4);
106
106
  }
107
107
  }
108
108
  }
@@ -24,7 +24,7 @@
24
24
  right: 0;
25
25
  display: flex;
26
26
  gap: $mg-spacing-50;
27
- z-index: 1;
27
+ z-index: 1; // scroll nav above container content — local to scroll-container stacking context
28
28
 
29
29
  &-button {
30
30
  width: $mg-spacing-300;
@@ -8,7 +8,7 @@
8
8
  justify-content: center;
9
9
  transform: translate(-50%, -300%);
10
10
  transition: transform 0.3s ease-in-out;
11
- z-index: 9999; // Ensure snackbar appears above other elements
11
+ z-index: $mg-z-index-toast; // above modals and all page chrome
12
12
  width: calc(100% - 32px); // Ensure it works on small screens
13
13
  max-width: 600px; // Limit width on large screens
14
14