@ably/ui 14.0.5 → 14.0.6

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 (279) hide show
  1. package/core/Flash.js +1 -1
  2. package/package.json +7 -9
  3. package/src/core/Accordion/Accordion.stories.tsx +0 -39
  4. package/src/core/Accordion.tsx +0 -149
  5. package/src/core/Code/Code.stories.tsx +0 -71
  6. package/src/core/Code/component.css +0 -1
  7. package/src/core/Code/component.js +0 -27
  8. package/src/core/Code.tsx +0 -44
  9. package/src/core/ConnectStateWrapper.tsx +0 -43
  10. package/src/core/ContactFooter/ContactFooter.stories.tsx +0 -11
  11. package/src/core/ContactFooter/component.css +0 -11
  12. package/src/core/ContactFooter/component.js +0 -2
  13. package/src/core/ContactFooter.tsx +0 -91
  14. package/src/core/CookieMessage/CookieMessage.stories.tsx +0 -12
  15. package/src/core/CookieMessage/component.css +0 -15
  16. package/src/core/CookieMessage.tsx +0 -52
  17. package/src/core/CustomerLogos/CustomerLogos.stories.tsx +0 -43
  18. package/src/core/CustomerLogos.tsx +0 -35
  19. package/src/core/DropdownMenu/DropdownMenu.stories.tsx +0 -48
  20. package/src/core/DropdownMenu.tsx +0 -140
  21. package/src/core/Expander/Expander.stories.tsx +0 -132
  22. package/src/core/Expander.tsx +0 -63
  23. package/src/core/FeaturedLink/FeaturedLink.stories.tsx +0 -43
  24. package/src/core/FeaturedLink.tsx +0 -93
  25. package/src/core/Flash/Flash.stories.tsx +0 -37
  26. package/src/core/Flash/component.css +0 -28
  27. package/src/core/Flash.tsx +0 -233
  28. package/src/core/Footer/Footer.stories.tsx +0 -26
  29. package/src/core/Footer/component.css +0 -33
  30. package/src/core/Footer.tsx +0 -535
  31. package/src/core/Icon/Icon.stories.tsx +0 -151
  32. package/src/core/Icon.tsx +0 -26
  33. package/src/core/Loader/Loader.stories.tsx +0 -21
  34. package/src/core/Loader.tsx +0 -52
  35. package/src/core/Logo/Logo.stories.tsx +0 -12
  36. package/src/core/Logo.tsx +0 -29
  37. package/src/core/Meganav/Meganav.stories.tsx +0 -86
  38. package/src/core/Meganav/component.css +0 -114
  39. package/src/core/Meganav/component.js +0 -150
  40. package/src/core/Meganav/component.json +0 -37
  41. package/src/core/Meganav.tsx +0 -225
  42. package/src/core/MeganavBlogPostsList/component.js +0 -43
  43. package/src/core/MeganavBlogPostsList.tsx +0 -41
  44. package/src/core/MeganavContentCompany.tsx +0 -166
  45. package/src/core/MeganavContentDevelopers.tsx +0 -210
  46. package/src/core/MeganavContentProducts.tsx +0 -163
  47. package/src/core/MeganavContentUseCases.tsx +0 -244
  48. package/src/core/MeganavControl/component.js +0 -117
  49. package/src/core/MeganavControl.tsx +0 -39
  50. package/src/core/MeganavControlMobileDropdown/component.js +0 -46
  51. package/src/core/MeganavControlMobileDropdown.tsx +0 -31
  52. package/src/core/MeganavControlMobilePanelClose/component.js +0 -36
  53. package/src/core/MeganavControlMobilePanelClose.tsx +0 -34
  54. package/src/core/MeganavControlMobilePanelOpen/component.js +0 -59
  55. package/src/core/MeganavControlMobilePanelOpen.tsx +0 -31
  56. package/src/core/MeganavItemsDesktop.tsx +0 -68
  57. package/src/core/MeganavItemsMobile.tsx +0 -197
  58. package/src/core/MeganavItemsSignedIn.tsx +0 -130
  59. package/src/core/MeganavSearch.tsx +0 -36
  60. package/src/core/MeganavSearchAutocomplete/component.js +0 -177
  61. package/src/core/MeganavSearchAutocomplete.tsx +0 -12
  62. package/src/core/MeganavSearchPanel.tsx +0 -52
  63. package/src/core/MeganavSearchSuggestions/component.js +0 -133
  64. package/src/core/MeganavSearchSuggestions.tsx +0 -62
  65. package/src/core/Notice/component.css +0 -7
  66. package/src/core/Notice/component.js +0 -154
  67. package/src/core/Notice.tsx +0 -102
  68. package/src/core/SignOutLink.tsx +0 -51
  69. package/src/core/Slider/Slider.stories.tsx +0 -98
  70. package/src/core/Slider/component.css +0 -40
  71. package/src/core/Slider/component.js +0 -105
  72. package/src/core/Slider.tsx +0 -224
  73. package/src/core/Table/Table.stories.tsx +0 -12
  74. package/src/core/Table/Table.tsx +0 -58
  75. package/src/core/Table/TableCell.tsx +0 -71
  76. package/src/core/Table/TableRow.tsx +0 -25
  77. package/src/core/Table/data.tsx +0 -133
  78. package/src/core/Table.tsx +0 -15
  79. package/src/core/Tooltip/Tooltip.stories.tsx +0 -27
  80. package/src/core/Tooltip.tsx +0 -88
  81. package/src/core/css.js +0 -3
  82. package/src/core/dom-query.js +0 -5
  83. package/src/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
  84. package/src/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
  85. package/src/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
  86. package/src/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
  87. package/src/core/fonts/NEXT-Book-Light.eot +0 -0
  88. package/src/core/fonts/NEXT-Book-Light.otf +0 -0
  89. package/src/core/fonts/NEXT-Book-Light.woff +0 -0
  90. package/src/core/fonts/NEXT-Book-Light.woff2 +0 -0
  91. package/src/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
  92. package/src/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
  93. package/src/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
  94. package/src/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
  95. package/src/core/fonts/NEXT-Book-Medium.eot +0 -0
  96. package/src/core/fonts/NEXT-Book-Medium.otf +0 -0
  97. package/src/core/fonts/NEXT-Book-Medium.woff +0 -0
  98. package/src/core/fonts/NEXT-Book-Medium.woff2 +0 -0
  99. package/src/core/fonts/jetBrains-mono.css +0 -3
  100. package/src/core/fonts/manrope.css +0 -3
  101. package/src/core/fonts/next.css +0 -63
  102. package/src/core/fonts/source-code-pro.css +0 -3
  103. package/src/core/hubspot-chat-toggle.js +0 -67
  104. package/src/core/icons/discord.svg +0 -10
  105. package/src/core/icons/facebook.svg +0 -4
  106. package/src/core/icons/github.svg +0 -3
  107. package/src/core/icons/glassdoor.svg +0 -3
  108. package/src/core/icons/google.svg +0 -3
  109. package/src/core/icons/icon-display-48hrs.svg +0 -3
  110. package/src/core/icons/icon-display-about-ably-col.svg +0 -4
  111. package/src/core/icons/icon-display-api-keys.svg +0 -3
  112. package/src/core/icons/icon-display-api.svg +0 -3
  113. package/src/core/icons/icon-display-asset-tracking-col.svg +0 -18
  114. package/src/core/icons/icon-display-browser.svg +0 -10
  115. package/src/core/icons/icon-display-calendar.svg +0 -3
  116. package/src/core/icons/icon-display-call-mobile.svg +0 -3
  117. package/src/core/icons/icon-display-careers-col.svg +0 -9
  118. package/src/core/icons/icon-display-case-studies-col.svg +0 -5
  119. package/src/core/icons/icon-display-chat-col.svg +0 -4
  120. package/src/core/icons/icon-display-chat-stack-col.svg +0 -4
  121. package/src/core/icons/icon-display-chat-stack.svg +0 -4
  122. package/src/core/icons/icon-display-cloud-servers.svg +0 -3
  123. package/src/core/icons/icon-display-compare-tech-col.svg +0 -9
  124. package/src/core/icons/icon-display-customers-col.svg +0 -15
  125. package/src/core/icons/icon-display-data-broadcast-col.svg +0 -26
  126. package/src/core/icons/icon-display-data-synchronization-col.svg +0 -14
  127. package/src/core/icons/icon-display-docs-col.svg +0 -7
  128. package/src/core/icons/icon-display-documentation.svg +0 -3
  129. package/src/core/icons/icon-display-events-col.svg +0 -13
  130. package/src/core/icons/icon-display-examples-col.svg +0 -11
  131. package/src/core/icons/icon-display-gdpr.svg +0 -3
  132. package/src/core/icons/icon-display-general-comms.svg +0 -3
  133. package/src/core/icons/icon-display-hipaa.svg +0 -10
  134. package/src/core/icons/icon-display-integrations-col.svg +0 -8
  135. package/src/core/icons/icon-display-it-support-access.svg +0 -3
  136. package/src/core/icons/icon-display-it-support-helpdesk.svg +0 -3
  137. package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +0 -8
  138. package/src/core/icons/icon-display-laptop.svg +0 -10
  139. package/src/core/icons/icon-display-lightbulb-col.svg +0 -10
  140. package/src/core/icons/icon-display-live-chat.svg +0 -3
  141. package/src/core/icons/icon-display-map-pin.svg +0 -3
  142. package/src/core/icons/icon-display-message.svg +0 -3
  143. package/src/core/icons/icon-display-padlock-closed.svg +0 -3
  144. package/src/core/icons/icon-display-platform.svg +0 -22
  145. package/src/core/icons/icon-display-play.svg +0 -3
  146. package/src/core/icons/icon-display-privacy-shield-framework.svg +0 -7
  147. package/src/core/icons/icon-display-push-notifications-col.svg +0 -6
  148. package/src/core/icons/icon-display-quickstart-guides-col.svg +0 -8
  149. package/src/core/icons/icon-display-resources-col.svg +0 -21
  150. package/src/core/icons/icon-display-sdks-col.svg +0 -11
  151. package/src/core/icons/icon-display-servers.svg +0 -3
  152. package/src/core/icons/icon-display-shopping-cart.svg +0 -10
  153. package/src/core/icons/icon-display-sla.svg +0 -3
  154. package/src/core/icons/icon-display-soc2-type2.svg +0 -3
  155. package/src/core/icons/icon-display-tech-account-comms.svg +0 -3
  156. package/src/core/icons/icon-display-tutorials-demos-col.svg +0 -25
  157. package/src/core/icons/icon-display-virtual-events-col.svg +0 -12
  158. package/src/core/icons/icon-display-virtual-events.svg +0 -12
  159. package/src/core/icons/icon-gui-ably-badge.svg +0 -3
  160. package/src/core/icons/icon-gui-arrow-bidirectional-horizontal.svg +0 -3
  161. package/src/core/icons/icon-gui-arrow-bidirectional-vertical.svg +0 -3
  162. package/src/core/icons/icon-gui-arrow-down.svg +0 -3
  163. package/src/core/icons/icon-gui-arrow-left.svg +0 -3
  164. package/src/core/icons/icon-gui-arrow-right.svg +0 -3
  165. package/src/core/icons/icon-gui-arrow-up.svg +0 -3
  166. package/src/core/icons/icon-gui-burger-menu.svg +0 -5
  167. package/src/core/icons/icon-gui-check-circled-fill-black.svg +0 -4
  168. package/src/core/icons/icon-gui-check-circled-fill.svg +0 -4
  169. package/src/core/icons/icon-gui-check-circled.svg +0 -3
  170. package/src/core/icons/icon-gui-checklist-checked.svg +0 -3
  171. package/src/core/icons/icon-gui-clock.svg +0 -3
  172. package/src/core/icons/icon-gui-close.svg +0 -3
  173. package/src/core/icons/icon-gui-copy.svg +0 -10
  174. package/src/core/icons/icon-gui-cross-circled-fill.svg +0 -4
  175. package/src/core/icons/icon-gui-cross-circled.svg +0 -3
  176. package/src/core/icons/icon-gui-dash-circled.svg +0 -3
  177. package/src/core/icons/icon-gui-disclosure-arrow.svg +0 -3
  178. package/src/core/icons/icon-gui-document-generic.svg +0 -3
  179. package/src/core/icons/icon-gui-enlarge.svg +0 -3
  180. package/src/core/icons/icon-gui-external-link.svg +0 -3
  181. package/src/core/icons/icon-gui-filter-flow-step-1.svg +0 -5
  182. package/src/core/icons/icon-gui-filter-flow-step-2.svg +0 -5
  183. package/src/core/icons/icon-gui-filter-flow-step-3.svg +0 -5
  184. package/src/core/icons/icon-gui-history.svg +0 -3
  185. package/src/core/icons/icon-gui-info.svg +0 -3
  186. package/src/core/icons/icon-gui-link-arrow.svg +0 -3
  187. package/src/core/icons/icon-gui-link.svg +0 -4
  188. package/src/core/icons/icon-gui-live-chat.svg +0 -3
  189. package/src/core/icons/icon-gui-minus.svg +0 -3
  190. package/src/core/icons/icon-gui-partial.svg +0 -4
  191. package/src/core/icons/icon-gui-plus.svg +0 -3
  192. package/src/core/icons/icon-gui-quote-marks-solid.svg +0 -3
  193. package/src/core/icons/icon-gui-refresh.svg +0 -10
  194. package/src/core/icons/icon-gui-resources.svg +0 -3
  195. package/src/core/icons/icon-gui-search.svg +0 -3
  196. package/src/core/icons/icon-gui-tick.svg +0 -3
  197. package/src/core/icons/icon-gui-warning.svg +0 -5
  198. package/src/core/icons/icon-live-updates-results-metrics-col.svg +0 -26
  199. package/src/core/icons/icon-multi-user-spaces-col.svg +0 -13
  200. package/src/core/icons/icon-social-x.svg +0 -3
  201. package/src/core/icons/icon-tech-apachekafka.svg +0 -3
  202. package/src/core/icons/linkedin.svg +0 -3
  203. package/src/core/icons/quote.svg +0 -3
  204. package/src/core/icons/stackoverflow.svg +0 -3
  205. package/src/core/icons/twitter.svg +0 -3
  206. package/src/core/icons/youtube.svg +0 -11
  207. package/src/core/icons.js +0 -6
  208. package/src/core/images/ably-logo.png +0 -0
  209. package/src/core/images/ably-logo.svg +0 -15
  210. package/src/core/images/ably-stack.svg +0 -14
  211. package/src/core/images/best-support-2023.svg +0 -1
  212. package/src/core/images/cust-logo-ao-col-pos.png +0 -0
  213. package/src/core/images/cust-logo-ao-col-pos@2x.png +0 -0
  214. package/src/core/images/cust-logo-ausopen-col-pos.png +0 -0
  215. package/src/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
  216. package/src/core/images/cust-logo-ausopen-mono-pos.svg +0 -5
  217. package/src/core/images/cust-logo-bloomberg-mono-pos.svg +0 -11
  218. package/src/core/images/cust-logo-hopin-mono-pos.svg +0 -4
  219. package/src/core/images/cust-logo-hubspot-col-pos.png +0 -0
  220. package/src/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
  221. package/src/core/images/cust-logo-hubspot-mono-pos.svg +0 -4
  222. package/src/core/images/cust-logo-lightspeed-col-pos.png +0 -0
  223. package/src/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
  224. package/src/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
  225. package/src/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
  226. package/src/core/images/cust-logo-mentimeter-mono-pos.svg +0 -17
  227. package/src/core/images/cust-logo-split-col-pos.png +0 -0
  228. package/src/core/images/cust-logo-split-col-pos@2x.png +0 -0
  229. package/src/core/images/cust-logo-split-mono-pos.svg +0 -9
  230. package/src/core/images/cust-logo-toyota-mono-pos.svg +0 -18
  231. package/src/core/images/cust-logo-vitac-col-pos.png +0 -0
  232. package/src/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
  233. package/src/core/images/cust-logo-webflow-col-pos.svg +0 -3
  234. package/src/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
  235. package/src/core/images/cust-photo-split-pato-echague.jpg +0 -0
  236. package/src/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
  237. package/src/core/images/fastest-implementation-2023.svg +0 -1
  238. package/src/core/images/flexible-companies.png +0 -0
  239. package/src/core/images/high-performer-2022.png +0 -0
  240. package/src/core/images/high-performer-2023.svg +0 -1
  241. package/src/core/images/highest-user-adoption-2022.png +0 -0
  242. package/src/core/images/highest-user-adoption-2023.svg +0 -1
  243. package/src/core/images/icon-tech-aws.svg +0 -4
  244. package/src/core/images/rocket-list-2021.png +0 -0
  245. package/src/core/images/scale-motif-open-empathetic.svg +0 -1
  246. package/src/core/images/technical-support-01-800x533.jpg +0 -0
  247. package/src/core/images/users-love-us-2022.png +0 -0
  248. package/src/core/load-sprites.js +0 -11
  249. package/src/core/react-renderer.tsx +0 -29
  250. package/src/core/remote-blogs-posts.js +0 -42
  251. package/src/core/remote-data-store.js +0 -34
  252. package/src/core/remote-data-util.js +0 -4
  253. package/src/core/remote-session-data.js +0 -58
  254. package/src/core/scripts.js +0 -10
  255. package/src/core/styles/buttons.css +0 -124
  256. package/src/core/styles/forms.css +0 -64
  257. package/src/core/styles/layout.css +0 -21
  258. package/src/core/styles/properties.css +0 -278
  259. package/src/core/styles/text.css +0 -168
  260. package/src/core/styles/toggles.css +0 -38
  261. package/src/core/styles.base.css +0 -1
  262. package/src/core/styles.components.css +0 -44
  263. package/src/core/styles.css +0 -2
  264. package/src/core/url-base.js +0 -7
  265. package/src/core/utils/syntax-highlighter-registry.js +0 -63
  266. package/src/core/utils/syntax-highlighter.css +0 -71
  267. package/src/core/utils/syntax-highlighter.js +0 -103
  268. package/src/pages/Buttons.mdx +0 -121
  269. package/src/pages/Chips.mdx +0 -136
  270. package/src/pages/Colour.mdx +0 -23
  271. package/src/pages/Forms.mdx +0 -219
  272. package/src/pages/Layout.mdx +0 -58
  273. package/src/pages/Toggles.mdx +0 -42
  274. package/src/pages/Typography.mdx +0 -206
  275. package/src/pages/utils.ts +0 -80
  276. package/src/reset/scripts.js +0 -1
  277. package/src/reset/styles/normalize.css +0 -353
  278. package/src/reset/styles/reset.css +0 -139
  279. package/src/reset/styles.css +0 -2
@@ -1,34 +0,0 @@
1
- import React from "react";
2
-
3
- import Icon from "./Icon";
4
- type MeganavControlMobilePanelCloseProps = {
5
- ariaControls: string;
6
- displayHr?: boolean;
7
- };
8
-
9
- const MeganavControlMobilePanelClose = ({
10
- ariaControls,
11
- displayHr = true,
12
- }: MeganavControlMobilePanelCloseProps) => (
13
- <div className="mx-24 md:mx-32">
14
- <button
15
- type="button"
16
- className="ui-meganav-mobile-link text-gui-default mb-16"
17
- data-id="meganav-control-mobile-panel-close"
18
- aria-expanded="false"
19
- aria-controls={ariaControls}
20
- aria-label="Hide panel"
21
- >
22
- <Icon
23
- name="icon-gui-disclosure-arrow"
24
- color="text-cool-black"
25
- size="1.5rem"
26
- additionalCSS="relative -top-1 transform rotate-180"
27
- />
28
- Back
29
- </button>
30
- {displayHr ? <hr className="ui-meganav-hr" /> : null}
31
- </div>
32
- );
33
-
34
- export default MeganavControlMobilePanelClose;
@@ -1,59 +0,0 @@
1
- import { queryId, queryIdAll } from "../dom-query";
2
- import { remsToPixelValue } from "../css";
3
-
4
- export default () => {
5
- const closeControls = Array.from(
6
- queryIdAll("meganav-control-mobile-panel-close"),
7
- );
8
- const openControls = Array.from(
9
- queryIdAll("meganav-control-mobile-panel-open"),
10
- );
11
- const dropdown = queryId("meganav-mobile-dropdown");
12
-
13
- // Height is defined in rem's so to get the pixel value we need to find the fontSize on root
14
- const meganavHeight = remsToPixelValue(
15
- getComputedStyle(document.documentElement).getPropertyValue(
16
- "--ui-meganav-height",
17
- ),
18
- );
19
-
20
- const clickHandler = (btn, closeBtn, panel) => () => {
21
- btn.setAttribute("aria-expanded", true);
22
- closeBtn.setAttribute("aria-expanded", true);
23
- panel.classList.replace("hidden", "block");
24
-
25
- // On devices where we don't have enough space for the panel, set it's height to
26
- // the height of the viewport (minus the meganav height) - this will trigger a scroll.
27
- // Otherwise just set it to the panel height. This handles the case where the ratio of vertical
28
- // space to horizontal is especially high (think tablets, but not only).
29
- panel.style.height = `${
30
- window.innerHeight - meganavHeight > panel.offsetHeight
31
- ? panel.offsetHeight
32
- : window.innerHeight - meganavHeight
33
- }px`;
34
- };
35
-
36
- return openControls.map((btn) => {
37
- const closeBtn = closeControls.find(
38
- (node) =>
39
- node.getAttribute("aria-controls") ===
40
- btn.getAttribute("aria-controls"),
41
- );
42
- const panel = document.querySelector(
43
- `#${btn.getAttribute("aria-controls")}`,
44
- );
45
- const handler = clickHandler(btn, closeBtn, panel);
46
-
47
- btn.addEventListener("click", handler);
48
-
49
- return {
50
- teardown: () => btn.removeEventListener("click", handler),
51
- clear: () => {
52
- panel.classList.replace("block", "hidden");
53
- dropdown.classList.remove("ui-meganav-mobile-dropdown-expand");
54
- btn.setAttribute("aria-expanded", false);
55
- panel.style.height = null;
56
- },
57
- };
58
- });
59
- };
@@ -1,31 +0,0 @@
1
- import React, { ReactNode } from "react";
2
-
3
- import Icon from "./Icon";
4
- type MeganavControlMobilePanelOpenProps = {
5
- ariaControls: string;
6
- children: ReactNode;
7
- };
8
-
9
- const MeganavControlMobilePanelOpen = ({
10
- ariaControls,
11
- children,
12
- }: MeganavControlMobilePanelOpenProps) => (
13
- <button
14
- type="button"
15
- className="ui-meganav-mobile-link"
16
- data-id="meganav-control-mobile-panel-open"
17
- aria-expanded="false"
18
- aria-controls={ariaControls}
19
- aria-label={`Show ${children}`}
20
- >
21
- {children}
22
- <Icon
23
- name="icon-gui-disclosure-arrow"
24
- color="text-cool-black"
25
- size="1.5rem"
26
- additionalCSS="relative -top-1 ml-auto float-right"
27
- />
28
- </button>
29
- );
30
-
31
- export default MeganavControlMobilePanelOpen;
@@ -1,68 +0,0 @@
1
- import React from "react";
2
-
3
- import MeganavData from "./Meganav/component.json";
4
- import MeganavControl from "./MeganavControl";
5
- import { AbsUrl, MeganavPanels, MeganavTheme } from "./Meganav";
6
-
7
- type MeganavDesktopItems = {
8
- panels: MeganavPanels;
9
- paths?: {
10
- logo: string;
11
- iconSprites: string;
12
- ablyStack: string;
13
- blogThumb1: string;
14
- blogThumb2: string;
15
- blogThumb3: string;
16
- };
17
- theme: MeganavTheme;
18
- absUrl: AbsUrl;
19
- };
20
-
21
- const MeganavDesktopItems = ({
22
- panels,
23
- paths,
24
- theme,
25
- absUrl,
26
- }: MeganavDesktopItems) => (
27
- <ul className="hidden md:flex" data-id="meganav-items-desktop">
28
- {MeganavData.panels.map((panel) => {
29
- const PanelComponent = panels[panel.component];
30
- const bgCSS = ["products-panel", "use-cases-panel"].includes(panel.id)
31
- ? "ui-meganav-panel-split-bg"
32
- : "";
33
-
34
- return (
35
- <li className="ui-meganav-item" key={panel.id}>
36
- <MeganavControl
37
- theme={theme}
38
- ariaControls={panel.id}
39
- ariaLabel={panel.label}
40
- >
41
- <span className="hidden lg:inline">{panel.label}</span>
42
- <span className="lg:hidden">{panel.shortLabel}</span>
43
- </MeganavControl>
44
-
45
- <div
46
- className={`ui-meganav-panel invisible ${bgCSS}`}
47
- id={panel.id}
48
- data-id="meganav-panel"
49
- >
50
- <PanelComponent paths={paths} absUrl={absUrl} />
51
- </div>
52
- </li>
53
- );
54
- })}
55
-
56
- <li className="ui-meganav-item">
57
- <a
58
- href={absUrl("/pricing")}
59
- data-id="meganav-link"
60
- className={`ui-meganav-link h-64 items-center flex ${theme.textColor}`}
61
- >
62
- Pricing
63
- </a>
64
- </li>
65
- </ul>
66
- );
67
-
68
- export default React.memo(MeganavDesktopItems);
@@ -1,197 +0,0 @@
1
- import React from "react";
2
-
3
- import SignOutLink from "./SignOutLink";
4
- import MeganavSearchSuggestions from "./MeganavSearchSuggestions";
5
- import Icon from "./Icon";
6
- import MeganavData from "./Meganav/component.json";
7
- import MeganavControlMobileDropdown from "./MeganavControlMobileDropdown";
8
- import MeganavControlMobilePanelClose from "./MeganavControlMobilePanelClose";
9
- import MeganavControlMobilePanelOpen from "./MeganavControlMobilePanelOpen";
10
- import MeganavSearchAutocomplete from "./MeganavSearchAutocomplete";
11
- import {
12
- AbsUrl,
13
- MeganavPanels,
14
- MeganavSessionState,
15
- MeganavTheme,
16
- } from "./Meganav";
17
-
18
- type MeganavItemsMobileProps = {
19
- panels: MeganavPanels;
20
- paths?: {
21
- iconSprites: string;
22
- };
23
- sessionState?: MeganavSessionState;
24
- theme: MeganavTheme;
25
- loginLink: string;
26
- absUrl: AbsUrl;
27
- };
28
-
29
- const MeganavItemsMobile = ({
30
- panels,
31
- paths,
32
- sessionState,
33
- theme,
34
- loginLink,
35
- absUrl,
36
- }: MeganavItemsMobileProps) => {
37
- const classNames = `ui-meganav-link ${theme.textColor}`;
38
-
39
- return (
40
- <ul className="flex md:hidden items-center" data-id="meganav-items-mobile">
41
- <li>
42
- {sessionState?.signedIn && sessionState?.logOut ? (
43
- <SignOutLink absUrl={absUrl} {...sessionState.logOut}>
44
- {({ text, href, onClick }) => (
45
- <a
46
- onClick={onClick}
47
- href={absUrl(href)}
48
- className={classNames}
49
- data-id="meganav-link"
50
- >
51
- {text}
52
- </a>
53
- )}
54
- </SignOutLink>
55
- ) : (
56
- <a
57
- href={absUrl(loginLink)}
58
- className={classNames}
59
- data-id="meganav-link"
60
- >
61
- Login
62
- </a>
63
- )}
64
- </li>
65
-
66
- <li className="ui-meganav-item">
67
- <MeganavControlMobileDropdown theme={theme} />
68
-
69
- <div
70
- className="ui-meganav-mobile-dropdown invisible"
71
- id="meganav-mobile-dropdown"
72
- data-id="meganav-mobile-dropdown"
73
- >
74
- <div className="pt-24 pb-16 ui-grid-px bg-white">
75
- <form className="mb-16" action={absUrl("/search")} method="get">
76
- <div className="relative w-full">
77
- <Icon
78
- name="icon-gui-search"
79
- color="text-cool-black"
80
- size="1.5rem"
81
- additionalCSS="absolute top-12 left-16 hover:text-gui-hover"
82
- />
83
- <button
84
- type="button"
85
- className="absolute top-12 right-16 p-0 focus:outline-gui-focus m-0 md:hidden invisible"
86
- data-id="meganav-search-input-clear"
87
- >
88
- <Icon
89
- name="icon-gui-cross-circled-fill"
90
- color="text-dark-grey"
91
- size="1.5rem"
92
- additionalCSS=""
93
- />
94
- </button>
95
- <input
96
- type="search"
97
- name="q"
98
- className="ui-input px-48 h-48"
99
- style={{ maxWidth: "none" }}
100
- placeholder="Search"
101
- autoComplete="off"
102
- data-id="meganav-mobile-search-input"
103
- />
104
-
105
- <MeganavSearchAutocomplete />
106
- </div>
107
- </form>
108
-
109
- <div
110
- className="max-h-0 overflow-hidden transition-all"
111
- data-id="meganav-mobile-search-suggestions"
112
- >
113
- <MeganavSearchSuggestions
114
- absUrl={absUrl}
115
- displaySupportLink={false}
116
- />
117
- </div>
118
-
119
- <ul className="mb-16" data-id="meganav-mobile-panel-controls">
120
- {MeganavData.panels.map((panel) => {
121
- const PanelComponent = panels[panel.component];
122
- const displayHr = [
123
- "company-panel",
124
- "developers-panel",
125
- ].includes(panel.id);
126
-
127
- return (
128
- <li
129
- className="ui-meganav-mobile-item"
130
- key={`${panel.id}-mobile`}
131
- >
132
- <MeganavControlMobilePanelOpen
133
- ariaControls={`${panel.id}-mobile`}
134
- >
135
- {panel.label}
136
- </MeganavControlMobilePanelOpen>
137
-
138
- <div
139
- className="ui-meganav-panel-mobile hidden"
140
- id={`${panel.id}-mobile`}
141
- data-scroll-lock-scrollable
142
- >
143
- <MeganavControlMobilePanelClose
144
- ariaControls={`${panel.id}-mobile`}
145
- displayHr={displayHr}
146
- />
147
- <PanelComponent paths={paths} absUrl={absUrl} />
148
- </div>
149
- </li>
150
- );
151
- })}
152
- <li>
153
- <a href={absUrl("/pricing")} className="ui-meganav-mobile-link">
154
- Pricing
155
- </a>
156
- </li>
157
- </ul>
158
-
159
- <hr className="ui-meganav-hr mb-20" />
160
-
161
- <div className="flex justify-between items-center mb-16">
162
- <a
163
- href={absUrl("/contact")}
164
- className="text-menu2 font-medium block ml-0 mr-8 lg:mx-12 p-0 hover:text-gui-hover focus:text-gui-focus focus:outline-none"
165
- >
166
- Contact us
167
- </a>
168
- {sessionState?.signedIn && sessionState?.account ? (
169
- <a
170
- href={absUrl(sessionState.account.links.dashboard.href)}
171
- className="ui-btn-secondary"
172
- >
173
- Dashboard
174
- </a>
175
- ) : (
176
- <a href={absUrl("/sign-up")} className="ui-btn">
177
- Sign up free
178
- </a>
179
- )}
180
- </div>
181
- </div>
182
- </div>
183
- </li>
184
- </ul>
185
- );
186
- };
187
-
188
- export default React.memo(MeganavItemsMobile, (oldState, newState) => {
189
- const { paths: pathsOld, theme: themeOld } = oldState;
190
- const { paths: pathsNew, theme: themeNew } = newState;
191
-
192
- return (
193
- pathsOld === pathsNew &&
194
- themeOld === themeNew &&
195
- Object.keys(newState.sessionState || {}).length === 0
196
- );
197
- });
@@ -1,130 +0,0 @@
1
- import React from "react";
2
-
3
- import MeganavControl from "./MeganavControl";
4
- import SignOutLink from "./SignOutLink";
5
- import MeganavSearch from "./MeganavSearch";
6
- import { AbsUrl, MeganavSessionState, MeganavTheme } from "./Meganav";
7
-
8
- type MeganavItemsSignedIn = {
9
- sessionState: MeganavSessionState;
10
- theme: MeganavTheme;
11
- absUrl: AbsUrl;
12
- };
13
-
14
- const truncate = (string, length) => {
15
- return string?.length && string.length > length
16
- ? `${string.slice(0, length - 1)}…`
17
- : string;
18
- };
19
-
20
- const MeganavItemsSignedIn = ({
21
- sessionState,
22
- theme,
23
- absUrl,
24
- }: MeganavItemsSignedIn) => {
25
- const links = sessionState.account
26
- ? Object.keys(sessionState.account.links).map(
27
- (key) => sessionState.account.links[key],
28
- )
29
- : [];
30
- const accountName = truncate(sessionState.accountName, 20);
31
- const preferredEmail = truncate(sessionState.preferredEmail, 20);
32
-
33
- return (
34
- <ul className="hidden md:flex items-center">
35
- <li className="ui-meganav-item relative">
36
- <MeganavControl
37
- ariaControls="account-panel"
38
- ariaLabel="Account"
39
- theme={theme}
40
- additionalCSS="mr-0"
41
- >
42
- {accountName}
43
- </MeganavControl>
44
-
45
- <div
46
- className="ui-meganav-panel-account invisible"
47
- id="account-panel"
48
- data-id="meganav-panel"
49
- >
50
- {/* Users exist without accounts in which case there is no links here */}
51
- {sessionState.account && (
52
- <>
53
- <p className="ui-meganav-overline mt-16 mx-16">Your account</p>
54
- <ul className="mb-16 mx-16">
55
- {links.map((item) => (
56
- <li key={item.href}>
57
- <a
58
- className="ui-meganav-account-link"
59
- href={absUrl(item.href)}
60
- >
61
- {item.text}
62
- </a>
63
- </li>
64
- ))}
65
- </ul>
66
- </>
67
- )}
68
-
69
- <p className="ui-meganav-overline mx-16">{preferredEmail}</p>
70
- <ul className="mb-8 mx-16">
71
- <li>
72
- <a
73
- href={absUrl(sessionState.mySettings.href)}
74
- className="ui-meganav-account-link"
75
- >
76
- {sessionState.mySettings.text}
77
- </a>
78
- </li>
79
- {sessionState.myAccessTokens && (
80
- <li>
81
- <a
82
- href={absUrl(sessionState.myAccessTokens.href)}
83
- className="ui-meganav-account-link"
84
- >
85
- {sessionState.myAccessTokens.text}
86
- <span className="ui-version-tag">preview</span>
87
- </a>
88
- </li>
89
- )}
90
- </ul>
91
-
92
- <hr className="ui-meganav-hr mb-16" />
93
-
94
- {sessionState.logOut && (
95
- <div className="mb-16 px-16">
96
- <SignOutLink absUrl={absUrl} {...sessionState.logOut}>
97
- {({ text, href, onClick }) => (
98
- <a
99
- onClick={onClick}
100
- href={absUrl(href)}
101
- className="ui-meganav-account-link"
102
- >
103
- {text}
104
- </a>
105
- )}
106
- </SignOutLink>
107
- </div>
108
- )}
109
- </div>
110
- </li>
111
-
112
- <li>
113
- <MeganavSearch absUrl={absUrl} />
114
- </li>
115
-
116
- {sessionState.account && (
117
- <li>
118
- <a
119
- href={absUrl(sessionState.account.links.dashboard.href)}
120
- className="ui-btn-secondary p-btn-small"
121
- >
122
- Dashboard
123
- </a>
124
- </li>
125
- )}
126
- </ul>
127
- );
128
- };
129
-
130
- export default MeganavItemsSignedIn;
@@ -1,36 +0,0 @@
1
- import React from "react";
2
-
3
- import Icon from "./Icon";
4
- import MeganavSearchPanel from "./MeganavSearchPanel";
5
- import { AbsUrl } from "./Meganav";
6
-
7
- const MeganavSearch = ({ absUrl }: { absUrl: AbsUrl }) => (
8
- <>
9
- <button
10
- type="button"
11
- data-id="meganav-control"
12
- data-control="search"
13
- className="h-64 w-24 px-24 pr-48 py-20 group focus:outline-none"
14
- aria-expanded="false"
15
- aria-controls="panel-search"
16
- aria-label={`Show Search Panel`}
17
- >
18
- <Icon
19
- name="icon-gui-search"
20
- color="text-cool-black"
21
- size="1.5rem"
22
- additionalCSS="group-hover:text-gui-hover group-focus:text-gui-focus"
23
- />
24
- </button>
25
-
26
- <div
27
- className="ui-meganav-panel invisible"
28
- id="panel-search"
29
- data-id="meganav-panel"
30
- >
31
- <MeganavSearchPanel absUrl={absUrl} />
32
- </div>
33
- </>
34
- );
35
-
36
- export default MeganavSearch;