@ably/ui 7.9.4 → 7.10.0-dev.45e131a

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 (55) hide show
  1. package/core/Meganav/component.css +5 -1
  2. package/core/Meganav/component.js +1 -1
  3. package/core/Meganav.jsx +251 -23
  4. package/core/MeganavContentWhyAbly.jsx +1 -1
  5. package/core/MeganavControl.jsx +5 -3
  6. package/core/MeganavControlMobileDropdown/component.js +1 -1
  7. package/core/MeganavItemsDesktop.jsx +5 -3
  8. package/core/MeganavItemsMobile.jsx +146 -10
  9. package/core/MeganavItemsSignedIn.jsx +229 -7
  10. package/core/MeganavSearch/component.js +1 -0
  11. package/core/MeganavSearch.jsx +474 -0
  12. package/core/MeganavSearchPanel/component.js +1 -0
  13. package/core/MeganavSearchPanel.jsx +426 -0
  14. package/core/MeganavSearchSuggestions/component.js +1 -0
  15. package/core/MeganavSearchSuggestions.jsx +366 -0
  16. package/core/fonts/.DS_Store +0 -0
  17. package/core/images/.DS_Store +0 -0
  18. package/core/styles.css +2 -15
  19. package/package.json +1 -1
  20. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/log/.keep +0 -0
  21. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/.keep +0 -0
  22. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/pids/.keep +0 -0
  23. package/src/.DS_Store +0 -0
  24. package/src/core/.DS_Store +0 -0
  25. package/src/core/Meganav/component.css +5 -1
  26. package/src/core/Meganav/component.html.erb +10 -5
  27. package/src/core/Meganav/component.jsx +12 -5
  28. package/src/core/MeganavContentWhyAbly/component.html.erb +1 -1
  29. package/src/core/MeganavContentWhyAbly/component.jsx +1 -1
  30. package/src/core/MeganavControl/component.html.erb +2 -2
  31. package/src/core/MeganavControl/component.jsx +3 -2
  32. package/src/core/MeganavControl/component.rb +3 -1
  33. package/src/core/MeganavControlMobileDropdown/component.js +22 -0
  34. package/src/core/MeganavItemsMobile/component.html.erb +12 -1
  35. package/src/core/MeganavItemsMobile/component.jsx +14 -1
  36. package/src/core/MeganavItemsSignedIn/component.html.erb +5 -1
  37. package/src/core/MeganavItemsSignedIn/component.jsx +7 -2
  38. package/src/core/MeganavSearch/component.html.erb +14 -0
  39. package/src/core/MeganavSearch/component.js +0 -0
  40. package/src/core/MeganavSearch/component.jsx +32 -0
  41. package/src/core/MeganavSearch/component.rb +13 -0
  42. package/src/core/MeganavSearchPanel/component.html.erb +20 -0
  43. package/src/core/MeganavSearchPanel/component.js +0 -0
  44. package/src/core/MeganavSearchPanel/component.jsx +36 -0
  45. package/src/core/MeganavSearchPanel/component.rb +13 -0
  46. package/src/core/MeganavSearchSuggestions/component.html.erb +22 -0
  47. package/src/core/MeganavSearchSuggestions/component.js +0 -0
  48. package/src/core/MeganavSearchSuggestions/component.jsx +49 -0
  49. package/src/core/MeganavSearchSuggestions/component.rb +18 -0
  50. package/src/core/fonts/.DS_Store +0 -0
  51. package/src/core/images/.DS_Store +0 -0
  52. package/src/core/styles/properties.css +2 -0
  53. package/src/core/styles.components.css +0 -15
  54. package/src/reset/.DS_Store +0 -0
  55. package/tailwind.config.js +2 -0
@@ -0,0 +1,366 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("react")) : factory(root[undefined]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(this, function(__WEBPACK_EXTERNAL_MODULE__9281__) {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 5751:
15
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16
+
17
+ "use strict";
18
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
20
+ /* harmony export */ });
21
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
22
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
23
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
24
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
25
+ /* harmony import */ var _Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9008);
26
+
27
+
28
+
29
+
30
+ var FeaturedLink = function FeaturedLink(_ref) {
31
+ var url = _ref.url,
32
+ _ref$textSize = _ref.textSize,
33
+ textSize = _ref$textSize === void 0 ? "text-menu3" : _ref$textSize,
34
+ _ref$iconColor = _ref.iconColor,
35
+ iconColor = _ref$iconColor === void 0 ? "text-cool-black" : _ref$iconColor,
36
+ _ref$flush = _ref.flush,
37
+ flush = _ref$flush === void 0 ? false : _ref$flush,
38
+ children = _ref.children;
39
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
40
+ href: url,
41
+ className: "ui-featured-link ".concat(textSize, " ").concat(flush ? "" : "py-8", " "),
42
+ style: {
43
+ "--featured-link-icon-size": "var(".concat(textSize.replace("text", "--fs"), ")")
44
+ }
45
+ }, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
46
+ name: "icon-gui-link-arrow",
47
+ size: "calc(var(--featured-link-icon-size) * 1.25)",
48
+ color: iconColor,
49
+ additionalCSS: "ui-featured-link-icon"
50
+ }));
51
+ };
52
+
53
+ FeaturedLink.propTypes = {
54
+ url: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
55
+ children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
56
+ textSize: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
57
+ iconColor: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
58
+ flush: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
59
+ };
60
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FeaturedLink);
61
+
62
+ /***/ }),
63
+
64
+ /***/ 9008:
65
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
66
+
67
+ "use strict";
68
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
69
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
70
+ /* harmony export */ });
71
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
72
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
73
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
74
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
75
+ var _excluded = ["name", "size", "color", "additionalCSS"];
76
+
77
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
78
+
79
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
80
+
81
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
82
+
83
+
84
+
85
+
86
+ var Icon = function Icon(_ref) {
87
+ var name = _ref.name,
88
+ _ref$size = _ref.size,
89
+ size = _ref$size === void 0 ? "0.75rem" : _ref$size,
90
+ _ref$color = _ref.color,
91
+ color = _ref$color === void 0 ? "" : _ref$color,
92
+ _ref$additionalCSS = _ref.additionalCSS,
93
+ additionalCSS = _ref$additionalCSS === void 0 ? "" : _ref$additionalCSS,
94
+ additionalAttributes = _objectWithoutProperties(_ref, _excluded);
95
+
96
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
97
+ className: "".concat(color, " ").concat(additionalCSS),
98
+ style: {
99
+ width: size,
100
+ height: size
101
+ }
102
+ }, additionalAttributes), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("use", {
103
+ xlinkHref: "#sprite-".concat(name)
104
+ }));
105
+ };
106
+
107
+ Icon.propTypes = {
108
+ name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string.isRequired),
109
+ size: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
110
+ color: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
111
+ additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
112
+ };
113
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Icon);
114
+
115
+ /***/ }),
116
+
117
+ /***/ 2703:
118
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
119
+
120
+ "use strict";
121
+ /**
122
+ * Copyright (c) 2013-present, Facebook, Inc.
123
+ *
124
+ * This source code is licensed under the MIT license found in the
125
+ * LICENSE file in the root directory of this source tree.
126
+ */
127
+
128
+
129
+
130
+ var ReactPropTypesSecret = __webpack_require__(414);
131
+
132
+ function emptyFunction() {}
133
+ function emptyFunctionWithReset() {}
134
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
135
+
136
+ module.exports = function() {
137
+ function shim(props, propName, componentName, location, propFullName, secret) {
138
+ if (secret === ReactPropTypesSecret) {
139
+ // It is still safe when called from React.
140
+ return;
141
+ }
142
+ var err = new Error(
143
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
144
+ 'Use PropTypes.checkPropTypes() to call them. ' +
145
+ 'Read more at http://fb.me/use-check-prop-types'
146
+ );
147
+ err.name = 'Invariant Violation';
148
+ throw err;
149
+ };
150
+ shim.isRequired = shim;
151
+ function getShim() {
152
+ return shim;
153
+ };
154
+ // Important!
155
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
156
+ var ReactPropTypes = {
157
+ array: shim,
158
+ bool: shim,
159
+ func: shim,
160
+ number: shim,
161
+ object: shim,
162
+ string: shim,
163
+ symbol: shim,
164
+
165
+ any: shim,
166
+ arrayOf: getShim,
167
+ element: shim,
168
+ elementType: shim,
169
+ instanceOf: getShim,
170
+ node: shim,
171
+ objectOf: getShim,
172
+ oneOf: getShim,
173
+ oneOfType: getShim,
174
+ shape: getShim,
175
+ exact: getShim,
176
+
177
+ checkPropTypes: emptyFunctionWithReset,
178
+ resetWarningCache: emptyFunction
179
+ };
180
+
181
+ ReactPropTypes.PropTypes = ReactPropTypes;
182
+
183
+ return ReactPropTypes;
184
+ };
185
+
186
+
187
+ /***/ }),
188
+
189
+ /***/ 5697:
190
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
191
+
192
+ /**
193
+ * Copyright (c) 2013-present, Facebook, Inc.
194
+ *
195
+ * This source code is licensed under the MIT license found in the
196
+ * LICENSE file in the root directory of this source tree.
197
+ */
198
+
199
+ if (false) { var throwOnDirectAccess, ReactIs; } else {
200
+ // By explicitly using `prop-types` you are opting into new production behavior.
201
+ // http://fb.me/prop-types-in-prod
202
+ module.exports = __webpack_require__(2703)();
203
+ }
204
+
205
+
206
+ /***/ }),
207
+
208
+ /***/ 414:
209
+ /***/ ((module) => {
210
+
211
+ "use strict";
212
+ /**
213
+ * Copyright (c) 2013-present, Facebook, Inc.
214
+ *
215
+ * This source code is licensed under the MIT license found in the
216
+ * LICENSE file in the root directory of this source tree.
217
+ */
218
+
219
+
220
+
221
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
222
+
223
+ module.exports = ReactPropTypesSecret;
224
+
225
+
226
+ /***/ }),
227
+
228
+ /***/ 9281:
229
+ /***/ ((module) => {
230
+
231
+ "use strict";
232
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
233
+
234
+ /***/ })
235
+
236
+ /******/ });
237
+ /************************************************************************/
238
+ /******/ // The module cache
239
+ /******/ var __webpack_module_cache__ = {};
240
+ /******/
241
+ /******/ // The require function
242
+ /******/ function __webpack_require__(moduleId) {
243
+ /******/ // Check if module is in cache
244
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
245
+ /******/ if (cachedModule !== undefined) {
246
+ /******/ return cachedModule.exports;
247
+ /******/ }
248
+ /******/ // Create a new module (and put it into the cache)
249
+ /******/ var module = __webpack_module_cache__[moduleId] = {
250
+ /******/ // no module.id needed
251
+ /******/ // no module.loaded needed
252
+ /******/ exports: {}
253
+ /******/ };
254
+ /******/
255
+ /******/ // Execute the module function
256
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
257
+ /******/
258
+ /******/ // Return the exports of the module
259
+ /******/ return module.exports;
260
+ /******/ }
261
+ /******/
262
+ /************************************************************************/
263
+ /******/ /* webpack/runtime/compat get default export */
264
+ /******/ (() => {
265
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
266
+ /******/ __webpack_require__.n = (module) => {
267
+ /******/ var getter = module && module.__esModule ?
268
+ /******/ () => (module['default']) :
269
+ /******/ () => (module);
270
+ /******/ __webpack_require__.d(getter, { a: getter });
271
+ /******/ return getter;
272
+ /******/ };
273
+ /******/ })();
274
+ /******/
275
+ /******/ /* webpack/runtime/define property getters */
276
+ /******/ (() => {
277
+ /******/ // define getter functions for harmony exports
278
+ /******/ __webpack_require__.d = (exports, definition) => {
279
+ /******/ for(var key in definition) {
280
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
281
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
282
+ /******/ }
283
+ /******/ }
284
+ /******/ };
285
+ /******/ })();
286
+ /******/
287
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
288
+ /******/ (() => {
289
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
290
+ /******/ })();
291
+ /******/
292
+ /******/ /* webpack/runtime/make namespace object */
293
+ /******/ (() => {
294
+ /******/ // define __esModule on exports
295
+ /******/ __webpack_require__.r = (exports) => {
296
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
297
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
298
+ /******/ }
299
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
300
+ /******/ };
301
+ /******/ })();
302
+ /******/
303
+ /************************************************************************/
304
+ var __webpack_exports__ = {};
305
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
306
+ (() => {
307
+ "use strict";
308
+ __webpack_require__.r(__webpack_exports__);
309
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
310
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
311
+ /* harmony export */ });
312
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
313
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
314
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
315
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
316
+ /* harmony import */ var _FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5751);
317
+
318
+
319
+
320
+
321
+ var MeganavSearchSuggestions = function MeganavSearchSuggestions(_ref) {
322
+ var absUrl = _ref.absUrl,
323
+ displaySupportLink = _ref.displaySupportLink;
324
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
325
+ className: "ui-text-overline2 text-cool-black py-12"
326
+ }, "Popular pages"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
327
+ className: "flex justify-between items-center overflow-x-scroll"
328
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
329
+ className: "flex"
330
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
331
+ className: "py-12 pr-8 flex-shrink-0"
332
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
333
+ href: absUrl("/docs/how-ably-works"),
334
+ className: "ui-text-p2 ui-link"
335
+ }, "How does Ably work?")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
336
+ className: "py-12 px-8 flex-shrink-0"
337
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
338
+ href: absUrl("/docs/quick-start-guide"),
339
+ className: "ui-text-p2 ui-link"
340
+ }, "Quickstart guide")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
341
+ className: "py-12 px-8 flex-shrink-0"
342
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
343
+ href: absUrl("/docs/core-features/pubsub"),
344
+ className: "ui-text-p2 ui-link"
345
+ }, "Publish/Subscribe Messaging")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
346
+ className: "py-12 pl-8 flex-shrink-0"
347
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
348
+ href: absUrl("/platform"),
349
+ className: "ui-text-p2 ui-link"
350
+ }, "Platform"))), displaySupportLink ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
351
+ url: absUrl("/support"),
352
+ textSize: "text-p2"
353
+ }, "Support") : null));
354
+ };
355
+
356
+ MeganavSearchSuggestions.propTypes = {
357
+ absUrl: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
358
+ displaySupportLink: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
359
+ };
360
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MeganavSearchSuggestions);
361
+ })();
362
+
363
+ /******/ return __webpack_exports__;
364
+ /******/ })()
365
+ ;
366
+ });
Binary file
Binary file
package/core/styles.css CHANGED
@@ -117,7 +117,9 @@
117
117
 
118
118
  --spacing-0: 0px;
119
119
  --spacing-1: 1px;
120
+ --spacing-2: 0.125rem;
120
121
  --spacing-4: 0.25rem;
122
+ --spacing-6: 0.375rem;
121
123
  --spacing-8: 0.5rem;
122
124
  --spacing-12: 0.75rem;
123
125
  --spacing-14: 0.875rem;
@@ -576,21 +578,6 @@
576
578
  stroke: var(--color-dark-grey);
577
579
  }
578
580
 
579
- /* Extend how tailwind does group hover for icons */
580
- .group {
581
- &:hover {
582
- .group-hover\:icon-gui-hover {
583
- stroke: var(--color-gui-hover);
584
- }
585
- }
586
-
587
- &:focus {
588
- .group-focus\:icon-gui-focus {
589
- stroke: var(--color-gui-focus);
590
- }
591
- }
592
- }
593
-
594
581
  .ui-version-tag {
595
582
  @apply inline-block absolute align-top uppercase font-bold whitespace-nowrap;
596
583
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "7.9.4",
3
+ "version": "7.10.0-dev.45e131a",
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",
package/src/.DS_Store ADDED
Binary file
Binary file
@@ -48,11 +48,15 @@
48
48
 
49
49
  .ui-meganav-link {
50
50
  @apply text-menu2 font-medium block;
51
- @apply mx-8 lg:mx-12 px-0 py-20;
51
+ @apply mr-12 lg:mr-24 px-0 py-20;
52
52
  @apply hover:text-gui-hover focus:text-gui-focus focus:outline-none;
53
53
  @apply transition-colors;
54
54
  }
55
55
 
56
+ .ui-meganav-item {
57
+ flex: 1 0 auto;
58
+ }
59
+
56
60
  .ui-meganav-mobile-link {
57
61
  @apply p-menu-row relative -left-8 w-extend-8;
58
62
  @apply text-menu2 font-medium block text-cool-black text-left;
@@ -2,20 +2,25 @@
2
2
  <%= notice %>
3
3
 
4
4
  <div class="ui-meganav ui-grid-px">
5
- <%= render(AblyUi::Core::Logo.new(data_id: "meganav-logo", href: logo_link)) %>
5
+ <div className="mr-24">
6
+ <%= render(AblyUi::Core::Logo.new(data_id: "meganav-logo", href: logo_link)) %>
7
+ </div>
6
8
  <%= render(AblyUi::Core::MeganavItemsDesktop.new(theme_name: @theme_name, url_base: url_base)) %>
7
9
 
8
10
  <% if @session_data[:signedIn] %>
9
11
  <%= render(AblyUi::Core::MeganavItemsSignedIn.new(session_data: @session_data, theme_name: @theme_name, url_base: url_base)) %>
10
12
  <% else %>
11
13
  <ul class="hidden md:flex items-center">
12
- <li>
14
+ <li class="ui-meganav-item">
13
15
  <%= link_to "Contact us", abs_url("/contact"), data: { id: "meganav-link" }, class: ["ui-meganav-link", theme(:text_color)] %>
14
16
  </li>
15
- <li>
16
- <%= link_to "Login", abs_url(login_link), data: { id: "meganav-link" }, class: ["ui-meganav-link", theme(:text_color)] %>
17
+ <li class="ui-meganav-item">
18
+ <%= link_to "Login", abs_url(login_link), data: { id: "meganav-link" }, class: ["ui-meganav-link", "mr-0", theme(:text_color)] %>
17
19
  </li>
18
- <li class="ml-16">
20
+ <li class="ui-meganav-item">
21
+ <%= render(AblyUi::Core::MeganavSearch.new(url_base: url_base)) %>
22
+ </li>
23
+ <li class="ui-meganav-item">
19
24
  <%= link_to "Sign up free", abs_url("/sign-up"), data: { id: "meganav-sign-up-btn" }, class: ["ui-btn", "p-btn-small", theme(:button_background_color), theme(:button_text_color)] %>
20
25
  </li>
21
26
  </ul>
@@ -18,23 +18,27 @@ import MeganavContentPlatform from "../MeganavContentPlatform/component.jsx";
18
18
  import MeganavContentUseCases from "../MeganavContentUseCases/component.jsx";
19
19
  import MeganavContentWhyAbly from "../MeganavContentWhyAbly/component.jsx";
20
20
  import MeganavContentDevelopers from "../MeganavContentDevelopers/component.jsx";
21
+ import MeganavSearch from "../MeganavSearch/component.jsx";
21
22
 
22
23
  const SignIn = ({ sessionState, theme, loginLink, absUrl }) => {
23
24
  return sessionState.signedIn ? (
24
25
  <MeganavItemsSignedIn absUrl={absUrl} sessionState={sessionState} theme={theme} />
25
26
  ) : (
26
27
  <ul className="hidden md:flex items-center">
27
- <li>
28
+ <li className="ui-meganav-item">
28
29
  <a href={absUrl("/contact")} className={`ui-meganav-link ${theme.textColor}`} data-id="meganav-link">
29
30
  Contact us
30
31
  </a>
31
32
  </li>
32
- <li>
33
- <a href={absUrl(loginLink)} className={`ui-meganav-link ${theme.textColor}`} data-id="meganav-link">
33
+ <li className="ui-meganav-item">
34
+ <a href={absUrl(loginLink)} className={`ui-meganav-link mr-0 ${theme.textColor}`} data-id="meganav-link">
34
35
  Login
35
36
  </a>
36
37
  </li>
37
- <li className="ml-16">
38
+ <li className="ui-meganav-item">
39
+ <MeganavSearch absUrl={absUrl} />
40
+ </li>
41
+ <li className="ui-meganav-item">
38
42
  <a href={absUrl("/sign-up")} data-id="meganav-sign-up-btn" className={`ui-btn p-btn-small ${theme.buttonBackgroundColor} ${theme.buttonTextColor}`}>
39
43
  Sign up free
40
44
  </a>
@@ -81,7 +85,10 @@ export default function Meganav({ paths, themeName = "white", notice, loginLink
81
85
  <nav className={`ui-meganav-wrapper ${theme.backgroundColor} ${theme.barShadow}`} data-id="meganav" aria-label="Main">
82
86
  {notice && <Notice {...notice.props} config={notice.config} />}
83
87
  <div className="ui-meganav ui-grid-px">
84
- <Logo dataId="meganav-logo" href={urlBase} />
88
+ <div className="mr-24">
89
+ <Logo dataId="meganav-logo" href={urlBase} />
90
+ </div>
91
+
85
92
  <MeganavItemsDesktop panels={panels} paths={paths} theme={theme} absUrl={absUrl} />
86
93
 
87
94
  {/* Because we load the session state through fetch, we display a placeholder until fetch returns */}
@@ -27,7 +27,7 @@
27
27
  </li>
28
28
 
29
29
  <li>
30
- <%= link_to abs_url("/resources/datasheets"), class: "group ui-meganav-media py-12" do %>
30
+ <%= link_to abs_url("/resources"), class: "group ui-meganav-media py-12" do %>
31
31
  <p class="ui-meganav-media-heading">Resources</p>
32
32
  <% end %>
33
33
  </li>
@@ -42,7 +42,7 @@ const MeganavContentWhyAbly = ({ absUrl }) => {
42
42
  </li>
43
43
 
44
44
  <li>
45
- <a href={absUrl("/resources/datasheets")} className="group ui-meganav-media py-12">
45
+ <a href={absUrl("/resources")} className="group ui-meganav-media py-12">
46
46
  <p className="ui-meganav-media-heading">Resources</p>
47
47
  </a>
48
48
  </li>
@@ -1,6 +1,6 @@
1
1
  <%= button_tag(type: "button",
2
- class: ["ui-meganav-link", "h-64", "flex", "items-center", "group", theme(:text_color)],
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 #{content}" }) 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 %>
@@ -3,11 +3,11 @@ import T from "prop-types";
3
3
 
4
4
  import Icon from "../Icon/component.jsx";
5
5
 
6
- const MeganavControl = ({ ariaControls, children, theme }) => (
6
+ const MeganavControl = ({ ariaControls, children, theme, additionalCSS }) => (
7
7
  <button
8
8
  type="button"
9
9
  data-id="meganav-control"
10
- className={`ui-meganav-link h-64 flex items-center group ${theme.textColor}`}
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
13
  aria-label={`Show ${children}`}
@@ -26,6 +26,7 @@ MeganavControl.propTypes = {
26
26
  ariaControls: T.string,
27
27
  children: T.node,
28
28
  theme: T.object,
29
+ additionalCSS: T.string,
29
30
  };
30
31
 
31
32
  export default MeganavControl;
@@ -2,9 +2,11 @@ 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
6
 
6
- def initialize(aria_controls:, theme_name:)
7
+ def initialize(aria_controls:, theme_name:, additional_css: '')
7
8
  @aria_controls = aria_controls
9
+ @additional_css = additional_css
8
10
  theme_setup(theme_name)
9
11
  end
10
12
  end
@@ -7,6 +7,8 @@ const MeganavControlMobileDropdown = ({ clearPanels }) => {
7
7
  const dropdown = queryId("meganav-mobile-dropdown");
8
8
  const menuIcon = queryId("meganav-control-mobile-dropdown-menu");
9
9
  const closeIcon = queryId("meganav-control-mobile-dropdown-close");
10
+ const MeganavSearchSuggestionsToggle = queryId("meganav-mobile-search-input");
11
+ const MeganavSearchSuggestions = queryId("meganav-mobile-search-suggestions");
10
12
 
11
13
  const clickHandler = () => {
12
14
  const ariaExpanded = control.getAttribute("aria-expanded");
@@ -26,7 +28,27 @@ const MeganavControlMobileDropdown = ({ clearPanels }) => {
26
28
  closeIcon.classList.toggle("hidden");
27
29
  };
28
30
 
31
+ const focusSuggestionsHandler = () => {
32
+ MeganavSearchSuggestions.classList.add("max-h-96");
33
+ };
34
+ const blurSuggestionsHandler = (event) => {
35
+ if (
36
+ event.relatedTarget === MeganavSearchSuggestions.querySelectorAll("a")[0]
37
+ ) {
38
+ return;
39
+ }
40
+ MeganavSearchSuggestions.classList.remove("max-h-96");
41
+ };
42
+
29
43
  control.addEventListener("click", clickHandler);
44
+ MeganavSearchSuggestionsToggle.addEventListener(
45
+ "focus",
46
+ focusSuggestionsHandler
47
+ );
48
+ MeganavSearchSuggestionsToggle.addEventListener(
49
+ "blur",
50
+ blurSuggestionsHandler
51
+ );
30
52
 
31
53
  return {
32
54
  teardown: () => {
@@ -11,7 +11,18 @@
11
11
  <%= render(AblyUi::Core::MeganavControlMobileDropdown.new(theme_name: @theme_name)) %>
12
12
 
13
13
  <div class="ui-meganav-mobile-dropdown invisible" id="meganav-mobile-dropdown" data-id="meganav-mobile-dropdown">
14
- <div class="py-16 ui-grid-px bg-white">
14
+ <div class="pt-24 pb-16 ui-grid-px bg-white">
15
+ <%= tag.form class: "mb-16", action: abs_url("/search"), method: "get" do %>
16
+ <div class="relative w-full">
17
+ <%= render(AblyUi::Core::Icon.new(name: "icon-gui-search", size: "1.5rem", color: "text-cool-black", additional_css: "absolute top-12 left-16")) %>
18
+ <input type="search" name="q" class="ui-input pl-48 h-48" placeholder="Search" data-id="meganav-mobile-search-input" />
19
+ </div>
20
+ <% end %>
21
+
22
+ <div class="max-h-0 overflow-hidden transition-all" data-id="meganav-mobile-search-suggestions">
23
+ <%= render(AblyUi::Core::MeganavSearchSuggestions.new(url_base: url_base, display_support_link: false)) %>
24
+ </div>
25
+
15
26
  <ul class="mb-16">
16
27
  <% panels.each do |panel| %>
17
28
  <li class="ui-meganav-mobile-item">