@ably/ui 14.0.4 → 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 (281) hide show
  1. package/core/Flash.js +1 -1
  2. package/core/styles/forms.css +4 -4
  3. package/core/styles/toggles.css +38 -0
  4. package/core/styles.components.css +1 -0
  5. package/package.json +15 -18
  6. package/tailwind.config.js +3 -0
  7. package/src/core/Accordion/Accordion.stories.tsx +0 -39
  8. package/src/core/Accordion.tsx +0 -149
  9. package/src/core/Code/Code.stories.tsx +0 -71
  10. package/src/core/Code/component.css +0 -1
  11. package/src/core/Code/component.js +0 -27
  12. package/src/core/Code.tsx +0 -44
  13. package/src/core/ConnectStateWrapper.tsx +0 -43
  14. package/src/core/ContactFooter/ContactFooter.stories.tsx +0 -11
  15. package/src/core/ContactFooter/component.css +0 -11
  16. package/src/core/ContactFooter/component.js +0 -2
  17. package/src/core/ContactFooter.tsx +0 -91
  18. package/src/core/CookieMessage/CookieMessage.stories.tsx +0 -12
  19. package/src/core/CookieMessage/component.css +0 -15
  20. package/src/core/CookieMessage.tsx +0 -52
  21. package/src/core/CustomerLogos/CustomerLogos.stories.tsx +0 -43
  22. package/src/core/CustomerLogos.tsx +0 -35
  23. package/src/core/DropdownMenu/DropdownMenu.stories.tsx +0 -48
  24. package/src/core/DropdownMenu.tsx +0 -140
  25. package/src/core/Expander/Expander.stories.tsx +0 -132
  26. package/src/core/Expander.tsx +0 -63
  27. package/src/core/FeaturedLink/FeaturedLink.stories.tsx +0 -43
  28. package/src/core/FeaturedLink.tsx +0 -93
  29. package/src/core/Flash/Flash.stories.tsx +0 -37
  30. package/src/core/Flash/component.css +0 -28
  31. package/src/core/Flash.tsx +0 -233
  32. package/src/core/Footer/Footer.stories.tsx +0 -26
  33. package/src/core/Footer/component.css +0 -33
  34. package/src/core/Footer.tsx +0 -535
  35. package/src/core/Icon/Icon.stories.tsx +0 -151
  36. package/src/core/Icon.tsx +0 -26
  37. package/src/core/Loader/Loader.stories.tsx +0 -21
  38. package/src/core/Loader.tsx +0 -52
  39. package/src/core/Logo/Logo.stories.tsx +0 -12
  40. package/src/core/Logo.tsx +0 -29
  41. package/src/core/Meganav/Meganav.stories.tsx +0 -86
  42. package/src/core/Meganav/component.css +0 -114
  43. package/src/core/Meganav/component.js +0 -150
  44. package/src/core/Meganav/component.json +0 -37
  45. package/src/core/Meganav.tsx +0 -225
  46. package/src/core/MeganavBlogPostsList/component.js +0 -43
  47. package/src/core/MeganavBlogPostsList.tsx +0 -41
  48. package/src/core/MeganavContentCompany.tsx +0 -166
  49. package/src/core/MeganavContentDevelopers.tsx +0 -210
  50. package/src/core/MeganavContentProducts.tsx +0 -163
  51. package/src/core/MeganavContentUseCases.tsx +0 -244
  52. package/src/core/MeganavControl/component.js +0 -117
  53. package/src/core/MeganavControl.tsx +0 -39
  54. package/src/core/MeganavControlMobileDropdown/component.js +0 -46
  55. package/src/core/MeganavControlMobileDropdown.tsx +0 -31
  56. package/src/core/MeganavControlMobilePanelClose/component.js +0 -36
  57. package/src/core/MeganavControlMobilePanelClose.tsx +0 -34
  58. package/src/core/MeganavControlMobilePanelOpen/component.js +0 -59
  59. package/src/core/MeganavControlMobilePanelOpen.tsx +0 -31
  60. package/src/core/MeganavItemsDesktop.tsx +0 -68
  61. package/src/core/MeganavItemsMobile.tsx +0 -197
  62. package/src/core/MeganavItemsSignedIn.tsx +0 -130
  63. package/src/core/MeganavSearch.tsx +0 -36
  64. package/src/core/MeganavSearchAutocomplete/component.js +0 -177
  65. package/src/core/MeganavSearchAutocomplete.tsx +0 -12
  66. package/src/core/MeganavSearchPanel.tsx +0 -52
  67. package/src/core/MeganavSearchSuggestions/component.js +0 -133
  68. package/src/core/MeganavSearchSuggestions.tsx +0 -62
  69. package/src/core/Notice/component.css +0 -7
  70. package/src/core/Notice/component.js +0 -154
  71. package/src/core/Notice.tsx +0 -102
  72. package/src/core/SignOutLink.tsx +0 -51
  73. package/src/core/Slider/Slider.stories.tsx +0 -98
  74. package/src/core/Slider/component.css +0 -40
  75. package/src/core/Slider/component.js +0 -105
  76. package/src/core/Slider.tsx +0 -224
  77. package/src/core/Table/Table.stories.tsx +0 -12
  78. package/src/core/Table/Table.tsx +0 -58
  79. package/src/core/Table/TableCell.tsx +0 -71
  80. package/src/core/Table/TableRow.tsx +0 -25
  81. package/src/core/Table/data.tsx +0 -133
  82. package/src/core/Table.tsx +0 -15
  83. package/src/core/Tooltip/Tooltip.stories.tsx +0 -27
  84. package/src/core/Tooltip.tsx +0 -88
  85. package/src/core/css.js +0 -3
  86. package/src/core/dom-query.js +0 -5
  87. package/src/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
  88. package/src/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
  89. package/src/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
  90. package/src/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
  91. package/src/core/fonts/NEXT-Book-Light.eot +0 -0
  92. package/src/core/fonts/NEXT-Book-Light.otf +0 -0
  93. package/src/core/fonts/NEXT-Book-Light.woff +0 -0
  94. package/src/core/fonts/NEXT-Book-Light.woff2 +0 -0
  95. package/src/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
  96. package/src/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
  97. package/src/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
  98. package/src/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
  99. package/src/core/fonts/NEXT-Book-Medium.eot +0 -0
  100. package/src/core/fonts/NEXT-Book-Medium.otf +0 -0
  101. package/src/core/fonts/NEXT-Book-Medium.woff +0 -0
  102. package/src/core/fonts/NEXT-Book-Medium.woff2 +0 -0
  103. package/src/core/fonts/jetBrains-mono.css +0 -3
  104. package/src/core/fonts/manrope.css +0 -3
  105. package/src/core/fonts/next.css +0 -63
  106. package/src/core/fonts/source-code-pro.css +0 -3
  107. package/src/core/hubspot-chat-toggle.js +0 -67
  108. package/src/core/icons/discord.svg +0 -10
  109. package/src/core/icons/facebook.svg +0 -4
  110. package/src/core/icons/github.svg +0 -3
  111. package/src/core/icons/glassdoor.svg +0 -3
  112. package/src/core/icons/google.svg +0 -3
  113. package/src/core/icons/icon-display-48hrs.svg +0 -3
  114. package/src/core/icons/icon-display-about-ably-col.svg +0 -4
  115. package/src/core/icons/icon-display-api-keys.svg +0 -3
  116. package/src/core/icons/icon-display-api.svg +0 -3
  117. package/src/core/icons/icon-display-asset-tracking-col.svg +0 -18
  118. package/src/core/icons/icon-display-browser.svg +0 -10
  119. package/src/core/icons/icon-display-calendar.svg +0 -3
  120. package/src/core/icons/icon-display-call-mobile.svg +0 -3
  121. package/src/core/icons/icon-display-careers-col.svg +0 -9
  122. package/src/core/icons/icon-display-case-studies-col.svg +0 -5
  123. package/src/core/icons/icon-display-chat-col.svg +0 -4
  124. package/src/core/icons/icon-display-chat-stack-col.svg +0 -4
  125. package/src/core/icons/icon-display-chat-stack.svg +0 -4
  126. package/src/core/icons/icon-display-cloud-servers.svg +0 -3
  127. package/src/core/icons/icon-display-compare-tech-col.svg +0 -9
  128. package/src/core/icons/icon-display-customers-col.svg +0 -15
  129. package/src/core/icons/icon-display-data-broadcast-col.svg +0 -26
  130. package/src/core/icons/icon-display-data-synchronization-col.svg +0 -14
  131. package/src/core/icons/icon-display-docs-col.svg +0 -7
  132. package/src/core/icons/icon-display-documentation.svg +0 -3
  133. package/src/core/icons/icon-display-events-col.svg +0 -13
  134. package/src/core/icons/icon-display-examples-col.svg +0 -11
  135. package/src/core/icons/icon-display-gdpr.svg +0 -3
  136. package/src/core/icons/icon-display-general-comms.svg +0 -3
  137. package/src/core/icons/icon-display-hipaa.svg +0 -10
  138. package/src/core/icons/icon-display-integrations-col.svg +0 -8
  139. package/src/core/icons/icon-display-it-support-access.svg +0 -3
  140. package/src/core/icons/icon-display-it-support-helpdesk.svg +0 -3
  141. package/src/core/icons/icon-display-kafka-at-the-edge-col.svg +0 -8
  142. package/src/core/icons/icon-display-laptop.svg +0 -10
  143. package/src/core/icons/icon-display-lightbulb-col.svg +0 -10
  144. package/src/core/icons/icon-display-live-chat.svg +0 -3
  145. package/src/core/icons/icon-display-map-pin.svg +0 -3
  146. package/src/core/icons/icon-display-message.svg +0 -3
  147. package/src/core/icons/icon-display-padlock-closed.svg +0 -3
  148. package/src/core/icons/icon-display-platform.svg +0 -22
  149. package/src/core/icons/icon-display-play.svg +0 -3
  150. package/src/core/icons/icon-display-privacy-shield-framework.svg +0 -7
  151. package/src/core/icons/icon-display-push-notifications-col.svg +0 -6
  152. package/src/core/icons/icon-display-quickstart-guides-col.svg +0 -8
  153. package/src/core/icons/icon-display-resources-col.svg +0 -21
  154. package/src/core/icons/icon-display-sdks-col.svg +0 -11
  155. package/src/core/icons/icon-display-servers.svg +0 -3
  156. package/src/core/icons/icon-display-shopping-cart.svg +0 -10
  157. package/src/core/icons/icon-display-sla.svg +0 -3
  158. package/src/core/icons/icon-display-soc2-type2.svg +0 -3
  159. package/src/core/icons/icon-display-tech-account-comms.svg +0 -3
  160. package/src/core/icons/icon-display-tutorials-demos-col.svg +0 -25
  161. package/src/core/icons/icon-display-virtual-events-col.svg +0 -12
  162. package/src/core/icons/icon-display-virtual-events.svg +0 -12
  163. package/src/core/icons/icon-gui-ably-badge.svg +0 -3
  164. package/src/core/icons/icon-gui-arrow-bidirectional-horizontal.svg +0 -3
  165. package/src/core/icons/icon-gui-arrow-bidirectional-vertical.svg +0 -3
  166. package/src/core/icons/icon-gui-arrow-down.svg +0 -3
  167. package/src/core/icons/icon-gui-arrow-left.svg +0 -3
  168. package/src/core/icons/icon-gui-arrow-right.svg +0 -3
  169. package/src/core/icons/icon-gui-arrow-up.svg +0 -3
  170. package/src/core/icons/icon-gui-burger-menu.svg +0 -5
  171. package/src/core/icons/icon-gui-check-circled-fill-black.svg +0 -4
  172. package/src/core/icons/icon-gui-check-circled-fill.svg +0 -4
  173. package/src/core/icons/icon-gui-check-circled.svg +0 -3
  174. package/src/core/icons/icon-gui-checklist-checked.svg +0 -3
  175. package/src/core/icons/icon-gui-clock.svg +0 -3
  176. package/src/core/icons/icon-gui-close.svg +0 -3
  177. package/src/core/icons/icon-gui-copy.svg +0 -10
  178. package/src/core/icons/icon-gui-cross-circled-fill.svg +0 -4
  179. package/src/core/icons/icon-gui-cross-circled.svg +0 -3
  180. package/src/core/icons/icon-gui-dash-circled.svg +0 -3
  181. package/src/core/icons/icon-gui-disclosure-arrow.svg +0 -3
  182. package/src/core/icons/icon-gui-document-generic.svg +0 -3
  183. package/src/core/icons/icon-gui-enlarge.svg +0 -3
  184. package/src/core/icons/icon-gui-external-link.svg +0 -3
  185. package/src/core/icons/icon-gui-filter-flow-step-1.svg +0 -5
  186. package/src/core/icons/icon-gui-filter-flow-step-2.svg +0 -5
  187. package/src/core/icons/icon-gui-filter-flow-step-3.svg +0 -5
  188. package/src/core/icons/icon-gui-history.svg +0 -3
  189. package/src/core/icons/icon-gui-info.svg +0 -3
  190. package/src/core/icons/icon-gui-link-arrow.svg +0 -3
  191. package/src/core/icons/icon-gui-link.svg +0 -4
  192. package/src/core/icons/icon-gui-live-chat.svg +0 -3
  193. package/src/core/icons/icon-gui-minus.svg +0 -3
  194. package/src/core/icons/icon-gui-partial.svg +0 -4
  195. package/src/core/icons/icon-gui-plus.svg +0 -3
  196. package/src/core/icons/icon-gui-quote-marks-solid.svg +0 -3
  197. package/src/core/icons/icon-gui-refresh.svg +0 -10
  198. package/src/core/icons/icon-gui-resources.svg +0 -3
  199. package/src/core/icons/icon-gui-search.svg +0 -3
  200. package/src/core/icons/icon-gui-tick.svg +0 -3
  201. package/src/core/icons/icon-gui-warning.svg +0 -5
  202. package/src/core/icons/icon-live-updates-results-metrics-col.svg +0 -26
  203. package/src/core/icons/icon-multi-user-spaces-col.svg +0 -13
  204. package/src/core/icons/icon-social-x.svg +0 -3
  205. package/src/core/icons/icon-tech-apachekafka.svg +0 -3
  206. package/src/core/icons/linkedin.svg +0 -3
  207. package/src/core/icons/quote.svg +0 -3
  208. package/src/core/icons/stackoverflow.svg +0 -3
  209. package/src/core/icons/twitter.svg +0 -3
  210. package/src/core/icons/youtube.svg +0 -11
  211. package/src/core/icons.js +0 -6
  212. package/src/core/images/ably-logo.png +0 -0
  213. package/src/core/images/ably-logo.svg +0 -15
  214. package/src/core/images/ably-stack.svg +0 -14
  215. package/src/core/images/best-support-2023.svg +0 -1
  216. package/src/core/images/cust-logo-ao-col-pos.png +0 -0
  217. package/src/core/images/cust-logo-ao-col-pos@2x.png +0 -0
  218. package/src/core/images/cust-logo-ausopen-col-pos.png +0 -0
  219. package/src/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
  220. package/src/core/images/cust-logo-ausopen-mono-pos.svg +0 -5
  221. package/src/core/images/cust-logo-bloomberg-mono-pos.svg +0 -11
  222. package/src/core/images/cust-logo-hopin-mono-pos.svg +0 -4
  223. package/src/core/images/cust-logo-hubspot-col-pos.png +0 -0
  224. package/src/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
  225. package/src/core/images/cust-logo-hubspot-mono-pos.svg +0 -4
  226. package/src/core/images/cust-logo-lightspeed-col-pos.png +0 -0
  227. package/src/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
  228. package/src/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
  229. package/src/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
  230. package/src/core/images/cust-logo-mentimeter-mono-pos.svg +0 -17
  231. package/src/core/images/cust-logo-split-col-pos.png +0 -0
  232. package/src/core/images/cust-logo-split-col-pos@2x.png +0 -0
  233. package/src/core/images/cust-logo-split-mono-pos.svg +0 -9
  234. package/src/core/images/cust-logo-toyota-mono-pos.svg +0 -18
  235. package/src/core/images/cust-logo-vitac-col-pos.png +0 -0
  236. package/src/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
  237. package/src/core/images/cust-logo-webflow-col-pos.svg +0 -3
  238. package/src/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
  239. package/src/core/images/cust-photo-split-pato-echague.jpg +0 -0
  240. package/src/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
  241. package/src/core/images/fastest-implementation-2023.svg +0 -1
  242. package/src/core/images/flexible-companies.png +0 -0
  243. package/src/core/images/high-performer-2022.png +0 -0
  244. package/src/core/images/high-performer-2023.svg +0 -1
  245. package/src/core/images/highest-user-adoption-2022.png +0 -0
  246. package/src/core/images/highest-user-adoption-2023.svg +0 -1
  247. package/src/core/images/icon-tech-aws.svg +0 -4
  248. package/src/core/images/rocket-list-2021.png +0 -0
  249. package/src/core/images/scale-motif-open-empathetic.svg +0 -1
  250. package/src/core/images/technical-support-01-800x533.jpg +0 -0
  251. package/src/core/images/users-love-us-2022.png +0 -0
  252. package/src/core/load-sprites.js +0 -11
  253. package/src/core/react-renderer.tsx +0 -29
  254. package/src/core/remote-blogs-posts.js +0 -42
  255. package/src/core/remote-data-store.js +0 -34
  256. package/src/core/remote-data-util.js +0 -4
  257. package/src/core/remote-session-data.js +0 -58
  258. package/src/core/scripts.js +0 -10
  259. package/src/core/styles/buttons.css +0 -124
  260. package/src/core/styles/forms.css +0 -64
  261. package/src/core/styles/layout.css +0 -21
  262. package/src/core/styles/properties.css +0 -278
  263. package/src/core/styles/text.css +0 -168
  264. package/src/core/styles.base.css +0 -1
  265. package/src/core/styles.components.css +0 -43
  266. package/src/core/styles.css +0 -2
  267. package/src/core/url-base.js +0 -7
  268. package/src/core/utils/syntax-highlighter-registry.js +0 -63
  269. package/src/core/utils/syntax-highlighter.css +0 -71
  270. package/src/core/utils/syntax-highlighter.js +0 -103
  271. package/src/pages/Buttons.mdx +0 -121
  272. package/src/pages/Chips.mdx +0 -136
  273. package/src/pages/Colour.mdx +0 -23
  274. package/src/pages/Forms.mdx +0 -173
  275. package/src/pages/Layout.mdx +0 -58
  276. package/src/pages/Typography.mdx +0 -206
  277. package/src/pages/utils.ts +0 -70
  278. package/src/reset/scripts.js +0 -1
  279. package/src/reset/styles/normalize.css +0 -353
  280. package/src/reset/styles/reset.css +0 -139
  281. package/src/reset/styles.css +0 -2
@@ -1,51 +0,0 @@
1
- import React, { MouseEventHandler, ReactNode, useRef } from "react";
2
- import { AbsUrl } from "./Meganav";
3
-
4
- type SignOutLinkProps = {
5
- token: string;
6
- href: string;
7
- text: string;
8
- children: ({
9
- href,
10
- text,
11
- onClick,
12
- }: {
13
- href: string;
14
- text: string;
15
- onClick: MouseEventHandler<HTMLAnchorElement>;
16
- }) => ReactNode;
17
- absUrl: AbsUrl;
18
- };
19
-
20
- const SignOutLink = ({
21
- token,
22
- href,
23
- text,
24
- children,
25
- absUrl,
26
- }: SignOutLinkProps) => {
27
- const formRef = useRef<HTMLFormElement>(null);
28
-
29
- const onClick = (e) => {
30
- formRef.current?.submit();
31
- e.preventDefault();
32
- };
33
-
34
- return (
35
- <>
36
- <form
37
- ref={formRef}
38
- method="post"
39
- action={absUrl(href)}
40
- className="hidden"
41
- >
42
- <input name="_method" value="delete" type="hidden" />
43
- <input name="authenticity_token" value={token} type="hidden" />
44
- </form>
45
-
46
- {children({ href, text, onClick })}
47
- </>
48
- );
49
- };
50
-
51
- export default SignOutLink;
@@ -1,98 +0,0 @@
1
- import React from "react";
2
- import Slider from "../Slider";
3
- import Icon from "../Icon";
4
-
5
- const Slide = ({ name }: { name: string }) => (
6
- <div className="relative ">
7
- <div className="relative w-full sm:w-[560px] md:w-[784px] lg:w-[960px] bg-white overflow-hidden flex gap-40 rounded-3xl shadow-container-subtle">
8
- <div className="w-full md:w-2/3 flex flex-col gap-24 pr-40 md:pr-0 pt-40 pl-40 pb-40 sm:pb-[120px] md:pb-40">
9
- <h2 className="ui-text-h2 font-medium text-neutral-1000">
10
- “Ably seamlessly absorbs sudden bursts in load during unexpected
11
- client events. The integration was easy and we were live in under a
12
- month.”
13
- </h2>
14
- <div className="flex flex-col sm:flex-row gap-32">
15
- <div className="flex gap-8">
16
- <div className="static self-center sm:absolute sm:-bottom-48 sm:-right-[56px] rounded-full bg-gradient-to-l from-neutral-200 to-50% to-neutral-500 w-[48px] h-[48px] sm:w-[201px] sm:h-[201px] md:w-[257px] md:h-[257px] lg:w-[280px] lg:h-[280px] overflow-hidden flex items-center justify-center sm:border-[16px] border-neutral-200">
17
- <img src="https://picsum.photos/id/64/200" alt="test-image" />
18
- </div>
19
- <div className="sm:py-16">
20
- <p className="ui-text-p1 text-neutral-1300">{name}</p>
21
- <p className="ui-text-p3 text-neutral-800">
22
- Co-Founder & Technical Leader
23
- </p>
24
- </div>
25
- </div>
26
-
27
- <div className="w-[80px] h-1 sm:w-1 sm:h-full bg-neutral-500"></div>
28
- <div className="flex items-center gap-4">
29
- <img src="https://picsum.photos/id/145/40" alt="test-image" />
30
- <p className="ui-text-h4 font-bold">Mentimeter</p>
31
- </div>
32
- </div>
33
- <a href="/case-study" className="ui-btn self-start">
34
- Read case study
35
- <Icon
36
- name="icon-gui-arrow-right"
37
- size="1.25rem"
38
- additionalCSS="ml-4"
39
- />
40
- </a>
41
- </div>
42
- </div>
43
-
44
- <div className="absolute h-256 -z-10 -bottom-48 -left-36 w-1/5 rounded-full blur-xl opacity-50 transform -rotate-45 bg-gradient-to-bl from-bg-glow-green to-bg-glow-teal"></div>
45
- <div className="absolute h-256 -z-10 -top-48 -right-48 w-3/5 rounded-full blur-xl opacity-50 transform rotate-12 bg-gradient-to-br from-bg-glow-green to-bg-glow-teal"></div>
46
- </div>
47
- );
48
-
49
- const slides = [
50
- <Slide key="1" name={"Johan Bengtsson"} />,
51
- <Slide key="2" name={"Mirko Bergman"} />,
52
- <Slide key="3" name={"Stefania Lombardo"} />,
53
- <Slide key="4" name={"Aleksandar Kostadinov"} />,
54
- ];
55
-
56
- export default {
57
- title: "Components/Slider",
58
- component: Slider,
59
- args: {
60
- children: slides,
61
- options: {
62
- interval: 10000,
63
- intervalIndicator: true,
64
- controlPosition: "floating",
65
- },
66
- },
67
- };
68
-
69
- export const FloatingControlPosition = {
70
- args: {
71
- children: slides,
72
- options: {
73
- interval: 10000,
74
- intervalIndicator: true,
75
- controlPosition: "floating",
76
- },
77
- },
78
- };
79
-
80
- export const InlineControlPosition = {
81
- args: {
82
- options: {
83
- interval: 10000,
84
- intervalIndicator: true,
85
- controlPosition: "inline",
86
- },
87
- },
88
- };
89
-
90
- export const WithoutIntervalIndicator = {
91
- args: {
92
- options: {
93
- interval: 10000,
94
- intervalIndicator: false,
95
- controlPosition: "floating",
96
- },
97
- },
98
- };
@@ -1,40 +0,0 @@
1
- @layer components {
2
- .ui-slider-marker {
3
- font-size: 0.5rem;
4
- top: -1px;
5
-
6
- @apply leading-none px-4 relative;
7
- }
8
-
9
- @keyframes fillAnimation {
10
- 0% {
11
- width: 0%;
12
- }
13
- 100% {
14
- width: 100%;
15
- }
16
- }
17
-
18
- .ui-icon-cta {
19
- @apply cursor-pointer overflow-hidden;
20
- @apply rounded border-2 border-mid-grey hover:border-active-orange;
21
- transition: all 0.4s;
22
- }
23
-
24
- @screen sm {
25
- .ui-icon-cta-left:hover .ui-icon-cta-holder {
26
- transform: translateX(-100%);
27
- }
28
- .ui-icon-cta-right .ui-icon-cta-holder {
29
- transform: translateX(-100%);
30
- }
31
- .ui-icon-cta-right:hover .ui-icon-cta-holder {
32
- transform: translateX(0%);
33
- }
34
- }
35
-
36
- .ui-icon-cta-holder {
37
- @apply w-full h-full;
38
- transition: all 0.4s;
39
- }
40
- }
@@ -1,105 +0,0 @@
1
- import throttle from "lodash.throttle";
2
-
3
- import { queryId, queryIdAll } from "../dom-query";
4
-
5
- const mdBreakpoint = () => window.matchMedia("(min-width: 48rem)").matches;
6
- const DRAG_BUFFER = 20;
7
-
8
- const init = (slidesContainer) => {
9
- const transformContainer = queryId("slider-strip", slidesContainer);
10
- const slides = Array.from(queryIdAll("slider-slide", slidesContainer));
11
- const slideLeftChevron = queryId("slider-previous", slidesContainer);
12
- const slideRightChevron = queryId("slider-next", slidesContainer);
13
- const slideMarkers = Array.from(queryIdAll("slider-marker", slidesContainer));
14
- const sliderControls = queryId("slider-controls", slidesContainer);
15
-
16
- sliderControls.classList.replace("hidden", "flex");
17
- const slidesLength = slides.length;
18
-
19
- const slidesWidth = slidesContainer.getBoundingClientRect().width;
20
- const { width: slideWidth, left: slideLeftDistance } =
21
- slides[0].getBoundingClientRect();
22
- const { left: slideLeftDistanceSecond } = slides[1].getBoundingClientRect();
23
- const slideGap = slideLeftDistanceSecond - slideLeftDistance - slideWidth;
24
- const adjustment = (slidesWidth - slideWidth) / 2;
25
-
26
- let currentIndex = 0;
27
- let touchStartX = 0;
28
-
29
- const calculateTransform = (index) =>
30
- index * -slideWidth + adjustment + index * -slideGap;
31
-
32
- const updateSlide = (index) =>
33
- (transformContainer.style.transform = `translateX(${calculateTransform(
34
- index,
35
- )}px)`);
36
-
37
- const updateMarkers = (index) => {
38
- slideMarkers.forEach((marker) =>
39
- marker.classList.remove("text-active-orange"),
40
- );
41
- slideMarkers[index].classList.remove("text-cool-black");
42
- slideMarkers[index].classList.add("text-active-orange");
43
- };
44
-
45
- const slideLeft = () => {
46
- currentIndex = currentIndex - 1 <= 0 ? 0 : currentIndex - 1;
47
- updateSlide(currentIndex);
48
- updateMarkers(currentIndex);
49
- };
50
-
51
- const slideRight = () => {
52
- currentIndex =
53
- currentIndex + 1 >= slidesLength ? currentIndex : currentIndex + 1;
54
- updateSlide(currentIndex);
55
- updateMarkers(currentIndex);
56
- };
57
-
58
- updateSlide(0);
59
- updateMarkers(0);
60
-
61
- slideLeftChevron.addEventListener("click", slideLeft);
62
-
63
- transformContainer.addEventListener("touchstart", (e) => {
64
- touchStartX = e.touches[0]?.clientX;
65
- });
66
-
67
- transformContainer.addEventListener("touchend", (e) => {
68
- const distance = e.changedTouches[0]?.clientX - touchStartX;
69
-
70
- // Prevent sliding on clicks
71
- if (Math.abs(distance) < DRAG_BUFFER) return;
72
-
73
- const direction = distance > 0 ? slideLeft : slideRight;
74
- direction();
75
- });
76
-
77
- slideRightChevron.addEventListener("click", slideRight);
78
-
79
- return () => {
80
- transformContainer.style.transform = null;
81
- sliderControls.classList.replace("flex", "hidden");
82
- };
83
- };
84
-
85
- const Slider = ({ container, mqEnableThreshold }) => {
86
- if (!container) return;
87
-
88
- const breakpointCheck = mqEnableThreshold || (() => !mdBreakpoint());
89
-
90
- let unmount = () => {};
91
- if (breakpointCheck()) unmount = init(container);
92
-
93
- window.addEventListener(
94
- "resize",
95
- throttle(() => {
96
- if (breakpointCheck()) {
97
- unmount = init(container);
98
- } else {
99
- unmount();
100
- }
101
- }, 100),
102
- );
103
- };
104
-
105
- export default Slider;
@@ -1,224 +0,0 @@
1
- import React, { useState, useEffect, useRef, ReactNode } from "react";
2
- import Icon from "./Icon";
3
-
4
- interface SliderProps {
5
- children: ReactNode[];
6
- options?: {
7
- interval?: number;
8
- controlPosition?: "inline" | "floating";
9
- intervalIndicator?: boolean;
10
- };
11
- }
12
-
13
- interface SliderIndicatorProps {
14
- numSlides: number;
15
- activeIndex: number;
16
- interval: number;
17
- intervalIndicator?: boolean;
18
- isInline?: boolean;
19
- }
20
-
21
- const SLIDE_TRANSITION_LENGTH = 300;
22
-
23
- const SlideIndicator = ({
24
- numSlides,
25
- activeIndex,
26
- interval,
27
- intervalIndicator,
28
- isInline,
29
- }: SliderIndicatorProps) => {
30
- return (
31
- <ul
32
- className={`flex gap-4 left-1/2 ${
33
- isInline ? "bottom-0" : "absolute bottom-0 transform -translate-x-1/2"
34
- }`}
35
- >
36
- {Array.from({ length: numSlides }, (_, i) =>
37
- intervalIndicator ? (
38
- <li
39
- key={i}
40
- className="relative w-40 h-4 mx-1 rounded-full bg-neutral-500"
41
- >
42
- {i === activeIndex && (
43
- <span
44
- className="absolute inset-0 rounded-full bg-active-orange"
45
- style={{
46
- animation: `fillAnimation ${interval}ms linear`,
47
- }}
48
- ></span>
49
- )}
50
- </li>
51
- ) : (
52
- <li key={i}>
53
- <span
54
- className={`ui-slider-marker ${
55
- i === activeIndex ? "text-active-orange" : "text-cool-black"
56
- }`}
57
- data-id="slider-marker"
58
- >
59
- &#x2b24;
60
- </span>
61
- </li>
62
- ),
63
- )}
64
- </ul>
65
- );
66
- };
67
-
68
- const setupSlides = (children: ReactNode[], activeIndex: number) => [
69
- children[activeIndex === 0 ? children.length - 1 : activeIndex - 1],
70
- children[activeIndex],
71
- children[activeIndex === children.length - 1 ? 0 : activeIndex + 1],
72
- ];
73
-
74
- const Slider = ({ children, options }: SliderProps) => {
75
- const [activeIndex, setActiveIndex] = useState(0);
76
- const [touchStartX, setTouchStartX] = useState(0);
77
- const [touchEndX, setTouchEndX] = useState(0);
78
- const [slides, setSlides] = useState<ReactNode[]>(
79
- setupSlides(children, activeIndex),
80
- );
81
- const [translationCoefficient, setTranslationCoefficient] = useState(0);
82
- const timerRef = useRef<NodeJS.Timeout | null>(null);
83
- const [slideLock, setSlideLock] = useState(false);
84
-
85
- const isInline = options?.controlPosition === "inline";
86
-
87
- const next = () => {
88
- if (!slideLock) {
89
- setActiveIndex((prevIndex) => (prevIndex + 1) % children.length);
90
- setTranslationCoefficient(1);
91
- resetInterval();
92
- setSlideLock(true);
93
- }
94
- };
95
-
96
- const prev = () => {
97
- if (!slideLock) {
98
- setActiveIndex((prevIndex) =>
99
- prevIndex > 0 ? prevIndex - 1 : children.length - 1,
100
- );
101
- setTranslationCoefficient(-1);
102
- resetInterval();
103
- setSlideLock(true);
104
- }
105
- };
106
-
107
- const resetInterval = () => {
108
- if (timerRef.current) clearInterval(timerRef.current);
109
- timerRef.current = setInterval(next, options?.interval ?? 10000);
110
- };
111
-
112
- const handleTouchStart = (e) => {
113
- setTouchStartX(e.touches[0].clientX);
114
- };
115
-
116
- const handleTouchMove = (e) => {
117
- setTouchEndX(e.touches[0].clientX);
118
- };
119
-
120
- const handleTouchEnd = () => {
121
- if (touchStartX - touchEndX > 50) {
122
- next();
123
- }
124
- if (touchStartX - touchEndX < -50) {
125
- prev();
126
- }
127
- };
128
-
129
- useEffect(() => {
130
- resetInterval();
131
- return () => {
132
- if (timerRef.current) clearInterval(timerRef.current);
133
- };
134
- }, [children.length, options?.interval]);
135
-
136
- useEffect(() => {
137
- setTimeout(() => {
138
- setSlides(setupSlides(children, activeIndex));
139
- setTranslationCoefficient(0);
140
- setSlideLock(false);
141
- }, SLIDE_TRANSITION_LENGTH);
142
- }, [activeIndex]);
143
-
144
- return (
145
- <div
146
- className="relative"
147
- onTouchStart={handleTouchStart}
148
- onTouchMove={handleTouchMove}
149
- onTouchEnd={handleTouchEnd}
150
- >
151
- <div className="overflow-y-visible overflow-x-clip w-full py-40">
152
- <div
153
- className={`flex items-center ${
154
- translationCoefficient !== 0
155
- ? `transition-transform ease-in-out duration-${SLIDE_TRANSITION_LENGTH}`
156
- : ""
157
- } `}
158
- style={{
159
- transform: `translateX(-${(translationCoefficient + 1) * 100}%)`,
160
- }}
161
- >
162
- {slides.map((child, index) => (
163
- <div
164
- key={index}
165
- className="w-full flex-shrink-0 flex justify-center sm:px-60"
166
- >
167
- {child}
168
- </div>
169
- ))}
170
- </div>
171
- </div>
172
-
173
- <div
174
- className={`flex items-center pointer-events-none ${
175
- isInline
176
- ? "ui-standard-container justify-center gap-24 -mt-16"
177
- : "sm:flex sm:absolute inset-0 justify-between"
178
- }`}
179
- >
180
- <button
181
- className={`${
182
- isInline ? "w-32 h-32" : "hidden sm:flex w-48 h-48"
183
- } pointer-events-auto rounded border border-mid-grey hover:border-active-orange flex justify-center items-center ui-icon-cta ui-icon-cta-left`}
184
- onClick={prev}
185
- >
186
- <div className="ui-icon-cta-holder flex w-48">
187
- <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
188
- <Icon name="icon-gui-arrow-left" size="1.5rem" />
189
- </div>
190
- <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
191
- <Icon name="icon-gui-arrow-left" size="1.5rem" />
192
- </div>
193
- </div>
194
- </button>
195
-
196
- <SlideIndicator
197
- numSlides={children.length}
198
- activeIndex={activeIndex}
199
- interval={options?.interval ?? 10000}
200
- intervalIndicator={options?.intervalIndicator}
201
- isInline={isInline}
202
- />
203
-
204
- <button
205
- className={`${
206
- isInline ? "w-32 h-32" : "hidden sm:flex w-48 h-48"
207
- } pointer-events-auto rounded border border-mid-grey hover:border-active-orange justify-center items-center ui-icon-cta ui-icon-cta-right`}
208
- onClick={next}
209
- >
210
- <div className="ui-icon-cta-holder flex w-48">
211
- <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
212
- <Icon name="icon-gui-arrow-right" size="1.5rem" />
213
- </div>
214
- <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
215
- <Icon name="icon-gui-arrow-right" size="1.5rem" />
216
- </div>
217
- </div>
218
- </button>
219
- </div>
220
- </div>
221
- );
222
- };
223
-
224
- export default Slider;
@@ -1,12 +0,0 @@
1
- import { PricingPageTable } from "./data";
2
-
3
- export default {
4
- title: "Components/Table",
5
- component: PricingPageTable,
6
- tags: ["autodocs"],
7
- parameters: {
8
- layout: "fullscreen",
9
- },
10
- };
11
-
12
- export const PricingPage = {};
@@ -1,58 +0,0 @@
1
- import React, {
2
- PropsWithChildren,
3
- ReactElement,
4
- TableHTMLAttributes,
5
- cloneElement,
6
- } from "react";
7
-
8
- type TableProps = {
9
- id?: string;
10
- };
11
-
12
- export const Table = ({
13
- id,
14
- children,
15
- ...rest
16
- }: PropsWithChildren<TableProps & TableHTMLAttributes<HTMLTableElement>>) => (
17
- <table
18
- id={id}
19
- {...rest}
20
- className={`ui-standard-container mb-4 sm:table-fixed ${
21
- rest?.className ?? ""
22
- }`}
23
- >
24
- {children}
25
- </table>
26
- );
27
-
28
- export const TableBody = ({
29
- children,
30
- ...rest
31
- }: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (
32
- <tbody {...rest}>{children}</tbody>
33
- );
34
-
35
- export const TableHeader = ({
36
- children,
37
- ...rest
38
- }: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (
39
- <thead
40
- {...rest}
41
- className={`sticky bg-white z-10 top-0 ${rest?.className ?? ""}`}
42
- >
43
- {cloneElement(children as ReactElement, { isHeader: true })}
44
- </thead>
45
- );
46
-
47
- export const TableRowHeader = ({
48
- children,
49
- ...rest
50
- }: PropsWithChildren<TableHTMLAttributes<HTMLTableRowElement>>) => (
51
- <tr
52
- className={`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${
53
- rest?.className ?? ""
54
- }`}
55
- >
56
- {cloneElement(children as ReactElement, { isRowHeader: true })}
57
- </tr>
58
- );
@@ -1,71 +0,0 @@
1
- import React, { PropsWithChildren } from "react";
2
-
3
- type TableCellProps = {
4
- isRowHeader?: boolean;
5
- } & React.TdHTMLAttributes<HTMLTableCellElement>;
6
-
7
- const LabelCell = ({
8
- children,
9
- ...rest
10
- }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => {
11
- const classes = `
12
- ui-text-p1 font-bold pt-24 pb-8 border-light-grey sm:p-24 sm:relative sm:top-2 flex sm:table-cell ${
13
- rest?.className ?? ""
14
- }
15
- `;
16
-
17
- return (
18
- <td {...rest} className={classes}>
19
- {children}
20
- </td>
21
- );
22
- };
23
-
24
- const TableCell = ({
25
- children,
26
- isRowHeader,
27
- ...rest
28
- }: PropsWithChildren<TableCellProps>) => (
29
- <td
30
- {...rest}
31
- className={`
32
- border-light-grey sm:p-24 leading-none flex sm:table-cell
33
- ${
34
- isRowHeader
35
- ? "rounded-l-none rounded-r sm:rounded-lg py-20 px-24"
36
- : "py-6"
37
- }
38
- ${rest?.className ?? ""}
39
- `}
40
- >
41
- {children}
42
- </td>
43
- );
44
-
45
- const HeaderCell = ({
46
- children,
47
- ...rest
48
- }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (
49
- <td
50
- {...rest}
51
- className={`ui-text-h3 px-24 py-24 hidden sm:table-cell ${
52
- rest?.className ?? ""
53
- }`}
54
- >
55
- {children}
56
- </td>
57
- );
58
-
59
- const CtaCell = ({
60
- children,
61
- ...rest
62
- }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (
63
- <td
64
- {...rest}
65
- className={`pt-24 hidden sm:table-cell ${rest?.className ?? ""}`}
66
- >
67
- {children}
68
- </td>
69
- );
70
-
71
- export { TableCell, LabelCell, HeaderCell, CtaCell };
@@ -1,25 +0,0 @@
1
- import React, { PropsWithChildren } from "react";
2
-
3
- const CtaRow = ({ children }: PropsWithChildren) => (
4
- <tr>
5
- <td className="hidden sm:block"></td>
6
- {children}
7
- </tr>
8
- );
9
-
10
- type RowProps = {
11
- isHeader?: boolean;
12
- } & React.HTMLAttributes<HTMLTableRowElement>;
13
-
14
- const TableRow = ({
15
- children,
16
- isHeader,
17
- ...rest
18
- }: PropsWithChildren<RowProps>) => (
19
- <tr {...rest}>
20
- {isHeader && <td className="bg-white" />}
21
- {children}
22
- </tr>
23
- );
24
-
25
- export { TableRow, CtaRow };