@hellobetterdigitalnz/selwynui 0.0.1-50 → 0.0.1-53
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/Accordion/AccordionProps.d.ts +1 -0
- package/dist/Components/DataDisplay/ImageContent/ImageContentProps.d.ts +3 -0
- package/dist/Components/DataDisplay/Media/Media.d.ts +1 -1
- package/dist/Components/DataDisplay/Media/MediaProps.d.ts +1 -0
- package/dist/Components/Shared/Container/ContainerProps.d.ts +4 -0
- package/dist/index.cjs.js +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2143 -2148
- package/dist/index.es.js.map +1 -1
- package/dist/selwynui.css +1 -1
- package/package.json +1 -1
- package/src/Components/DataDisplay/Accordion/Accordion.stories.tsx +7 -19
- package/src/Components/DataDisplay/Accordion/Accordion.tsx +7 -4
- package/src/Components/DataDisplay/Accordion/AccordionItem.tsx +2 -2
- package/src/Components/DataDisplay/Accordion/AccordionProps.tsx +2 -1
- package/src/Components/DataDisplay/Accordion/accordion-bg-design.tsx +5 -5
- package/src/Components/DataDisplay/Accordion/accordion.module.scss +42 -23
- package/src/Components/DataDisplay/ChatItenaryBlock/ChatItenaryBlock.tsx +1 -1
- package/src/Components/DataDisplay/ContactsBlock/ContactsBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/ContactsBlock/contactsBlock.module.scss +6 -1
- package/src/Components/DataDisplay/DetailsCard/DetailsCard.tsx +3 -1
- package/src/Components/DataDisplay/ImageContent/ImageContent.stories.tsx +2 -0
- package/src/Components/DataDisplay/ImageContent/ImageContent.tsx +6 -4
- package/src/Components/DataDisplay/ImageContent/ImageContentProps.tsx +4 -0
- package/src/Components/DataDisplay/KPIBlock/KPIBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/KPIBlock/KPIBlock.tsx +1 -16
- package/src/Components/DataDisplay/KPIBlock/kpiBlock.module.scss +2 -0
- package/src/Components/DataDisplay/Media/Media.stories.tsx +2 -8
- package/src/Components/DataDisplay/Media/Media.tsx +66 -31
- package/src/Components/DataDisplay/Media/MediaProps.tsx +1 -0
- package/src/Components/DataDisplay/Media/media.module.scss +16 -0
- package/src/Components/DataDisplay/Media/{media.scss → mediaVideo.scss} +6 -0
- package/src/Components/Layout/Footer/Footer.tsx +1 -1
- package/src/Components/Layout/Footer/FooterBottom.tsx +7 -7
- package/src/Components/Layout/Footer/FooterTop.tsx +1 -1
- package/src/Components/Layout/Header/Header.stories.tsx +3 -3
- package/src/Components/Layout/Header/Header.tsx +1 -1
- package/src/Components/Layout/Header/MegaMenu/MegaMenu.tsx +1 -1
- package/src/Components/Layout/Header/MobileNavigation/MobileNavigation.tsx +1 -1
- package/src/Components/Layout/Header/MobileNavigation/MobileSubNavigation/MobileSubNavigation.tsx +1 -1
- package/src/Components/Layout/Header/header.module.scss +11 -18
- package/src/Components/Layout/HeroBanner/HeroBanner.tsx +3 -3
- package/src/Components/Shared/Container/Container.tsx +15 -8
- package/src/Components/Shared/Container/ContainerProps.tsx +6 -1
- package/src/Components/Shared/Container/container.module.scss +22 -0
- package/src/Components/Shared/ElementHolder/elementHolder.module.scss +9 -5
|
@@ -6,6 +6,8 @@ import Accordion from './Accordion.tsx';
|
|
|
6
6
|
import AccordionItem from './AccordionItem.tsx';
|
|
7
7
|
import Container from "../../Shared/Container/Container";
|
|
8
8
|
import ElementHolder from "../../Shared/ElementHolder/ElementHolder";
|
|
9
|
+
import Button from "../../Form/Button/Button.tsx";
|
|
10
|
+
import { ArrowRight } from "@hellobetterdigitalnz/selwynui";
|
|
9
11
|
|
|
10
12
|
const meta: Meta = {
|
|
11
13
|
title: 'DataDisplay / Accordion',
|
|
@@ -22,7 +24,6 @@ type Story = StoryObj<typeof meta>;
|
|
|
22
24
|
|
|
23
25
|
const AccordionTemplate: Story = {
|
|
24
26
|
render: ({ items, ...args }) => {
|
|
25
|
-
// keep track of open states by index
|
|
26
27
|
const [openItems, setOpenItems] = useState<Record<string, boolean>>({});
|
|
27
28
|
|
|
28
29
|
const handleToggle = (id: string, value: boolean) => {
|
|
@@ -31,8 +32,7 @@ const AccordionTemplate: Story = {
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<ElementHolder paddingBottom="md" paddingTop="sm" pillar="visit">
|
|
34
|
-
|
|
35
|
-
<Accordion {...args}>
|
|
35
|
+
<Accordion {...args}>
|
|
36
36
|
{items.map((item: any) => (
|
|
37
37
|
<AccordionItem
|
|
38
38
|
key={item.index}
|
|
@@ -45,9 +45,6 @@ const AccordionTemplate: Story = {
|
|
|
45
45
|
</AccordionItem>
|
|
46
46
|
))}
|
|
47
47
|
</Accordion>
|
|
48
|
-
</Container>
|
|
49
|
-
|
|
50
|
-
{/* Buttons to trigger specific IDs */}
|
|
51
48
|
</ElementHolder>
|
|
52
49
|
);
|
|
53
50
|
},
|
|
@@ -58,32 +55,23 @@ export const Example = {
|
|
|
58
55
|
args: {
|
|
59
56
|
allowMultiple:true,
|
|
60
57
|
title: 'Insights lorem ipsum dolor sit amet',
|
|
61
|
-
content: '
|
|
58
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ',
|
|
62
59
|
// image: '/img/accordion-image.svg',
|
|
63
60
|
items: [
|
|
64
61
|
{
|
|
65
62
|
index:'1',
|
|
66
63
|
title: 'Lorem ipsum dolor',
|
|
67
|
-
children:
|
|
64
|
+
children: <p>Sed fringilla magna facilisis auctor venenatis. Duis ut vestibulum risus. Nunc a finibus dui. Donec hendrerit tristique odio, ac porta dui maximus et. Duis vestibulum velit eget erat fermentum, fermentum mollis tortor tincidunt. Integer lacinia lacinia urna scelerisque mattis. Fusce vestibulum felis eget magna placerat faucibus id et tellus. Sed rutrum mi sed leo viverra tempus. Nunc eu congue tellus, sed dapibus dui.</p>
|
|
68
65
|
},
|
|
69
66
|
{
|
|
70
67
|
index:'2',
|
|
71
68
|
title: 'Lorem ipsum dolor',
|
|
72
69
|
children: <>
|
|
73
|
-
<p>
|
|
70
|
+
<p>Sed fringilla magna facilisis auctor venenatis. Duis ut vestibulum risus. Nunc a finibus dui. Donec hendrerit tristique odio, ac porta dui maximus et. Duis vestibulum velit eget erat fermentum, fermentum mollis tortor tincidunt. Integer lacinia lacinia urna scelerisque mattis. Fusce vestibulum felis eget magna placerat faucibus id et tellus. Sed rutrum mi sed leo viverra tempus. Nunc eu congue tellus, sed dapibus dui.</p>
|
|
71
|
+
<Button label="LEARN MORE" secondaryIcon={<ArrowRight/>} pillar="taste"/>
|
|
74
72
|
<img src="/img/accordion-image.svg" alt="" />
|
|
75
73
|
</>,
|
|
76
74
|
},
|
|
77
|
-
{
|
|
78
|
-
index:'3',
|
|
79
|
-
title: 'Lorem ipsum dolor',
|
|
80
|
-
children: 'Sed fringilla magna facilisis auctor venenatis. Duis ut vestibulum risus. Nunc a finibus dui. Donec hendrerit tristique odio, ac porta dui maximus et. Duis vestibulum velit eget erat fermentum, fermentum mollis tortor tincidunt. Integer lacinia lacinia urna scelerisque mattis. Fusce vestibulum felis eget magna placerat faucibus id et tellus. Sed rutrum mi sed leo viverra tempus. Nunc eu congue tellus, sed dapibus dui.'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
index:'4',
|
|
84
|
-
title: 'Lorem ipsum dolor',
|
|
85
|
-
children: 'Sed fringilla magna facilisis auctor venenatis. Duis ut vestibulum risus. Nunc a finibus dui. Donec hendrerit tristique odio, ac porta dui maximus et. Duis vestibulum velit eget erat fermentum, fermentum mollis tortor tincidunt. Integer lacinia lacinia urna scelerisque mattis. Fusce vestibulum felis eget magna placerat faucibus id et tellus. Sed rutrum mi sed leo viverra tempus. Nunc eu congue tellus, sed dapibus dui.'
|
|
86
|
-
},
|
|
87
75
|
],
|
|
88
76
|
},
|
|
89
77
|
};
|
|
@@ -3,6 +3,7 @@ import AccordionProvider from "./AccordionProvider";
|
|
|
3
3
|
import AccordionProps from "./AccordionProps.tsx";
|
|
4
4
|
import ScrollFadeIn from "../../Shared/ScrollFadeIn/ScrollFadeIn.tsx";
|
|
5
5
|
import AccordionBgDesign from "./accordion-bg-design.tsx";
|
|
6
|
+
import { Container } from "../../Shared/index.ts";
|
|
6
7
|
|
|
7
8
|
const Accordion = (props: AccordionProps) => {
|
|
8
9
|
const {
|
|
@@ -31,7 +32,8 @@ const Accordion = (props: AccordionProps) => {
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<AccordionProvider allowMultiple={allowMultiple ?? false} >
|
|
34
|
-
<
|
|
35
|
+
<Container>
|
|
36
|
+
<div className={styles.accordionBlock} >
|
|
35
37
|
{title && (
|
|
36
38
|
<div className={styles.accordionHeading}>
|
|
37
39
|
<ScrollFadeIn>
|
|
@@ -42,12 +44,13 @@ const Accordion = (props: AccordionProps) => {
|
|
|
42
44
|
|
|
43
45
|
)}
|
|
44
46
|
<div className={`${styles.accordionWrapper}`}>
|
|
45
|
-
<div className={styles.accordionBgDesignContainer}>
|
|
46
|
-
<AccordionBgDesign />
|
|
47
|
-
</div>
|
|
48
47
|
{children}
|
|
49
48
|
</div>
|
|
49
|
+
<div className={styles.accordionBgDesignContainer}>
|
|
50
|
+
<AccordionBgDesign />
|
|
51
|
+
</div>
|
|
50
52
|
</div>
|
|
53
|
+
</Container>
|
|
51
54
|
</AccordionProvider>
|
|
52
55
|
);
|
|
53
56
|
};
|
|
@@ -132,7 +132,7 @@ const AccordionItem = (props: AccordionItemProps) => {
|
|
|
132
132
|
<h4>{title}</h4>
|
|
133
133
|
</div>
|
|
134
134
|
<div className={`${styles.icon} accordionIcon`}>
|
|
135
|
-
{isOpened ? <CaretUp
|
|
135
|
+
{isOpened ? <CaretUp/> : <CaretDown />}
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
138
|
|
|
@@ -150,7 +150,7 @@ const AccordionItem = (props: AccordionItemProps) => {
|
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
152
|
|
|
153
|
-
<
|
|
153
|
+
<div className={styles.accordionHorizontalLine}></div>
|
|
154
154
|
|
|
155
155
|
</div>
|
|
156
156
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ReactNode} from "react";
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
interface AccordionProps {
|
|
4
4
|
allowMultiple?: boolean;
|
|
@@ -8,6 +8,7 @@ interface AccordionProps {
|
|
|
8
8
|
image?: string;
|
|
9
9
|
activeId?: number | null;
|
|
10
10
|
onActiveIdChange?: (id: number | null) => void;
|
|
11
|
+
pillar?: 'visit' | 'live' | 'business' | 'participate' | 'taste'
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export default AccordionProps;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const AccordionBgDesign = () => {
|
|
2
2
|
return (
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="639" height="577" viewBox="0 0 639 577" fill="none">
|
|
4
4
|
<g opacity="0.05">
|
|
5
|
-
<path d="
|
|
6
|
-
<path d="
|
|
7
|
-
<path d="
|
|
8
|
-
<path d="
|
|
5
|
+
<path d="M639 296.466C467.655 296.466 328.715 422.083 328.715 577H639V296.466Z" fill="currentColor" />
|
|
6
|
+
<path d="M639 0.0916445C467.655 0.0916445 328.715 125.71 328.715 280.626H639V0.0916445Z" fill="currentColor" />
|
|
7
|
+
<path d="M0 576.908C0 421.992 138.94 296.374 310.285 296.374V576.908H0Z" fill="currentColor" />
|
|
8
|
+
<path d="M0 280.534C0 125.618 138.94 0 310.285 0V280.534H0Z" fill="currentColor" />
|
|
9
9
|
</g>
|
|
10
10
|
</svg>
|
|
11
11
|
)
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
font-size: var(--font-size-h4);
|
|
5
5
|
font-weight: var(--font-weight-bold);
|
|
6
6
|
line-height: var(--line-height-h4);
|
|
7
|
-
|
|
7
|
+
letter-spacing: var(--letter-spacing-h4);
|
|
8
|
+
padding-bottom: 32px;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
p {
|
|
@@ -19,7 +20,6 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.accordionWrapper {
|
|
22
|
-
margin-block: 72px;
|
|
23
23
|
|
|
24
24
|
.title {
|
|
25
25
|
flex: 1;
|
|
@@ -32,46 +32,61 @@
|
|
|
32
32
|
font-weight: var(--font-weight-bold);
|
|
33
33
|
line-height: var(--line-height-body-regular);
|
|
34
34
|
}
|
|
35
|
+
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
.icon {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
margin-right: 4px;
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
42
|
+
svg {
|
|
43
|
+
width: 24px !important;
|
|
44
|
+
height: 24px !important;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
|
|
48
49
|
.accordion {
|
|
49
50
|
display: flex;
|
|
50
51
|
flex-direction: column;
|
|
51
52
|
overflow: hidden;
|
|
53
|
+
|
|
54
|
+
.accordionHorizontalLine {
|
|
55
|
+
border-bottom: 1px solid var(--color-text);
|
|
56
|
+
height: 0;
|
|
57
|
+
width: 100%;
|
|
58
|
+
}
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
.header {
|
|
55
62
|
display: flex;
|
|
56
63
|
align-items: center;
|
|
57
64
|
cursor: pointer;
|
|
65
|
+
padding: 16px 32px;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
.accordionBodyHolder {
|
|
61
69
|
.accordionBody {
|
|
62
|
-
font-size: var(--font-size-body-regular);
|
|
63
|
-
font-weight: var(--font-weight-body-regular);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
img {
|
|
72
|
+
width: 100%;
|
|
73
|
+
padding: 32px 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
.bodyInner {
|
|
73
79
|
font-size: var(--font-size-body-regular);
|
|
74
80
|
font-weight: var(--font-weight-body-regular);
|
|
81
|
+
padding-left: 32px;
|
|
82
|
+
|
|
83
|
+
p {
|
|
84
|
+
margin: 8px 32px 32px 0;
|
|
85
|
+
font-size: var(--font-size-body-regular);
|
|
86
|
+
font-weight: var(--font-weight-body-regular);
|
|
87
|
+
padding: 0 16px 0 0;
|
|
88
|
+
line-height: var(--line-height-body-regular);
|
|
89
|
+
}
|
|
75
90
|
}
|
|
76
91
|
}
|
|
77
92
|
|
|
@@ -79,25 +94,29 @@
|
|
|
79
94
|
|
|
80
95
|
display: flex;
|
|
81
96
|
flex-grow: 1;
|
|
82
|
-
|
|
97
|
+
margin: 0 -45px;
|
|
83
98
|
|
|
84
99
|
.accordionHeading {
|
|
85
|
-
width:
|
|
100
|
+
width: 39%;
|
|
101
|
+
padding: 0 45px;
|
|
102
|
+
|
|
103
|
+
h2 {
|
|
104
|
+
padding-bottom: 72px;
|
|
105
|
+
}
|
|
86
106
|
}
|
|
87
107
|
|
|
88
108
|
.accordionWrapper {
|
|
89
|
-
width:
|
|
109
|
+
width: 61%;
|
|
90
110
|
position: relative;
|
|
111
|
+
padding: 0 45px;
|
|
91
112
|
}
|
|
92
113
|
|
|
93
114
|
.accordionBgDesignContainer {
|
|
94
115
|
position: absolute;
|
|
95
|
-
top:
|
|
116
|
+
top: 191px;
|
|
96
117
|
right: 0;
|
|
97
118
|
pointer-events: none;
|
|
98
119
|
display: block;
|
|
99
120
|
}
|
|
100
121
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
122
|
}
|
|
@@ -63,7 +63,7 @@ const ChatItineraryBlock = (props: ChatItineraryBlockProps) => {
|
|
|
63
63
|
|
|
64
64
|
<div className={`${styles.chatItineraryBlock} ${styles.hero}`}>
|
|
65
65
|
<div style={{backgroundImage: `url('https://images.pexels.com/photos/1563356/pexels-photo-1563356.jpeg')`}} className={styles.heroBackground}></div>
|
|
66
|
-
<Container>
|
|
66
|
+
<Container border={false}>
|
|
67
67
|
<div className={styles.heroContent}>
|
|
68
68
|
<h1 className={styles.titleHeader}>
|
|
69
69
|
Kia ora, I’m your AI<br />
|
|
@@ -19,7 +19,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
19
19
|
const ContactsBlockTemplate: Story = {
|
|
20
20
|
render: () => {
|
|
21
21
|
return (
|
|
22
|
-
<ElementHolder paddingTop="md" paddingBottom="md" pillar="
|
|
22
|
+
<ElementHolder paddingTop="md" paddingBottom="md" pillar="live" level="light">
|
|
23
23
|
<ContactBlock contactBlockTitle={'Meet the team'}>
|
|
24
24
|
<ContactItem
|
|
25
25
|
image={'./img/contact-image.svg'}
|
|
@@ -37,12 +37,15 @@
|
|
|
37
37
|
font-size: var(--font-size-h6);
|
|
38
38
|
font-weight: var(--font-weight-bold);
|
|
39
39
|
line-height: var(--line-height-h6);
|
|
40
|
+
letter-spacing: -0.56px;
|
|
41
|
+
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
h2 {
|
|
43
45
|
font-size: var(--font-size-h6);
|
|
44
46
|
font-weight: var(--font-weight-h4);
|
|
45
47
|
line-height: var(--line-height-h6);
|
|
48
|
+
letter-spacing: -0.56px;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -113,11 +116,13 @@
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
.contactMiddleContent {
|
|
116
|
-
padding-block:
|
|
119
|
+
padding-block: 58px;
|
|
117
120
|
|
|
118
121
|
p {
|
|
119
122
|
font-size: var(--font-size-small);
|
|
120
123
|
font-weight: var(--font-weight-h4);
|
|
124
|
+
letter-spacing: -0.48px;
|
|
125
|
+
text-decoration: underline;
|
|
121
126
|
}
|
|
122
127
|
}
|
|
123
128
|
|
|
@@ -11,11 +11,13 @@ const DetailsCard = (props: DetailsCardProps) => {
|
|
|
11
11
|
image = '',
|
|
12
12
|
variation= 'long',
|
|
13
13
|
link = {},
|
|
14
|
+
pillar = 'visit'
|
|
14
15
|
} = props;
|
|
15
16
|
|
|
16
17
|
const classes = [
|
|
17
18
|
styles.detailsCard,
|
|
18
|
-
"detailsCard",
|
|
19
|
+
"detailsCard",
|
|
20
|
+
`${pillar}`
|
|
19
21
|
];
|
|
20
22
|
|
|
21
23
|
if(variation==='short') {
|
|
@@ -31,6 +31,8 @@ const ImageContentTemplate: Story = {
|
|
|
31
31
|
level={'light'}
|
|
32
32
|
>
|
|
33
33
|
<ImageContent
|
|
34
|
+
paddingTop={'md'}
|
|
35
|
+
paddingBottom={'md'}
|
|
34
36
|
title={'Lorem'}
|
|
35
37
|
boldTitle={'ipsum dolor'}
|
|
36
38
|
content={'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat'}
|
|
@@ -20,6 +20,8 @@ const ImageContent = (props: ImageContentProps) => {
|
|
|
20
20
|
imageBorder = "top-right",
|
|
21
21
|
rendition = "contained",
|
|
22
22
|
list,
|
|
23
|
+
spaceTop = 'none',
|
|
24
|
+
spaceBottom = 'none',
|
|
23
25
|
} = props;
|
|
24
26
|
|
|
25
27
|
const pillarLogo = (
|
|
@@ -39,7 +41,7 @@ const ImageContent = (props: ImageContentProps) => {
|
|
|
39
41
|
|
|
40
42
|
if (rendition === 'full'){
|
|
41
43
|
return <div className={`${styles.imageContent} ${styles.imageContentFull} ${styles[imageBorder]} `}>
|
|
42
|
-
<Container>
|
|
44
|
+
<Container spaceTop={spaceTop} spaceBottom={spaceBottom}>
|
|
43
45
|
<div className={styles.imageContentWrapper}>
|
|
44
46
|
<div className={styles.content}>
|
|
45
47
|
<div className={styles.contentWrapper}>
|
|
@@ -85,7 +87,7 @@ const ImageContent = (props: ImageContentProps) => {
|
|
|
85
87
|
|
|
86
88
|
if(rendition === "fluid"){
|
|
87
89
|
return <div className={`${styles.imageContent} ${styles.imageContentFluid} ${styles[alignment]}`}>
|
|
88
|
-
<Container>
|
|
90
|
+
<Container spaceTop={spaceTop} spaceBottom={spaceBottom}>
|
|
89
91
|
<div className={styles.imageContentWrapper}>
|
|
90
92
|
<div className={styles.imageWrapper}>
|
|
91
93
|
<div className={styles.imageHolder}>
|
|
@@ -125,7 +127,7 @@ const ImageContent = (props: ImageContentProps) => {
|
|
|
125
127
|
if (rendition === 'masked'){
|
|
126
128
|
return (
|
|
127
129
|
<div className={`${styles.imageContent} ${styles.maskedImageContent} ${styles[alignment]}`}>
|
|
128
|
-
<Container>
|
|
130
|
+
<Container spaceTop={spaceTop} spaceBottom={spaceBottom}>
|
|
129
131
|
<div className={styles.imageContentWrapper}>
|
|
130
132
|
|
|
131
133
|
{/* IMAGE BLOCK */}
|
|
@@ -158,7 +160,7 @@ const ImageContent = (props: ImageContentProps) => {
|
|
|
158
160
|
|
|
159
161
|
|
|
160
162
|
return <div className={`${styles.imageContent} ${styles[alignment]}`}>
|
|
161
|
-
<Container>
|
|
163
|
+
<Container spaceTop={spaceTop} spaceBottom={spaceBottom}>
|
|
162
164
|
<div className={styles.imageContentWrapper}>
|
|
163
165
|
<div className={styles.imageWrapper}>
|
|
164
166
|
<div className={styles.imageHolder}>
|
|
@@ -14,6 +14,8 @@ export type RenditionType =
|
|
|
14
14
|
| "contained"
|
|
15
15
|
| "masked";
|
|
16
16
|
|
|
17
|
+
type SpacingOption = "none" | "xsm" |"sm" | "md" | "lg" | "xl"
|
|
18
|
+
|
|
17
19
|
export interface ImageSet {
|
|
18
20
|
single?: string;
|
|
19
21
|
setOfFour?: [string, string, string, string];
|
|
@@ -38,6 +40,8 @@ export interface ImageContentProps {
|
|
|
38
40
|
imageBorder?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
|
39
41
|
rendition?: RenditionType;
|
|
40
42
|
list?: Item[];
|
|
43
|
+
spaceTop?: SpacingOption
|
|
44
|
+
spaceBottom?: SpacingOption
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
export default ImageContentProps;
|
|
@@ -54,7 +54,7 @@ const KPIBlockBusinessTemplate: Story = {
|
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
56
|
<>
|
|
57
|
-
<ElementHolder paddingTop="sm" paddingBottom="sm" pillar="business" level="
|
|
57
|
+
<ElementHolder paddingTop="sm" paddingBottom="sm" pillar="business" level="light">
|
|
58
58
|
<KPIBlock
|
|
59
59
|
title={'Business Growth Statistics'}
|
|
60
60
|
description={'Our comprehensive approach to business development has yielded impressive results across multiple sectors.'}
|
|
@@ -2,7 +2,6 @@ import KPIBlockProps from "./KPIBlockProps.tsx";
|
|
|
2
2
|
import styles from './kpiBlock.module.scss';
|
|
3
3
|
import Container from "../../Shared/Container/Container.tsx";
|
|
4
4
|
import PillarIcon from "../../Shared/PillarIcon/PillarIcon.tsx";
|
|
5
|
-
import ElementHolder from "../../Shared/ElementHolder/ElementHolder.tsx";
|
|
6
5
|
import cslx from "clsx";
|
|
7
6
|
|
|
8
7
|
|
|
@@ -12,11 +11,6 @@ const KPIBlock = (props: KPIBlockProps) => {
|
|
|
12
11
|
description,
|
|
13
12
|
stats = [],
|
|
14
13
|
pillar ,
|
|
15
|
-
paddingTop,
|
|
16
|
-
paddingBottom,
|
|
17
|
-
level,
|
|
18
|
-
marginBottom,
|
|
19
|
-
marginTop,
|
|
20
14
|
spacingBottom='xsm',
|
|
21
15
|
} = props;
|
|
22
16
|
|
|
@@ -29,14 +23,6 @@ const KPIBlock = (props: KPIBlockProps) => {
|
|
|
29
23
|
);
|
|
30
24
|
|
|
31
25
|
return (
|
|
32
|
-
<ElementHolder
|
|
33
|
-
paddingTop={paddingTop}
|
|
34
|
-
paddingBottom={paddingBottom}
|
|
35
|
-
pillar={pillar}
|
|
36
|
-
level={level}
|
|
37
|
-
marginBottom={marginBottom}
|
|
38
|
-
marginTop={marginTop}
|
|
39
|
-
>
|
|
40
26
|
<div className={`${styles.kpi} ${className}`}>
|
|
41
27
|
<Container>
|
|
42
28
|
<div className={styles.kpiWrapper}>
|
|
@@ -54,11 +40,10 @@ const KPIBlock = (props: KPIBlockProps) => {
|
|
|
54
40
|
</div>
|
|
55
41
|
</div>
|
|
56
42
|
</Container>
|
|
57
|
-
</div>
|
|
58
43
|
<div className={styles.pillarIcon}>
|
|
59
44
|
<PillarIcon pillar={pillar}/>
|
|
60
45
|
</div>
|
|
61
|
-
</
|
|
46
|
+
</div>
|
|
62
47
|
);
|
|
63
48
|
};
|
|
64
49
|
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
display: flex;
|
|
73
73
|
flex-direction: inherit;
|
|
74
74
|
align-items: start;
|
|
75
|
+
width: 100%;
|
|
75
76
|
|
|
76
77
|
@media (max-width: 900px) {
|
|
77
78
|
flex-direction: column;
|
|
@@ -207,6 +208,7 @@
|
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
.pillarIcon {
|
|
211
|
+
color: var(--color-block-text);
|
|
210
212
|
position: absolute;
|
|
211
213
|
right: 0;
|
|
212
214
|
bottom: 0;
|
|
@@ -21,17 +21,11 @@ const PathwayBlockTemplate: Story = {
|
|
|
21
21
|
render: () => {
|
|
22
22
|
|
|
23
23
|
const mediaProps = {
|
|
24
|
-
|
|
24
|
+
thumbnail: "https://images.unsplash.com/photo-1501594907352-04cda38ebc29?w=1200&h=675&fit=crop",
|
|
25
25
|
videoSrc: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
return
|
|
29
|
-
<>
|
|
30
|
-
<ElementHolder pillar="taste">
|
|
31
|
-
<Media {...mediaProps} />
|
|
32
|
-
</ElementHolder>
|
|
33
|
-
</>
|
|
34
|
-
)
|
|
28
|
+
return <Media pillar={'visit'} {...mediaProps} />
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
31
|
|
|
@@ -1,57 +1,92 @@
|
|
|
1
1
|
import MediaProps from "./MediaProps.tsx";
|
|
2
|
-
import {useEffect, useRef} from "react";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
3
|
import videojs from "video.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const Media = (props : MediaProps) => {
|
|
8
|
-
|
|
9
|
-
const {imageSrc , videoSrc, thumbnail} = props
|
|
4
|
+
import "video.js/dist/video-js.css";
|
|
5
|
+
import styles from "./media.module.scss";
|
|
6
|
+
import './mediaVideo.scss'
|
|
10
7
|
|
|
8
|
+
const Media = ({ imageSrc, videoSrc, thumbnail, pillar }: MediaProps) => {
|
|
11
9
|
const videoRef = useRef<HTMLVideoElement>(null);
|
|
12
10
|
const playerRef = useRef<any>(null);
|
|
13
11
|
|
|
14
12
|
useEffect(() => {
|
|
15
|
-
if (!playerRef.current && videoRef.current) {
|
|
16
|
-
const videoElement = videoRef.current;
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
if (imageSrc) {
|
|
15
|
+
if (playerRef.current) {
|
|
16
|
+
playerRef.current.dispose();
|
|
17
|
+
playerRef.current = null;
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Init video player only if NO imageSrc
|
|
23
|
+
if (!playerRef.current && videoRef.current) {
|
|
24
|
+
playerRef.current = videojs(videoRef.current, {
|
|
19
25
|
controls: true,
|
|
20
26
|
responsive: true,
|
|
21
27
|
fluid: true,
|
|
22
|
-
preload:
|
|
28
|
+
preload: "metadata",
|
|
23
29
|
playbackRates: [0.5, 1, 1.5, 2],
|
|
24
30
|
poster: thumbnail,
|
|
25
31
|
controlBar: {
|
|
26
|
-
volumePanel: {
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
volumePanel: { inline: true },
|
|
33
|
+
playToggle: true,
|
|
34
|
+
currentTimeDisplay: true,
|
|
35
|
+
timeDivider: true,
|
|
36
|
+
durationDisplay: true,
|
|
37
|
+
remainingTimeDisplay: false,
|
|
38
|
+
progressControl: true,
|
|
39
|
+
fullscreenToggle: true,
|
|
40
|
+
playbackRateMenuButton: true,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Add custom SVG icon to big play button
|
|
45
|
+
playerRef.current.ready(() => {
|
|
46
|
+
const bigPlayButton = playerRef.current.el().querySelector('.vjs-big-play-button');
|
|
47
|
+
if (bigPlayButton) {
|
|
48
|
+
bigPlayButton.innerHTML = `
|
|
49
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none">
|
|
50
|
+
<path d="M13.5 7.47751V40.5225C13.5049 40.7862 13.5792 41.0439 13.7155 41.2698C13.8518 41.4956 14.0452 41.6814 14.2762 41.8086C14.5073 41.9358 14.7678 41.9999 15.0314 41.9943C15.2951 41.9887 15.5527 41.9137 15.7781 41.7769L42.7931 25.2544C43.0089 25.1238 43.1874 24.9397 43.3112 24.72C43.4351 24.5002 43.5001 24.2523 43.5001 24C43.5001 23.7478 43.4351 23.4998 43.3112 23.2801C43.1874 23.0603 43.0089 22.8762 42.7931 22.7456L15.7781 6.22314C15.5527 6.08628 15.2951 6.01128 15.0314 6.00571C14.7678 6.00013 14.5073 6.06418 14.2762 6.19139C14.0452 6.3186 13.8518 6.50448 13.7155 6.73028C13.5792 6.95608 13.5049 7.21382 13.5 7.47751Z" fill="currentColor"/>
|
|
51
|
+
</svg>
|
|
52
|
+
`;
|
|
29
53
|
}
|
|
30
54
|
});
|
|
31
55
|
}
|
|
32
56
|
|
|
57
|
+
|
|
58
|
+
if (playerRef.current && videoSrc) {
|
|
59
|
+
playerRef.current.src({ src: videoSrc, type: "video/mp4" });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Cleanup on unmount
|
|
33
63
|
return () => {
|
|
34
64
|
if (playerRef.current) {
|
|
35
65
|
playerRef.current.dispose();
|
|
36
66
|
playerRef.current = null;
|
|
37
67
|
}
|
|
38
68
|
};
|
|
39
|
-
}, [imageSrc]);
|
|
40
|
-
|
|
41
|
-
return <div className="video-container">
|
|
42
|
-
<div className="video-wrapper">
|
|
43
|
-
<div data-vjs-player>
|
|
44
|
-
<video
|
|
45
|
-
ref={videoRef}
|
|
46
|
-
className="video-js vjs-big-play-centered"
|
|
47
|
-
playsInline
|
|
48
|
-
>
|
|
49
|
-
<source src={videoSrc} type="video/mp4" />
|
|
50
|
-
</video>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
69
|
+
}, [imageSrc, videoSrc, thumbnail]);
|
|
54
70
|
|
|
55
|
-
}
|
|
71
|
+
return <div className={`${pillar}`}>
|
|
72
|
+
{imageSrc ? (
|
|
73
|
+
<div className={styles.media}>
|
|
74
|
+
<div className={`${styles.imgWrapper}`}>
|
|
75
|
+
<img src={imageSrc} alt="" className="media-image" />
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
) : (
|
|
79
|
+
<div className="video-container">
|
|
80
|
+
<div data-vjs-player>
|
|
81
|
+
<video
|
|
82
|
+
ref={videoRef}
|
|
83
|
+
className="video-js vjs-big-play-centered"
|
|
84
|
+
playsInline
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
};
|
|
56
91
|
|
|
57
|
-
export default Media;
|
|
92
|
+
export default Media;
|