@ably/ui 8.7.0-dev.73348b7 → 8.7.0-dev.734c219

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 (169) hide show
  1. package/README.md +16 -5
  2. package/core/.DS_Store +0 -0
  3. package/core/Code/component.css +5 -3
  4. package/core/Code/component.js +1 -1
  5. package/core/Code.jsx +373 -7273
  6. package/core/CompanyAutocomplete/component.js +1 -1
  7. package/core/ConnectStateWrapper/component.js +1 -1
  8. package/core/ConnectStateWrapper.jsx +16 -7
  9. package/core/ContactFooter/component.js +1 -1
  10. package/core/ContactFooter.jsx +20 -126
  11. package/core/CookieMessage/component.js +1 -1
  12. package/core/CookieMessage.jsx +24 -296
  13. package/core/CustomerLogos/component.js +1 -1
  14. package/core/CustomerLogos.jsx +18 -120
  15. package/core/DropdownMenu/component.js +1 -0
  16. package/core/DropdownMenu.jsx +313 -0
  17. package/core/FeatureFooter/component.js +1 -1
  18. package/core/FeaturedLink/component.css +1 -1
  19. package/core/FeaturedLink/component.js +1 -1
  20. package/core/FeaturedLink.jsx +15 -121
  21. package/core/Flash/component.js +1 -1
  22. package/core/Flash.jsx +151 -1533
  23. package/core/Footer/component.css +23 -3
  24. package/core/Footer/component.js +1 -1
  25. package/core/Footer.jsx +166 -181
  26. package/core/Icon/component.js +1 -1
  27. package/core/Icon.jsx +12 -117
  28. package/core/Loader/component.js +1 -1
  29. package/core/Loader.jsx +12 -117
  30. package/core/Logo/component.js +1 -1
  31. package/core/Logo.jsx +38 -228
  32. package/core/Meganav/component.css +8 -10
  33. package/core/Meganav/component.js +1 -2
  34. package/core/Meganav/component.json +1 -1
  35. package/core/Meganav.jsx +2237 -9548
  36. package/core/MeganavBlogPostsList/component.js +1 -1
  37. package/core/MeganavBlogPostsList.jsx +18 -125
  38. package/core/MeganavContentCompany/component.js +1 -1
  39. package/core/MeganavContentCompany.jsx +60 -141
  40. package/core/MeganavContentDevelopers/component.js +1 -1
  41. package/core/MeganavContentDevelopers.jsx +53 -134
  42. package/core/MeganavContentPlatform/component.js +1 -1
  43. package/core/MeganavContentPlatform.jsx +28 -135
  44. package/core/MeganavContentUseCases/component.js +1 -1
  45. package/core/MeganavContentUseCases.jsx +68 -166
  46. package/core/MeganavContentWhyAbly/component.js +1 -6
  47. package/core/MeganavContentWhyAbly.jsx +1468 -3
  48. package/core/MeganavControl/component.js +1 -1
  49. package/core/MeganavControl.jsx +15 -121
  50. package/core/MeganavControlMobileDropdown/component.js +1 -1
  51. package/core/MeganavControlMobileDropdown.jsx +16 -122
  52. package/core/MeganavControlMobilePanelClose/component.js +1 -1
  53. package/core/MeganavControlMobilePanelClose.jsx +15 -121
  54. package/core/MeganavControlMobilePanelOpen/component.js +1 -1
  55. package/core/MeganavControlMobilePanelOpen.jsx +15 -121
  56. package/core/MeganavItemsDesktop/component.js +1 -1
  57. package/core/MeganavItemsDesktop.jsx +21 -129
  58. package/core/MeganavItemsMobile/component.js +1 -1
  59. package/core/MeganavItemsMobile.jsx +44 -158
  60. package/core/MeganavItemsSignedIn/component.js +1 -1
  61. package/core/MeganavItemsSignedIn.jsx +38 -151
  62. package/core/MeganavSearch/component.js +1 -1
  63. package/core/MeganavSearch.jsx +28 -138
  64. package/core/MeganavSearchAutocomplete/component.js +1 -2
  65. package/core/MeganavSearchAutocomplete.jsx +4 -4
  66. package/core/MeganavSearchPanel/component.js +1 -1
  67. package/core/MeganavSearchPanel.jsx +24 -133
  68. package/core/MeganavSearchSuggestions/component.js +1 -1
  69. package/core/MeganavSearchSuggestions.jsx +18 -125
  70. package/core/Notice/component.css +1 -1
  71. package/core/Notice/component.js +1 -2
  72. package/core/Notice.jsx +189 -2191
  73. package/core/Showcase/component.js +1 -1
  74. package/core/Showcase.jsx +1 -1
  75. package/core/SignOutLink/component.js +1 -1
  76. package/core/SignOutLink.jsx +12 -117
  77. package/core/Slider/component.js +1 -1
  78. package/core/Slider.jsx +31 -588
  79. package/core/Uptime/component.js +1 -1
  80. package/core/Uptime.jsx +24 -127
  81. package/core/fonts/jetBrains-mono.css +3 -0
  82. package/core/fonts/manrope.css +3 -0
  83. package/core/images/ably-logo.png +0 -0
  84. package/core/images/high-performer-2022.png +0 -0
  85. package/core/images/highest-user-adoption-2022.png +0 -0
  86. package/core/images/users-love-us-2022.png +0 -0
  87. package/core/scripts.js +1 -1
  88. package/core/sprites.svg +106 -1
  89. package/core/styles.css +224 -101
  90. package/package.json +4 -4
  91. package/reset/scripts.js +1 -1
  92. package/reset/styles.css +1 -11
  93. package/src/.DS_Store +0 -0
  94. package/src/core/Code/component.css +1 -67
  95. package/src/core/Code/component.js +11 -46
  96. package/src/core/Code/component.jsx +7 -3
  97. package/src/core/CustomerLogos/component.html.erb +2 -2
  98. package/src/core/CustomerLogos/component.jsx +3 -2
  99. package/src/core/CustomerLogos/component.rb +2 -1
  100. package/src/core/DropdownMenu/component.jsx +112 -0
  101. package/src/core/FeatureFooter/component.html.erb +1 -1
  102. package/src/core/FeaturedLink/component.css +1 -1
  103. package/src/core/Flash/component.jsx +40 -14
  104. package/src/core/Footer/component.css +23 -3
  105. package/src/core/Footer/component.html.erb +120 -58
  106. package/src/core/Footer/component.jsx +127 -52
  107. package/src/core/Logo/component.html.erb +2 -27
  108. package/src/core/Logo/component.jsx +7 -40
  109. package/src/core/Logo/component.rb +15 -6
  110. package/src/core/Meganav/component.css +8 -8
  111. package/src/core/Meganav/component.html.erb +1 -1
  112. package/src/core/Meganav/component.json +1 -1
  113. package/src/core/Meganav/component.jsx +1 -1
  114. package/src/core/Meganav/component.rb +3 -2
  115. package/src/core/MeganavContentCompany/component.html.erb +9 -0
  116. package/src/core/MeganavContentCompany/component.jsx +9 -0
  117. package/src/core/MeganavContentDevelopers/component.html.erb +26 -10
  118. package/src/core/MeganavContentDevelopers/component.jsx +28 -9
  119. package/src/core/MeganavContentPlatform/component.html.erb +7 -7
  120. package/src/core/MeganavContentPlatform/component.jsx +7 -7
  121. package/src/core/MeganavContentUseCases/component.html.erb +43 -39
  122. package/src/core/MeganavContentUseCases/component.jsx +42 -39
  123. package/src/core/MeganavSearchSuggestions/component.html.erb +1 -1
  124. package/src/core/Notice/component.css +1 -1
  125. package/src/core/Notice/component.html.erb +2 -2
  126. package/src/core/Notice/component.jsx +2 -2
  127. package/src/core/core.rb +12 -4
  128. package/src/core/fonts/jetBrains-mono.css +3 -0
  129. package/src/core/fonts/manrope.css +3 -0
  130. package/src/core/icons/github.svg +1 -1
  131. package/src/core/icons/google.svg +3 -0
  132. package/src/core/icons/icon-display-chat-col.svg +4 -0
  133. package/src/core/icons/icon-display-data-broadcast-col.svg +26 -0
  134. package/src/core/icons/icon-display-data-synchronization-col.svg +14 -0
  135. package/src/core/icons/icon-display-events-col.svg +13 -0
  136. package/src/core/icons/icon-display-integrations-col.svg +8 -0
  137. package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +8 -0
  138. package/src/core/icons/icon-display-push-notifications-col.svg +6 -0
  139. package/src/core/icons/icon-gui-check-circled-fill-black.svg +4 -0
  140. package/src/core/icons/icon-gui-filter-flow-step-1.svg +5 -0
  141. package/src/core/icons/icon-gui-filter-flow-step-2.svg +5 -0
  142. package/src/core/icons/icon-gui-filter-flow-step-3.svg +5 -0
  143. package/src/core/icons/icon-gui-resources.svg +3 -0
  144. package/src/core/icons/icon-tech-apachekafka.svg +3 -0
  145. package/src/core/icons/stackoverflow.svg +3 -0
  146. package/src/core/icons/youtube.svg +11 -0
  147. package/src/core/images/ably-logo.png +0 -0
  148. package/src/core/images/high-performer-2022.png +0 -0
  149. package/src/core/images/highest-user-adoption-2022.png +0 -0
  150. package/src/core/images/users-love-us-2022.png +0 -0
  151. package/src/core/styles/buttons.css +5 -5
  152. package/src/core/styles/forms.css +5 -5
  153. package/src/core/styles/properties.css +155 -45
  154. package/src/core/styles/text.css +59 -40
  155. package/src/core/utils/syntax-highlighter-registry.js +63 -0
  156. package/src/core/utils/syntax-highlighter.css +71 -0
  157. package/src/core/utils/syntax-highlighter.js +103 -0
  158. package/tailwind.config.js +142 -47
  159. package/core/Meganav/component.js.LICENSE.txt +0 -7
  160. package/core/MeganavSearchAutocomplete/component.js.LICENSE.txt +0 -7
  161. package/core/fonts/.DS_Store +0 -0
  162. package/core/images/.DS_Store +0 -0
  163. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/.keep +0 -0
  164. package/preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/tmp/pids/.keep +0 -0
  165. package/src/core/.DS_Store +0 -0
  166. package/src/core/fonts/.DS_Store +0 -0
  167. package/src/core/images/.DS_Store +0 -0
  168. package/src/reset/.DS_Store +0 -0
  169. /package/{preview/vendor/bundle/ruby/3.0.0/bundler/gems/ably-ui-abffd210ec0f/preview/log/.keep → src/core/DropdownMenu/component.js} +0 -0
@@ -1,47 +1,17 @@
1
1
  import "./component.css";
2
- import hljs from "highlight.js/lib/core";
3
2
 
4
- import bash from "highlight.js/lib/languages/bash";
5
- import cpp from "highlight.js/lib/languages/cpp";
6
- import csharp from "highlight.js/lib/languages/csharp";
7
- import dart from "highlight.js/lib/languages/dart";
8
- import plaintext from "highlight.js/lib/languages/plaintext";
9
- import go from "highlight.js/lib/languages/go";
10
- import java from "highlight.js/lib/languages/java";
11
- import javascript from "highlight.js/lib/languages/javascript";
12
- import json from "highlight.js/lib/languages/json";
13
- import objectivec from "highlight.js/lib/languages/objectivec";
14
- import php from "highlight.js/lib/languages/php";
15
- import python from "highlight.js/lib/languages/python";
16
- import ruby from "highlight.js/lib/languages/ruby";
17
- import swift from "highlight.js/lib/languages/swift";
18
- import xml from "highlight.js/lib/languages/xml";
3
+ // Note: importing syntax-highlighter here means the component.js file will include
4
+ // all the language dependecies, creating a large a bundle. Prefer using the highlighter serverside.
5
+ import {
6
+ highlightSnippet,
7
+ registerDefaultLanguages,
8
+ } from "../utils/syntax-highlighter";
19
9
 
20
- // Supported languages need to be imported here
21
- // https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md
22
- const register = [
23
- { label: "", key: "plaintext", module: plaintext },
24
- { label: "JS", key: "javascript", module: javascript },
25
- { label: "Java", key: "java", module: java },
26
- { label: "Ruby", key: "ruby", module: ruby },
27
- { label: "Python", key: "python", module: python },
28
- { label: "PHP", key: "php", module: php },
29
- { label: "Shell", key: "bash", module: bash },
30
- { label: "C#", key: "cs", module: csharp },
31
- { label: "Go", key: "go", module: go },
32
- { label: "HTML", key: "xml", module: xml },
33
- { label: "C++", key: "cpp", module: cpp },
34
- { label: "Dart", key: "dart", module: dart },
35
- { label: "Swift", key: "swift", module: swift },
36
- { label: "Objective C", key: "objectivec", module: objectivec },
37
- { label: "Node.js", key: "javascript", module: javascript },
38
- { label: "JSON", key: "json", module: json },
39
- ];
10
+ import languagesRegistry from "../utils/syntax-highlighter-registry";
40
11
 
41
- // Initialize a sub-set of languages as used
42
- register.forEach(({ key, module }) => hljs.registerLanguage(key, module));
12
+ registerDefaultLanguages(languagesRegistry);
43
13
 
44
- function convertCodeToHTML(el) {
14
+ function highlightEl(el) {
45
15
  if (!el) throw "Missing code element";
46
16
 
47
17
  const pre = el.querySelector("pre");
@@ -51,14 +21,9 @@ function convertCodeToHTML(el) {
51
21
  if (!code || !pre || !language) throw "Malformed code element";
52
22
 
53
23
  const { innerHTML } = code;
54
- const html = hljs.highlight(innerHTML, { language }).value;
24
+ const html = highlightSnippet(language, innerHTML);
55
25
 
56
26
  code.innerHTML = html;
57
27
  }
58
28
 
59
- function highlight(language, snippet) {
60
- return hljs.highlight(snippet, { language }).value;
61
- }
62
-
63
- export { highlight };
64
- export default convertCodeToHTML;
29
+ export default highlightEl;
@@ -1,12 +1,16 @@
1
1
  import React from "react";
2
2
  import T from "prop-types";
3
3
 
4
- import "./component.css";
5
- import { highlight } from "./component.js";
4
+ import "../utils/syntax-highlighter.css";
5
+ import { highlightSnippet, registerDefaultLanguages } from "../utils/syntax-highlighter";
6
+ import languagesRegistry from "../utils/syntax-highlighter-registry";
7
+
8
+ registerDefaultLanguages(languagesRegistry);
6
9
 
7
10
  const Code = ({ language, snippet, textSize = "ui-text-code", padding = "p-32", additionalCSS = "" }) => {
8
- const HTMLraw = highlight(language, `${snippet}`.trim());
11
+ const HTMLraw = highlightSnippet(language, `${snippet}`.trim());
9
12
  const className = `language-${language} ${textSize}`;
13
+
10
14
  return (
11
15
  <div className={`hljs overflow-auto ${padding} ${additionalCSS}`} data-id="code">
12
16
  <pre lang={language}>
@@ -1,9 +1,9 @@
1
1
  <section class="w-full bg-white">
2
- <ul class="py-64 flex flex-row flex-wrap md:flex-nowrap content-between m-auto items-center">
2
+ <%= tag.ul class: "py-64 flex flex-row flex-wrap md:flex-nowrap content-between m-auto items-center #{@additional_css}" do %>
3
3
  <% companies.each do |company| %>
4
4
  <li class="flex-auto text-center sm:w-1/3 w-1/2">
5
5
  <%= image_tag company[:logo], alt: "#{company[:label]} logo", class: 'mx-auto' %>
6
6
  </li>
7
7
  <% end %>
8
- </ul>
8
+ <% end %>
9
9
  </section>
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
2
  import T from "prop-types";
3
3
 
4
- const CustomerLogos = ({ companies }) => {
4
+ const CustomerLogos = ({ companies, additionalCss = "" }) => {
5
5
  return (
6
6
  <section className="w-full bg-white">
7
- <ul className="py-64 flex flex-row flex-wrap md:flex-nowrap content-between m-auto items-center">
7
+ <ul className={`py-64 flex flex-row flex-wrap md:flex-nowrap content-between m-auto items-center ${additionalCss}`}>
8
8
  {companies.map((company) => (
9
9
  <li key={company.label} className="flex-auto text-center sm:w-1/3 w-1/2">
10
10
  <img alt={company.label} src={company.logo} className="mx-auto" />
@@ -22,6 +22,7 @@ CustomerLogos.propTypes = {
22
22
  logo: T.string,
23
23
  })
24
24
  ),
25
+ additionalCss: T.string,
25
26
  };
26
27
 
27
28
  export default CustomerLogos;
@@ -5,8 +5,9 @@ module AblyUi
5
5
  class CustomerLogos < ViewComponent::Base
6
6
  attr_reader :companies
7
7
 
8
- def initialize(companies:)
8
+ def initialize(companies:, additional_css: '')
9
9
  @companies = companies
10
+ @additional_css = additional_css
10
11
  end
11
12
  end
12
13
  end
@@ -0,0 +1,112 @@
1
+ import React, { createContext, useContext, useState, useEffect, useRef } from "react";
2
+ import T from "prop-types";
3
+ import Icon from "../Icon/component.jsx";
4
+
5
+ const DropdownMenuContext = createContext();
6
+
7
+ const DropdownMenu = ({ children }) => {
8
+ const [isOpen, setOpen] = useState(false);
9
+ const ref = useRef(null);
10
+
11
+ useEffect(() => {
12
+ const clickHandler = (e) => {
13
+ if (ref?.current?.contains(e.target)) return;
14
+ setOpen(false);
15
+ };
16
+
17
+ document.addEventListener("click", clickHandler);
18
+
19
+ return () => {
20
+ document.removeEventListener("click", clickHandler);
21
+ };
22
+ }, []);
23
+
24
+ return (
25
+ <DropdownMenuContext.Provider value={{ isOpen, setOpen }}>
26
+ <div id="dropdown-menu" className="relative" ref={ref}>
27
+ {children}
28
+ </div>
29
+ </DropdownMenuContext.Provider>
30
+ );
31
+ };
32
+
33
+ DropdownMenu.propTypes = {
34
+ children: T.node,
35
+ };
36
+
37
+ const Trigger = ({ children, additionalTriggerCSS = "" }) => {
38
+ const { isOpen, setOpen } = useContext(DropdownMenuContext);
39
+
40
+ return (
41
+ <button
42
+ id="menu-trigger"
43
+ onClick={() => setOpen(!isOpen)}
44
+ className={`${additionalTriggerCSS} flex items-center p-8 ml-8 group hover:text-gui-hover hover:bg-light-grey active:text-gui-active focus:text-gui-focus focus:outline-none rounded-lg`}
45
+ >
46
+ <span className="leading-normal">{children}</span>
47
+ <Icon
48
+ name="icon-gui-disclosure-arrow"
49
+ color="text-cool-black"
50
+ size="1.25rem"
51
+ additionalCSS="transform rotate-90 group-hover:text-gui-hover group-active:text-gui-active group-focus:text-gui-focus"
52
+ />
53
+ </button>
54
+ );
55
+ };
56
+
57
+ Trigger.propTypes = {
58
+ children: T.node,
59
+ additionalTriggerCSS: T.string,
60
+ };
61
+
62
+ const Content = ({ children, anchorPosition = "right", additionalContentCSS }) => {
63
+ const { isOpen } = useContext(DropdownMenuContext);
64
+
65
+ if (!isOpen) {
66
+ return null;
67
+ }
68
+
69
+ const anchorPositionClasses = anchorPosition === "right" ? "right-0" : "left-0";
70
+
71
+ return (
72
+ <div
73
+ id="menu-content"
74
+ className={`${additionalContentCSS} absolute p-8 z-10 border border-mid-grey bg-white rounded shadow-container ${anchorPositionClasses}`}
75
+ style={{ minWidth: 275, top: 44 }}
76
+ >
77
+ {children}
78
+ </div>
79
+ );
80
+ };
81
+
82
+ Content.propTypes = {
83
+ children: T.node,
84
+ anchorPosition: T.string,
85
+ additionalContentCSS: T.string,
86
+ };
87
+
88
+ const Link = ({ url, title, subtitle, iconName, children }) => {
89
+ return (
90
+ <a href={url} className="menu-link group block p-8 hover:bg-light-grey hover:text-cool-black rounded">
91
+ <p className="mb-4">
92
+ {title}
93
+ {iconName ? <Icon name={iconName} size="1rem" color="text-cool-black" additionalCSS="align-middle ml-8 relative -top-1 -left-4" /> : null}
94
+ </p>
95
+ {subtitle ? <p className="text-p3 mb-16 text-dark-grey">{subtitle}</p> : null}
96
+ {children}
97
+ </a>
98
+ );
99
+ };
100
+
101
+ Link.propTypes = {
102
+ url: T.string,
103
+ title: T.string,
104
+ subtitle: T.string,
105
+ iconName: T.string,
106
+ children: T.node,
107
+ };
108
+
109
+ DropdownMenu.Trigger = Trigger;
110
+ DropdownMenu.Content = Content;
111
+ DropdownMenu.Link = Link;
112
+ export default DropdownMenu;
@@ -46,7 +46,7 @@
46
46
  </ul>
47
47
  </span>
48
48
  <span class="flex-0">
49
- <%= link_to 'Start with a free account', abs_url("/sign-up"), class: "ui-btn-secondary self-start mt-24" %>
49
+ <%= link_to 'Start building', abs_url("/sign-up"), class: "ui-btn-secondary self-start mt-24" %>
50
50
  </span>
51
51
  </div>
52
52
  </div>
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  .ui-featured-link {
3
- @apply font-sans font-medium block;
3
+ @apply font-manrope font-bold block;
4
4
  @apply text-gui-default hover:text-gui-hover focus:text-gui-focus focus:outline-gui-focus;
5
5
  }
6
6
 
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useState, useRef } from "react";
2
2
  import DOMPurify from "dompurify";
3
3
  import T from "prop-types";
4
+ import { nanoid } from "nanoid/non-secure";
4
5
 
5
6
  import { getRemoteDataStore } from "../remote-data-store";
6
7
  import ConnectStateWrapper from "../ConnectStateWrapper/component.jsx";
@@ -50,30 +51,45 @@ const FLASH_TEXT_COLOR = {
50
51
  const AUTO_HIDE = ["success", "info", "notice"];
51
52
  const AUTO_HIDE_TIME = 8000;
52
53
 
53
- const Flash = ({ type, content }) => {
54
- const ref = useRef(null);
55
- const [closed, setClosed] = useState(false);
56
- const [flashHeight, setFlashHeight] = useState(0);
57
- const [triggerEntryAnimation, setTriggerEntryAnimation] = useState(false);
54
+ const useAutoHide = (type, closeFlash) => {
55
+ const timeoutId = useRef(null);
58
56
 
59
- useEffect(() => setTriggerEntryAnimation(true), []);
60
57
  useEffect(() => {
61
58
  if (AUTO_HIDE.includes(type)) {
62
- setTimeout(() => {
63
- // closeFlash is idempotent, we can call it even if the flash has been already closed
59
+ timeoutId.current = setTimeout(() => {
64
60
  closeFlash();
65
61
  }, AUTO_HIDE_TIME);
66
62
  }
67
- }, [closed]);
63
+
64
+ return () => {
65
+ if (timeoutId.current) {
66
+ clearTimeout(timeoutId.current);
67
+ }
68
+ };
69
+ }, []);
70
+ };
71
+
72
+ const Flash = ({ id, type, content, removeFlash }) => {
73
+ const ref = useRef(null);
74
+ const [closed, setClosed] = useState(false);
75
+ const [flashHeight, setFlashHeight] = useState(0);
76
+ const [triggerEntryAnimation, setTriggerEntryAnimation] = useState(false);
68
77
 
69
78
  const closeFlash = () => {
70
79
  if (ref.current) {
71
80
  setFlashHeight(ref.current.getBoundingClientRect().height);
72
81
  }
73
82
 
74
- setTimeout(() => setClosed(true), 0);
83
+ setClosed(true);
84
+
85
+ setTimeout(() => {
86
+ removeFlash(id);
87
+ }, 100);
75
88
  };
76
89
 
90
+ useEffect(() => setTriggerEntryAnimation(true), []);
91
+ useAutoHide(type, closeFlash);
92
+
77
93
  const animateEntry = triggerEntryAnimation && !closed;
78
94
 
79
95
  let style;
@@ -123,13 +139,23 @@ Flash.propTypes = {
123
139
  };
124
140
 
125
141
  const Flashes = ({ flashes }) => {
126
- const items = flashes?.items || [];
142
+ const [flashesWithIds, setFlashesWithIds] = useState([]);
143
+
144
+ const removeFlash = (flashId) => setFlashesWithIds((items) => items.filter((item) => item.id !== flashId));
145
+
146
+ useEffect(() => {
147
+ setFlashesWithIds((state) => {
148
+ return [...state, ...(flashes?.items || []).map((flash) => ({ ...flash, id: nanoid(), removed: false }))];
149
+ });
150
+ }, [flashes]);
127
151
 
128
152
  return (
129
153
  <div className="ui-flash" data-id={FLASH_DATA_ID}>
130
- {items.map((flash) => (
131
- <Flash key={flash.type} {...flash} />
132
- ))}
154
+ {flashesWithIds
155
+ .filter((item) => !item.removed)
156
+ .map((flash) => (
157
+ <Flash removeFlash={removeFlash} key={flash.id} {...flash} />
158
+ ))}
133
159
  </div>
134
160
  );
135
161
  };
@@ -1,13 +1,33 @@
1
1
  @layer components {
2
2
  .ui-footer-col-title {
3
- @apply text-overline2 p-menu-row-title font-normal uppercase tracking-widen-0.1;
3
+ @apply font-jetbrains_mono text-overline2 p-menu-row-title font-medium uppercase tracking-widen-0.16;
4
4
  }
5
5
 
6
6
  .ui-footer-menu-row-link {
7
- @apply text-menu3 text-cool-black font-light hover:text-gui-hover block;
7
+ @apply text-menu3 text-cool-black font-manrope font-medium hover:text-gui-hover block;
8
8
  }
9
9
 
10
10
  .ui-footer-link {
11
- @apply text-gui-default hover:text-gui-hover hover:underline text-menu3 font-light;
11
+ @apply text-gui-default hover:text-gui-hover text-menu3 font-manrope font-medium;
12
+ }
13
+
14
+ .ui-footer-compliance-text {
15
+ font-size: 12px;
16
+ }
17
+
18
+ .ui-footer-tick-icon {
19
+ min-width: 1.5rem;
20
+ }
21
+
22
+ @media (max-width: 1040px) {
23
+ .ui-footer-bottom-links {
24
+ @apply pb-40;
25
+ }
26
+ }
27
+
28
+ @media screen {
29
+ .ui-footer-glassdoor {
30
+ display: none;
31
+ }
12
32
  }
13
33
  }
@@ -1,18 +1,16 @@
1
- <footer class="bg-light-grey font-sans antialiased" data-id="footer">
2
- <div class="max-w-screen-xl mx-auto py-32 sm:py-40 lg:py-64 ui-grid-gap ui-grid-px grid grid-cols-6">
1
+ <footer class="bg-light-grey font-manrope antialiased leading-normal" data-id="footer">
2
+ <div class="max-w-screen-xl mx-auto py-32 sm:py-40 md:py-64 ui-grid-gap ui-grid-px grid grid-cols-6">
3
3
  <div class="col-span-full md:col-span-2">
4
4
  <div class="flex flex-row p-menu-row-snug">
5
5
  <%= image_tag(ably_stack_path, alt: "Ably homepage", class: "mr-24 -mt-16") %>
6
- <h2 class="text-overline2 col-span-full font-medium uppercase tracking-widen-0.1">The Ably Platform</h2>
6
+ <h2 class="text-overline2 col-span-full font-jetbrains_mono font-bold uppercase tracking-widen-0.16">The Ably Platform</h2>
7
7
  </div>
8
-
9
- <div class="grid grid-cols-4">
10
- <p class="text-p3 py-16 font-medium p-menu-row-snug col-span-3">
8
+ <div class="md:col-span-4 md:w-3/4 xs:w-3/5 w-full">
9
+ <p class="font-manrope text-p3 py-16 font-bold p-menu-row-snug">
11
10
  Easily power any realtime experience in your application via a simple API that handles everything realtime.
12
11
  </p>
13
12
  </div>
14
-
15
- <ul class="grid gap-x-8 sm:gap-x-16 md:gap-x-24 xl:gap-x-32 sm:grid-cols-2 md:grid-cols-1">
13
+ <ul class="grid grid-cols-1">
16
14
  <li class="p-menu-row-snug">
17
15
  <%= link_to 'Pub/sub messaging', abs_url("/pub-sub-messaging"), class: "ui-footer-menu-row-link" %>
18
16
  </li>
@@ -30,8 +28,7 @@
30
28
  </li>
31
29
  </ul>
32
30
  </div>
33
-
34
- <div class="col-span-full sm:col-span-3 md:col-span-1">
31
+ <div class="col-span-full xs:col-span-3 md:col-span-1">
35
32
  <h2 class="ui-footer-col-title">Ably is for</h2>
36
33
  <ul>
37
34
  <li class="p-menu-row-snug">
@@ -69,8 +66,7 @@
69
66
  </li>
70
67
  </ul>
71
68
  </div>
72
-
73
- <div class="col-span-full sm:col-span-3 md:col-span-1">
69
+ <div class="col-span-full xs:col-span-3 md:col-span-1">
74
70
  <h2 class="ui-footer-col-title">Developers</h2>
75
71
  <ul>
76
72
  <li class="p-menu-row-snug">
@@ -91,14 +87,13 @@
91
87
  <li class="p-menu-row-snug">
92
88
  <%= link_to 'SDKs', abs_url("/download"), class: "ui-footer-menu-row-link" %>
93
89
  </li>
94
- <li class="p-menu-row-snug flex items-center">
90
+ <li class="p-menu-row-snug flex items-center -mt-4">
95
91
  <a class="pr-8 ui-footer-menu-row-link" href="https://status.ably.com/">System status</a>
96
- <iframe class="w-24 h-24 mt-4" src="https://status.ably.com/embed/icon" allowtransparency="true" frameborder="0" scrolling="no"></iframe>
92
+ <iframe class="w-20 h-20 mb-2" src="https://status.ably.com/embed/icon" allowtransparency="true" frameborder="0" scrolling="no"></iframe>
97
93
  </li>
98
94
  </ul>
99
95
  </div>
100
-
101
- <div class="col-span-full sm:col-span-3 md:col-span-1">
96
+ <div class="col-span-full xs:col-span-3 md:col-span-1">
102
97
  <h2 class="ui-footer-col-title">WHY ABLY</h2>
103
98
  <ul>
104
99
  <li class="p-menu-row-snug">
@@ -121,8 +116,7 @@
121
116
  </li>
122
117
  </ul>
123
118
  </div>
124
-
125
- <div class="col-span-full sm:col-span-3 md:col-span-1">
119
+ <div class="col-span-full xs:col-span-3 md:col-span-1">
126
120
  <h2 class="ui-footer-col-title">ABOUT</h2>
127
121
  <ul>
128
122
  <li class="p-menu-row-snug">
@@ -141,7 +135,7 @@
141
135
  <%= link_to 'Open protocol policy', abs_url("/open-policy"), class: "ui-footer-menu-row-link" %>
142
136
  </li>
143
137
  <li class="p-menu-row-snug">
144
- <%= link_to 'Press & Media', abs_url("/press-center"), class: "ui-footer-menu-row-link" %>
138
+ <%= link_to 'Press & Media', abs_url("/press-center"), class: "ui-footer-menu-row-link" %>
145
139
  </li>
146
140
  <li class="p-menu-row-snug">
147
141
  <%= link_to 'Contact us', abs_url("/contact"), class: "ui-footer-menu-row-link" %>
@@ -149,51 +143,119 @@
149
143
  </ul>
150
144
  </div>
151
145
  </div>
152
-
153
146
  <div class="max-w-screen-xl ui-grid-px mx-auto">
154
- <hr class="border-t border-mid-grey" />
147
+ <hr class="border-t border-mid-grey my-0"/>
155
148
  </div>
156
-
157
- <div class="max-w-screen-xl mx-auto py-24 md:py-40 lg:py-32 grid ui-grid-gap ui-grid-px grid-cols-2">
158
- <div class="flex flex-col flex-auto pb-40 ml-8 col-span-full md:col-span-1">
159
- <div class="inline-flex">
160
- <%= link_to 'Cookies', abs_url("/privacy"), class: "ui-footer-link pr-24" %>
161
- <%= link_to 'Legals', abs_url("/legals"), class: "ui-footer-link pr-24" %>
162
- <%= link_to 'Data Protection', abs_url("/data-protection"), class: "ui-footer-link pr-24" %>
163
- <%= link_to 'Privacy', abs_url("/privacy"), class: "ui-footer-link" %>
149
+ <%# Twitter + Glassdoor SM * above + Glassdoor XS + Badges %>
150
+ <div class="max-w-screen-xl mx-auto py-16 grid ui-grid-gap ui-grid-px sm:grid-cols-2">
151
+ <div class="md:flex md:items-center">
152
+ <div class="flex flex-col md:flex-row flex-auto ml-8 sm:col-span-1 md:col-span-2">
153
+ <div class="">
154
+ <div class="flex pb-24">
155
+ <a class="h-24 pr-24 text-cool-black hover:text-icon-twitter" href="https://twitter.com/ablyrealtime" title="Ably on Twitter">
156
+ <%= render(AblyUi::Core::Icon.new(name: "twitter", size: "1.5rem")) %>
157
+ </a>
158
+ <a
159
+ class="h-24 pr-24 text-cool-black hover:text-icon-linkedin"
160
+ href="https://www.linkedin.com/company/ably-realtime"
161
+ title="Ably on LinkedIn"
162
+ >
163
+ <%= render(AblyUi::Core::Icon.new(name: "linkedin", size: "1.5rem")) %>
164
+ </a>
165
+ <a class="h-24 pr-24 text-cool-black hover:text-icon-github" href="https://github.com/ably/" title="Ably on Github">
166
+ <%= render(AblyUi::Core::Icon.new(name: "github", size: "1.5rem")) %>
167
+ </a>
168
+ <a class="h-24 pr-24 text-cool-black hover:text-icon-discord" href="https://discord.gg/jwBPhEZ9g5" title="Ably on Discord">
169
+ <%= render(AblyUi::Core::Icon.new(name: "discord", size: "1.5rem")) %>
170
+ </a>
171
+ </div>
172
+ </div>
173
+ <%# GLASSDOOR on SM and Above %>
174
+ <div class="xs:hidden sm:block ui-footer-glassdoor">
175
+ <div class="flex sm:pt-24 md:pt-0 sm:border-t sm:border-l-0 md:border-t-0 md:border-l sm:border-mid-grey sm:w-3/4 md:w-full md:pl-24">
176
+ <a
177
+ href="https://www.glassdoor.co.uk/Overview/Working-at-Ably-EI_IE2184188.11,15.htm"
178
+ class="h-24 text-cool-black hover:text-icon-glassdoor"
179
+ title="Ably reviews on glassdoor"
180
+ >
181
+ <%= render(AblyUi::Core::Icon.new(name: "glassdoor", size: "1.5rem")) %>
182
+ </a>
183
+ <div class="pl-16 text-menu3 font-manrope font-medium">
184
+ <strong class="block font-medium">We&apos;re hiring!</strong>
185
+ <a href="https://www.glassdoor.co.uk/Overview/Working-at-Ably-EI_IE2184188.11,15.htm" class="ui-footer-link">
186
+ Learn more at Glassdoor
187
+ </a>
188
+ </div>
189
+ </div>
190
+ </div>
164
191
  </div>
165
-
166
- <div class="pt-32 flex items-center">
167
- <a class="h-24 pr-24 text-cool-black hover:text-icon-twitter" href="https://twitter.com/ablyrealtime">
168
- <%= render(AblyUi::Core::Icon.new(name: "twitter", size: "1.5rem")) %>
169
- </a>
170
- <a class="h-24 pr-24 text-cool-black hover:text-icon-linkedin" href="https://www.linkedin.com/company/ably-realtime">
171
- <%= render(AblyUi::Core::Icon.new(name: "linkedin", size: "1.5rem")) %>
172
- </a>
173
- <a class="h-24 pr-24 text-cool-black hover:text-icon-github" href="https://github.com/ably/">
174
- <%= render(AblyUi::Core::Icon.new(name: "github", size: "1.5rem")) %>
175
- </a>
176
- <a class="h-24 pr-24 text-cool-black hover:text-icon-discord" href="https://discord.gg/jwBPhEZ9g5">
177
- <%= render(AblyUi::Core::Icon.new(name: "discord", size: "1.5rem")) %>
178
- </a>
179
- <div class="border-l border-mid-grey h-40"></div>
180
- <a
181
- class="flex flex-row pl-24 text-cool-black hover:text-icon-glassdoor"
182
- href="https://www.glassdoor.co.uk/Overview/Working-at-Ably-EI_IE2184188.11,15.htm"
183
- >
184
- <%= render(AblyUi::Core::Icon.new(name: "glassdoor", size: "1.5rem")) %>
185
- </a>
186
- <div class="pl-16 text-menu3 font-light">
187
- <strong class="block font-medium">We&apos;re hiring!</strong>
188
- <a href="https://www.glassdoor.co.uk/Overview/Working-at-Ably-EI_IE2184188.11,15.htm" class="ui-footer-link">Learn more</a>
189
- at Glassdoor
192
+ <%# GlassDoor on XS ONLY %>
193
+ <div class="xs:block sm:hidden">
194
+ <div class="border-t border-mid-grey w-full"></div>
195
+ <div class="flex py-24">
196
+ <a
197
+ class="h-24 pr-16 text-cool-black hover:text-icon-glassdoor"
198
+ href="https://www.glassdoor.co.uk/Overview/Working-at-Ably-EI_IE2184188.11,15.htm"
199
+ title="Ably reviews on glassdoor"
200
+ >
201
+ <%= render(AblyUi::Core::Icon.new(name: "glassdoor", size: "1.5rem")) %>
202
+ </a>
203
+ <div class="text-menu3 font-manrope font-medium">
204
+ <strong class="block font-medium">We&apos;re hiring!</strong>
205
+ <a href="https://www.glassdoor.co.uk/Overview/Working-at-Ably-EI_IE2184188.11,15.htm" class="ui-footer-link">
206
+ Learn more at Glassdoor
207
+ </a>
208
+ </div>
190
209
  </div>
191
210
  </div>
192
211
  </div>
193
-
194
- <div class="md:text-right col-span-full md:col-span-1 ml-8 inline-flex md:ml-auto">
195
- <%= image_tag(rocket_list, alt: "Rocket List 2021", class: "mr-24 w-96 h-96") %>
196
- <%= image_tag(flexible_companies, alt: "Flexible Companies 2021", class: "w-96 h-96") %>
212
+ <div class="col-span-full sm:col-span-1 inline-flex sm:ml-auto sm:items-center">
213
+ <%= image_tag(highest_user_adoption, alt: "Highest User Adoption 2022", class: "mr-24 h-80") %>
214
+ <%= image_tag(users_love_us, alt: "Users Love Us", class: "mr-24 h-80") %>
215
+ <%= image_tag(highest_performer, alt: "High Performer 2022", class: "mr-24 h-80") %>
216
+ </div>
217
+ </div>
218
+ <div class="max-w-screen-xl ui-grid-px mx-auto">
219
+ <hr class="border-t border-mid-grey my-0"/>
220
+ </div>
221
+ <div class="max-w-screen-xl mx-auto py-24 sm:py-40 md:py-32 md:grid md:grid-cols-2 ui-grid-gap ui-grid-px">
222
+ <div class="flex ml-8 col-span-full sm:col-span-1 md:pb-16 items-center ui-footer-bottom-links">
223
+ <div class="flex">
224
+ <%= link_to 'Cookies', abs_url("/privacy"), class: "pr-24 ui-footer-link" %>
225
+ <%= link_to 'Legals', abs_url("/legals"), class: "pr-24 ui-footer-link" %>
226
+ <%= link_to 'Data Protection', abs_url("/data-protection"), class: "pr-24 ui-footer-link" %>
227
+ <%= link_to 'Privacy', abs_url("/privacy"), class: "ui-footer-link" %>
228
+ </div>
229
+ </div>
230
+ <div class="xs:grid xs:grid-cols-2 sm:grid-cols-4 xs:pl-16 sm:pl-8 md:justify-items-end">
231
+ <div class="flex mr-24">
232
+ <%= render(AblyUi::Core::Icon.new(name: "icon-gui-tick", color: "text-active-orange", size: "1.5rem", additional_css:"bg-white rounded-full mr-12 ui-footer-tick-icon")) %>
233
+ <div>
234
+ <p class="ui-footer-compliance-text font-bold whitespace-nowrap">SOC 2 Type 2</p>
235
+ <p class="ui-footer-compliance-text font-medium mb-24">Certified</p>
236
+ </div>
237
+ </div>
238
+ <div class="flex mr-24 md:col-start-2">
239
+ <%= render(AblyUi::Core::Icon.new(name: "icon-gui-tick", color: "text-active-orange", size: "1.5rem", additional_css:"bg-white rounded-full mr-12 ui-footer-tick-icon")) %>
240
+ <div>
241
+ <p class="ui-footer-compliance-text font-bold whitespace-nowrap">HIPAA</p>
242
+ <p class="ui-footer-compliance-text font-medium mb-24">Compliant</p>
243
+ </div>
244
+ </div>
245
+ <div class="flex mr-24 md:col-start-3">
246
+ <%= render(AblyUi::Core::Icon.new(name: "icon-gui-tick", color: "text-active-orange", size: "1.5rem", additional_css:"bg-white rounded-full mr-12 ui-footer-tick-icon")) %>
247
+ <div>
248
+ <p class="ui-footer-compliance-text font-bold whitespace-nowrap">EU GDPR</p>
249
+ <p class="ui-footer-compliance-text font-medium mb-24">Certified</p>
250
+ </div>
251
+ </div>
252
+ <div class="flex mr-24 md:col-start-4">
253
+ <%= render(AblyUi::Core::Icon.new(name: "icon-gui-tick", color: "text-active-orange", size: "1.5rem", additional_css:"bg-white rounded-full mr-12 ui-footer-tick-icon")) %>
254
+ <div>
255
+ <p class="ui-footer-compliance-text font-bold whitespace-nowrap">256-bit AES</p>
256
+ <p class="ui-footer-compliance-text font-medium mb-24">Encryption</p>
257
+ </div>
258
+ </div>
197
259
  </div>
198
260
  </div>
199
261
  </footer>