@undrr/undrr-mangrove 2.2.0 → 2.3.0

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 (86) hide show
  1. package/README.md +1 -1
  2. package/components/BookCard.js +1 -1
  3. package/components/Breadcrumbs.js +1 -1
  4. package/components/Checkbox.js +1 -1
  5. package/components/Chips.js +1 -1
  6. package/components/ContentCard.js +1 -1
  7. package/components/ContentTeaser.js +1 -1
  8. package/components/CopyButton.js +2 -2
  9. package/components/CtaButton.js +1 -1
  10. package/components/Drawer.js +2 -2
  11. package/components/Drawer.js.LICENSE.txt +1 -1
  12. package/components/DrupalContentPatterns.js +1 -1
  13. package/components/EmbedContainer.js +1 -1
  14. package/components/Footer.js +1 -1
  15. package/components/FormAction.js +1 -1
  16. package/components/FormErrorSummary.js +1 -1
  17. package/components/FormGroup.js +1 -1
  18. package/components/FullWidth.js +1 -1
  19. package/components/Gallery.js +2 -2
  20. package/components/Hero.js +1 -1
  21. package/components/HighlightBox.js +1 -1
  22. package/components/HorizontalBookCard.js +2 -2
  23. package/components/HorizontalBookCard.js.LICENSE.txt +1 -1
  24. package/components/HorizontalCard.js +2 -2
  25. package/components/HorizontalCard.js.LICENSE.txt +1 -1
  26. package/components/IconCard.js +2 -2
  27. package/components/IconCard.js.LICENSE.txt +1 -1
  28. package/components/Legend.js +1 -1
  29. package/components/Loader.js +1 -1
  30. package/components/MegaMenu.js +2 -2
  31. package/components/Notice.js +1 -1
  32. package/components/PageHeader.js +1 -1
  33. package/components/Pager.js +1 -1
  34. package/components/ProgressBar.js +1 -1
  35. package/components/QuoteHighlight.js +2 -2
  36. package/components/QuoteHighlight.js.LICENSE.txt +1 -1
  37. package/components/Radio.js +1 -1
  38. package/components/Range.js +1 -1
  39. package/components/ScrollContainer.js +2 -2
  40. package/components/SegmentedControl.js +1 -1
  41. package/components/Select.js +1 -1
  42. package/components/ServiceNotice.js +2 -2
  43. package/components/ShareButtons.js +2 -2
  44. package/components/ShowMore.js +1 -1
  45. package/components/SkipLink.js +1 -1
  46. package/components/StatsCard.js +2 -2
  47. package/components/StatsCard.js.LICENSE.txt +1 -1
  48. package/components/SyndicationSearchWidget.js +2 -2
  49. package/components/Tab.js +2 -2
  50. package/components/TextCta.js +2 -2
  51. package/components/TextCta.js.LICENSE.txt +1 -1
  52. package/components/TextInput.js +1 -1
  53. package/components/Textarea.js +1 -1
  54. package/components/Tree.js +1 -1
  55. package/components/UserFeedback.js +2 -2
  56. package/components/VerticalCard.js +2 -2
  57. package/components/VerticalCard.js.LICENSE.txt +1 -1
  58. package/components/hydrate.js +1 -1
  59. package/css/style-all.css +4 -4
  60. package/css/style-all.css.map +1 -1
  61. package/css/style-delta.css +4 -4
  62. package/css/style-delta.css.map +1 -1
  63. package/css/style-gutenberg.css +1 -1
  64. package/css/style-irp.css +4 -4
  65. package/css/style-irp.css.map +1 -1
  66. package/css/style-mcr.css +4 -4
  67. package/css/style-mcr.css.map +1 -1
  68. package/css/style-preventionweb.css +4 -4
  69. package/css/style-preventionweb.css.map +1 -1
  70. package/css/style.css +4 -4
  71. package/css/style.css.map +1 -1
  72. package/docs/EDITORIAL-MANUAL.md +1 -1
  73. package/error-pages/401.html +1 -1
  74. package/error-pages/403.html +1 -1
  75. package/error-pages/404.html +1 -1
  76. package/error-pages/429.html +1 -1
  77. package/error-pages/500.html +1 -1
  78. package/error-pages/502.html +1 -1
  79. package/error-pages/503.html +1 -1
  80. package/error-pages/504.html +1 -1
  81. package/error-pages/5xx.html +1 -1
  82. package/error-pages/challenge.html +1 -1
  83. package/error-pages/managed-challenge.html +1 -1
  84. package/package.json +1 -1
  85. package/scss/Components/MegaMenu/mega-menu.scss +57 -33
  86. package/scss/assets/scss/_variables.scss +1 -1
@@ -12,7 +12,9 @@
12
12
  .mg-mega-wrapper {
13
13
  position: relative;
14
14
  background: rgb(var(--mg-color-white));
15
- box-shadow: inset 0 -1px 0 rgb(var(--mg-color-neutral-600) / 0.24);
15
+
16
+ // Paint below the header so opaque logo/trigger surfaces cannot cover it.
17
+ box-shadow: 0 1px 0 rgb(var(--mg-color-neutral-600) / 0.24);
16
18
  z-index: var(--mg-z-index-nav);
17
19
  }
18
20
 
@@ -22,9 +24,7 @@
22
24
  align-items: flex-start;
23
25
  z-index: var(--mg-z-index-nav);
24
26
 
25
- // In the default variant this class is on the nav <ul> itself (the branded
26
- // variant puts it on a wrapping <div> and uses &__nav for the list), so it
27
- // is a list class and carries the house rule.
27
+ // Plain HTML consumers can use this class directly on a navigation list.
28
28
  @include mg-list-unmarked;
29
29
 
30
30
  padding: 0;
@@ -36,17 +36,38 @@
36
36
  }
37
37
 
38
38
  // Kept max-width based to avoid a Firefox glitch with .mg-container-full-width.
39
- @media screen and (max-width: $mg-breakpoint-tablet) {
40
- padding-left: mg-rem(40); // space for the icon button
41
- overflow-x: hidden; // primarily for mobile
39
+ @media screen and (width < $mg-breakpoint-tablet) {
40
+ position: relative;
41
+ padding-inline-start: mg-rem(40); // space for the icon button
42
+ overflow-x: auto;
43
+ overscroll-behavior-inline: contain;
44
+ scrollbar-width: none;
45
+ }
46
+
47
+ // React keeps the hamburger outside the scrolling rail in both variants.
48
+ // Avoid sticky flex children: WebKit can scroll them out of view in RTL.
49
+ @media screen and (width < $mg-breakpoint-tablet) {
50
+ &:has(> .mg-mega-topbar__nav) {
51
+ padding-inline-start: 0;
52
+ overflow: hidden;
53
+ }
54
+
55
+ > .mg-mega-topbar-mobile__icon-button {
56
+ position: relative;
57
+ inset: auto;
58
+ width: mg-rem(40);
59
+ flex-shrink: 0;
60
+ align-self: stretch;
61
+ background: rgb(var(--mg-color-white));
62
+ }
42
63
  }
43
64
 
44
65
  // --- Branded variant (with inline logo) ---
45
66
  &--branded {
46
67
  align-items: center;
47
68
 
48
- @media screen and (max-width: $mg-breakpoint-tablet) {
49
- padding-left: 0; // logo replaces the left padding
69
+ @media screen and (width < $mg-breakpoint-tablet) {
70
+ padding-inline-start: 0; // logo replaces the left padding
50
71
  overflow-x: hidden;
51
72
  }
52
73
 
@@ -72,6 +93,10 @@
72
93
  justify-content: flex-end;
73
94
  flex: 1;
74
95
 
96
+ @media screen and (width < $mg-breakpoint-tablet) {
97
+ justify-content: flex-start;
98
+ }
99
+
75
100
  @include mg-list-unmarked;
76
101
 
77
102
  margin: 0;
@@ -109,11 +134,23 @@
109
134
 
110
135
  @include mg-list-unmarked;
111
136
 
112
- // Clip overflow on mobile so the scrolling content hint works correctly.
113
- // pointer-events is left as auto here — it is restricted only when JS has
114
- // initialised the full mega menu (see .mg-mega-wrapper--js-active below).
115
- @media screen and (max-width: $mg-breakpoint-tablet) {
116
- overflow: hidden;
137
+ // The branded rail scrolls independently of the logo and hamburger.
138
+ @media screen and (width < $mg-breakpoint-tablet) {
139
+ overflow-x: auto;
140
+ overscroll-behavior-inline: contain;
141
+ scrollbar-width: none;
142
+ cursor: grab;
143
+ user-select: none;
144
+
145
+ &:active {
146
+ cursor: grabbing;
147
+ }
148
+
149
+ .mg-mega-topbar__item-link {
150
+ cursor: inherit;
151
+ }
152
+
153
+ justify-content: flex-start;
117
154
  flex: 1;
118
155
  min-width: 0;
119
156
  }
@@ -148,6 +185,7 @@
148
185
  }
149
186
  }
150
187
 
188
+ flex-shrink: 0;
151
189
  font-size: var(--mg-font-size-300);
152
190
  color: rgb(var(--mg-color-interactive));
153
191
  font-weight: bold;
@@ -688,6 +726,7 @@
688
726
  .mg-mega-topbar-mobile__icon-button {
689
727
  // Mobile-first: Display by default
690
728
  position: absolute;
729
+ inset-block: 0;
691
730
 
692
731
  // Anchored to both edges of the topbar rather than assumed to be
693
732
  // viewport-wide: a `100vw` overlay overhangs and is clipped by the parent's
@@ -701,7 +740,8 @@
701
740
  color: rgb(var(--mg-color-interactive));
702
741
  font-size: mg-rem(20);
703
742
  width: auto;
704
- height: 100%;
743
+ height: auto;
744
+ min-height: mg-rem(44);
705
745
  padding: var(--mg-spacing-100);
706
746
  border: none;
707
747
  cursor: pointer;
@@ -793,24 +833,8 @@
793
833
  box-shadow: 3px 0 6px -2px rgb(0 0 0 / 0.15);
794
834
  }
795
835
 
796
- // Full JS mega menu — sidebar handles mobile nav, so topbar items must NOT be
797
- // interactive on small screens. This class is added by the React component on
798
- // mount (useEffect), so it is absent when JS fails or has not yet hydrated,
799
- // preserving a clickable fallback for server-rendered nav markup.
800
- .mg-mega-wrapper--js-active {
801
- @media screen and (max-width: $mg-breakpoint-tablet) {
802
- .mg-mega-topbar__nav {
803
- pointer-events: none;
804
- }
805
-
806
- .mg-mega-topbar__item {
807
- pointer-events: none;
808
- }
809
- }
810
- }
811
-
812
836
  // Mobile progressive navigation: one stable surface at every depth. Existing
813
- // desktop classes and the full-strip opening target remain compatible.
837
+ // desktop classes remain compatible; the rail opens individual sections.
814
838
  .mg-mega-mobile-sidebar--progressive {
815
839
  position: fixed;
816
840
  inset: 0 0 auto;
@@ -1094,7 +1118,7 @@
1094
1118
 
1095
1119
  // Existing plain HTML navigation needs no hamburger gutter or JS enhancement.
1096
1120
  // Keep overflow local to the rail so every destination remains reachable.
1097
- @media screen and (max-width: $mg-breakpoint-tablet) {
1121
+ @media screen and (width < $mg-breakpoint-tablet) {
1098
1122
  .mg-mega-topbar:not(
1099
1123
  .mg-mega-topbar--branded,
1100
1124
  :has(.mg-mega-topbar-mobile__icon-button)
@@ -4,7 +4,7 @@
4
4
  * Storybook: https://mangrove.undrr.org/
5
5
  * LLMs context: https://mangrove.undrr.org/llms.txt
6
6
  * Repository: https://github.com/PreventionWeb/undrr-mangrove
7
- * Version: 2.2.0
7
+ * Version: 2.3.0
8
8
  *
9
9
  * ██╗ ██╗███╗ ██╗██████╗ ██████╗ ██████╗
10
10
  * ██║ ██║████╗ ██║██╔══██╗██╔══██╗██╔══██╗