@ably/ui 14.0.0-dev.99c9769 → 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.
- package/core/.DS_Store +0 -0
- package/core/Accordion.js +1 -1
- package/core/Code.js +1 -1
- package/core/ContactFooter/component.css +9 -7
- package/core/ContactFooter.js +1 -1
- package/core/CookieMessage/component.css +12 -10
- package/core/CookieMessage.js +1 -1
- package/core/Expander.js +1 -0
- package/core/Flash/component.css +21 -19
- package/core/Flash.js +1 -1
- package/core/Footer/component.css +24 -22
- package/core/Footer.js +1 -1
- package/core/Meganav/component.css +105 -103
- package/core/Meganav/component.js +1 -1
- package/core/Meganav.js +1 -1
- package/core/Notice/component.css +6 -4
- package/core/Notice/component.js +1 -1
- package/core/Notice.js +1 -1
- package/core/Slider/component.css +38 -4
- package/core/Slider/component.js +1 -1
- package/core/Slider.js +1 -1
- package/core/Table/Table.js +1 -1
- package/core/Table/TableCell.js +3 -3
- package/core/Table/data.js +1 -1
- package/core/Table.js +1 -1
- package/core/scripts.js +1 -1
- package/core/styles/buttons.css +123 -121
- package/core/styles/forms.css +51 -49
- package/core/styles/layout.css +16 -14
- package/core/styles/properties.css +252 -250
- package/core/styles/text.css +167 -165
- package/core/styles.components.css +24 -22
- package/core/utils/syntax-highlighter.css +59 -55
- package/package.json +2 -4
- package/src/core/.DS_Store +0 -0
- package/src/core/Accordion.tsx +7 -5
- package/src/core/Code.tsx +0 -1
- package/src/core/ContactFooter/component.css +9 -7
- package/src/core/ContactFooter.tsx +0 -1
- package/src/core/CookieMessage/component.css +12 -10
- package/src/core/CookieMessage.tsx +0 -1
- package/src/core/Expander/Expander.stories.tsx +132 -0
- package/src/core/Expander.tsx +63 -0
- package/src/core/Flash/component.css +21 -19
- package/src/core/Flash.tsx +0 -1
- package/src/core/Footer/component.css +24 -22
- package/src/core/Footer.tsx +0 -1
- package/src/core/Meganav/component.css +105 -103
- package/src/core/Meganav/component.js +0 -2
- package/src/core/Meganav.tsx +0 -1
- package/src/core/Notice/component.css +6 -4
- package/src/core/Notice/component.js +0 -1
- package/src/core/Notice.tsx +0 -1
- package/src/core/Slider/Slider.stories.tsx +82 -29
- package/src/core/Slider/component.css +38 -4
- package/src/core/Slider/component.js +0 -2
- package/src/core/Slider.tsx +189 -85
- package/src/core/Table/Table.tsx +1 -2
- package/src/core/Table/TableCell.tsx +2 -40
- package/src/core/Table/data.tsx +21 -1
- package/src/core/Table.tsx +1 -12
- package/src/core/scripts.js +0 -2
- package/src/core/styles/buttons.css +123 -121
- package/src/core/styles/forms.css +51 -49
- package/src/core/styles/layout.css +16 -14
- package/src/core/styles/properties.css +252 -250
- package/src/core/styles/text.css +167 -165
- package/src/core/styles.components.css +24 -22
- package/src/core/utils/syntax-highlighter.css +59 -55
|
@@ -1,45 +1,98 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Slider from "../Slider";
|
|
3
|
+
import Icon from "../Icon";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
<Slide key="
|
|
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
|
|
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
|
-
|
|
82
|
+
options: {
|
|
83
|
+
interval: 10000,
|
|
84
|
+
intervalIndicator: true,
|
|
85
|
+
controlPosition: "inline",
|
|
86
|
+
},
|
|
36
87
|
},
|
|
37
88
|
};
|
|
38
89
|
|
|
39
|
-
export const
|
|
90
|
+
export const WithoutIntervalIndicator = {
|
|
40
91
|
args: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
92
|
+
options: {
|
|
93
|
+
interval: 10000,
|
|
94
|
+
intervalIndicator: false,
|
|
95
|
+
controlPosition: "floating",
|
|
96
|
+
},
|
|
44
97
|
},
|
|
45
98
|
};
|
|
@@ -1,6 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
@layer components {
|
|
2
|
+
.ui-slider-marker {
|
|
3
|
+
font-size: 0.5rem;
|
|
4
|
+
top: -1px;
|
|
4
5
|
|
|
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(-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
|
}
|
package/src/core/Slider.tsx
CHANGED
|
@@ -1,108 +1,212 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
1
|
+
import React, { useState, useEffect, useRef, ReactNode } from "react";
|
|
3
2
|
import Icon from "./Icon";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 = 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
|
+
⬤
|
|
60
|
+
</span>
|
|
61
|
+
</li>
|
|
62
|
+
)
|
|
63
|
+
)}
|
|
64
|
+
</ul>
|
|
65
|
+
);
|
|
16
66
|
};
|
|
17
67
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}, []);
|
|
123
|
+
resetInterval();
|
|
124
|
+
return () => {
|
|
125
|
+
if (timerRef.current) clearInterval(timerRef.current);
|
|
126
|
+
};
|
|
127
|
+
}, [children.length, options?.interval]);
|
|
35
128
|
|
|
36
|
-
|
|
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="
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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=
|
|
65
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
<
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
⬤
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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>
|
package/src/core/Table/Table.tsx
CHANGED
|
@@ -49,10 +49,9 @@ export const TableRowHeader = ({
|
|
|
49
49
|
...rest
|
|
50
50
|
}: PropsWithChildren<TableHTMLAttributes<HTMLTableRowElement>>) => (
|
|
51
51
|
<tr
|
|
52
|
-
className={`-ml-24 mt-8 sm:ml-0 sm:mt-0
|
|
52
|
+
className={`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${
|
|
53
53
|
rest?.className ?? ""
|
|
54
54
|
}`}
|
|
55
|
-
style={{ top: "4rem" }}
|
|
56
55
|
>
|
|
57
56
|
{cloneElement(children as ReactElement, { isRowHeader: true })}
|
|
58
57
|
</tr>
|
|
@@ -1,45 +1,15 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import Icon from "../Icon";
|
|
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
|
-
const Partial = () => (
|
|
29
|
-
<Icon
|
|
30
|
-
name="icon-gui-partial"
|
|
31
|
-
size="1.5rem"
|
|
32
|
-
additionalCSS="flex-grow-0 flex-shrink-0"
|
|
33
|
-
data-testid="partial-icon"
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
|
|
37
7
|
const LabelCell = ({
|
|
38
8
|
children,
|
|
39
9
|
...rest
|
|
40
10
|
}: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => {
|
|
41
11
|
const classes = `
|
|
42
|
-
ui-text-p1
|
|
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 ${
|
|
43
13
|
rest?.className ?? ""
|
|
44
14
|
}
|
|
45
15
|
`;
|
|
@@ -98,12 +68,4 @@ const CtaCell = ({
|
|
|
98
68
|
</td>
|
|
99
69
|
);
|
|
100
70
|
|
|
101
|
-
export {
|
|
102
|
-
TableCell,
|
|
103
|
-
LabelCell,
|
|
104
|
-
HeaderCell,
|
|
105
|
-
CtaCell,
|
|
106
|
-
Supported,
|
|
107
|
-
Unsupported,
|
|
108
|
-
Partial,
|
|
109
|
-
};
|
|
71
|
+
export { TableCell, LabelCell, HeaderCell, CtaCell };
|
package/src/core/Table/data.tsx
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import React, { Fragment } from "react";
|
|
2
2
|
|
|
3
3
|
import Tooltip from "../Tooltip";
|
|
4
|
-
import { Supported, Unsupported } from "./TableCell";
|
|
5
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}`,
|
package/src/core/Table.tsx
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { Table, TableRowHeader, TableHeader, TableBody } from "./Table/Table";
|
|
2
2
|
import { TableRow } from "./Table/TableRow";
|
|
3
|
-
import {
|
|
4
|
-
TableCell,
|
|
5
|
-
LabelCell,
|
|
6
|
-
HeaderCell,
|
|
7
|
-
CtaCell,
|
|
8
|
-
Supported,
|
|
9
|
-
Unsupported,
|
|
10
|
-
Partial,
|
|
11
|
-
} from "./Table/TableCell";
|
|
3
|
+
import { TableCell, LabelCell, HeaderCell, CtaCell } from "./Table/TableCell";
|
|
12
4
|
|
|
13
5
|
export default {
|
|
14
6
|
Root: Table,
|
|
@@ -20,7 +12,4 @@ export default {
|
|
|
20
12
|
RowHeader: TableRowHeader,
|
|
21
13
|
Body: TableBody,
|
|
22
14
|
Header: TableHeader,
|
|
23
|
-
Supported,
|
|
24
|
-
Unsupported,
|
|
25
|
-
Partial,
|
|
26
15
|
};
|
package/src/core/scripts.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "array-flat-polyfill";
|
|
2
2
|
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
|
|
5
3
|
export { default as reactRenderer, renderComponent } from "./react-renderer";
|
|
6
4
|
export { default as loadSprites } from "./load-sprites";
|
|
7
5
|
export { default as toggleChatWidget } from "./hubspot-chat-toggle";
|