@ably/ui 14.1.0-dev.6699453 → 14.1.0-dev.76621d8

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 (308) hide show
  1. package/core/styles/forms.css +19 -0
  2. package/core/styles.components.css +0 -1
  3. package/package.json +2 -1
  4. package/src/.DS_Store +0 -0
  5. package/src/core/.DS_Store +0 -0
  6. package/src/core/Accordion/.DS_Store +0 -0
  7. package/src/core/Accordion/Accordion.stories.tsx +39 -0
  8. package/src/core/Accordion.tsx +149 -0
  9. package/src/core/Code/.DS_Store +0 -0
  10. package/src/core/Code/Code.stories.tsx +71 -0
  11. package/src/core/Code/component.css +1 -0
  12. package/src/core/Code/component.js +27 -0
  13. package/src/core/Code.tsx +44 -0
  14. package/src/core/ConnectStateWrapper.tsx +43 -0
  15. package/src/core/ContactFooter/.DS_Store +0 -0
  16. package/src/core/ContactFooter/ContactFooter.stories.tsx +11 -0
  17. package/src/core/ContactFooter/component.css +11 -0
  18. package/src/core/ContactFooter/component.js +2 -0
  19. package/src/core/ContactFooter.tsx +91 -0
  20. package/src/core/CookieMessage/.DS_Store +0 -0
  21. package/src/core/CookieMessage/CookieMessage.stories.tsx +12 -0
  22. package/src/core/CookieMessage/component.css +15 -0
  23. package/src/core/CookieMessage.tsx +52 -0
  24. package/src/core/CustomerLogos/.DS_Store +0 -0
  25. package/src/core/CustomerLogos/CustomerLogos.stories.tsx +43 -0
  26. package/src/core/CustomerLogos.tsx +35 -0
  27. package/src/core/DropdownMenu/.DS_Store +0 -0
  28. package/src/core/DropdownMenu/DropdownMenu.stories.tsx +48 -0
  29. package/src/core/DropdownMenu.tsx +140 -0
  30. package/src/core/Expander/Expander.stories.tsx +132 -0
  31. package/src/core/Expander.tsx +63 -0
  32. package/src/core/FeaturedLink/.DS_Store +0 -0
  33. package/src/core/FeaturedLink/FeaturedLink.stories.tsx +43 -0
  34. package/src/core/FeaturedLink.tsx +93 -0
  35. package/src/core/Flash/.DS_Store +0 -0
  36. package/src/core/Flash/Flash.stories.tsx +37 -0
  37. package/src/core/Flash/component.css +28 -0
  38. package/src/core/Flash.tsx +233 -0
  39. package/src/core/Footer/.DS_Store +0 -0
  40. package/src/core/Footer/Footer.stories.tsx +26 -0
  41. package/src/core/Footer/component.css +33 -0
  42. package/src/core/Footer.tsx +535 -0
  43. package/src/core/Icon/.DS_Store +0 -0
  44. package/src/core/Icon/Icon.stories.tsx +151 -0
  45. package/src/core/Icon.tsx +26 -0
  46. package/src/core/Loader/.DS_Store +0 -0
  47. package/src/core/Loader/Loader.stories.tsx +21 -0
  48. package/src/core/Loader.tsx +52 -0
  49. package/src/core/Logo/.DS_Store +0 -0
  50. package/src/core/Logo/Logo.stories.tsx +12 -0
  51. package/src/core/Logo.tsx +29 -0
  52. package/src/core/Meganav/.DS_Store +0 -0
  53. package/src/core/Meganav/Meganav.stories.tsx +86 -0
  54. package/src/core/Meganav/component.css +114 -0
  55. package/src/core/Meganav/component.js +150 -0
  56. package/src/core/Meganav/component.json +37 -0
  57. package/src/core/Meganav.tsx +225 -0
  58. package/src/core/MeganavBlogPostsList/.DS_Store +0 -0
  59. package/src/core/MeganavBlogPostsList/component.js +43 -0
  60. package/src/core/MeganavBlogPostsList.tsx +41 -0
  61. package/src/core/MeganavContentCompany.tsx +166 -0
  62. package/src/core/MeganavContentDevelopers.tsx +210 -0
  63. package/src/core/MeganavContentProducts.tsx +163 -0
  64. package/src/core/MeganavContentUseCases.tsx +244 -0
  65. package/src/core/MeganavControl/.DS_Store +0 -0
  66. package/src/core/MeganavControl/component.js +117 -0
  67. package/src/core/MeganavControl.tsx +39 -0
  68. package/src/core/MeganavControlMobileDropdown/.DS_Store +0 -0
  69. package/src/core/MeganavControlMobileDropdown/component.js +46 -0
  70. package/src/core/MeganavControlMobileDropdown.tsx +31 -0
  71. package/src/core/MeganavControlMobilePanelClose/.DS_Store +0 -0
  72. package/src/core/MeganavControlMobilePanelClose/component.js +36 -0
  73. package/src/core/MeganavControlMobilePanelClose.tsx +34 -0
  74. package/src/core/MeganavControlMobilePanelOpen/.DS_Store +0 -0
  75. package/src/core/MeganavControlMobilePanelOpen/component.js +59 -0
  76. package/src/core/MeganavControlMobilePanelOpen.tsx +31 -0
  77. package/src/core/MeganavItemsDesktop.tsx +68 -0
  78. package/src/core/MeganavItemsMobile.tsx +197 -0
  79. package/src/core/MeganavItemsSignedIn.tsx +130 -0
  80. package/src/core/MeganavSearch.tsx +36 -0
  81. package/src/core/MeganavSearchAutocomplete/.DS_Store +0 -0
  82. package/src/core/MeganavSearchAutocomplete/component.js +177 -0
  83. package/src/core/MeganavSearchAutocomplete.tsx +12 -0
  84. package/src/core/MeganavSearchPanel.tsx +52 -0
  85. package/src/core/MeganavSearchSuggestions/.DS_Store +0 -0
  86. package/src/core/MeganavSearchSuggestions/component.js +133 -0
  87. package/src/core/MeganavSearchSuggestions.tsx +62 -0
  88. package/src/core/Notice/.DS_Store +0 -0
  89. package/src/core/Notice/component.css +7 -0
  90. package/src/core/Notice/component.js +154 -0
  91. package/src/core/Notice.tsx +102 -0
  92. package/src/core/SignOutLink.tsx +51 -0
  93. package/src/core/Slider/.DS_Store +0 -0
  94. package/src/core/Slider/Slider.stories.tsx +98 -0
  95. package/src/core/Slider/component.css +40 -0
  96. package/src/core/Slider/component.js +105 -0
  97. package/src/core/Slider.tsx +224 -0
  98. package/src/core/Table/.DS_Store +0 -0
  99. package/src/core/Table/Table.stories.tsx +12 -0
  100. package/src/core/Table/Table.tsx +58 -0
  101. package/src/core/Table/TableCell.tsx +71 -0
  102. package/src/core/Table/TableRow.tsx +25 -0
  103. package/src/core/Table/data.tsx +133 -0
  104. package/src/core/Table.tsx +15 -0
  105. package/src/core/Tooltip/.DS_Store +0 -0
  106. package/src/core/Tooltip/Tooltip.stories.tsx +27 -0
  107. package/src/core/Tooltip.tsx +88 -0
  108. package/src/core/css.js +3 -0
  109. package/src/core/dom-query.js +5 -0
  110. package/src/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
  111. package/src/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
  112. package/src/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
  113. package/src/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
  114. package/src/core/fonts/NEXT-Book-Light.eot +0 -0
  115. package/src/core/fonts/NEXT-Book-Light.otf +0 -0
  116. package/src/core/fonts/NEXT-Book-Light.woff +0 -0
  117. package/src/core/fonts/NEXT-Book-Light.woff2 +0 -0
  118. package/src/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
  119. package/src/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
  120. package/src/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
  121. package/src/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
  122. package/src/core/fonts/NEXT-Book-Medium.eot +0 -0
  123. package/src/core/fonts/NEXT-Book-Medium.otf +0 -0
  124. package/src/core/fonts/NEXT-Book-Medium.woff +0 -0
  125. package/src/core/fonts/NEXT-Book-Medium.woff2 +0 -0
  126. package/src/core/fonts/jetBrains-mono.css +3 -0
  127. package/src/core/fonts/manrope.css +3 -0
  128. package/src/core/fonts/next.css +63 -0
  129. package/src/core/fonts/source-code-pro.css +3 -0
  130. package/src/core/hubspot-chat-toggle.js +67 -0
  131. package/src/core/icons/discord.svg +10 -0
  132. package/src/core/icons/facebook.svg +4 -0
  133. package/src/core/icons/github.svg +3 -0
  134. package/src/core/icons/glassdoor.svg +3 -0
  135. package/src/core/icons/google.svg +3 -0
  136. package/src/core/icons/icon-display-48hrs.svg +3 -0
  137. package/src/core/icons/icon-display-about-ably-col.svg +4 -0
  138. package/src/core/icons/icon-display-api-keys.svg +3 -0
  139. package/src/core/icons/icon-display-api.svg +3 -0
  140. package/src/core/icons/icon-display-asset-tracking-col.svg +18 -0
  141. package/src/core/icons/icon-display-browser.svg +10 -0
  142. package/src/core/icons/icon-display-calendar.svg +3 -0
  143. package/src/core/icons/icon-display-call-mobile.svg +3 -0
  144. package/src/core/icons/icon-display-careers-col.svg +9 -0
  145. package/src/core/icons/icon-display-case-studies-col.svg +5 -0
  146. package/src/core/icons/icon-display-chat-col.svg +4 -0
  147. package/src/core/icons/icon-display-chat-stack-col.svg +4 -0
  148. package/src/core/icons/icon-display-chat-stack.svg +4 -0
  149. package/src/core/icons/icon-display-cloud-servers.svg +3 -0
  150. package/src/core/icons/icon-display-compare-tech-col.svg +9 -0
  151. package/src/core/icons/icon-display-customers-col.svg +15 -0
  152. package/src/core/icons/icon-display-data-broadcast-col.svg +26 -0
  153. package/src/core/icons/icon-display-data-synchronization-col.svg +14 -0
  154. package/src/core/icons/icon-display-docs-col.svg +7 -0
  155. package/src/core/icons/icon-display-documentation.svg +3 -0
  156. package/src/core/icons/icon-display-events-col.svg +13 -0
  157. package/src/core/icons/icon-display-examples-col.svg +11 -0
  158. package/src/core/icons/icon-display-gdpr.svg +3 -0
  159. package/src/core/icons/icon-display-general-comms.svg +3 -0
  160. package/src/core/icons/icon-display-hipaa.svg +10 -0
  161. package/src/core/icons/icon-display-integrations-col.svg +8 -0
  162. package/src/core/icons/icon-display-it-support-access.svg +3 -0
  163. package/src/core/icons/icon-display-it-support-helpdesk.svg +3 -0
  164. package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +8 -0
  165. package/src/core/icons/icon-display-laptop.svg +10 -0
  166. package/src/core/icons/icon-display-lightbulb-col.svg +10 -0
  167. package/src/core/icons/icon-display-live-chat.svg +3 -0
  168. package/src/core/icons/icon-display-map-pin.svg +3 -0
  169. package/src/core/icons/icon-display-message.svg +3 -0
  170. package/src/core/icons/icon-display-padlock-closed.svg +3 -0
  171. package/src/core/icons/icon-display-platform.svg +22 -0
  172. package/src/core/icons/icon-display-play.svg +3 -0
  173. package/src/core/icons/icon-display-privacy-shield-framework.svg +7 -0
  174. package/src/core/icons/icon-display-push-notifications-col.svg +6 -0
  175. package/src/core/icons/icon-display-quickstart-guides-col.svg +8 -0
  176. package/src/core/icons/icon-display-resources-col.svg +21 -0
  177. package/src/core/icons/icon-display-sdks-col.svg +11 -0
  178. package/src/core/icons/icon-display-servers.svg +3 -0
  179. package/src/core/icons/icon-display-shopping-cart.svg +10 -0
  180. package/src/core/icons/icon-display-sla.svg +3 -0
  181. package/src/core/icons/icon-display-soc2-type2.svg +3 -0
  182. package/src/core/icons/icon-display-tech-account-comms.svg +3 -0
  183. package/src/core/icons/icon-display-tutorials-demos-col.svg +25 -0
  184. package/src/core/icons/icon-display-virtual-events-col.svg +12 -0
  185. package/src/core/icons/icon-display-virtual-events.svg +12 -0
  186. package/src/core/icons/icon-gui-ably-badge.svg +3 -0
  187. package/src/core/icons/icon-gui-arrow-bidirectional-horizontal.svg +3 -0
  188. package/src/core/icons/icon-gui-arrow-bidirectional-vertical.svg +3 -0
  189. package/src/core/icons/icon-gui-arrow-down.svg +3 -0
  190. package/src/core/icons/icon-gui-arrow-left.svg +3 -0
  191. package/src/core/icons/icon-gui-arrow-right.svg +3 -0
  192. package/src/core/icons/icon-gui-arrow-up.svg +3 -0
  193. package/src/core/icons/icon-gui-burger-menu.svg +5 -0
  194. package/src/core/icons/icon-gui-check-circled-fill-black.svg +4 -0
  195. package/src/core/icons/icon-gui-check-circled-fill.svg +4 -0
  196. package/src/core/icons/icon-gui-check-circled.svg +3 -0
  197. package/src/core/icons/icon-gui-checklist-checked.svg +3 -0
  198. package/src/core/icons/icon-gui-clock.svg +3 -0
  199. package/src/core/icons/icon-gui-close.svg +3 -0
  200. package/src/core/icons/icon-gui-copy.svg +10 -0
  201. package/src/core/icons/icon-gui-cross-circled-fill.svg +4 -0
  202. package/src/core/icons/icon-gui-cross-circled.svg +3 -0
  203. package/src/core/icons/icon-gui-dash-circled.svg +3 -0
  204. package/src/core/icons/icon-gui-disclosure-arrow.svg +3 -0
  205. package/src/core/icons/icon-gui-document-generic.svg +3 -0
  206. package/src/core/icons/icon-gui-enlarge.svg +3 -0
  207. package/src/core/icons/icon-gui-external-link.svg +3 -0
  208. package/src/core/icons/icon-gui-filter-flow-step-1.svg +5 -0
  209. package/src/core/icons/icon-gui-filter-flow-step-2.svg +5 -0
  210. package/src/core/icons/icon-gui-filter-flow-step-3.svg +5 -0
  211. package/src/core/icons/icon-gui-history.svg +3 -0
  212. package/src/core/icons/icon-gui-info.svg +3 -0
  213. package/src/core/icons/icon-gui-link-arrow.svg +3 -0
  214. package/src/core/icons/icon-gui-link.svg +4 -0
  215. package/src/core/icons/icon-gui-live-chat.svg +3 -0
  216. package/src/core/icons/icon-gui-minus.svg +3 -0
  217. package/src/core/icons/icon-gui-partial.svg +4 -0
  218. package/src/core/icons/icon-gui-plus.svg +3 -0
  219. package/src/core/icons/icon-gui-quote-marks-solid.svg +3 -0
  220. package/src/core/icons/icon-gui-refresh.svg +10 -0
  221. package/src/core/icons/icon-gui-resources.svg +3 -0
  222. package/src/core/icons/icon-gui-search.svg +3 -0
  223. package/src/core/icons/icon-gui-tick.svg +3 -0
  224. package/src/core/icons/icon-gui-warning.svg +5 -0
  225. package/src/core/icons/icon-live-updates-results-metrics-col.svg +26 -0
  226. package/src/core/icons/icon-multi-user-spaces-col.svg +13 -0
  227. package/src/core/icons/icon-social-x.svg +3 -0
  228. package/src/core/icons/icon-tech-apachekafka.svg +3 -0
  229. package/src/core/icons/linkedin.svg +3 -0
  230. package/src/core/icons/quote.svg +3 -0
  231. package/src/core/icons/stackoverflow.svg +3 -0
  232. package/src/core/icons/twitter.svg +3 -0
  233. package/src/core/icons/youtube.svg +11 -0
  234. package/src/core/icons.js +6 -0
  235. package/src/core/images/ably-logo.png +0 -0
  236. package/src/core/images/ably-logo.svg +15 -0
  237. package/src/core/images/ably-stack.svg +14 -0
  238. package/src/core/images/best-support-2023.svg +1 -0
  239. package/src/core/images/cust-logo-ao-col-pos.png +0 -0
  240. package/src/core/images/cust-logo-ao-col-pos@2x.png +0 -0
  241. package/src/core/images/cust-logo-ausopen-col-pos.png +0 -0
  242. package/src/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
  243. package/src/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
  244. package/src/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
  245. package/src/core/images/cust-logo-hopin-mono-pos.svg +4 -0
  246. package/src/core/images/cust-logo-hubspot-col-pos.png +0 -0
  247. package/src/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
  248. package/src/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
  249. package/src/core/images/cust-logo-lightspeed-col-pos.png +0 -0
  250. package/src/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
  251. package/src/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
  252. package/src/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
  253. package/src/core/images/cust-logo-mentimeter-mono-pos.svg +17 -0
  254. package/src/core/images/cust-logo-split-col-pos.png +0 -0
  255. package/src/core/images/cust-logo-split-col-pos@2x.png +0 -0
  256. package/src/core/images/cust-logo-split-mono-pos.svg +9 -0
  257. package/src/core/images/cust-logo-toyota-mono-pos.svg +18 -0
  258. package/src/core/images/cust-logo-vitac-col-pos.png +0 -0
  259. package/src/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
  260. package/src/core/images/cust-logo-webflow-col-pos.svg +3 -0
  261. package/src/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
  262. package/src/core/images/cust-photo-split-pato-echague.jpg +0 -0
  263. package/src/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
  264. package/src/core/images/fastest-implementation-2023.svg +1 -0
  265. package/src/core/images/flexible-companies.png +0 -0
  266. package/src/core/images/high-performer-2022.png +0 -0
  267. package/src/core/images/high-performer-2023.svg +1 -0
  268. package/src/core/images/highest-user-adoption-2022.png +0 -0
  269. package/src/core/images/highest-user-adoption-2023.svg +1 -0
  270. package/src/core/images/icon-tech-aws.svg +4 -0
  271. package/src/core/images/rocket-list-2021.png +0 -0
  272. package/src/core/images/scale-motif-open-empathetic.svg +1 -0
  273. package/src/core/images/technical-support-01-800x533.jpg +0 -0
  274. package/src/core/images/users-love-us-2022.png +0 -0
  275. package/src/core/load-sprites.js +11 -0
  276. package/src/core/react-renderer.tsx +29 -0
  277. package/src/core/remote-blogs-posts.js +42 -0
  278. package/src/core/remote-data-store.js +34 -0
  279. package/src/core/remote-data-util.js +4 -0
  280. package/src/core/remote-session-data.js +58 -0
  281. package/src/core/scripts.js +10 -0
  282. package/src/core/styles/Dropdown.stories.tsx +49 -0
  283. package/src/core/styles/Toggle.stories.tsx +41 -0
  284. package/src/core/styles/buttons.css +124 -0
  285. package/src/core/styles/forms.css +83 -0
  286. package/src/core/styles/layout.css +21 -0
  287. package/src/core/styles/properties.css +278 -0
  288. package/src/core/styles/text.css +168 -0
  289. package/src/core/styles/toggles.css +38 -0
  290. package/src/core/styles.base.css +1 -0
  291. package/src/core/styles.components.css +44 -0
  292. package/src/core/styles.css +2 -0
  293. package/src/core/url-base.js +7 -0
  294. package/src/core/utils/syntax-highlighter-registry.js +63 -0
  295. package/src/core/utils/syntax-highlighter.css +71 -0
  296. package/src/core/utils/syntax-highlighter.js +103 -0
  297. package/src/pages/Buttons.mdx +121 -0
  298. package/src/pages/Chips.mdx +136 -0
  299. package/src/pages/Colour.mdx +23 -0
  300. package/src/pages/Forms.mdx +219 -0
  301. package/src/pages/Layout.mdx +58 -0
  302. package/src/pages/Typography.mdx +206 -0
  303. package/src/pages/utils.ts +80 -0
  304. package/src/reset/scripts.js +1 -0
  305. package/src/reset/styles/normalize.css +353 -0
  306. package/src/reset/styles/reset.css +139 -0
  307. package/src/reset/styles.css +2 -0
  308. package/core/styles/dropdowns.css +0 -41
@@ -61,4 +61,23 @@
61
61
  /* color: var(--text-dark-grey); */
62
62
  color: #76767c;
63
63
  }
64
+
65
+ .ui-dropdown-base {
66
+ @apply rounded-lg border border-neutral-500 pl-16 pr-[56px] appearance-none select-none focus:outline-gui-focus focus:outline-4 leading-snug;
67
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjNjY3MDg1IiBkPSJNMTIuOTA0NiAxMkw5LjAwNjcxIDE2LjMzMUwxMC40OTMzIDE3LjY2OUwxNC45OTMzIDEyLjY2OUwxNC45OTMzIDExLjMzMUwxMC40OTMzIDYuMzMxMDVMOS4wMDY3MSA3LjY2ODk4TDEyLjkwNDYgMTJaIiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAxMiAxMikiLz4KPC9zdmc+Cg==");
68
+ background-repeat: no-repeat;
69
+ background-position: center right 16px;
70
+ }
71
+
72
+ .ui-dropdown-base option:disabled {
73
+ @apply text-neutral-800;
74
+ }
75
+
76
+ .ui-dropdown {
77
+ @apply ui-dropdown-base py-12;
78
+ }
79
+
80
+ .ui-dropdown-small {
81
+ @apply ui-dropdown-base py-8;
82
+ }
64
83
  }
@@ -3,7 +3,6 @@
3
3
  @import "./styles/text.css";
4
4
  @import "./styles/forms.css";
5
5
  @import "./styles/toggles.css";
6
- @import "./styles/dropdowns.css";
7
6
 
8
7
  @layer components {
9
8
  .ui-input {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "14.1.0-dev.6699453",
3
+ "version": "14.1.0-dev.76621d8",
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",
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "license": "Apache-2.0",
10
10
  "files": [
11
+ "src",
11
12
  "core",
12
13
  "reset",
13
14
  "tailwind.config.js",
package/src/.DS_Store ADDED
Binary file
Binary file
Binary file
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import Accordion, { AccordionProps } from "../Accordion";
3
+
4
+ export default {
5
+ title: "JS Components/Accordion",
6
+ component: Accordion,
7
+ args: {
8
+ data: [
9
+ {
10
+ name: "Item 1",
11
+ content: "Content 1",
12
+ },
13
+ {
14
+ name: "Item 2",
15
+ content: "Content 2",
16
+ },
17
+ {
18
+ name: "Item 3",
19
+ content: "Content 3",
20
+ },
21
+ {
22
+ name: "Item 4",
23
+ content: "Content 4",
24
+ },
25
+ ],
26
+ autoClose: false,
27
+ topBorder: false,
28
+ bottomBorder: false,
29
+ arrowIcon: false,
30
+ },
31
+ };
32
+
33
+ export const Default = {};
34
+
35
+ export const AutoClose = {
36
+ render: (args: AccordionProps) => (
37
+ <Accordion data={args.data} autoClose={true} />
38
+ ),
39
+ };
@@ -0,0 +1,149 @@
1
+ import React, { useState, ReactNode, JSX } from "react";
2
+ import Icon from "./Icon";
3
+
4
+ type AccordionData = {
5
+ name: string;
6
+ content: ReactNode;
7
+ };
8
+
9
+ type AccordionRowProps = {
10
+ bottomBorder?: boolean;
11
+ topBorder?: boolean;
12
+ active: boolean;
13
+ last: boolean;
14
+ name: string;
15
+ index;
16
+ children: ReactNode;
17
+ arrowIcon?: boolean;
18
+ setActiveIndex: (index: number) => void;
19
+ };
20
+
21
+ export type AccordionProps = {
22
+ data: AccordionData[];
23
+ arrowIcon?: boolean;
24
+ topBorder?: boolean;
25
+ bottomBorder?: boolean;
26
+ id?: string;
27
+ autoClose?: boolean;
28
+ className?: string;
29
+ };
30
+
31
+ const AccordionRow = ({
32
+ name,
33
+ children,
34
+ index,
35
+ setActiveIndex,
36
+ active,
37
+ topBorder,
38
+ bottomBorder,
39
+ last,
40
+ arrowIcon,
41
+ }: AccordionRowProps) => {
42
+ let iconActive: JSX.Element, iconInactive: JSX.Element;
43
+ const handleSetIndex = () => {
44
+ setActiveIndex(index);
45
+ };
46
+
47
+ if (arrowIcon) {
48
+ iconActive = (
49
+ <Icon
50
+ name="icon-gui-disclosure-arrow"
51
+ color="text-dark-grey"
52
+ size="1.5rem"
53
+ additionalCSS="-rotate-90"
54
+ />
55
+ );
56
+ iconInactive = (
57
+ <Icon
58
+ name="icon-gui-disclosure-arrow"
59
+ color="text-dark-grey"
60
+ size="1.5rem"
61
+ additionalCSS="rotate-90"
62
+ />
63
+ );
64
+ } else {
65
+ iconActive = (
66
+ <Icon name="icon-gui-minus" color="text-dark-grey" size="1.5rem" />
67
+ );
68
+ iconInactive = (
69
+ <Icon name="icon-gui-plus" color="text-dark-grey" size="1.5rem" />
70
+ );
71
+ }
72
+
73
+ return (
74
+ <div
75
+ className={`border-mid-grey ${last && !bottomBorder ? "" : "border-b"} ${
76
+ topBorder ? "border-t" : ""
77
+ }`}
78
+ >
79
+ <button
80
+ type="button"
81
+ onClick={handleSetIndex}
82
+ className={`flex w-full px-0 focus:outline-none py-20`}
83
+ >
84
+ <span className="ui-text-p1 font-bold text-left mr-8">{name}</span>
85
+ <span className="ml-auto">{active ? iconActive : iconInactive}</span>
86
+ </button>
87
+
88
+ <section
89
+ className="ui-text-p2 transition-all overflow-hidden"
90
+ style={{
91
+ maxHeight: active ? "500px" : "0",
92
+ paddingBottom: active ? "1.5rem" : "0",
93
+ }}
94
+ >
95
+ {children}
96
+ </section>
97
+ </div>
98
+ );
99
+ };
100
+
101
+ const Accordion = ({
102
+ data,
103
+ id = "id-accordion",
104
+ topBorder,
105
+ bottomBorder,
106
+ arrowIcon,
107
+ autoClose,
108
+ className,
109
+ }: AccordionProps) => {
110
+ const [activeIndexes, setActiveIndexes] = useState<number[]>([]);
111
+
112
+ const handleSetIndex = (index: number) => {
113
+ const currentIndexIsActive = activeIndexes.includes(index);
114
+
115
+ if (autoClose) {
116
+ setActiveIndexes(currentIndexIsActive ? [] : [index]);
117
+ } else {
118
+ setActiveIndexes(
119
+ currentIndexIsActive
120
+ ? activeIndexes.filter((i) => i !== index)
121
+ : [...activeIndexes, index],
122
+ );
123
+ }
124
+ };
125
+
126
+ return (
127
+ <div className={className} id={id}>
128
+ {data.map((item, currentIndex) => {
129
+ return (
130
+ <AccordionRow
131
+ key={item.name}
132
+ name={item.name}
133
+ arrowIcon={arrowIcon}
134
+ index={currentIndex}
135
+ last={data.length === currentIndex + 1}
136
+ topBorder={topBorder && currentIndex === 0}
137
+ bottomBorder={bottomBorder && data.length === currentIndex + 1}
138
+ active={activeIndexes.includes(currentIndex)}
139
+ setActiveIndex={handleSetIndex}
140
+ >
141
+ {item.content}
142
+ </AccordionRow>
143
+ );
144
+ })}
145
+ </div>
146
+ );
147
+ };
148
+
149
+ export default Accordion;
Binary file
@@ -0,0 +1,71 @@
1
+ import Code from "../Code";
2
+
3
+ export default {
4
+ title: "JS Components/Code",
5
+ component: Code,
6
+ tags: ["autodocs"],
7
+ };
8
+
9
+ export const Javascript = {
10
+ args: {
11
+ language: "javascript",
12
+ snippet: `var ably = new Ably.Realtime('1WChTA.mc0Biw:kNfiYG4KiPgmHHgH');
13
+ var channel = ably.channels.get('web-pal');
14
+
15
+ // Subscribe to messages on channel
16
+ channel.subscribe('greeting', function(message) {
17
+ alert(message.data);
18
+ });`,
19
+ },
20
+ };
21
+
22
+ export const Swift = {
23
+ args: {
24
+ language: "swift",
25
+ snippet: `let ably = ARTRealtime(key: "1WChTA.mc0Biw:kNfiYG4KiPgmHHgH")
26
+ let channel = ably.channels.get("web-pal")
27
+
28
+ // Subscribe to messages on channel
29
+ channel.subscribe("greeting") { message in
30
+ print("\\(message.data)")
31
+ }`,
32
+ },
33
+ };
34
+
35
+ export const Java = {
36
+ args: {
37
+ language: "java",
38
+ snippet: `AblyRealtime ably = new AblyRealtime("1WChTA.mc0Biw:kNfiYG4KiPgmHHgH");
39
+ Channel channel = ably.channels.get("web-pal");
40
+
41
+ /* Subscribe to messages on channel */
42
+
43
+ MessageListener listener;
44
+ listener = new MessageListener() {
45
+ @Override
46
+ public void onMessage(Message message) {
47
+ System.out.print(message.data);
48
+ };
49
+ };
50
+ channel.subscribe("greeting", listener);`,
51
+ },
52
+ };
53
+
54
+ export const Kotlin = {
55
+ args: {
56
+ language: "kotlin",
57
+ snippet: `var ably = new Ably.Realtime('1WChTA.mc0Biw:kNfiYG4KiPgmHHgH');
58
+ val exampleConstraints = DefaultResolutionConstraints(
59
+ DefaultResolutionSet( // this constructor provides one Resolution for all states
60
+ Resolution(
61
+ accuracy = Accuracy.BALANCED,
62
+ desiredInterval = 1000L,
63
+ minimumDisplacement = 1.0
64
+ )
65
+ ),
66
+ proximityThreshold = DefaultProximity(spatial = 1.0),
67
+ batteryLevelThreshold = 10.0f,
68
+ lowBatteryMultiplier = 2.0f
69
+ )`,
70
+ },
71
+ };
@@ -0,0 +1 @@
1
+ @import "../utils/syntax-highlighter.css";
@@ -0,0 +1,27 @@
1
+ // Note: importing syntax-highlighter here means the component.js file will include
2
+ // all the language dependecies, creating a large a bundle. Prefer using the highlighter serverside.
3
+ import {
4
+ highlightSnippet,
5
+ registerDefaultLanguages,
6
+ } from "../utils/syntax-highlighter";
7
+
8
+ import languagesRegistry from "../utils/syntax-highlighter-registry";
9
+
10
+ registerDefaultLanguages(languagesRegistry);
11
+
12
+ function highlightEl(el) {
13
+ if (!el) throw "Missing code element";
14
+
15
+ const pre = el.querySelector("pre");
16
+ const code = el.querySelector("code");
17
+ const language = pre.getAttribute("lang");
18
+
19
+ if (!code || !pre || !language) throw "Malformed code element";
20
+
21
+ const { innerHTML } = code;
22
+ const html = highlightSnippet(language, innerHTML);
23
+
24
+ code.innerHTML = html;
25
+ }
26
+
27
+ export default highlightEl;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+
3
+ import {
4
+ highlightSnippet,
5
+ registerDefaultLanguages,
6
+ } from "./utils/syntax-highlighter";
7
+ import languagesRegistry from "./utils/syntax-highlighter-registry";
8
+
9
+ registerDefaultLanguages(languagesRegistry);
10
+
11
+ type CodeProps = {
12
+ language: string;
13
+ snippet: string;
14
+ textSize?: string;
15
+ padding?: string;
16
+ additionalCSS?: string;
17
+ };
18
+
19
+ const Code = ({
20
+ language,
21
+ snippet,
22
+ textSize = "ui-text-code",
23
+ padding = "p-32",
24
+ additionalCSS = "",
25
+ }: CodeProps) => {
26
+ const HTMLraw = highlightSnippet(language, `${snippet}`.trim()) ?? "";
27
+ const className = `language-${language} ${textSize}`;
28
+
29
+ return (
30
+ <div
31
+ className={`hljs overflow-auto ${padding} ${additionalCSS}`}
32
+ data-id="code"
33
+ >
34
+ <pre lang={language}>
35
+ <code
36
+ className={className}
37
+ dangerouslySetInnerHTML={{ __html: HTMLraw }}
38
+ />
39
+ </pre>
40
+ </div>
41
+ );
42
+ };
43
+
44
+ export default Code;
@@ -0,0 +1,43 @@
1
+ import React, { useEffect, useState } from "react";
2
+
3
+ import { connectState, getRemoteDataStore } from "./remote-data-store";
4
+
5
+ /*
6
+ Connect a react component to a global store.
7
+ This is similar to what react-redux does but uses our global store so
8
+ can share state with other React mount points or anything that uses the
9
+ store.
10
+ - selectors is an object where keys are your prop names and values are your select
11
+ functions that work on the store to retrieve the state you are interested in
12
+ - initial state is set in useEffect so the wrapped component needs to handle it's props set to undefined initially
13
+ */
14
+
15
+ const ConnectStateWrapper = (Component, selectors) => {
16
+ const [state, setState] = useState({});
17
+
18
+ const setStateForKey = (key) => (storeState) =>
19
+ setState(() => ({ [key]: storeState }));
20
+
21
+ useEffect(() => {
22
+ const store = getRemoteDataStore();
23
+ const resolvedState = Object.keys(selectors).reduce(
24
+ (acc, key) => ({ ...acc, [key]: selectors[key](store) }),
25
+ {},
26
+ );
27
+
28
+ // Set initial state
29
+ setState(resolvedState);
30
+
31
+ // Create a store subscription for each selector. Depending on your use case, this can be inefficient.
32
+ // When optimising for renders, look for wins with selectors better for your use and using connectState directly.
33
+ Object.keys(selectors).forEach((key) => {
34
+ connectState(selectors[key], setStateForKey(key));
35
+ });
36
+ }, []);
37
+
38
+ const WrappedComponent = (props) => <Component {...props} {...state} />;
39
+
40
+ return WrappedComponent;
41
+ };
42
+
43
+ export default ConnectStateWrapper;
Binary file
@@ -0,0 +1,11 @@
1
+ import ContactFooter from "../ContactFooter";
2
+
3
+ export default {
4
+ title: "JS Components/Contact Footer",
5
+ component: ContactFooter,
6
+ parameters: {
7
+ layout: "fullscreen",
8
+ },
9
+ };
10
+
11
+ export const Default = {};
@@ -0,0 +1,11 @@
1
+ @layer components {
2
+ .ui-contact-footer {
3
+ background-size: 100% 100%;
4
+ background-position: right center;
5
+ @apply w-full bg-gradient-active-orange;
6
+ }
7
+
8
+ .ui-contact-footer-box {
9
+ @apply p-24 sm:p-32 xl:p-40 bg-white flex flex-col justify-between rounded-sm;
10
+ }
11
+ }
@@ -0,0 +1,2 @@
1
+ import toggleChatWidget from "../hubspot-chat-toggle";
2
+ export default () => toggleChatWidget({ dataId: "contact-footer" });
@@ -0,0 +1,91 @@
1
+ import React, { useEffect } from "react";
2
+
3
+ import Icon from "./Icon";
4
+ import _absUrl from "./url-base.js";
5
+ import toggleChatWidget from "./hubspot-chat-toggle";
6
+
7
+ type ContactFooterProps = {
8
+ urlBase: string;
9
+ };
10
+
11
+ const ContactFooter = ({ urlBase }: ContactFooterProps) => {
12
+ useEffect(() => toggleChatWidget({ dataId: "contact-footer" }), []);
13
+ const absUrl = (path) => _absUrl(path, urlBase);
14
+
15
+ return (
16
+ <div
17
+ className="ui-contact-footer font-sans antialiased"
18
+ data-id="contact-footer"
19
+ >
20
+ <div className="w-full bp-lg max-w-screen-xl mx-auto py-64 grid grid-cols-1 md:grid-cols-3 ui-grid-gap ui-grid-px">
21
+ <div className="ui-contact-footer-box">
22
+ <Icon
23
+ name="icon-display-live-chat"
24
+ size="3rem"
25
+ additionalCSS="block mb-16"
26
+ />
27
+ <div>
28
+ <div className="ui-text-h3 mb-24">Live Chat</div>
29
+ <p className="ui-text-p1">
30
+ Reach out team of experts over chat powered by Ably.
31
+ </p>
32
+ </div>
33
+ <button
34
+ type="button"
35
+ className="ui-btn-secondary self-start mt-16"
36
+ disabled
37
+ data-id="open-chat-widget"
38
+ data-enabled-label="Start a live chat"
39
+ data-disabled-label="Live chat unavailable"
40
+ >
41
+ Live chat unavailable
42
+ </button>
43
+ </div>
44
+
45
+ <div className="ui-contact-footer-box">
46
+ <Icon
47
+ name="icon-display-call-mobile"
48
+ size="3rem"
49
+ additionalCSS="block mb-16"
50
+ />
51
+ <div className="flex-grow">
52
+ <div className="ui-text-h3 mb-24">Call us</div>
53
+ <p className="ui-text-p1">
54
+ <span className="block">
55
+ <strong className="font-bold">+1 877 434 5287</strong> (USA,
56
+ toll free)
57
+ </span>
58
+ <span className="block">
59
+ <strong className="font-bold">+44 20 3318 4689</strong> (UK)
60
+ </span>
61
+ </p>
62
+ </div>
63
+ </div>
64
+
65
+ <div className="ui-contact-footer-box">
66
+ <Icon
67
+ name="icon-display-tech-account-comms"
68
+ size="3rem"
69
+ additionalCSS="block mb-16"
70
+ />
71
+ <div>
72
+ <div className="ui-text-h3 mb-24">
73
+ Technical and account support
74
+ </div>
75
+ <p className="ui-text-p1">
76
+ We&apos;re standing by to help with any questions or code.
77
+ </p>
78
+ </div>
79
+ <a
80
+ className="ui-btn-secondary self-start p-btn mt-16"
81
+ href={absUrl("/support")}
82
+ >
83
+ Get support now
84
+ </a>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ );
89
+ };
90
+
91
+ export default ContactFooter;
Binary file
@@ -0,0 +1,12 @@
1
+ import CookieMessage from "../CookieMessage";
2
+
3
+ export default {
4
+ title: "JS Components/Cookie Message",
5
+ component: CookieMessage,
6
+ args: {
7
+ cookieId: "cookie-namespace",
8
+ noticeId: "cookie-message",
9
+ },
10
+ };
11
+
12
+ export const Default = {};
@@ -0,0 +1,15 @@
1
+ @layer components {
2
+ .ui-cookie-message {
3
+ @apply rounded-lg bg-white font-sans;
4
+ @apply justify-between items-center;
5
+ @apply opacity-100 z-50 bottom-0 fixed sm:flex;
6
+ @apply p-16 mb-16 ml-16;
7
+ max-width: 70vw;
8
+ box-shadow: 0px 24px 32px 0px #0000000d;
9
+ border: 1px solid var(--color-mid-grey);
10
+ border-left: 0.5rem solid var(--color-electric-cyan);
11
+ transition:
12
+ bottom 250ms ease-out,
13
+ opacity 150ms ease-out;
14
+ }
15
+ }
@@ -0,0 +1,52 @@
1
+ import React, { useRef, useEffect, useState } from "react";
2
+ import Cookie from "js-cookie";
3
+
4
+ import _absUrl from "./url-base";
5
+
6
+ const COOKIE_EXPIRY = 365;
7
+
8
+ type CookieMessageProps = {
9
+ cookieId: string;
10
+ urlBase: string;
11
+ };
12
+
13
+ const CookieMessage = ({ cookieId, urlBase }: CookieMessageProps) => {
14
+ const ref = useRef<HTMLDivElement>(null);
15
+ const [hideCookieMessage, setHideCookieMessage] = useState(true);
16
+
17
+ useEffect(() => {
18
+ const isCookieSet = Cookie.get(cookieId) ? true : false;
19
+ setHideCookieMessage(isCookieSet);
20
+ }, []);
21
+
22
+ const handleClose = () => {
23
+ Cookie.set(cookieId, "1", { expires: COOKIE_EXPIRY });
24
+
25
+ ref.current?.classList.add("bottom-1", "opacity-0");
26
+ setTimeout(() => setHideCookieMessage(true), 500);
27
+ };
28
+
29
+ const absUrl = (path) => _absUrl(path, urlBase);
30
+
31
+ // Presume the message is hidden by default
32
+ if (hideCookieMessage) return null;
33
+
34
+ return (
35
+ <div className="ui-cookie-message" ref={ref}>
36
+ <p className="ui-text-p2 pr-32">
37
+ <a href={absUrl("/privacy")} className="underline">
38
+ How we use cookies
39
+ </a>{" "}
40
+ to improve your experience.
41
+ </p>
42
+ <button
43
+ className="ui-btn-secondary mt-12 sm:mt-0 whitespace-nowrap"
44
+ onClick={handleClose}
45
+ >
46
+ Accept and close
47
+ </button>
48
+ </div>
49
+ );
50
+ };
51
+
52
+ export default CookieMessage;
Binary file