@ably/ui 14.0.0-dev.968e4a2 → 14.0.0-dev.ae75f49

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 (192) hide show
  1. package/README.md +8 -10
  2. package/core/.DS_Store +0 -0
  3. package/core/Accordion.js +1 -1
  4. package/core/Code.js +1 -1
  5. package/core/ConnectStateWrapper.js +1 -1
  6. package/core/ContactFooter/component.css +9 -7
  7. package/core/ContactFooter.js +1 -1
  8. package/core/CookieMessage/component.css +12 -10
  9. package/core/CookieMessage.js +1 -1
  10. package/core/DropdownMenu.js +1 -1
  11. package/core/Expander.js +1 -0
  12. package/core/FeaturedLink.js +1 -1
  13. package/core/Flash/component.css +21 -19
  14. package/core/Flash.js +1 -1
  15. package/core/Footer/component.css +24 -22
  16. package/core/Footer.js +1 -1
  17. package/core/Meganav/component.css +105 -103
  18. package/core/Meganav/component.js +1 -1
  19. package/core/Meganav.js +1 -1
  20. package/core/MeganavBlogPostsList.js +1 -1
  21. package/core/MeganavContentCompany.js +1 -1
  22. package/core/MeganavContentDevelopers.js +1 -1
  23. package/core/MeganavContentProducts.js +1 -1
  24. package/core/MeganavContentUseCases.js +1 -1
  25. package/core/MeganavControl.js +1 -1
  26. package/core/MeganavControlMobileDropdown.js +1 -1
  27. package/core/MeganavControlMobilePanelClose.js +1 -1
  28. package/core/MeganavControlMobilePanelOpen.js +1 -1
  29. package/core/MeganavItemsDesktop.js +1 -1
  30. package/core/MeganavItemsMobile.js +1 -1
  31. package/core/MeganavItemsSignedIn.js +1 -1
  32. package/core/MeganavSearch.js +1 -1
  33. package/core/MeganavSearchPanel.js +1 -1
  34. package/core/MeganavSearchSuggestions.js +1 -1
  35. package/core/Notice/component.css +6 -4
  36. package/core/Notice/component.js +1 -1
  37. package/core/Notice.js +1 -1
  38. package/core/Slider/component.css +38 -4
  39. package/core/Slider/component.js +1 -1
  40. package/core/Slider.js +1 -1
  41. package/core/Table/Table.js +1 -1
  42. package/core/Table/TableCell.js +4 -4
  43. package/core/Table/data.js +1 -1
  44. package/core/Table.js +1 -1
  45. package/core/Tooltip.js +1 -1
  46. package/core/icons/icon-gui-partial.svg +4 -0
  47. package/core/scripts.js +1 -1
  48. package/core/sprites.svg +1 -1
  49. package/core/styles/buttons.css +123 -121
  50. package/core/styles/forms.css +51 -49
  51. package/core/styles/layout.css +16 -14
  52. package/core/styles/properties.css +252 -250
  53. package/core/styles/text.css +167 -165
  54. package/core/styles.components.css +24 -22
  55. package/core/utils/syntax-highlighter.css +59 -55
  56. package/package.json +2 -5
  57. package/src/.DS_Store +0 -0
  58. package/src/core/.DS_Store +0 -0
  59. package/src/core/Accordion/Accordion.stories.tsx +1 -1
  60. package/src/core/Accordion.tsx +8 -6
  61. package/src/core/Code/Code.stories.tsx +1 -1
  62. package/src/core/Code.tsx +2 -3
  63. package/src/core/ConnectStateWrapper.tsx +1 -1
  64. package/src/core/ContactFooter/ContactFooter.stories.tsx +1 -1
  65. package/src/core/ContactFooter/component.css +9 -7
  66. package/src/core/ContactFooter.tsx +3 -4
  67. package/src/core/CookieMessage/CookieMessage.stories.tsx +1 -1
  68. package/src/core/CookieMessage/component.css +12 -10
  69. package/src/core/CookieMessage.tsx +1 -2
  70. package/src/core/CustomerLogos/CustomerLogos.stories.tsx +1 -1
  71. package/src/core/DropdownMenu/DropdownMenu.stories.tsx +2 -2
  72. package/src/core/DropdownMenu.tsx +1 -1
  73. package/src/core/Expander/Expander.stories.tsx +132 -0
  74. package/src/core/Expander.tsx +63 -0
  75. package/src/core/FeaturedLink/FeaturedLink.stories.tsx +1 -1
  76. package/src/core/FeaturedLink.tsx +1 -1
  77. package/src/core/Flash/Flash.stories.tsx +1 -1
  78. package/src/core/Flash/component.css +21 -19
  79. package/src/core/Flash.tsx +3 -4
  80. package/src/core/Footer/Footer.stories.tsx +1 -1
  81. package/src/core/Footer/component.css +24 -22
  82. package/src/core/Footer.tsx +2 -3
  83. package/src/core/Icon/Icon.stories.tsx +2 -1
  84. package/src/core/Loader/Loader.stories.tsx +1 -1
  85. package/src/core/Logo/Logo.stories.tsx +1 -1
  86. package/src/core/Meganav/Meganav.stories.tsx +1 -1
  87. package/src/core/Meganav/component.css +105 -103
  88. package/src/core/Meganav/component.js +0 -2
  89. package/src/core/Meganav.tsx +16 -19
  90. package/src/core/MeganavBlogPostsList.tsx +2 -2
  91. package/src/core/MeganavContentCompany.tsx +5 -5
  92. package/src/core/MeganavContentDevelopers.tsx +2 -2
  93. package/src/core/MeganavContentProducts.tsx +2 -2
  94. package/src/core/MeganavContentUseCases.tsx +2 -2
  95. package/src/core/MeganavControl.tsx +2 -2
  96. package/src/core/MeganavControlMobileDropdown.tsx +2 -2
  97. package/src/core/MeganavControlMobilePanelClose.tsx +1 -2
  98. package/src/core/MeganavControlMobilePanelOpen.tsx +1 -2
  99. package/src/core/MeganavItemsDesktop.tsx +3 -3
  100. package/src/core/MeganavItemsMobile.tsx +9 -9
  101. package/src/core/MeganavItemsSignedIn.tsx +4 -8
  102. package/src/core/MeganavSearch.tsx +3 -3
  103. package/src/core/MeganavSearchPanel.tsx +4 -4
  104. package/src/core/MeganavSearchSuggestions.tsx +2 -2
  105. package/src/core/Notice/component.css +6 -4
  106. package/src/core/Notice/component.js +1 -2
  107. package/src/core/Notice.tsx +2 -4
  108. package/src/core/SignOutLink.tsx +1 -1
  109. package/src/core/Slider/Slider.stories.tsx +83 -30
  110. package/src/core/Slider/component.css +38 -4
  111. package/src/core/Slider/component.js +0 -2
  112. package/src/core/Slider.tsx +187 -83
  113. package/src/core/Table/Table.tsx +38 -10
  114. package/src/core/Table/TableCell.tsx +14 -27
  115. package/src/core/Table/data.tsx +23 -3
  116. package/src/core/Table.tsx +3 -12
  117. package/src/core/Tooltip/Tooltip.stories.tsx +1 -1
  118. package/src/core/Tooltip.tsx +34 -6
  119. package/src/core/icons/icon-gui-partial.svg +4 -0
  120. package/src/core/scripts.js +0 -2
  121. package/src/core/styles/buttons.css +123 -121
  122. package/src/core/styles/forms.css +51 -49
  123. package/src/core/styles/layout.css +16 -14
  124. package/src/core/styles/properties.css +252 -250
  125. package/src/core/styles/text.css +167 -165
  126. package/src/core/styles.components.css +24 -22
  127. package/src/core/utils/syntax-highlighter.css +59 -55
  128. package/src/pages/Buttons.mdx +1 -1
  129. package/src/pages/Chips.mdx +1 -1
  130. package/src/pages/Forms.mdx +2 -2
  131. package/core/Accordion/component.js +0 -0
  132. package/core/ConnectStateWrapper/component.js +0 -0
  133. package/core/CookieMessage/component.js +0 -1
  134. package/core/CustomerLogos/component.js +0 -0
  135. package/core/DropdownMenu/component.js +0 -0
  136. package/core/FeaturedLink/component.js +0 -0
  137. package/core/Flash/component.js +0 -1
  138. package/core/Footer/component.js +0 -1
  139. package/core/Icon/component.js +0 -0
  140. package/core/Loader/component.js +0 -0
  141. package/core/Logo/component.js +0 -0
  142. package/core/MeganavContentCompany/component.js +0 -0
  143. package/core/MeganavContentDevelopers/component.js +0 -0
  144. package/core/MeganavContentProducts/.DS_Store +0 -0
  145. package/core/MeganavContentProducts/component.js +0 -0
  146. package/core/MeganavContentUseCases/.DS_Store +0 -0
  147. package/core/MeganavContentUseCases/component.js +0 -0
  148. package/core/MeganavItemsDesktop/.DS_Store +0 -0
  149. package/core/MeganavItemsDesktop/component.js +0 -0
  150. package/core/MeganavItemsMobile/.DS_Store +0 -0
  151. package/core/MeganavItemsMobile/component.js +0 -0
  152. package/core/MeganavItemsSignedIn/.DS_Store +0 -0
  153. package/core/MeganavItemsSignedIn/component.js +0 -0
  154. package/core/MeganavSearch/.DS_Store +0 -0
  155. package/core/MeganavSearch/component.js +0 -0
  156. package/core/MeganavSearchPanel/.DS_Store +0 -0
  157. package/core/MeganavSearchPanel/component.js +0 -0
  158. package/core/SignOutLink/.DS_Store +0 -0
  159. package/core/SignOutLink/component.js +0 -0
  160. package/src/core/Accordion/component.js +0 -0
  161. package/src/core/ConnectStateWrapper/component.js +0 -0
  162. package/src/core/CookieMessage/component.js +0 -1
  163. package/src/core/CustomerLogos/component.js +0 -0
  164. package/src/core/DropdownMenu/component.js +0 -0
  165. package/src/core/FeaturedLink/component.js +0 -0
  166. package/src/core/Flash/component.js +0 -1
  167. package/src/core/Footer/component.js +0 -1
  168. package/src/core/Icon/component.js +0 -0
  169. package/src/core/Loader/component.js +0 -0
  170. package/src/core/Logo/component.js +0 -0
  171. package/src/core/MeganavContentCompany/.DS_Store +0 -0
  172. package/src/core/MeganavContentCompany/component.js +0 -0
  173. package/src/core/MeganavContentDevelopers/.DS_Store +0 -0
  174. package/src/core/MeganavContentDevelopers/component.js +0 -0
  175. package/src/core/MeganavContentProducts/.DS_Store +0 -0
  176. package/src/core/MeganavContentProducts/component.js +0 -0
  177. package/src/core/MeganavContentUseCases/.DS_Store +0 -0
  178. package/src/core/MeganavContentUseCases/component.js +0 -1
  179. package/src/core/MeganavItemsDesktop/.DS_Store +0 -0
  180. package/src/core/MeganavItemsDesktop/component.js +0 -0
  181. package/src/core/MeganavItemsMobile/.DS_Store +0 -0
  182. package/src/core/MeganavItemsMobile/component.js +0 -0
  183. package/src/core/MeganavItemsSignedIn/.DS_Store +0 -0
  184. package/src/core/MeganavItemsSignedIn/component.js +0 -0
  185. package/src/core/MeganavSearch/.DS_Store +0 -0
  186. package/src/core/MeganavSearch/component.js +0 -0
  187. package/src/core/MeganavSearchPanel/.DS_Store +0 -0
  188. package/src/core/MeganavSearchPanel/component.js +0 -0
  189. package/src/core/SignOutLink/.DS_Store +0 -0
  190. package/src/core/SignOutLink/component.js +0 -0
  191. /package/core/{MeganavContentCompany → Tooltip}/.DS_Store +0 -0
  192. /package/{core/MeganavContentDevelopers → src/core/Tooltip}/.DS_Store +0 -0
@@ -1,45 +1,98 @@
1
- import React, { ReactNode } from "react";
2
- import Slider from "./component.tsx";
1
+ import React from "react";
2
+ import Slider from "../Slider";
3
+ import Icon from "../Icon";
3
4
 
4
- export default {
5
- title: "Components/Slider",
6
- component: Slider,
7
- parameters: {
8
- layout: "fullscreen",
9
- },
10
- tags: ["autodocs"],
11
- };
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>
12
26
 
13
- const Slide = ({ children }: { children: ReactNode }) => (
14
- <div className="h-full p-24 bg-white rounded">
15
- <p className="ui-text-p2 text-center">{children}</p>
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>
16
46
  </div>
17
47
  );
18
48
 
19
49
  const slides = [
20
- <Slide key="1">
21
- Powers live chat, updates, analytics, and composition for millions of users.
22
- </Slide>,
23
- <Slide key="2">
24
- Powers virtual venues for millions of event attendees around the world.
25
- </Slide>,
26
- <Slide key="3">
27
- Provides 5 million daily users with live financial commentary and stock
28
- tickers.
29
- </Slide>,
30
- <Slide key="4">Monitors live car performance data across the USA.</Slide>,
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"} />,
31
54
  ];
32
55
 
33
- export const SliderOnAllBreakpoints = {
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 = {
34
81
  args: {
35
- slides,
82
+ options: {
83
+ interval: 10000,
84
+ intervalIndicator: true,
85
+ controlPosition: "inline",
86
+ },
36
87
  },
37
88
  };
38
89
 
39
- export const SliderOnSmallBreakpointOnly = {
90
+ export const WithoutIntervalIndicator = {
40
91
  args: {
41
- slides,
42
- classes: `sm:grid-cols-${slides.length / 2} md:grid-cols-${slides.length}`,
43
- mqEnableThreshold: () => !window.matchMedia("(min-width: 48rem)").matches,
92
+ options: {
93
+ interval: 10000,
94
+ intervalIndicator: false,
95
+ controlPosition: "floating",
96
+ },
44
97
  },
45
98
  };
@@ -1,6 +1,40 @@
1
- .ui-slider-marker {
2
- font-size: 0.5rem;
3
- top: -1px;
1
+ @layer components {
2
+ .ui-slider-marker {
3
+ font-size: 0.5rem;
4
+ top: -1px;
4
5
 
5
- @apply leading-none px-4 relative;
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(-120%);
27
+ }
28
+ .ui-icon-cta-right .ui-icon-cta-holder {
29
+ transform: translateX(-120%);
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
+ }
6
40
  }
@@ -1,5 +1,3 @@
1
- import "./component.css";
2
-
3
1
  import throttle from "lodash.throttle";
4
2
 
5
3
  import { queryId, queryIdAll } from "../dom-query";
@@ -1,108 +1,212 @@
1
- import React, { CSSProperties, ReactNode, useEffect, useRef } from "react";
1
+ import React, { useState, useEffect, useRef, ReactNode } from "react";
2
+ import Icon from "./Icon";
2
3
 
3
- import Icon from "../Icon/component.tsx";
4
- import SliderScripts from "./component.js";
5
- import "./component.css";
4
+ interface SliderProps {
5
+ children: ReactNode[];
6
+ options?: {
7
+ interval?: number;
8
+ controlPosition?: "inline" | "floating";
9
+ intervalIndicator?: boolean;
10
+ };
11
+ }
6
12
 
7
- type SliderProps = {
8
- slides?: ReactNode[];
9
- classes?: string;
10
- slideClasses?: string;
11
- slideMinWidth?: string;
12
- slideMaxWidth?: string;
13
- mqEnableThreshold?: () => boolean;
13
+ interface SliderIndicatorProps {
14
+ numSlides: number;
15
+ activeIndex: number;
16
+ interval: number;
17
+ intervalIndicator?: boolean;
18
+ isInline?: boolean;
19
+ }
14
20
 
15
- container?: HTMLDivElement | null;
21
+ const SLIDE_TRANSITION_LENGTH = 500;
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
+ );
16
66
  };
17
67
 
18
- const Slider = ({
19
- slides = [],
20
- classes = "",
21
- slideClasses = "",
22
- slideMinWidth = "16.875rem",
23
- slideMaxWidth = "1fr",
24
- mqEnableThreshold = () => true,
25
- ...props
26
- }: SliderProps) => {
27
- const containerRef = useRef<HTMLDivElement>(null);
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
+
84
+ const isInline = options?.controlPosition === "inline";
85
+
86
+ const next = () => {
87
+ setActiveIndex((prevIndex) => (prevIndex + 1) % children.length);
88
+ setTranslationCoefficient(1);
89
+ resetInterval();
90
+ };
91
+
92
+ const prev = () => {
93
+ setActiveIndex((prevIndex) =>
94
+ prevIndex > 0 ? prevIndex - 1 : children.length - 1
95
+ );
96
+ setTranslationCoefficient(-1);
97
+ resetInterval();
98
+ };
99
+
100
+ const resetInterval = () => {
101
+ if (timerRef.current) clearInterval(timerRef.current);
102
+ timerRef.current = setInterval(next, options?.interval ?? 10000);
103
+ };
104
+
105
+ const handleTouchStart = (e) => {
106
+ setTouchStartX(e.touches[0].clientX);
107
+ };
108
+
109
+ const handleTouchMove = (e) => {
110
+ setTouchEndX(e.touches[0].clientX);
111
+ };
112
+
113
+ const handleTouchEnd = () => {
114
+ if (touchStartX - touchEndX > 50) {
115
+ next();
116
+ }
117
+ if (touchStartX - touchEndX < -50) {
118
+ prev();
119
+ }
120
+ };
28
121
 
29
122
  useEffect(() => {
30
- SliderScripts({
31
- container: containerRef.current,
32
- mqEnableThreshold,
33
- });
34
- }, []);
123
+ resetInterval();
124
+ return () => {
125
+ if (timerRef.current) clearInterval(timerRef.current);
126
+ };
127
+ }, [children.length, options?.interval]);
35
128
 
36
- if (slides.length === 0) return;
129
+ useEffect(() => {
130
+ setTimeout(() => {
131
+ setSlides(setupSlides(children, activeIndex));
132
+ setTranslationCoefficient(0);
133
+ }, SLIDE_TRANSITION_LENGTH);
134
+ }, [activeIndex]);
37
135
 
38
136
  return (
39
137
  <div
40
- className="w-full overflow-x-hidden"
41
- data-id="slider"
42
- style={
43
- {
44
- "--dynamic-grid-columns-count": slides.length,
45
- "--dynamic-grid-column-min-width": slideMinWidth,
46
- "--dynamic-grid-column-max-width": slideMaxWidth,
47
- } as CSSProperties
48
- }
49
- ref={containerRef}
138
+ className="relative"
139
+ onTouchStart={handleTouchStart}
140
+ onTouchMove={handleTouchMove}
141
+ onTouchEnd={handleTouchEnd}
50
142
  >
51
- <ol
52
- className={`grid ui-grid-gap grid-cols-dynamic transform transition-transform ${classes}`}
53
- data-id="slider-strip"
54
- {...props}
55
- >
56
- {slides.map((slide, i) => (
57
- <li key={i} className={slideClasses} data-id="slider-slide">
58
- {slide}
59
- </li>
60
- ))}
61
- </ol>
143
+ <div className="overflow-y-visible overflow-x-clip w-full py-40">
144
+ <div
145
+ className={`flex items-center ${
146
+ translationCoefficient !== 0
147
+ ? `transition-transform ease-in-out duration-${SLIDE_TRANSITION_LENGTH}`
148
+ : ""
149
+ } `}
150
+ style={{
151
+ transform: `translateX(-${(translationCoefficient + 1) * 100}%)`,
152
+ }}
153
+ >
154
+ {slides.map((child, index) => (
155
+ <div
156
+ key={index}
157
+ className="w-full flex-shrink-0 flex justify-center sm:px-60"
158
+ >
159
+ {child}
160
+ </div>
161
+ ))}
162
+ </div>
163
+ </div>
62
164
 
63
165
  <div
64
- className="justify-center items-center my-24 hidden"
65
- data-id="slider-controls"
166
+ className={`flex items-center pointer-events-none ${
167
+ isInline
168
+ ? "ui-standard-container justify-center gap-24 -mt-16"
169
+ : "sm:flex sm:absolute inset-0 justify-between"
170
+ }`}
66
171
  >
67
172
  <button
68
- type="button"
69
- className="p-0 w-24 h-24 flex items-center focus:outline-gui-focus"
70
- data-id="slider-previous"
173
+ className={`${
174
+ isInline ? "w-32 h-32" : "hidden sm:flex w-48 h-48"
175
+ } pointer-events-auto rounded border border-mid-grey hover:border-active-orange flex justify-center items-center ui-icon-cta ui-icon-cta-left`}
176
+ onClick={prev}
71
177
  >
72
- <Icon
73
- name="icon-gui-disclosure-arrow"
74
- size="1.5rem"
75
- color="text-cool-black"
76
- additionalCSS="transform rotate-180"
77
- data-id="meganav-control-mobile-dropdown-menu"
78
- />
178
+ <div className="ui-icon-cta-holder flex gap-4">
179
+ <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
180
+ <Icon name="icon-gui-arrow-left" size="1.5rem" />
181
+ </div>
182
+ <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
183
+ <Icon name="icon-gui-arrow-left" size="1.5rem" />
184
+ </div>
185
+ </div>
79
186
  </button>
80
187
 
81
- <ul className="flex justify-center items-center mx-32 relative h-24">
82
- {slides.map((_, i) => (
83
- <li key={i}>
84
- <span
85
- className="ui-slider-marker text-cool-black"
86
- data-id="slider-marker"
87
- >
88
- &#x2b24;
89
- </span>{" "}
90
- {/* ⬤ */}
91
- </li>
92
- ))}
93
- </ul>
188
+ <SlideIndicator
189
+ numSlides={children.length}
190
+ activeIndex={activeIndex}
191
+ interval={options?.interval ?? 10000}
192
+ intervalIndicator={options?.intervalIndicator}
193
+ isInline={isInline}
194
+ />
94
195
 
95
196
  <button
96
- type="button"
97
- className="p-0 w-24 h-24 flex items-center focus:outline-gui-focus"
98
- data-id="slider-next"
197
+ className={`${
198
+ isInline ? "w-32 h-32" : "hidden sm:flex w-48 h-48"
199
+ } pointer-events-auto rounded border border-mid-grey hover:border-active-orange justify-center items-center ui-icon-cta ui-icon-cta-right`}
200
+ onClick={next}
99
201
  >
100
- <Icon
101
- name="icon-gui-disclosure-arrow"
102
- size="1.5rem"
103
- color="text-cool-black"
104
- data-id="meganav-control-mobile-dropdown-menu"
105
- />
202
+ <div className="ui-icon-cta-holder flex gap-4">
203
+ <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
204
+ <Icon name="icon-gui-arrow-right" size="1.5rem" />
205
+ </div>
206
+ <div className="w-full h-full flex-shrink-0 flex items-center justify-center">
207
+ <Icon name="icon-gui-arrow-right" size="1.5rem" />
208
+ </div>
209
+ </div>
106
210
  </button>
107
211
  </div>
108
212
  </div>
@@ -1,29 +1,57 @@
1
- import React, { PropsWithChildren, ReactElement, cloneElement } from "react";
1
+ import React, {
2
+ PropsWithChildren,
3
+ ReactElement,
4
+ TableHTMLAttributes,
5
+ cloneElement,
6
+ } from "react";
2
7
 
3
8
  type TableProps = {
4
9
  id?: string;
5
10
  };
6
11
 
7
- export const Table = ({ id, children }: PropsWithChildren<TableProps>) => (
8
- <table id={id} className="ui-standard-container mb-4 sm:table-fixed">
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
+ >
9
24
  {children}
10
25
  </table>
11
26
  );
12
27
 
13
- export const TableBody = ({ children }: PropsWithChildren) => (
14
- <tbody>{children}</tbody>
28
+ export const TableBody = ({
29
+ children,
30
+ ...rest
31
+ }: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (
32
+ <tbody {...rest}>{children}</tbody>
15
33
  );
16
34
 
17
- export const TableHeader = ({ children }: PropsWithChildren) => (
18
- <thead className="sticky bg-white z-10 top-0" key="sticky-block">
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
+ >
19
43
  {cloneElement(children as ReactElement, { isHeader: true })}
20
44
  </thead>
21
45
  );
22
46
 
23
- export const TableRowHeader = ({ children }: PropsWithChildren) => (
47
+ export const TableRowHeader = ({
48
+ children,
49
+ ...rest
50
+ }: PropsWithChildren<TableHTMLAttributes<HTMLTableRowElement>>) => (
24
51
  <tr
25
- className="-ml-24 mt-8 sm:ml-0 sm:mt-0 ui-text-overline1 !text-cool-black bg-light-grey sm:sticky z-10"
26
- style={{ top: "4rem" }}
52
+ className={`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${
53
+ rest?.className ?? ""
54
+ }`}
27
55
  >
28
56
  {cloneElement(children as ReactElement, { isRowHeader: true })}
29
57
  </tr>
@@ -1,37 +1,16 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import Icon from "../Icon/component.tsx";
3
2
 
4
3
  type TableCellProps = {
5
4
  isRowHeader?: boolean;
6
5
  } & React.TdHTMLAttributes<HTMLTableCellElement>;
7
6
 
8
- const Supported = () => (
9
- <Icon
10
- name="icon-gui-check-circled-fill"
11
- size="1.5rem"
12
- color="text-gui-success"
13
- additionalCSS="flex-grow-0 flex-shrink-0"
14
- data-testid="supported-icon"
15
- />
16
- );
17
-
18
- const Unsupported = () => (
19
- <Icon
20
- name="icon-gui-cross-circled-fill"
21
- size="1.5rem"
22
- color="text-gui-error"
23
- additionalCSS="flex-grow-0 flex-shrink-0"
24
- data-testid="unsupported-icon"
25
- />
26
- );
27
-
28
7
  const LabelCell = ({
29
8
  children,
30
9
  ...rest
31
10
  }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => {
32
11
  const classes = `
33
- ui-text-p1 !font-bold pt-24 pb-8 border-light-grey sm:p-24 sm:relative sm:top-2 flex sm:table-cell ${
34
- rest.className ?? ""
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 ?? ""
35
14
  }
36
15
  `;
37
16
 
@@ -56,7 +35,7 @@ const TableCell = ({
56
35
  ? "rounded-l-none rounded-r sm:rounded-lg py-20 px-24"
57
36
  : "py-6"
58
37
  }
59
- ${rest.className ?? ""}
38
+ ${rest?.className ?? ""}
60
39
  `}
61
40
  >
62
41
  {children}
@@ -67,7 +46,12 @@ const HeaderCell = ({
67
46
  children,
68
47
  ...rest
69
48
  }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (
70
- <td {...rest} className="ui-text-h3 px-24 py-24 hidden sm:table-cell">
49
+ <td
50
+ {...rest}
51
+ className={`ui-text-h3 px-24 py-24 hidden sm:table-cell ${
52
+ rest?.className ?? ""
53
+ }`}
54
+ >
71
55
  {children}
72
56
  </td>
73
57
  );
@@ -76,9 +60,12 @@ const CtaCell = ({
76
60
  children,
77
61
  ...rest
78
62
  }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (
79
- <td {...rest} className="pt-24 hidden sm:table-cell">
63
+ <td
64
+ {...rest}
65
+ className={`pt-24 hidden sm:table-cell ${rest?.className ?? ""}`}
66
+ >
80
67
  {children}
81
68
  </td>
82
69
  );
83
70
 
84
- export { TableCell, LabelCell, HeaderCell, CtaCell, Supported, Unsupported };
71
+ export { TableCell, LabelCell, HeaderCell, CtaCell };
@@ -1,8 +1,28 @@
1
1
  import React, { Fragment } from "react";
2
2
 
3
- import Tooltip from "../../Tooltip/component";
4
- import { Supported, Unsupported } from "../TableCell";
5
- import Table from "..";
3
+ import Tooltip from "../Tooltip";
4
+ import Table from "../Table";
5
+ import Icon from "../Icon";
6
+
7
+ const Supported = () => (
8
+ <Icon
9
+ name="icon-gui-check-circled-fill"
10
+ size="1.5rem"
11
+ color="text-gui-success"
12
+ additionalCSS="flex-grow-0 flex-shrink-0"
13
+ data-testid="supported-icon"
14
+ />
15
+ );
16
+
17
+ const Unsupported = () => (
18
+ <Icon
19
+ name="icon-gui-cross-circled-fill"
20
+ size="1.5rem"
21
+ color="text-gui-error"
22
+ additionalCSS="flex-grow-0 flex-shrink-0"
23
+ data-testid="unsupported-icon"
24
+ />
25
+ );
6
26
 
7
27
  const testRow = (index) => ({
8
28
  label: `Label ${index + 1}`,
@@ -1,13 +1,6 @@
1
- import { Table, TableRowHeader, TableHeader, TableBody } from "./Table";
2
- import { TableRow } from "./TableRow";
3
- import {
4
- TableCell,
5
- LabelCell,
6
- HeaderCell,
7
- CtaCell,
8
- Supported,
9
- Unsupported,
10
- } from "./TableCell";
1
+ import { Table, TableRowHeader, TableHeader, TableBody } from "./Table/Table";
2
+ import { TableRow } from "./Table/TableRow";
3
+ import { TableCell, LabelCell, HeaderCell, CtaCell } from "./Table/TableCell";
11
4
 
12
5
  export default {
13
6
  Root: Table,
@@ -19,6 +12,4 @@ export default {
19
12
  RowHeader: TableRowHeader,
20
13
  Body: TableBody,
21
14
  Header: TableHeader,
22
- Supported,
23
- Unsupported,
24
15
  };