@hellobetterdigitalnz/selwynui 0.0.1-50 → 0.0.1-51
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/Media/Media.d.ts +1 -1
- package/dist/Components/DataDisplay/Media/MediaProps.d.ts +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +8 -6
- package/dist/index.es.js.map +1 -1
- package/dist/selwynui.css +1 -1
- package/package.json +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/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/Header/Header.stories.tsx +3 -3
- package/src/Components/Layout/Header/header.module.scss +11 -18
|
@@ -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') {
|
|
@@ -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;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
.video-container{
|
|
2
4
|
.vjs-big-play-button{
|
|
3
5
|
background: var(--color-block-bg) !important;
|
|
6
|
+
color: var(--color-block-text);
|
|
4
7
|
height: 114px;
|
|
5
8
|
width: 114px;
|
|
6
9
|
border-radius: 100%;
|
|
7
10
|
border: none;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
.vjs_video_4320-dimensions.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
@@ -61,9 +61,9 @@ const HeaderTemplate: Story = {
|
|
|
61
61
|
<HeaderRightItem extraClass={'desktop-item'}>
|
|
62
62
|
<MagnifyingGlass/>
|
|
63
63
|
</HeaderRightItem>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
{/*<HeaderRightItem extraClass={'mobile-item'}>*/}
|
|
65
|
+
{/* <List/>*/}
|
|
66
|
+
{/*</HeaderRightItem>*/}
|
|
67
67
|
</HeaderRight>
|
|
68
68
|
{/*<MobileNavigation>*/}
|
|
69
69
|
{/* <li>*/}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
align-items: flex-end;
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
min-height: 60px;
|
|
14
|
+
width: 100%;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.headerLogo{
|
|
@@ -33,11 +34,9 @@
|
|
|
33
34
|
.headerRightWrapper{
|
|
34
35
|
display: flex;
|
|
35
36
|
align-items: center;
|
|
36
|
-
margin: 0 -12px;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.headerBottomItemHolder{
|
|
40
|
-
padding: 0 12px 12px 12px;
|
|
41
40
|
transition: all 0.3s ease-in;
|
|
42
41
|
|
|
43
42
|
a{
|
|
@@ -48,6 +47,7 @@
|
|
|
48
47
|
font-weight: 400;
|
|
49
48
|
line-height: 1.5;
|
|
50
49
|
cursor: pointer;
|
|
50
|
+
letter-spacing: -0.96px;
|
|
51
51
|
|
|
52
52
|
.icon{
|
|
53
53
|
display: flex;
|
|
@@ -96,19 +96,6 @@
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
@media screen and (min-width: 1648px) {
|
|
100
|
-
|
|
101
|
-
.headerRightWrapper{
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
margin: 0 -28px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.headerBottomItemHolder {
|
|
108
|
-
padding: 0 28px 30px 28px;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
99
|
|
|
113
100
|
@media screen and (min-width: 992px) {
|
|
114
101
|
|
|
@@ -125,9 +112,15 @@
|
|
|
125
112
|
}
|
|
126
113
|
|
|
127
114
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
115
|
+
.headerRightWrapper{
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.headerBottomItemHolder {
|
|
121
|
+
padding-bottom: 30px;
|
|
122
|
+
padding-left: 60px;
|
|
123
|
+
}
|
|
131
124
|
|
|
132
125
|
}
|
|
133
126
|
|