@hellobetterdigitalnz/selwynui 0.0.1-40 → 0.0.1-42
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/dist/Components/DataDisplay/CarouselBlock/CarouselBlock.d.ts +2 -0
- package/dist/Components/DataDisplay/CarouselBlock/CarouselBlockProps.d.ts +17 -0
- package/dist/Components/DataDisplay/PathwayBlock/PathwayBlockProps.d.ts +3 -4
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +629 -628
- package/dist/index.es.js.map +1 -1
- package/dist/selwynui.css +1 -1
- package/package.json +2 -1
- package/src/Components/DataDisplay/CarouselBlock/CarouselBlock.tsx +13 -0
- package/src/Components/DataDisplay/CarouselBlock/CarouselBlockProps.tsx +19 -0
- package/src/Components/DataDisplay/CarouselBlock/carouselBlock.module.scss +0 -0
- package/src/Components/DataDisplay/ContentBlock/ContentBlock.stories.tsx +107 -0
- package/src/Components/DataDisplay/ContentBlock/ContentBlock.tsx +26 -0
- package/src/Components/DataDisplay/ContentBlock/ContentBlockProps.tsx +6 -0
- package/src/Components/DataDisplay/ContentBlock/contentBlock.module.scss +61 -0
- package/src/Components/DataDisplay/ImageContent/imageContent.module.scss +9 -5
- package/src/Components/DataDisplay/ListBlock/listBlock.module.scss +2 -0
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.tsx +1 -1
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlockProps.tsx +4 -2
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.stories.tsx +6 -0
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlockProps.tsx +3 -4
- package/src/Components/DataDisplay/PathwayBlock/pathwayBlock.module.scss +27 -25
- package/src/Components/DataDisplay/TestimonyCard/TestimonyCard.stories.tsx +1 -1
- package/src/Components/DataDisplay/TestimonyCard/TestimonyCard.tsx +37 -7
- package/src/Components/DataDisplay/TestimonyCard/testimonyCard.module.scss +48 -4
- package/src/Components/DataDisplay/index.ts +8 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ListingDetailBlockProps from "./ListingDetailBlockProps";
|
|
2
2
|
import styles from "./ListingDetailBlock.module.scss";
|
|
3
3
|
import {CheckCircle, Clock, DeviceMobile, MapPin, Mountains, Path} from "../../Icons";
|
|
4
4
|
import {Button} from "../../Form";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ListingDetailBlockProps.ts
|
|
2
|
-
|
|
2
|
+
interface ListingDetailBlockProps {
|
|
3
3
|
title: string;
|
|
4
4
|
description: string;
|
|
5
5
|
facilities: string[];
|
|
@@ -12,4 +12,6 @@ export interface ListingDetailBlockProps {
|
|
|
12
12
|
phone?: string;
|
|
13
13
|
websiteUrl?: string;
|
|
14
14
|
websiteText?: string; // e.g., "WEBSITE →"
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default ListingDetailBlockProps;
|
|
@@ -37,6 +37,12 @@ const PathwayBlockTemplate: Story = {
|
|
|
37
37
|
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
|
38
38
|
image: "https://images.pexels.com/photos/1595655/pexels-photo-1595655.jpeg"
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
title: "Lorem ipsum",
|
|
42
|
+
date: "2024-01-17",
|
|
43
|
+
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
44
|
+
image: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg"
|
|
45
|
+
},
|
|
40
46
|
{
|
|
41
47
|
title: "Lorem ipsum",
|
|
42
48
|
date: "2024-01-17",
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
.pathwayBlock {
|
|
2
|
+
.header {
|
|
3
|
+
font-size: var(--font-size-h3);
|
|
4
|
+
font-weight: 700;
|
|
5
|
+
margin: 0 0 36px 0;
|
|
6
|
+
letter-spacing: -3.6px;
|
|
7
|
+
}
|
|
8
|
+
.cardsGrid {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
margin: -12px;
|
|
12
|
+
}
|
|
2
13
|
|
|
14
|
+
.card{
|
|
15
|
+
width: 33.33%;
|
|
16
|
+
padding: 12px;
|
|
3
17
|
|
|
18
|
+
@media (max-width: 992px) {
|
|
19
|
+
width: 50%;
|
|
20
|
+
}
|
|
4
21
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.header {
|
|
12
|
-
font-size: var(--font-size-h3);
|
|
13
|
-
//font-weight: var();
|
|
14
|
-
margin: 0 0 72px 0;
|
|
15
|
-
}
|
|
16
|
-
.cardsGrid {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
margin: -12px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.card{
|
|
23
|
-
width: 33.33%;
|
|
24
|
-
padding: 12px;
|
|
22
|
+
@media (max-width: 599px) {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
@media (max-width: 999px) {
|
|
27
|
-
width: 50%;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
@media (
|
|
31
|
-
|
|
28
|
+
@media screen and (min-width: 992px){
|
|
29
|
+
.header {
|
|
30
|
+
margin: 0 0 72px 0;
|
|
31
|
+
letter-spacing: -3.6px;
|
|
32
|
+
}
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -31,7 +31,7 @@ const TestimonyCardTemplate: Story = {
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
image:"https://images.pexels.com/photos/1906658/pexels-photo-1906658.jpeg",
|
|
34
|
-
testimony: 'The sense of community here is incredible.',
|
|
34
|
+
testimony: 'The sense of community here is incredible. Living in Selwyn is like waking up in a dream every single day. The community is not only vibrant but also filled with friendly faces and engaging activities that bring everyone together.\n\nThe sunsets here are truly breathtaking, painting the sky in hues of orange, pink, and purple, creating a picturesque backdrop that makes every evening feel special!',
|
|
35
35
|
author: '— Sarah & James'
|
|
36
36
|
}
|
|
37
37
|
]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
2
|
import TestimonyCardProps from "./TestimonyCardProps.tsx";
|
|
3
3
|
import styles from './testimonyCard.module.scss';
|
|
4
4
|
import Container from "../../Shared/Container/Container.tsx";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
6
|
const TestimonyCard = (props: TestimonyCardProps) => {
|
|
9
7
|
const {
|
|
10
8
|
testimonies,
|
|
@@ -12,9 +10,29 @@ const TestimonyCard = (props: TestimonyCardProps) => {
|
|
|
12
10
|
} = props;
|
|
13
11
|
|
|
14
12
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
13
|
+
const [direction, setDirection] = useState<'left' | 'right'>('right');
|
|
15
14
|
|
|
16
15
|
const defaultImage = 'https://images.pexels.com/photos/1563356/pexels-photo-1563356.jpeg';
|
|
17
16
|
|
|
17
|
+
const handleDotClick = (index: number) => {
|
|
18
|
+
if (index > currentIndex) {
|
|
19
|
+
setDirection('right');
|
|
20
|
+
} else {
|
|
21
|
+
setDirection('left');
|
|
22
|
+
}
|
|
23
|
+
setCurrentIndex(index);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const interval = setInterval(() => {
|
|
29
|
+
setDirection('right');
|
|
30
|
+
setCurrentIndex((prev) => (prev + 1) % testimonies.length);
|
|
31
|
+
}, 5000); // change every 5 seconds
|
|
32
|
+
|
|
33
|
+
return () => clearInterval(interval); // cleanup on unmount
|
|
34
|
+
}, [testimonies.length]);
|
|
35
|
+
|
|
18
36
|
return <div
|
|
19
37
|
className={`
|
|
20
38
|
${styles.testimonyCard}
|
|
@@ -26,22 +44,34 @@ const TestimonyCard = (props: TestimonyCardProps) => {
|
|
|
26
44
|
<div className={styles.testimonyCardWrapper}>
|
|
27
45
|
<div className={styles.testimonyCardLeft}>
|
|
28
46
|
<img
|
|
47
|
+
key={`image-${currentIndex}`}
|
|
48
|
+
className={styles[`slideIn${direction === 'right' ? 'Right' : 'Left'}`]}
|
|
29
49
|
src={testimonies[currentIndex].image || defaultImage}
|
|
30
50
|
alt={`${testimonies[currentIndex].author} testimonial`}
|
|
31
51
|
/>
|
|
32
52
|
</div>
|
|
33
53
|
<div className={styles.testimonyCardRight}>
|
|
34
54
|
<div className={styles.testimonyContent}>
|
|
35
|
-
<div className={styles
|
|
55
|
+
<div className={styles[`slideIn${direction === 'right' ? 'Right' : 'Left'}`]} >
|
|
36
56
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="39" viewBox="0 0 56 39" fill="none">
|
|
37
57
|
<path d="M23.1134 27.0562C23.1134 32.4847 18.9331 36 13.4798 36C8.02648 36 4.75277 33.6194 3.3652 27.0562C1.97764 20.493 7.78599 17.227 13.2393 17.227C18.6926 17.227 23.1134 21.6276 23.1134 27.0562Z" fill="#92C134"/>
|
|
38
58
|
<path d="M53.0015 27.0558C53.0015 32.4844 48.8212 35.9997 43.3679 35.9997C37.9145 35.9997 34.6408 33.619 33.2533 27.0558C31.8657 20.4926 37.674 17.2267 43.1274 17.2267C48.5807 17.2267 53.0015 21.6273 53.0015 27.0558Z" fill="#92C134"/>
|
|
39
59
|
<path d="M3.3652 27.0562C4.75277 33.6194 8.02648 36 13.4798 36C18.9331 36 23.1134 32.4847 23.1134 27.0562C23.1134 21.6276 18.6926 17.227 13.2393 17.227C7.78599 17.227 1.97764 20.493 3.3652 27.0562ZM3.3652 27.0562C1.97764 20.493 4.78431 13.7613 7.99019 9.54638C11.1961 5.33146 17.2399 2.24873 21.5318 3.16115M33.2533 27.0558C34.6408 33.619 37.9145 35.9997 43.3679 35.9997C48.8212 35.9997 53.0015 32.4844 53.0015 27.0558C53.0015 21.6273 48.5807 17.2267 43.1274 17.2267C37.674 17.2267 31.8657 20.4926 33.2533 27.0558ZM33.2533 27.0558C31.8657 20.4926 34.6724 13.761 37.8782 9.54606C41.0841 5.33115 47.1279 2.24841 51.4199 3.16083" stroke="#92C134" strokeWidth="6" strokeLinecap="round" strokeLinejoin="round"/>
|
|
40
60
|
</svg>
|
|
41
61
|
</div>
|
|
42
|
-
<h6
|
|
62
|
+
<h6
|
|
63
|
+
key={`testimony-${currentIndex}`}
|
|
64
|
+
className={styles[`slideIn${direction === 'right' ? 'Right' : 'Left'}`]}
|
|
65
|
+
>
|
|
66
|
+
{testimonies[currentIndex].testimony}
|
|
67
|
+
</h6>
|
|
43
68
|
</div>
|
|
44
|
-
<p
|
|
69
|
+
<p
|
|
70
|
+
key={`author-${currentIndex}`}
|
|
71
|
+
className={styles[`slideIn${direction === 'right' ? 'Right' : 'Left'}`]}
|
|
72
|
+
>
|
|
73
|
+
{testimonies[currentIndex].author}
|
|
74
|
+
</p>
|
|
45
75
|
|
|
46
76
|
{testimonies.length > 1 && (
|
|
47
77
|
<div className={styles.pagination}>
|
|
@@ -49,7 +79,7 @@ const TestimonyCard = (props: TestimonyCardProps) => {
|
|
|
49
79
|
<button
|
|
50
80
|
key={index}
|
|
51
81
|
className={`${styles.dot} ${index === currentIndex ? styles.active : ''}`}
|
|
52
|
-
onClick={() =>
|
|
82
|
+
onClick={() => handleDotClick(index)}
|
|
53
83
|
aria-label={`Go to testimonial ${index + 1}`}
|
|
54
84
|
/>
|
|
55
85
|
))}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
gap: 69px;
|
|
12
12
|
align-items: center;
|
|
13
13
|
|
|
14
|
-
@media (max-width:
|
|
14
|
+
@media (max-width: 1032px) {
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
gap: 32px;
|
|
17
17
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
.testimonyCardLeft {
|
|
21
21
|
flex-shrink: 0;
|
|
22
|
+
overflow: hidden;
|
|
22
23
|
|
|
23
24
|
@media (max-width: 834px) {
|
|
24
25
|
padding-top: 0;
|
|
@@ -37,7 +38,6 @@
|
|
|
37
38
|
@media (max-width: 834px) {
|
|
38
39
|
width: 100%;
|
|
39
40
|
height: 360px;
|
|
40
|
-
//aspect-ratio: 1;
|
|
41
41
|
border-radius: 2px 2px 96px 2px;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -52,9 +52,19 @@
|
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
gap: 24px;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
position: relative;
|
|
57
|
+
min-height: 340px;
|
|
58
|
+
height: 100%;
|
|
55
59
|
|
|
56
|
-
@media (max-width:
|
|
60
|
+
@media (max-width: 1390px) {
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@media (max-width: 1032px) {
|
|
57
66
|
width: 100%;
|
|
67
|
+
height: 100%;
|
|
58
68
|
gap: 16px;
|
|
59
69
|
}
|
|
60
70
|
|
|
@@ -67,7 +77,6 @@
|
|
|
67
77
|
|
|
68
78
|
@media (max-width: 834px) {
|
|
69
79
|
padding-left: 0;
|
|
70
|
-
font-size: 12px;
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
82
|
}
|
|
@@ -76,6 +85,7 @@
|
|
|
76
85
|
display: flex;
|
|
77
86
|
gap: 16px;
|
|
78
87
|
align-items: flex-start;
|
|
88
|
+
overflow: hidden;
|
|
79
89
|
|
|
80
90
|
@media (max-width: 834px) {
|
|
81
91
|
flex-direction: column;
|
|
@@ -119,6 +129,9 @@
|
|
|
119
129
|
display: flex;
|
|
120
130
|
gap: 12px;
|
|
121
131
|
padding-left: 70px;
|
|
132
|
+
position: absolute;
|
|
133
|
+
bottom: 0;
|
|
134
|
+
left: 0;
|
|
122
135
|
|
|
123
136
|
@media (max-width: 834px) {
|
|
124
137
|
padding-left: 0;
|
|
@@ -156,4 +169,35 @@
|
|
|
156
169
|
}
|
|
157
170
|
}
|
|
158
171
|
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Animations
|
|
175
|
+
@keyframes slideInRight {
|
|
176
|
+
from {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
transform: translateX(50px);
|
|
179
|
+
}
|
|
180
|
+
to {
|
|
181
|
+
opacity: 1;
|
|
182
|
+
transform: translateX(0);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@keyframes slideInLeft {
|
|
187
|
+
from {
|
|
188
|
+
opacity: 0;
|
|
189
|
+
transform: translateX(-50px);
|
|
190
|
+
}
|
|
191
|
+
to {
|
|
192
|
+
opacity: 1;
|
|
193
|
+
transform: translateX(0);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.slideInRight {
|
|
198
|
+
animation: slideInRight 0.5s ease-out;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.slideInLeft {
|
|
202
|
+
animation: slideInLeft 0.5s ease-out;
|
|
159
203
|
}
|
|
@@ -36,6 +36,14 @@ export type { default as TestimonyCardProps } from './TestimonyCard/TestimonyCar
|
|
|
36
36
|
export { default as Pathway } from './ListBlock/ListBlock.tsx';
|
|
37
37
|
export type { default as PathwayProps } from './ListBlock/ListBlockProps.tsx';
|
|
38
38
|
|
|
39
|
+
// ListingDetailBlock
|
|
40
|
+
export { default as ListingDetailBlock } from './ListingDetailBlock/ListingDetailBlock';
|
|
41
|
+
export type { default as ListingDetailBlockProps } from './ListingDetailBlock/ListingDetailBlockProps';
|
|
42
|
+
|
|
43
|
+
// ContentBlock
|
|
44
|
+
export { default as ContentBlock } from './ContentBlock/ContentBlock';
|
|
45
|
+
export type { default as ContentBlockProps } from './ContentBlock/ContentBlockProps';
|
|
46
|
+
|
|
39
47
|
// PromoBanner
|
|
40
48
|
export { default as PromoBannerBlock } from './PromoBannerBlock/PromoBannerBlock';
|
|
41
49
|
export type { default as PromoBannerBlockProps } from './PromoBannerBlock/PromoBannerBlockProps';
|