@ably/ui 8.2.1-dev.ade9a3d → 8.2.1-dev.db8f789

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 (51) hide show
  1. package/core/Footer.jsx +1 -3
  2. package/core/Meganav/component.css +4 -0
  3. package/core/Meganav/component.js +1 -1
  4. package/core/Meganav.jsx +47 -27
  5. package/core/MeganavBlogPostsList.jsx +2 -1
  6. package/core/MeganavContentCompany.jsx +5 -4
  7. package/core/MeganavContentDevelopers.jsx +3 -3
  8. package/core/MeganavContentPlatform.jsx +17 -10
  9. package/core/MeganavContentUseCases.jsx +5 -5
  10. package/core/MeganavContentWhyAbly/component.js +21 -5
  11. package/core/MeganavContentWhyAbly.jsx +3276 -3
  12. package/core/MeganavControl/component.js +1 -1
  13. package/core/MeganavControl.jsx +3 -1
  14. package/core/MeganavItemsDesktop.jsx +7 -3
  15. package/core/MeganavItemsSignedIn.jsx +4 -1
  16. package/core/sprites.svg +9 -0
  17. package/package.json +1 -1
  18. package/src/core/Footer/component.html.erb +1 -1
  19. package/src/core/Footer/component.jsx +1 -6
  20. package/src/core/Meganav/component.css +4 -0
  21. package/src/core/MeganavBlogPostsList/component.html.erb +1 -1
  22. package/src/core/MeganavBlogPostsList/component.jsx +3 -1
  23. package/src/core/MeganavContentCompany/component.html.erb +5 -5
  24. package/src/core/MeganavContentCompany/component.jsx +3 -3
  25. package/src/core/MeganavContentDevelopers/component.html.erb +5 -5
  26. package/src/core/MeganavContentDevelopers/component.jsx +3 -3
  27. package/src/core/MeganavContentPlatform/component.html.erb +11 -11
  28. package/src/core/MeganavContentPlatform/component.jsx +17 -11
  29. package/src/core/MeganavContentUseCases/component.html.erb +5 -5
  30. package/src/core/MeganavContentUseCases/component.jsx +5 -5
  31. package/src/core/MeganavControl/component.html.erb +1 -1
  32. package/src/core/MeganavControl/component.js +9 -1
  33. package/src/core/MeganavControl/component.jsx +3 -2
  34. package/src/core/MeganavControl/component.rb +8 -2
  35. package/src/core/MeganavItemsDesktop/component.html.erb +2 -2
  36. package/src/core/MeganavItemsDesktop/component.jsx +3 -2
  37. package/src/core/MeganavItemsDesktop/component.rb +8 -0
  38. package/src/core/MeganavItemsSignedIn/component.html.erb +1 -1
  39. package/src/core/MeganavItemsSignedIn/component.jsx +1 -1
  40. package/src/core/icons/icon-gui-copy.svg +10 -0
  41. package/core/.DS_Store +0 -0
  42. package/core/fonts/.DS_Store +0 -0
  43. package/core/images/.DS_Store +0 -0
  44. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/log/.keep +0 -0
  45. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/.keep +0 -0
  46. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/pids/.keep +0 -0
  47. package/src/.DS_Store +0 -0
  48. package/src/core/.DS_Store +0 -0
  49. package/src/core/fonts/.DS_Store +0 -0
  50. package/src/core/images/.DS_Store +0 -0
  51. package/src/reset/.DS_Store +0 -0
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t():(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.MeganavControl=t())}(this,(function(){return(()=>{"use strict";var e={9581:(e,t,r)=>{r.d(t,{A:()=>n,n:()=>i});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector("[data-id=".concat(e,"]"))},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelectorAll("[data-id=".concat(e,"]"))}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{r.d(n,{default:()=>i});var e=r(9581);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const i=function(){var r=Array.from((0,e.n)("meganav-control")),n=Array.from((0,e.n)("meganav-panel")),i=getComputedStyle(document.documentElement).getPropertyValue("--bp-md"),o=function(e){return"search"===e.dataset.control},a=function(e,n,o){if(window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: ".concat(i,")")).matches&&!r.some((function(e){return e===document.activeElement}))&&!function(){var e=document.querySelector('[data-id="meganav-panel"]#panel-search');if(e)return!e.classList.contains("invisible")}()){var a,c=["invisible","visible"];(a=n.classList).replace.apply(a,function(e){if(Array.isArray(e))return t(e)}(u=o?c:c.reverse())||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),e.setAttribute("aria-expanded",o)}var u};return r.map((function(t){var i,c,u=t.parentNode,l=document.querySelector("#".concat(t.getAttribute("aria-controls"))),s=function(t,i){return function(){if(r.forEach((function(e){return e!==t&&e.setAttribute("aria-expanded",!1)})),n.forEach((function(e){return e!==i&&e.classList.replace("visible","invisible")})),"true"===t.getAttribute("aria-expanded")?(t.setAttribute("aria-expanded",!1),i.classList.replace("visible","invisible")):(t.setAttribute("aria-expanded",!0),i.classList.replace("invisible","visible")),o(t)){var a=(0,e.A)("meganav-search-input",i);if(!a)return;a.focus()}else t.focus()}}(t,l);return t.addEventListener("click",s),o(t)||(i=function(e,t){return function(){return a(e,t,!0)}}(t,l),c=function(e,t){return function(){return a(e,t,!1)}}(t,l),u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",c)),[{teardown:function(){i&&c&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",c)),t.removeEventListener("click",s)},clear:function(){t.setAttribute("aria-expanded",!1),l.classList.replace("visible","invisible")}}]})).flat()}})(),n.default})()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t():(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.MeganavControl=t())}(this,(function(){return(()=>{"use strict";var e={9581:(e,t,r)=>{r.d(t,{A:()=>n,n:()=>o});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector("[data-id=".concat(e,"]"))},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelectorAll("[data-id=".concat(e,"]"))}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{r.d(n,{default:()=>o});var e=r(9581);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const o=function(){var r=Array.from((0,e.n)("meganav-control")),n=Array.from((0,e.n)("meganav-panel")),o=getComputedStyle(document.documentElement).getPropertyValue("--bp-md"),a=function(e){return"search"===e.dataset.control},i=function(e,n,a){if(window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: ".concat(o,")")).matches&&!r.some((function(e){return e===document.activeElement}))&&!function(){var e=document.querySelector('[data-id="meganav-panel"]#panel-search');if(e)return!e.classList.contains("invisible")}()){var i,c=["invisible","visible"];(i=n.classList).replace.apply(i,function(e){if(Array.isArray(e))return t(e)}(u=a?c:c.reverse())||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),e.setAttribute("aria-expanded",a),e.dataset.hover=a}var u};return r.map((function(t){var o,c,u=t.parentNode,s=document.querySelector("#".concat(t.getAttribute("aria-controls"))),l=function(t,o){return function(){r.forEach((function(e){return e!==t&&e.setAttribute("aria-expanded",!1)})),n.forEach((function(e){return e!==o&&e.classList.replace("visible","invisible")}));var i=t.getAttribute("aria-expanded"),c="true"===t.dataset.hover;if("true"!==i||c?(t.setAttribute("aria-expanded",!0),o.classList.replace("invisible","visible")):(t.setAttribute("aria-expanded",!1),o.classList.replace("visible","invisible")),c&&(t.dataset.hover=!1),a(t)){var u=(0,e.A)("meganav-search-input",o);if(!u)return;u.focus()}else t.focus()}}(t,s);return t.addEventListener("click",l),a(t)||(o=function(e,t){return function(){return i(e,t,!0)}}(t,s),c=function(e,t){return function(){return i(e,t,!1)}}(t,s),u.addEventListener("mouseenter",o),u.addEventListener("mouseleave",c)),[{teardown:function(){o&&c&&(u.removeEventListener("mouseenter",o),u.removeEventListener("mouseleave",c)),t.removeEventListener("click",l)},clear:function(){t.setAttribute("aria-expanded",!1),s.classList.replace("visible","invisible")}}]})).flat()}})(),n.default})()}));
@@ -270,6 +270,7 @@ __webpack_require__.r(__webpack_exports__);
270
270
 
271
271
  var MeganavControl = function MeganavControl(_ref) {
272
272
  var ariaControls = _ref.ariaControls,
273
+ ariaLabel = _ref.ariaLabel,
273
274
  children = _ref.children,
274
275
  theme = _ref.theme,
275
276
  additionalCSS = _ref.additionalCSS;
@@ -279,7 +280,7 @@ var MeganavControl = function MeganavControl(_ref) {
279
280
  className: "ui-meganav-link h-64 flex items-center group ".concat(additionalCSS, " ").concat(theme.textColor),
280
281
  "aria-expanded": "false",
281
282
  "aria-controls": ariaControls,
282
- "aria-label": "Show ".concat(children)
283
+ "aria-label": "Show ".concat(ariaLabel, " panel")
283
284
  }, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
284
285
  name: "icon-gui-disclosure-arrow",
285
286
  color: "text-cool-black",
@@ -290,6 +291,7 @@ var MeganavControl = function MeganavControl(_ref) {
290
291
 
291
292
  MeganavControl.propTypes = {
292
293
  ariaControls: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
294
+ ariaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
293
295
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
294
296
  theme: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
295
297
  additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
@@ -82,6 +82,7 @@ Icon.propTypes = {
82
82
 
83
83
  var MeganavControl = function MeganavControl(_ref) {
84
84
  var ariaControls = _ref.ariaControls,
85
+ ariaLabel = _ref.ariaLabel,
85
86
  children = _ref.children,
86
87
  theme = _ref.theme,
87
88
  additionalCSS = _ref.additionalCSS;
@@ -91,7 +92,7 @@ var MeganavControl = function MeganavControl(_ref) {
91
92
  className: "ui-meganav-link h-64 flex items-center group ".concat(additionalCSS, " ").concat(theme.textColor),
92
93
  "aria-expanded": "false",
93
94
  "aria-controls": ariaControls,
94
- "aria-label": "Show ".concat(children)
95
+ "aria-label": "Show ".concat(ariaLabel, " panel")
95
96
  }, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
96
97
  name: "icon-gui-disclosure-arrow",
97
98
  color: "text-cool-black",
@@ -102,6 +103,7 @@ var MeganavControl = function MeganavControl(_ref) {
102
103
 
103
104
  MeganavControl.propTypes = {
104
105
  ariaControls: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
106
+ ariaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
105
107
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
106
108
  theme: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
107
109
  additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
@@ -334,18 +336,20 @@ var MeganavDesktopItems = function MeganavDesktopItems(_ref) {
334
336
  "data-id": "meganav-items-desktop"
335
337
  }, _Meganav_component_json__WEBPACK_IMPORTED_MODULE_2__/* .panels.map */ .h.map(function (panel) {
336
338
  var PanelComponent = panels[panel.component];
339
+ var bgCSS = ["platform-panel", "use-cases-panel"].includes(panel.id) ? "ui-meganav-panel-split-bg" : "";
337
340
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
338
341
  className: "ui-meganav-item",
339
342
  key: panel.id
340
343
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MeganavControl_component_jsx__WEBPACK_IMPORTED_MODULE_3__.default, {
341
344
  theme: theme,
342
- ariaControls: panel.id
345
+ ariaControls: panel.id,
346
+ ariaLabel: panel.label
343
347
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
344
348
  className: "hidden lg:inline"
345
349
  }, panel.label), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
346
350
  className: "lg:hidden"
347
351
  }, panel.shortLabel)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
348
- className: "ui-meganav-panel invisible",
352
+ className: "ui-meganav-panel invisible ".concat(bgCSS),
349
353
  id: panel.id,
350
354
  "data-id": "meganav-panel"
351
355
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PanelComponent, {
@@ -132,6 +132,7 @@ Icon.propTypes = {
132
132
 
133
133
  var MeganavControl = function MeganavControl(_ref) {
134
134
  var ariaControls = _ref.ariaControls,
135
+ ariaLabel = _ref.ariaLabel,
135
136
  children = _ref.children,
136
137
  theme = _ref.theme,
137
138
  additionalCSS = _ref.additionalCSS;
@@ -141,7 +142,7 @@ var MeganavControl = function MeganavControl(_ref) {
141
142
  className: "ui-meganav-link h-64 flex items-center group ".concat(additionalCSS, " ").concat(theme.textColor),
142
143
  "aria-expanded": "false",
143
144
  "aria-controls": ariaControls,
144
- "aria-label": "Show ".concat(children)
145
+ "aria-label": "Show ".concat(ariaLabel, " panel")
145
146
  }, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
146
147
  name: "icon-gui-disclosure-arrow",
147
148
  color: "text-cool-black",
@@ -152,6 +153,7 @@ var MeganavControl = function MeganavControl(_ref) {
152
153
 
153
154
  MeganavControl.propTypes = {
154
155
  ariaControls: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
156
+ ariaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
155
157
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
156
158
  theme: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
157
159
  additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
@@ -644,6 +646,7 @@ var MeganavItemsSignedIn = function MeganavItemsSignedIn(_ref) {
644
646
  className: "ui-meganav-item relative"
645
647
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MeganavControl_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
646
648
  ariaControls: "account-panel",
649
+ ariaLabel: "Account",
647
650
  theme: theme,
648
651
  additionalCSS: "mr-0"
649
652
  }, accountName), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
package/core/sprites.svg CHANGED
@@ -287,6 +287,15 @@
287
287
  <path fill-rule="evenodd" clip-rule="evenodd" d="M1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8ZM8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0ZM8.66667 3.33333C8.66667 2.96514 8.36819 2.66667 8 2.66667C7.63181 2.66667 7.33333 2.96514 7.33333 3.33333V7.38675C7.33333 7.9706 7.58846 8.5253 8.03175 8.90527L9.89947 10.5062C10.179 10.7458 10.5999 10.7134 10.8395 10.4339C11.0791 10.1543 11.0467 9.73344 10.7672 9.49383L8.89947 7.89292C8.75171 7.76627 8.66667 7.58137 8.66667 7.38675V3.33333Z" fill="currentColor"/>
288
288
  </symbol><symbol fill="none" id="sprite-icon-gui-close" viewBox="0 0 24 24"><title>sprite-icon-gui-close</title>
289
289
  <path fill-rule="evenodd" clip-rule="evenodd" d="M13.4142 12L22.7071 21.2929L21.2929 22.7071L12 13.4142L2.70711 22.7071L1.29289 21.2929L10.5858 12L1.29289 2.70712L2.70711 1.29291L12 10.5858L21.2929 1.29291L22.7071 2.70712L13.4142 12Z" fill="currentColor"/>
290
+ </symbol><symbol fill="none" id="sprite-icon-gui-copy" viewBox="0 0 16 16"><title>sprite-icon-gui-copy</title>
291
+ <g clip-path="url(#clip0_222_232)">
292
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.66634 0.835938C1.65382 0.835938 0.833008 1.65675 0.833008 2.66927V9.33594C0.833008 10.3485 1.65382 11.1693 2.66634 11.1693H3.33301C3.60915 11.1693 3.83301 10.9454 3.83301 10.6693C3.83301 10.3931 3.60915 10.1693 3.33301 10.1693H2.66634C2.2061 10.1693 1.83301 9.79618 1.83301 9.33594V2.66927C1.83301 2.20903 2.2061 1.83594 2.66634 1.83594H9.33301C9.79325 1.83594 10.1663 2.20903 10.1663 2.66927V3.33594C10.1663 3.61208 10.3902 3.83594 10.6663 3.83594C10.9425 3.83594 11.1663 3.61208 11.1663 3.33594V2.66927C11.1663 1.65675 10.3455 0.835938 9.33301 0.835938H2.66634ZM6.66634 4.83594C5.65382 4.83594 4.83301 5.65675 4.83301 6.66927V13.3359C4.83301 14.3485 5.65382 15.1693 6.66634 15.1693H13.333C14.3455 15.1693 15.1663 14.3485 15.1663 13.3359V6.66927C15.1663 5.65675 14.3455 4.83594 13.333 4.83594H6.66634ZM5.83301 6.66927C5.83301 6.20903 6.2061 5.83594 6.66634 5.83594H13.333C13.7932 5.83594 14.1663 6.20903 14.1663 6.66927V13.3359C14.1663 13.7962 13.7932 14.1693 13.333 14.1693H6.66634C6.2061 14.1693 5.83301 13.7962 5.83301 13.3359V6.66927Z" fill="currentColor"/>
293
+ </g>
294
+ <defs>
295
+ <clipPath id="clip0_222_232">
296
+ <rect width="16" height="16" fill="white"/>
297
+ </clipPath>
298
+ </defs>
290
299
  </symbol><symbol fill="none" id="sprite-icon-gui-cross-circled-fill" viewBox="0 0 24 24"><title>sprite-icon-gui-cross-circled-fill</title>
291
300
  <path fill-rule="evenodd" clip-rule="evenodd" d="M0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12Z" fill="currentColor"/>
292
301
  <path fill-rule="evenodd" clip-rule="evenodd" d="M13.4142 12L17.7071 16.2928L16.2929 17.7071L12 13.4142L7.70711 17.7071L6.29289 16.2928L10.5858 12L6.29289 7.70706L7.70711 6.29285L12 10.5857L16.2929 6.29285L17.7071 7.70706L13.4142 12Z" fill="white"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "8.2.1-dev.ade9a3d",
3
+ "version": "8.2.1-dev.db8f789",
4
4
  "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -141,7 +141,7 @@
141
141
  <%= link_to 'Open protocol policy', abs_url("/open-policy"), class: "ui-footer-menu-row-link" %>
142
142
  </li>
143
143
  <li class="p-menu-row-snug">
144
- <a href="https://www.notion.so/ably/Ably-Press-Center-551152f5be724d4495a7c2e29d9f51c7" target="_blank" rel="noopener" class="ui-footer-menu-row-link">Press & Media</a>
144
+ <%= link_to 'Press & Media', abs_url("/press-center"), class: "ui-footer-menu-row-link" %>
145
145
  </li>
146
146
  <li class="p-menu-row-snug">
147
147
  <%= link_to 'Contact us', abs_url("/contact"), class: "ui-footer-menu-row-link" %>
@@ -219,12 +219,7 @@ export default function Footer({ paths, urlBase }) {
219
219
  </a>
220
220
  </li>
221
221
  <li className="p-menu-row-snug">
222
- <a
223
- href="https://www.notion.so/ably/Ably-Press-Center-551152f5be724d4495a7c2e29d9f51c7"
224
- rel="noopener noreferrer"
225
- target="_blank"
226
- className="ui-footer-menu-row-link"
227
- >
222
+ <a href={absUrl("/press-center")} className="ui-footer-menu-row-link">
228
223
  Press & Media
229
224
  </a>
230
225
  </li>
@@ -46,6 +46,10 @@
46
46
  @apply bg-white rounded-t-none;
47
47
  }
48
48
 
49
+ .ui-meganav-panel-split-bg {
50
+ background: linear-gradient(to right, #fafafb 33%, white 33%, white 100%);
51
+ }
52
+
49
53
  .ui-meganav-link {
50
54
  @apply text-menu2 font-medium block;
51
55
  @apply mr-12 lg:mr-24 px-0 py-20;
@@ -1,5 +1,5 @@
1
1
  <div class="hidden col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0" data-id="meganav-company-panel-blog-section">
2
2
  <h3 class="ui-meganav-overline" id="meganav-company-panel-recent-blog-posts">Blog</h3>
3
3
  <ul class="mb-8" aria-labelledby="meganav-company-panel-recent-blog-posts" data-id="meganav-company-panel-recent-blog-posts"></ul>
4
- <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/blog"))) do %>More from our Blog<% end %>
4
+ <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/blog"), text_size: 'text-p3')) do %>More from our Blog<% end %>
5
5
  </div>
@@ -20,7 +20,9 @@ const MeganavBlogPostsList = ({ recentBlogPosts, absUrl }) =>
20
20
  ))}
21
21
  </ul>
22
22
 
23
- <FeaturedLink url={absUrl("/blog")}>More from our Blog</FeaturedLink>
23
+ <FeaturedLink url={absUrl("/blog")} textSize="text-p3">
24
+ More from our Blog
25
+ </FeaturedLink>
24
26
  </div>
25
27
  ) : null;
26
28
 
@@ -1,6 +1,6 @@
1
- <div class="flex">
1
+ <div class="flex max-w-screen-xl mx-auto">
2
2
  <div class="ui-meganav-content-spacer"></div>
3
- <section class="grid grid-cols-12 ui-grid-gap-x">
3
+ <section class="grid grid-cols-12 ui-grid-gap-x w-full">
4
4
  <div class="col-span-full md:col-span-4 pt-24 md:py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
5
5
  <h3 class="ui-meganav-overline" id="meganav-company-panel-list-why-companies">Why companies choose Ably</h3>
6
6
  <ul aria-labelledby="meganav-company-panel-list-why-companies">
@@ -18,7 +18,7 @@
18
18
  <%= render(AblyUi::Core::Icon.new(name: "icon-display-case-studies-col", size: "2.5rem")) %>
19
19
  <div class="flex flex-col justify-center">
20
20
  <p class="ui-meganav-media-heading">Case studies</p>
21
- <p class="ui-meganav-media-copy">Discover how customers are benefitting from Ably.</p>
21
+ <p class="ui-meganav-media-copy">Discover how customers are benefiting from Ably.</p>
22
22
  </div>
23
23
  <% end %>
24
24
  </li>
@@ -55,7 +55,7 @@
55
55
  <% end %>
56
56
  </li>
57
57
  <li>
58
- <%= link_to abs_url("/compare"), class: "ui-meganav-media-with-image group" do %>
58
+ <%= link_to abs_url("/about"), class: "ui-meganav-media-with-image group" do %>
59
59
  <%= render(AblyUi::Core::Icon.new(name: "icon-display-about-ably-col", size: "2.5rem")) %>
60
60
  <div class="flex flex-col justify-center">
61
61
  <p class="ui-meganav-media-heading">About Ably</p>
@@ -64,7 +64,7 @@
64
64
  <% end %>
65
65
  </li>
66
66
  <li>
67
- <%= link_to abs_url("/aws"), class: "ui-meganav-media-with-image group" do %>
67
+ <%= link_to abs_url("/careers"), class: "ui-meganav-media-with-image group" do %>
68
68
  <%= render(AblyUi::Core::Icon.new(name: "icon-display-careers-col", size: "2.5rem")) %>
69
69
  <div class="flex flex-col justify-center">
70
70
  <p class="ui-meganav-media-heading">Careers</p>
@@ -12,9 +12,9 @@ const MeganavContentCompany = ({ paths, absUrl }) => {
12
12
  const BlogPostsList = ConnectStateWrapper(MeganavBlogPostsList, { recentBlogPosts: selectRecentBlogPosts });
13
13
 
14
14
  return (
15
- <div className="flex">
15
+ <div className="flex max-w-screen-xl mx-auto">
16
16
  <div className="ui-meganav-content-spacer"></div>
17
- <section className="grid grid-cols-12 ui-grid-gap-x">
17
+ <section className="grid grid-cols-12 ui-grid-gap-x w-full">
18
18
  <div className="col-span-full md:col-span-4 pt-24 md:py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
19
19
  <h3 className="ui-meganav-overline" id="meganav-company-panel-list-why-companies">
20
20
  Why companies choose Ably
@@ -34,7 +34,7 @@ const MeganavContentCompany = ({ paths, absUrl }) => {
34
34
  <Icon name="icon-display-case-studies-col" size="2.5rem" />
35
35
  <div className="flex flex-col justify-center">
36
36
  <p className="ui-meganav-media-heading">Case studies</p>
37
- <p className="ui-meganav-media-copy">Discover how customers are benefitting from Ably.</p>
37
+ <p className="ui-meganav-media-copy">Discover how customers are benefiting from Ably.</p>
38
38
  </div>
39
39
  </a>
40
40
  </li>
@@ -1,6 +1,6 @@
1
- <div class="flex">
1
+ <div class="flex max-w-screen-xl mx-auto">
2
2
  <div class="ui-meganav-content-spacer"></div>
3
- <section class="grid grid-cols-12 ui-grid-gap-x">
3
+ <section class="grid grid-cols-12 ui-grid-gap-x w-full">
4
4
  <div class="col-span-full md:col-span-4 pt-24 md:py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
5
5
  <h3 class="ui-meganav-overline uppercase" id="meganav-developers-panel-explore">
6
6
  Explore
@@ -29,7 +29,7 @@
29
29
  <%= render(AblyUi::Core::Icon.new(name: "icon-display-quickstart-guides-col", size: "2.5rem")) %>
30
30
  <div class="flex flex-col justify-center">
31
31
  <p class="ui-meganav-media-heading">Quickstart guides</p>
32
- <p class="ui-meganav-media-copy">Documentation to help you get up and running quickly.</p>
32
+ <p class="ui-meganav-media-copy">Documentation to help you get started quickly.</p>
33
33
  </div>
34
34
  <% end %>
35
35
  </li>
@@ -93,9 +93,9 @@
93
93
  </a>
94
94
  </li>
95
95
  <li>
96
- <a href={absUrl("/support")} class="group ui-meganav-media py-12">
96
+ <%= link_to abs_url("/support"), class: "group ui-meganav-media py-12" do %>
97
97
  <p class="ui-meganav-media-heading">Support & FAQs</p>
98
- </a>
98
+ <% end %>
99
99
  </li>
100
100
  </ul>
101
101
  </div>
@@ -4,9 +4,9 @@ import T from "prop-types";
4
4
  import Icon from "../Icon/component.jsx";
5
5
 
6
6
  const MeganavContentDevelopers = ({ absUrl }) => (
7
- <div className="flex">
7
+ <div className="flex max-w-screen-xl mx-auto">
8
8
  <div className="ui-meganav-content-spacer"></div>
9
- <section className="grid grid-cols-12 ui-grid-gap-x">
9
+ <section className="grid grid-cols-12 ui-grid-gap-x w-full">
10
10
  <div className="col-span-full md:col-span-4 pt-24 md:py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
11
11
  <h3 className="ui-meganav-overline uppercase" id="meganav-developers-panel-explore">
12
12
  Explore
@@ -35,7 +35,7 @@ const MeganavContentDevelopers = ({ absUrl }) => (
35
35
  <Icon name="icon-display-quickstart-guides-col" size="2.5rem" />
36
36
  <div className="flex flex-col justify-center">
37
37
  <p className="ui-meganav-media-heading">Quickstart guides</p>
38
- <p className="ui-meganav-media-copy">Documentation to help you get up and running quickly.</p>
38
+ <p className="ui-meganav-media-copy">Documentation to help you get started quickly.</p>
39
39
  </div>
40
40
  </a>
41
41
  </li>
@@ -1,23 +1,23 @@
1
- <div class="flex">
1
+ <div class="flex max-w-screen-xl mx-auto">
2
2
  <div class="ui-meganav-content-spacer bg-extra-light-grey"></div>
3
- <section class="grid grid-cols-12 ui-grid-gap-x">
4
- <div class="col-span-full md:col-span-4 bg-extra-light-grey py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
3
+ <section class="grid grid-cols-12 ui-grid-gap-x w-full">
4
+ <div class="col-span-full md:col-span-4 py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24 bg-extra-light-grey">
5
5
  <div class="flex mb-20">
6
6
  <%= image_tag(ably_stack_path, alt: "Ably homepage") %>
7
7
  <h3 class="ui-meganav-overline ml-24">The Ably Platform</h3>
8
8
  </div>
9
9
 
10
- <p class="text-p2 font-medium text-cool-black mb-8">
10
+ <p class="text-p2 font-medium text-cool-black mb-24" style="max-width: 330px">
11
11
  Easily power any realtime experience in your application. No complex infrastructure to manage or provision. Just a simple API that handles everything
12
12
  realtime, and lets you focus on your code.
13
13
  </p>
14
14
 
15
- <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/platform"))) do %>Explore how it works<% end %>
15
+ <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/platform"), text_size: 'text-p2')) do %>Explore how it works<% end %>
16
16
  </div>
17
17
 
18
- <div class="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
18
+ <div class="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
19
19
  <h3 class="ui-meganav-overline" id="meganav-platform-panel-list-examples">Our Examples</h3>
20
- <ul aria-labelledby="meganav-platform-panel-list-examples">
20
+ <ul class="mb-16" aria-labelledby="meganav-platform-panel-list-examples">
21
21
  <li>
22
22
  <%= link_to abs_url("/examples/avatar-stack"), class: "ui-meganav-media group" do %>
23
23
  <p class="ui-meganav-media-heading">Avatar Stack</p>
@@ -56,12 +56,12 @@
56
56
  </li>
57
57
  </ul>
58
58
 
59
- <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/examples"))) do %>Explore all live examples<% end %>
59
+ <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/examples"), text_size: 'text-p3')) do %>Explore all live examples<% end %>
60
60
  </div>
61
61
 
62
- <div class="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
62
+ <div class="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
63
63
  <h3 class="ui-meganav-overline" id="meganav-platform-panel-list-our-technology">Our technology</h3>
64
- <ul class="mb-8" aria-labelledby="meganav-platform-panel-list-our-technology">
64
+ <ul class="mb-16" aria-labelledby="meganav-platform-panel-list-our-technology">
65
65
  <li>
66
66
  <%= link_to abs_url("/four-pillars-of-dependability#performance"), class: "ui-meganav-media group" do %>
67
67
  <p class="ui-meganav-media-heading">Predictable performance</p>
@@ -94,7 +94,7 @@
94
94
  </li>
95
95
  </ul>
96
96
 
97
- <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/four-pillars-of-dependability"))) do %>Explore Four Pillars of Dependability<% end %>
97
+ <%= render(AblyUi::Core::FeaturedLink.new(url: abs_url("/four-pillars-of-dependability"), text_size: 'text-p3')) do %>Explore Four Pillars of Dependability<% end %>
98
98
  </div>
99
99
  </section>
100
100
  <div class="ui-meganav-content-spacer"></div>
@@ -4,27 +4,29 @@ import T from "prop-types";
4
4
  import FeaturedLink from "../FeaturedLink/component.jsx";
5
5
 
6
6
  const MeganavContentPlatform = ({ paths, absUrl }) => (
7
- <div className="flex">
7
+ <div className="flex max-w-screen-xl mx-auto">
8
8
  <div className="ui-meganav-content-spacer bg-extra-light-grey"></div>
9
- <section className="grid grid-cols-12 ui-grid-gap-x">
10
- <div className="col-span-full md:col-span-4 bg-extra-light-grey py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
9
+ <section className="grid grid-cols-12 ui-grid-gap-x w-full">
10
+ <div className="col-span-full md:col-span-4 py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24 bg-extra-light-grey">
11
11
  <div className="flex mb-20">
12
12
  <img src={paths.ablyStack} alt="Ably homepage" />
13
13
  <h3 className="ui-meganav-overline ml-24">The Ably Platform</h3>
14
14
  </div>
15
- <p className="text-p2 font-medium text-cool-black mb-8">
15
+ <p className="text-p2 font-medium text-cool-black mb-24" style={{ maxWidth: "330px" }}>
16
16
  Easily power any realtime experience in your application. No complex infrastructure to manage or provision. Just a simple API that handles everything
17
17
  realtime, and lets you focus on your code.
18
18
  </p>
19
19
 
20
- <FeaturedLink url={absUrl("/platform")}>Explore how it works</FeaturedLink>
20
+ <FeaturedLink url={absUrl("/platform")} textSize="text-p2">
21
+ Explore how it works
22
+ </FeaturedLink>
21
23
  </div>
22
24
 
23
- <div className="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
25
+ <div className="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
24
26
  <h3 className="ui-meganav-overline" id="meganav-platform-panel-list-examples">
25
27
  Our Examples
26
28
  </h3>
27
- <ul aria-labelledby="meganav-platform-panel-list-examples">
29
+ <ul className="mb-16" aria-labelledby="meganav-platform-panel-list-examples">
28
30
  <li>
29
31
  <a href={absUrl("/examples/avatar-stack")} className="group ui-meganav-media">
30
32
  <p className="ui-meganav-media-heading">Avatar Stack</p>
@@ -62,14 +64,16 @@ const MeganavContentPlatform = ({ paths, absUrl }) => (
62
64
  </a>
63
65
  </li>
64
66
  </ul>
65
- <FeaturedLink url={absUrl("/examples")}>Explore all live examples</FeaturedLink>
67
+ <FeaturedLink url={absUrl("/examples")} textSize="text-p3">
68
+ Explore all live examples
69
+ </FeaturedLink>
66
70
  </div>
67
71
 
68
- <div className="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
72
+ <div className="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
69
73
  <h3 className="ui-meganav-overline" id="meganav-platform-panel-list-our-technology">
70
74
  Our technology
71
75
  </h3>
72
- <ul className="mb-8" aria-labelledby="meganav-platform-panel-list-our-technology">
76
+ <ul className="mb-16" aria-labelledby="meganav-platform-panel-list-our-technology">
73
77
  <li>
74
78
  <a href={absUrl("/four-pillars-of-dependability#performance")} className="ui-meganav-media group">
75
79
  <p className="ui-meganav-media-heading">Predictable performance</p>
@@ -102,7 +106,9 @@ const MeganavContentPlatform = ({ paths, absUrl }) => (
102
106
  </li>
103
107
  </ul>
104
108
 
105
- <FeaturedLink url={absUrl("/four-pillars-of-dependability")}>Explore Four Pillars of Dependability</FeaturedLink>
109
+ <FeaturedLink url={absUrl("/four-pillars-of-dependability")} textSize="text-p3">
110
+ Explore Four Pillars of Dependability
111
+ </FeaturedLink>
106
112
  </div>
107
113
  </section>
108
114
  <div className="ui-meganav-content-spacer"></div>
@@ -1,7 +1,7 @@
1
- <div class="flex">
1
+ <div class="flex max-w-screen-xl mx-auto">
2
2
  <div class="ui-meganav-content-spacer bg-extra-light-grey"></div>
3
- <section class="grid grid-cols-12 ui-grid-gap-x">
4
- <div class="col-span-full md:col-span-4 bg-extra-light-grey py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
3
+ <section class="grid grid-cols-12 ui-grid-gap-x w-full">
4
+ <div class="col-span-full md:col-span-4 py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24 bg-extra-light-grey">
5
5
  <h3 class="ui-meganav-overline" id="meganav-use-cases-panel-use-cases">
6
6
  Use cases
7
7
  </h3>
@@ -27,7 +27,7 @@
27
27
  </ul>
28
28
  </div>
29
29
 
30
- <div class="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
30
+ <div class="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
31
31
  <h3 class="ui-meganav-overline" id="meganav-use-cases-panel-industry">
32
32
  Industry
33
33
  </h3>
@@ -89,7 +89,7 @@
89
89
  </ul>
90
90
  </div>
91
91
 
92
- <div class="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
92
+ <div class="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
93
93
  <h3 class="ui-meganav-overline" id="meganav-use-cases-panel-solutions">
94
94
  Solutions
95
95
  </h3>
@@ -4,10 +4,10 @@ import T from "prop-types";
4
4
  import Icon from "../Icon/component.jsx";
5
5
 
6
6
  const MeganavContentUseCases = ({ absUrl }) => (
7
- <div className="flex">
7
+ <div className="flex max-w-screen-xl mx-auto">
8
8
  <div className="ui-meganav-content-spacer bg-extra-light-grey"></div>
9
- <section className="grid grid-cols-12 ui-grid-gap-x">
10
- <div className="col-span-full md:col-span-4 bg-extra-light-grey py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24">
9
+ <section className="grid grid-cols-12 ui-grid-gap-x w-full">
10
+ <div className="col-span-full md:col-span-4 py-24 lg:py-32 px-24 sm:px-32 md:pl-0 md:pr-24 bg-extra-light-grey">
11
11
  <h3 className="ui-meganav-overline" id="meganav-use-cases-panel-use-cases">
12
12
  Use cases
13
13
  </h3>
@@ -33,7 +33,7 @@ const MeganavContentUseCases = ({ absUrl }) => (
33
33
  </ul>
34
34
  </div>
35
35
 
36
- <div className="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
36
+ <div className="col-span-full md:col-span-4 pt-24 pb-8 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
37
37
  <h3 className="ui-meganav-overline" id="meganav-use-cases-panel-industry">
38
38
  Industry
39
39
  </h3>
@@ -95,7 +95,7 @@ const MeganavContentUseCases = ({ absUrl }) => (
95
95
  </ul>
96
96
  </div>
97
97
 
98
- <div className="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0">
98
+ <div className="col-span-full md:col-span-4 pt-8 pb-24 md:py-24 lg:py-32 px-24 sm:px-32 md:px-0 bg-white">
99
99
  <h3 className="ui-meganav-overline" id="meganav-use-cases-panel-solutions">
100
100
  Solutions
101
101
  </h3>
@@ -1,6 +1,6 @@
1
1
  <%= button_tag(type: "button",
2
2
  class: ["ui-meganav-link", "h-64", "flex", "items-center", "group", theme(:text_color), additional_css],
3
3
  data: { id: "meganav-control" },
4
- aria: { expanded: false, controls: aria_controls, label: "Show #{content}" }) do -%>
4
+ aria: { expanded: false, controls: aria_controls, label: "Show #{aria_label} panel" }) do -%>
5
5
  <%= content -%><%= render(AblyUi::Core::Icon.new(name: "icon-gui-disclosure-arrow", size: "1.5rem", color: "text-cool-black", additional_css: "transform rotate-90 group-hover:text-gui-hover group-focus:text-gui-focus")) %>
6
6
  <% end %>
@@ -30,6 +30,7 @@ const MeganavControl = () => {
30
30
  const classes = ["invisible", "visible"];
31
31
  panel.classList.replace(...(open ? classes : classes.reverse()));
32
32
  control.setAttribute("aria-expanded", open);
33
+ control.dataset.hover = open;
33
34
  }
34
35
  };
35
36
 
@@ -50,7 +51,10 @@ const MeganavControl = () => {
50
51
 
51
52
  const ariaExpanded = control.getAttribute("aria-expanded");
52
53
 
53
- if (ariaExpanded === "true") {
54
+ // Prevent closing of the panel if it was already opened by hovering
55
+ const openedByHover = control.dataset.hover === "true";
56
+
57
+ if (ariaExpanded === "true" && !openedByHover) {
54
58
  control.setAttribute("aria-expanded", false);
55
59
  panel.classList.replace("visible", "invisible");
56
60
  } else {
@@ -58,6 +62,10 @@ const MeganavControl = () => {
58
62
  panel.classList.replace("invisible", "visible");
59
63
  }
60
64
 
65
+ if (openedByHover) {
66
+ control.dataset.hover = false;
67
+ }
68
+
61
69
  if (isSearchControl(control)) {
62
70
  const searchInput = queryId("meganav-search-input", panel);
63
71
  if (!searchInput) return;
@@ -3,14 +3,14 @@ import T from "prop-types";
3
3
 
4
4
  import Icon from "../Icon/component.jsx";
5
5
 
6
- const MeganavControl = ({ ariaControls, children, theme, additionalCSS }) => (
6
+ const MeganavControl = ({ ariaControls, ariaLabel, children, theme, additionalCSS }) => (
7
7
  <button
8
8
  type="button"
9
9
  data-id="meganav-control"
10
10
  className={`ui-meganav-link h-64 flex items-center group ${additionalCSS} ${theme.textColor}`}
11
11
  aria-expanded="false"
12
12
  aria-controls={ariaControls}
13
- aria-label={`Show ${children}`}
13
+ aria-label={`Show ${ariaLabel} panel`}
14
14
  >
15
15
  {children}
16
16
  <Icon
@@ -24,6 +24,7 @@ const MeganavControl = ({ ariaControls, children, theme, additionalCSS }) => (
24
24
 
25
25
  MeganavControl.propTypes = {
26
26
  ariaControls: T.string,
27
+ ariaLabel: T.string,
27
28
  children: T.node,
28
29
  theme: T.object,
29
30
  additionalCSS: T.string,
@@ -2,10 +2,16 @@ module AblyUi
2
2
  module Core
3
3
  class MeganavControl < ViewComponent::Base
4
4
  include AblyUi::Core::MeganavConfig
5
- attr_reader :aria_controls, :additional_css
5
+ attr_reader :aria_controls, :aria_label, :additional_css
6
6
 
7
- def initialize(aria_controls:, theme_name:, additional_css: '')
7
+ def initialize(
8
+ aria_controls:,
9
+ aria_label:,
10
+ theme_name:,
11
+ additional_css: ''
12
+ )
8
13
  @aria_controls = aria_controls
14
+ @aria_label = aria_label
9
15
  @additional_css = additional_css
10
16
  theme_setup(theme_name)
11
17
  end
@@ -1,12 +1,12 @@
1
1
  <ul class="hidden md:flex" data-id="meganav-items-desktop">
2
2
  <% panels.each do |panel| %>
3
3
  <li class="ui-meganav-item">
4
- <%= render(AblyUi::Core::MeganavControl.new(aria_controls: panel[:id], theme_name: @theme_name)) do %>
4
+ <%= render(AblyUi::Core::MeganavControl.new(aria_controls: panel[:id], aria_label: panel[:label], theme_name: @theme_name)) do %>
5
5
  <span class="hidden lg:inline"><%= panel[:label] %></span>
6
6
  <span class="lg:hidden"><%= panel[:short_label] %></span>
7
7
  <% end %>
8
8
 
9
- <%= content_tag :div, class: 'ui-meganav-panel invisible', data: { id: "meganav-panel" }, id: panel[:id] do %>
9
+ <%= content_tag :div, class: "ui-meganav-panel invisible #{bg_css(panel[:id])}", data: { id: "meganav-panel" }, id: panel[:id] do %>
10
10
  <%= render("AblyUi::Core::#{panel[:component]}".constantize.new(url_base: url_base)) %>
11
11
  <% end %>
12
12
  </li>