@ably/ui 6.0.0 → 6.0.1-dev.cf70cf9

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.
@@ -0,0 +1,46 @@
1
+ @layer components {
2
+ .ui-company-autocomplete-container {
3
+ @apply shadow-container absolute bg-white w-full z-10 font-sans;
4
+ }
5
+
6
+ .ui-company-autocomplete-list {
7
+ @apply border border-mid-grey border-t-0;
8
+ }
9
+
10
+ .ui-company-autocomplete-listitem {
11
+ @apply border-b border-mid-grey h-48;
12
+ }
13
+
14
+ .ui-company-autocomplete-btn {
15
+ @apply h-full w-full flex items-center py-4 px-12;
16
+ }
17
+
18
+ .ui-company-autocomplete-btn:focus {
19
+ @apply focus:text-gui-focus;
20
+ }
21
+
22
+ .ui-company-autocomplete-listitem:last-child {
23
+ @apply border-b-0;
24
+ }
25
+
26
+ .ui-company-autocomplete-listitem:hover {
27
+ @apply bg-light-grey cursor-pointer;
28
+ }
29
+
30
+ .ui-company-autocomplete-listitem:hover .ui-company-autocomplete-name {
31
+ @apply text-gui-hover;
32
+ }
33
+
34
+ .ui-company-autocomplete-logo {
35
+ @apply w-32;
36
+ }
37
+
38
+ .ui-company-autocomplete-name {
39
+ @apply font-sans font-light text-cool-black ml-8 text-p3 text-left;
40
+ }
41
+
42
+ .ui-company-autocomplete-domain {
43
+ @apply font-sans font-light text-dark-grey ml-auto text-p3;
44
+ }
45
+ }
46
+
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AblyUi=e():(t.AblyUi=t.AblyUi||{},t.AblyUi.Core=t.AblyUi.Core||{},t.AblyUi.Core.CompanyAutocomplete=e())}(this,(function(){return(()=>{var t={7757:(t,e,r)=>{t.exports=r(5666)},3096:(t,e,r)=>{var n="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,s=f||l||Function("return this")(),p=Object.prototype.toString,d=Math.max,h=Math.min,v=function(){return s.Date.now()};function y(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function m(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==p.call(t)}(t))return NaN;if(y(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=y(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var r=a.test(t);return r||c.test(t)?u(t.slice(2),r?2:8):i.test(t)?NaN:+t}t.exports=function(t,e,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(n);return y(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),function(t,e,r){var o,i,a,c,u,f,l=0,s=!1,p=!1,g=!0;if("function"!=typeof t)throw new TypeError(n);function w(e){var r=o,n=i;return o=i=void 0,l=e,c=t.apply(n,r)}function b(t){return l=t,u=setTimeout(E,e),s?w(t):c}function x(t){var r=t-f;return void 0===f||r>=e||r<0||p&&t-l>=a}function E(){var t=v();if(x(t))return L(t);u=setTimeout(E,function(t){var r=e-(t-f);return p?h(r,a-(t-l)):r}(t))}function L(t){return u=void 0,g&&o?w(t):(o=i=void 0,c)}function j(){var t=v(),r=x(t);if(o=arguments,i=this,f=t,r){if(void 0===u)return b(f);if(p)return u=setTimeout(E,e),w(f)}return void 0===u&&(u=setTimeout(E,e)),c}return e=m(e)||0,y(r)&&(s=!!r.leading,a=(p="maxWait"in r)?d(m(r.maxWait)||0,e):a,g="trailing"in r?!!r.trailing:g),j.cancel=function(){void 0!==u&&clearTimeout(u),l=0,o=f=i=u=void 0},j.flush=function(){return void 0===u?c:L(v())},j}(t,e,{leading:o,maxWait:e,trailing:i})}},5666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n=s;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===s)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?h:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var s="suspendedStart",p="suspendedYield",d="executing",h="completed",v={};function y(){}function m(){}function g(){}var w={};w[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(N([])));x&&x!==r&&n.call(x,i)&&(w=x);var E=g.prototype=y.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var f=u.arg,s=f.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function N(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:S}}function S(){return{value:e,done:!0}}return m.prototype=E.constructor=g,g.constructor=m,m.displayName=u(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},L(j.prototype),j.prototype[a]=function(){return this},t.AsyncIterator=j,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new j(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(E),u(E,c,"Generator"),E[i]=function(){return this},E.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=N,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),f=n.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};return(()=>{"use strict";r.d(n,{default:()=>h});var t=r(7757),e=r.n(t),o=r(3096),i=r.n(o);function a(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function c(t){a(i,n,o,c,u,"next",t)}function u(t){a(i,n,o,c,u,"throw",t)}c(void 0)}))}}var u=function(t){return t.parentNode.querySelector("[data-id=company-autocomplete-dropdown]")},f=function(t){return t?t.querySelectorAll("li > button"):[]},l=function(t){return Array.from(t).indexOf(document.activeElement)},s=function(t){var e=u(t);e&&(e.classList.add("hidden"),e.querySelector("ol").innerHTML="")},p=function(t,e){var r=t.parentNode,n=function(t){var e=u(t);if(!e){t.parentNode.style.position="relative",(e=document.createElement("div")).dataset.id="company-autocomplete-dropdown",e.classList.add("ui-company-autocomplete-container");var r=document.createElement("ol");return r.classList.add("ui-company-autocomplete-list"),{container:e,list:r}}return{container:e,list:e.querySelector("ol")}}(t),o=n.container,i=n.list,a=function(t){return t.map((function(t){var e=document.createElement("li");e.classList.add("ui-company-autocomplete-listitem");var r=document.createElement("button");r.classList.add("ui-company-autocomplete-btn"),r.dataset.name=t.name;var n=document.createElement("img");n.alt="".concat(t.name," logo"),n.src=t.logo,n.classList.add("ui-company-autocomplete-logo");var o=document.createElement("p");o.textContent=t.name,o.classList.add("ui-company-autocomplete-name");var i=document.createElement("p");return i.textContent=t.domain,i.classList.add("ui-company-autocomplete-domain"),r.append(n),r.append(o),r.append(i),e.append(r),e}))}(e);s(t),a.forEach((function(r,n){i.append(r),r.addEventListener("click",(function(r){t.value=e[n].name,r.preventDefault()}))})),o.append(i),o.classList.remove("hidden"),r.append(o)},d=function(){var t=c(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n){t.next=3;break}return t.abrupt("return",[]);case 3:return t.next=5,fetch("".concat(r,"?query=").concat(n));case 5:return o=t.sent,t.next=8,o.json();case 8:return i=t.sent,t.abrupt("return",i);case 12:return t.prev=12,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",[]);case 16:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e,r){return t.apply(this,arguments)}}();const h=function(t,r){t&&r&&(t.addEventListener("keyup",i()(function(){var n=c(e().mark((function n(o){var i,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!["Enter","Space","Tab","Escape"].includes(o.code)){e.next=2;break}return e.abrupt("return");case 2:return i=o.target.value,e.next=5,d(r,i);case 5:(a=e.sent)&&a.length>0&&p(t,a);case 7:case"end":return e.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),100,{trailing:!0})),t.parentNode.addEventListener("keydown",(function(e){"ArrowDown"===e.code?function(t,e){var r=u(t),n=f(r),o=l(n);0!==n.length&&(document.activeElement===t?n[0].focus():o>=0&&o<n.length-1&&n[o+1].focus(),e.preventDefault())}(t,e):"ArrowUp"===e.code?function(t,e){var r=u(t),n=f(r),o=l(n);0!==n.length&&(0===o?t.focus():o>0&&n[o-1].focus(),e.preventDefault())}(t,e):"Enter"===e.code||"Space"===e.code?function(t,e){e.target.dataset.name&&(t.value=e.target.dataset.name,s(t),t.focus(),e.preventDefault())}(t,e):"Tab"===e.code?function(t,e){var r=u(t),n=f(r),o=l(n);(document.activeElement===t&&e.shiftKey||o===n.length-1)&&s(t)}(t,e):"Escape"===e.code&&s(t)})),document.body.addEventListener("click",(function(){s(t)})))}})(),n.default})()}));
@@ -0,0 +1,17 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else {
7
+ var a = factory();
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(this, function() {
11
+ return /******/ (() => { // webpackBootstrap
12
+ var __webpack_exports__ = {};
13
+
14
+ /******/ return __webpack_exports__;
15
+ /******/ })()
16
+ ;
17
+ });
@@ -0,0 +1 @@
1
+
package/core/Meganav.jsx CHANGED
@@ -684,7 +684,14 @@ var MeganavContentDevelopers = function MeganavContentDevelopers(_ref) {
684
684
  className: "ui-meganav-media-heading"
685
685
  }, "Streaming data sources"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
686
686
  className: "ui-meganav-media-copy"
687
- }, "Augment your apps with realtime updates like weather or transit."))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
687
+ }, "Augment your apps with realtime updates like weather or transit."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
688
+ href: absUrl("/periodic-table-of-realtime"),
689
+ className: "ui-meganav-media group"
690
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
691
+ className: "ui-meganav-media-heading"
692
+ }, "The Periodic Table of Realtime"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
693
+ className: "ui-meganav-media-copy"
694
+ }, "A compendium for all things realtime and event-driven."))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
688
695
  className: "ui-meganav-overline uppercase",
689
696
  id: "meganav-developers-panel-quick-links"
690
697
  }, "Quick links"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
@@ -372,7 +372,14 @@ var MeganavContentDevelopers = function MeganavContentDevelopers(_ref) {
372
372
  className: "ui-meganav-media-heading"
373
373
  }, "Streaming data sources"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
374
374
  className: "ui-meganav-media-copy"
375
- }, "Augment your apps with realtime updates like weather or transit."))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
375
+ }, "Augment your apps with realtime updates like weather or transit."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
376
+ href: absUrl("/periodic-table-of-realtime"),
377
+ className: "ui-meganav-media group"
378
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
379
+ className: "ui-meganav-media-heading"
380
+ }, "The Periodic Table of Realtime"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
381
+ className: "ui-meganav-media-copy"
382
+ }, "A compendium for all things realtime and event-driven."))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
376
383
  className: "ui-meganav-overline uppercase",
377
384
  id: "meganav-developers-panel-quick-links"
378
385
  }, "Quick links"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
@@ -0,0 +1,59 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["AblyUi"] = factory();
8
+ else
9
+ root["AblyUi"] = root["AblyUi"] || {}, root["AblyUi"]["Core"] = root["AblyUi"]["Core"] || {}, root["AblyUi"]["Core"]["Test"] = factory();
10
+ })(this, function() {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ "./src/core/Test/component.js":
15
+ /*!************************************!*\
16
+ !*** ./src/core/Test/component.js ***!
17
+ \************************************/
18
+ /*! unknown exports (runtime-defined) */
19
+ /*! runtime requirements: */
20
+ /***/ (() => {
21
+
22
+
23
+
24
+ /***/ })
25
+
26
+ /******/ });
27
+ /************************************************************************/
28
+ /******/ // The module cache
29
+ /******/ var __webpack_module_cache__ = {};
30
+ /******/
31
+ /******/ // The require function
32
+ /******/ function __webpack_require__(moduleId) {
33
+ /******/ // Check if module is in cache
34
+ /******/ if(__webpack_module_cache__[moduleId]) {
35
+ /******/ return __webpack_module_cache__[moduleId].exports;
36
+ /******/ }
37
+ /******/ // Create a new module (and put it into the cache)
38
+ /******/ var module = __webpack_module_cache__[moduleId] = {
39
+ /******/ // no module.id needed
40
+ /******/ // no module.loaded needed
41
+ /******/ exports: {}
42
+ /******/ };
43
+ /******/
44
+ /******/ // Execute the module function
45
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
46
+ /******/
47
+ /******/ // Return the exports of the module
48
+ /******/ return module.exports;
49
+ /******/ }
50
+ /******/
51
+ /************************************************************************/
52
+ /******/ // module exports must be returned from runtime so entry inlining is disabled
53
+ /******/ // startup
54
+ /******/ // Load entry module and return exports
55
+ /******/ return __webpack_require__("./src/core/Test/component.js");
56
+ /******/ })()
57
+ .default;
58
+ });
59
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9BYmx5VWkuQ29yZS5bbmFtZV0vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovL0FibHlVaS5Db3JlLltuYW1lXS93ZWJwYWNrL2Jvb3RzdHJhcCIsIndlYnBhY2s6Ly9BYmx5VWkuQ29yZS5bbmFtZV0vd2VicGFjay9zdGFydHVwIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSx1Q0FBdUMsdURBQXVEO0FBQzlGLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7OztVQ1ZBO1VBQ0E7O1VBRUE7VUFDQTtVQUNBO1VBQ0E7VUFDQTtVQUNBO1VBQ0E7VUFDQTtVQUNBO1VBQ0E7VUFDQTtVQUNBOztVQUVBO1VBQ0E7O1VBRUE7VUFDQTtVQUNBOzs7VUNyQkE7VUFDQTtVQUNBO1VBQ0EiLCJmaWxlIjoiY29yZS9UZXN0L2NvbXBvbmVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiB3ZWJwYWNrVW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbihyb290LCBmYWN0b3J5KSB7XG5cdGlmKHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlID09PSAnb2JqZWN0Jylcblx0XHRtb2R1bGUuZXhwb3J0cyA9IGZhY3RvcnkoKTtcblx0ZWxzZSBpZih0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQpXG5cdFx0ZGVmaW5lKFtdLCBmYWN0b3J5KTtcblx0ZWxzZSBpZih0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcpXG5cdFx0ZXhwb3J0c1tcIkFibHlVaVwiXSA9IGZhY3RvcnkoKTtcblx0ZWxzZVxuXHRcdHJvb3RbXCJBYmx5VWlcIl0gPSByb290W1wiQWJseVVpXCJdIHx8IHt9LCByb290W1wiQWJseVVpXCJdW1wiQ29yZVwiXSA9IHJvb3RbXCJBYmx5VWlcIl1bXCJDb3JlXCJdIHx8IHt9LCByb290W1wiQWJseVVpXCJdW1wiQ29yZVwiXVtcIlRlc3RcIl0gPSBmYWN0b3J5KCk7XG59KSh0aGlzLCBmdW5jdGlvbigpIHtcbnJldHVybiAiLCIvLyBUaGUgbW9kdWxlIGNhY2hlXG52YXIgX193ZWJwYWNrX21vZHVsZV9jYWNoZV9fID0ge307XG5cbi8vIFRoZSByZXF1aXJlIGZ1bmN0aW9uXG5mdW5jdGlvbiBfX3dlYnBhY2tfcmVxdWlyZV9fKG1vZHVsZUlkKSB7XG5cdC8vIENoZWNrIGlmIG1vZHVsZSBpcyBpbiBjYWNoZVxuXHRpZihfX3dlYnBhY2tfbW9kdWxlX2NhY2hlX19bbW9kdWxlSWRdKSB7XG5cdFx0cmV0dXJuIF9fd2VicGFja19tb2R1bGVfY2FjaGVfX1ttb2R1bGVJZF0uZXhwb3J0cztcblx0fVxuXHQvLyBDcmVhdGUgYSBuZXcgbW9kdWxlIChhbmQgcHV0IGl0IGludG8gdGhlIGNhY2hlKVxuXHR2YXIgbW9kdWxlID0gX193ZWJwYWNrX21vZHVsZV9jYWNoZV9fW21vZHVsZUlkXSA9IHtcblx0XHQvLyBubyBtb2R1bGUuaWQgbmVlZGVkXG5cdFx0Ly8gbm8gbW9kdWxlLmxvYWRlZCBuZWVkZWRcblx0XHRleHBvcnRzOiB7fVxuXHR9O1xuXG5cdC8vIEV4ZWN1dGUgdGhlIG1vZHVsZSBmdW5jdGlvblxuXHRfX3dlYnBhY2tfbW9kdWxlc19fW21vZHVsZUlkXShtb2R1bGUsIG1vZHVsZS5leHBvcnRzLCBfX3dlYnBhY2tfcmVxdWlyZV9fKTtcblxuXHQvLyBSZXR1cm4gdGhlIGV4cG9ydHMgb2YgdGhlIG1vZHVsZVxuXHRyZXR1cm4gbW9kdWxlLmV4cG9ydHM7XG59XG5cbiIsIi8vIG1vZHVsZSBleHBvcnRzIG11c3QgYmUgcmV0dXJuZWQgZnJvbSBydW50aW1lIHNvIGVudHJ5IGlubGluaW5nIGlzIGRpc2FibGVkXG4vLyBzdGFydHVwXG4vLyBMb2FkIGVudHJ5IG1vZHVsZSBhbmQgcmV0dXJuIGV4cG9ydHNcbnJldHVybiBfX3dlYnBhY2tfcmVxdWlyZV9fKFwiLi9zcmMvY29yZS9UZXN0L2NvbXBvbmVudC5qc1wiKTtcbiJdLCJzb3VyY2VSb290IjoiIn0=
package/core/Test.jsx ADDED
@@ -0,0 +1,4 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ })()
4
+ ;
@@ -0,0 +1 @@
1
+ @import "./styles/properties.css";
@@ -0,0 +1,49 @@
1
+ @import "./styles/buttons.css";
2
+ @import "./styles/layout.css";
3
+ @import "./styles/text.css";
4
+
5
+ @layer components {
6
+ .ui-input {
7
+ @apply text-p2 font-light bg-light-grey rounded p-input w-full leading-none appearance-none border border-mid-grey transition-input;
8
+ @apply hover:bg-white hover:shadow-input hover:border-transparent;
9
+ @apply focus:bg-white focus:shadow-input focus:border-transparent focus:outline-gui-focus;
10
+ @apply max-w-screen-sm;
11
+ }
12
+
13
+ /* Basis for icon component */
14
+ .ui-icon-cool-black {
15
+ stroke: var(--color-cool-black);
16
+ }
17
+
18
+ .ui-icon-white {
19
+ stroke: var(--color-white);
20
+ }
21
+
22
+ .ui-icon-dark-grey {
23
+ stroke: var(--color-dark-grey);
24
+ }
25
+
26
+ /* Extend how tailwind does group hover for icons */
27
+ .group {
28
+ &:hover {
29
+ .group-hover\:icon-gui-hover {
30
+ stroke: var(--color-gui-hover);
31
+ }
32
+ }
33
+
34
+ &:focus {
35
+ .group-focus\:icon-gui-focus {
36
+ stroke: var(--color-gui-focus);
37
+ }
38
+ }
39
+ }
40
+
41
+ .ui-version-tag {
42
+ @apply inline-block absolute align-top uppercase font-bold whitespace-nowrap;
43
+
44
+ position: relative;
45
+ vertical-align: super;
46
+ margin-left: 3px;
47
+ font-size: 8px;
48
+ }
49
+ }
Binary file
Binary file
@@ -0,0 +1 @@
1
+ @import "./styles/properties.css";
@@ -0,0 +1,49 @@
1
+ @import "./styles/buttons.css";
2
+ @import "./styles/layout.css";
3
+ @import "./styles/text.css";
4
+
5
+ @layer components {
6
+ .ui-input {
7
+ @apply text-p2 font-light bg-light-grey rounded p-input w-full leading-none appearance-none border border-mid-grey transition-input;
8
+ @apply hover:bg-white hover:shadow-input hover:border-transparent;
9
+ @apply focus:bg-white focus:shadow-input focus:border-transparent focus:outline-gui-focus;
10
+ @apply max-w-screen-sm;
11
+ }
12
+
13
+ /* Basis for icon component */
14
+ .ui-icon-cool-black {
15
+ stroke: var(--color-cool-black);
16
+ }
17
+
18
+ .ui-icon-white {
19
+ stroke: var(--color-white);
20
+ }
21
+
22
+ .ui-icon-dark-grey {
23
+ stroke: var(--color-dark-grey);
24
+ }
25
+
26
+ /* Extend how tailwind does group hover for icons */
27
+ .group {
28
+ &:hover {
29
+ .group-hover\:icon-gui-hover {
30
+ stroke: var(--color-gui-hover);
31
+ }
32
+ }
33
+
34
+ &:focus {
35
+ .group-focus\:icon-gui-focus {
36
+ stroke: var(--color-gui-focus);
37
+ }
38
+ }
39
+ }
40
+
41
+ .ui-version-tag {
42
+ @apply inline-block absolute align-top uppercase font-bold whitespace-nowrap;
43
+
44
+ position: relative;
45
+ vertical-align: super;
46
+ margin-left: 3px;
47
+ font-size: 8px;
48
+ }
49
+ }
package/core/styles.css CHANGED
@@ -175,7 +175,7 @@
175
175
  @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
176
176
  @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
177
177
  @apply transition-colors;
178
- @apply flex items-center;
178
+ @apply inline-flex items-center justify-center;
179
179
  }
180
180
 
181
181
  .ui-btn-alt {
@@ -195,7 +195,7 @@
195
195
 
196
196
  @apply text-white text-btn2 font-sans font-medium inline-block rounded p-btn;
197
197
  @apply focus:outline-gui-focus;
198
- @apply flex items-center;
198
+ @apply inline-flex items-center justify-center;
199
199
  }
200
200
 
201
201
  .ui-btn-alt:hover,
@@ -215,7 +215,7 @@
215
215
  @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
216
216
  @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
217
217
  @apply transition-colors;
218
- @apply flex items-center;
218
+ @apply inline-flex items-center justify-center;
219
219
  }
220
220
 
221
221
  .ui-btn-secondary {
@@ -225,7 +225,7 @@
225
225
  @apply focus:border-cool-black focus:bg-white focus:outline-gui-focus;
226
226
  @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:bg-white disabled:cursor-not-allowed;
227
227
  @apply transition-colors;
228
- @apply flex items-center;
228
+ @apply inline-flex items-center justify-center;
229
229
  }
230
230
 
231
231
  .ui-btn-secondary-invert {
@@ -235,7 +235,7 @@
235
235
  @apply focus:outline-gui-focus;
236
236
  @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:cursor-not-allowed;
237
237
  @apply transition-colors;
238
- @apply flex items-center;
238
+ @apply inline-flex items-center justify-center;
239
239
  }
240
240
 
241
241
  .ui-btn-icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "6.0.0",
3
+ "version": "6.0.1-dev.cf70cf9",
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
@@ -0,0 +1,45 @@
1
+ @layer components {
2
+ .ui-company-autocomplete-container {
3
+ @apply shadow-container absolute bg-white w-full z-10 font-sans;
4
+ }
5
+
6
+ .ui-company-autocomplete-list {
7
+ @apply border border-mid-grey border-t-0;
8
+ }
9
+
10
+ .ui-company-autocomplete-listitem {
11
+ @apply border-b border-mid-grey h-48;
12
+ }
13
+
14
+ .ui-company-autocomplete-btn {
15
+ @apply h-full w-full flex items-center py-4 px-12;
16
+ }
17
+
18
+ .ui-company-autocomplete-btn:focus {
19
+ @apply focus:text-gui-focus;
20
+ }
21
+
22
+ .ui-company-autocomplete-listitem:last-child {
23
+ @apply border-b-0;
24
+ }
25
+
26
+ .ui-company-autocomplete-listitem:hover {
27
+ @apply bg-light-grey cursor-pointer;
28
+ }
29
+
30
+ .ui-company-autocomplete-listitem:hover .ui-company-autocomplete-name {
31
+ @apply text-gui-hover;
32
+ }
33
+
34
+ .ui-company-autocomplete-logo {
35
+ @apply w-32;
36
+ }
37
+
38
+ .ui-company-autocomplete-name {
39
+ @apply font-sans font-light text-cool-black ml-8 text-p3 text-left;
40
+ }
41
+
42
+ .ui-company-autocomplete-domain {
43
+ @apply font-sans font-light text-dark-grey ml-auto text-p3;
44
+ }
45
+ }
@@ -0,0 +1,202 @@
1
+ import "./component.css";
2
+
3
+ import throttle from "lodash.throttle";
4
+
5
+ const COMPANY_AUTOCOMPLETE_DROPDOWN = "[data-id=company-autocomplete-dropdown]";
6
+
7
+ const getContainer = (input) =>
8
+ input.parentNode.querySelector(COMPANY_AUTOCOMPLETE_DROPDOWN);
9
+ const getItems = (container) =>
10
+ container ? container.querySelectorAll("li > button") : [];
11
+ const getFocusedItemIndex = (items) =>
12
+ Array.from(items).indexOf(document.activeElement);
13
+
14
+ const clearList = (input) => {
15
+ const container = getContainer(input);
16
+
17
+ if (container) {
18
+ container.classList.add("hidden");
19
+ container.querySelector("ol").innerHTML = "";
20
+ }
21
+ };
22
+
23
+ const renderItems = (data) =>
24
+ data.map((element) => {
25
+ const listItem = document.createElement("li");
26
+ listItem.classList.add("ui-company-autocomplete-listitem");
27
+
28
+ const btn = document.createElement("button");
29
+ btn.classList.add("ui-company-autocomplete-btn");
30
+ btn.dataset.name = element.name;
31
+
32
+ const logo = document.createElement("img");
33
+ logo.alt = `${element.name} logo`;
34
+ logo.src = element.logo;
35
+ logo.classList.add("ui-company-autocomplete-logo");
36
+
37
+ const name = document.createElement("p");
38
+ name.textContent = element.name;
39
+ name.classList.add("ui-company-autocomplete-name");
40
+
41
+ const domain = document.createElement("p");
42
+ domain.textContent = element.domain;
43
+ domain.classList.add("ui-company-autocomplete-domain");
44
+
45
+ btn.append(logo);
46
+ btn.append(name);
47
+ btn.append(domain);
48
+ listItem.append(btn);
49
+
50
+ return listItem;
51
+ });
52
+
53
+ const renderContainer = (input) => {
54
+ let container = getContainer(input);
55
+
56
+ if (!container) {
57
+ input.parentNode.style.position = "relative";
58
+
59
+ container = document.createElement("div");
60
+ container.dataset.id = "company-autocomplete-dropdown";
61
+ container.classList.add("ui-company-autocomplete-container");
62
+
63
+ const list = document.createElement("ol");
64
+ list.classList.add("ui-company-autocomplete-list");
65
+
66
+ return { container, list };
67
+ }
68
+
69
+ return { container, list: container.querySelector("ol") };
70
+ };
71
+
72
+ const renderDropdown = (input, data) => {
73
+ const parent = input.parentNode;
74
+ const { container, list } = renderContainer(input);
75
+ const items = renderItems(data);
76
+
77
+ clearList(input);
78
+
79
+ items.forEach((item, index) => {
80
+ list.append(item);
81
+ item.addEventListener("click", (event) => {
82
+ input.value = data[index].name;
83
+ event.preventDefault();
84
+ });
85
+ });
86
+
87
+ container.append(list);
88
+ container.classList.remove("hidden");
89
+ parent.append(container);
90
+ };
91
+
92
+ const fetchData = async (url, query) => {
93
+ try {
94
+ if (!query) {
95
+ return [];
96
+ }
97
+
98
+ const res = await fetch(`${url}?query=${query}`);
99
+ const payload = await res.json();
100
+
101
+ return payload;
102
+ } catch (e) {
103
+ // eslint-disable-next-line no-console
104
+ console.error(e);
105
+ return [];
106
+ }
107
+ };
108
+
109
+ const handleDownArrow = (input, event) => {
110
+ const container = getContainer(input);
111
+ const items = getItems(container);
112
+ const focusedItemIndex = getFocusedItemIndex(items);
113
+
114
+ if (items.length === 0) {
115
+ return;
116
+ } else if (document.activeElement === input) {
117
+ items[0].focus();
118
+ } else if (focusedItemIndex >= 0 && focusedItemIndex < items.length - 1) {
119
+ items[focusedItemIndex + 1].focus();
120
+ }
121
+
122
+ event.preventDefault();
123
+ };
124
+
125
+ const handleUpArrow = (input, event) => {
126
+ const container = getContainer(input);
127
+ const items = getItems(container);
128
+ const focusedItemIndex = getFocusedItemIndex(items);
129
+
130
+ if (items.length === 0) {
131
+ return;
132
+ } else if (focusedItemIndex === 0) {
133
+ input.focus();
134
+ } else if (focusedItemIndex > 0) {
135
+ items[focusedItemIndex - 1].focus();
136
+ }
137
+
138
+ event.preventDefault();
139
+ };
140
+
141
+ const handleTab = (input, event) => {
142
+ const container = getContainer(input);
143
+ const items = getItems(container);
144
+ const focusedItemIndex = getFocusedItemIndex(items);
145
+
146
+ if (document.activeElement === input && event.shiftKey) {
147
+ clearList(input);
148
+ } else if (focusedItemIndex === items.length - 1) {
149
+ clearList(input);
150
+ }
151
+ };
152
+
153
+ const handleEnter = (input, event) => {
154
+ if (event.target.dataset.name) {
155
+ input.value = event.target.dataset.name;
156
+ clearList(input);
157
+ input.focus();
158
+ event.preventDefault();
159
+ }
160
+ };
161
+
162
+ const CompanyAutocomplete = (input, url) => {
163
+ if (!input || !url) return;
164
+
165
+ input.addEventListener(
166
+ "keyup",
167
+ throttle(
168
+ async (event) => {
169
+ if (["Enter", "Space", "Tab", "Escape"].includes(event.code)) return;
170
+
171
+ const query = event.target.value;
172
+ const data = await fetchData(url, query);
173
+
174
+ if (data && data.length > 0) {
175
+ renderDropdown(input, data);
176
+ }
177
+ },
178
+ 100,
179
+ { trailing: true }
180
+ )
181
+ );
182
+
183
+ input.parentNode.addEventListener("keydown", (event) => {
184
+ if (event.code === "ArrowDown") {
185
+ handleDownArrow(input, event);
186
+ } else if (event.code === "ArrowUp") {
187
+ handleUpArrow(input, event);
188
+ } else if (event.code === "Enter" || event.code === "Space") {
189
+ handleEnter(input, event);
190
+ } else if (event.code === "Tab") {
191
+ handleTab(input, event);
192
+ } else if (event.code === "Escape") {
193
+ clearList(input);
194
+ }
195
+ });
196
+
197
+ document.body.addEventListener("click", () => {
198
+ clearList(input);
199
+ });
200
+ };
201
+
202
+ export default CompanyAutocomplete;
@@ -35,6 +35,12 @@
35
35
  <p class="ui-meganav-media-copy">Augment your apps with realtime updates like weather or transit.</p>
36
36
  <% end %>
37
37
  </li>
38
+ <li>
39
+ <%= link_to abs_url("/periodic-table-of-realtime"), class: "ui-meganav-media group" do %>
40
+ <p class="ui-meganav-media-heading">The Periodic Table of Realtime</p>
41
+ <p class="ui-meganav-media-copy">A compendium for all things realtime and event-driven.</p>
42
+ <% end %>
43
+ </li>
38
44
  </ul>
39
45
  </div>
40
46
 
@@ -44,6 +44,12 @@ const MeganavContentDevelopers = ({ absUrl }) => (
44
44
  <p className="ui-meganav-media-copy">Augment your apps with realtime updates like weather or transit.</p>
45
45
  </a>
46
46
  </li>
47
+ <li>
48
+ <a href={absUrl("/periodic-table-of-realtime")} className="ui-meganav-media group">
49
+ <p className="ui-meganav-media-heading">The Periodic Table of Realtime</p>
50
+ <p className="ui-meganav-media-copy">A compendium for all things realtime and event-driven.</p>
51
+ </a>
52
+ </li>
47
53
  </ul>
48
54
  </div>
49
55
 
Binary file
Binary file
@@ -6,7 +6,7 @@
6
6
  @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
7
7
  @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
8
8
  @apply transition-colors;
9
- @apply flex items-center;
9
+ @apply inline-flex items-center justify-center;
10
10
  }
11
11
 
12
12
  .ui-btn-alt {
@@ -26,7 +26,7 @@
26
26
 
27
27
  @apply text-white text-btn2 font-sans font-medium inline-block rounded p-btn;
28
28
  @apply focus:outline-gui-focus;
29
- @apply flex items-center;
29
+ @apply inline-flex items-center justify-center;
30
30
  }
31
31
 
32
32
  .ui-btn-alt:hover,
@@ -46,7 +46,7 @@
46
46
  @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
47
47
  @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
48
48
  @apply transition-colors;
49
- @apply flex items-center;
49
+ @apply inline-flex items-center justify-center;
50
50
  }
51
51
 
52
52
  .ui-btn-secondary {
@@ -56,7 +56,7 @@
56
56
  @apply focus:border-cool-black focus:bg-white focus:outline-gui-focus;
57
57
  @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:bg-white disabled:cursor-not-allowed;
58
58
  @apply transition-colors;
59
- @apply flex items-center;
59
+ @apply inline-flex items-center justify-center;
60
60
  }
61
61
 
62
62
  .ui-btn-secondary-invert {
@@ -66,7 +66,7 @@
66
66
  @apply focus:outline-gui-focus;
67
67
  @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:cursor-not-allowed;
68
68
  @apply transition-colors;
69
- @apply flex items-center;
69
+ @apply inline-flex items-center justify-center;
70
70
  }
71
71
 
72
72
  .ui-btn-icon {
Binary file