@hellobetterdigitalnz/selwynui 0.0.1-47 → 0.0.1-49

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 (34) hide show
  1. package/dist/Components/DataDisplay/ContentBlock/ContentBlockProps.d.ts +3 -0
  2. package/dist/Components/DataDisplay/KPIBlock/KPIBlockProps.d.ts +2 -0
  3. package/dist/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.d.ts +1 -1
  4. package/dist/Components/DataDisplay/ListingDetailBlock/ListingDetailBlockProps.d.ts +15 -9
  5. package/dist/Components/DataDisplay/Media/Media.d.ts +3 -0
  6. package/dist/Components/DataDisplay/Media/MediaProps.d.ts +6 -0
  7. package/dist/index.cjs.js +12 -16
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.es.js +2751 -2761
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/selwynui.css +1 -1
  12. package/package.json +2 -1
  13. package/src/Components/DataDisplay/ContentBlock/ContentBlock.stories.tsx +2 -2
  14. package/src/Components/DataDisplay/ContentBlock/ContentBlock.tsx +1 -3
  15. package/src/Components/DataDisplay/ContentBlock/contentBlock.module.scss +16 -33
  16. package/src/Components/DataDisplay/DetailsCard/DetailsCard.tsx +1 -4
  17. package/src/Components/DataDisplay/KPIBlock/KPIBlock.tsx +12 -2
  18. package/src/Components/DataDisplay/KPIBlock/KPIBlockProps.tsx +3 -1
  19. package/src/Components/DataDisplay/KPIBlock/kpiBlock.module.scss +69 -0
  20. package/src/Components/DataDisplay/ListBlock/ListBlock.stories.tsx +3 -3
  21. package/src/Components/DataDisplay/ListBlock/ListBlock.tsx +20 -8
  22. package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.stories.tsx +55 -9
  23. package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.tsx +55 -82
  24. package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlockProps.tsx +18 -12
  25. package/src/Components/DataDisplay/ListingDetailBlock/listingDetailBlock.module.scss +21 -13
  26. package/src/Components/DataDisplay/ListingDetailBlock/listingDetailBlock.module.scss~ +248 -0
  27. package/src/Components/DataDisplay/Media/Media.stories.tsx +42 -0
  28. package/src/Components/DataDisplay/Media/Media.tsx +57 -0
  29. package/src/Components/DataDisplay/Media/MediaProps.tsx +7 -0
  30. package/src/Components/DataDisplay/Media/media.scss +14 -0
  31. package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.stories.tsx +24 -14
  32. package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.stories.tsx~ +80 -0
  33. package/src/Components/DataDisplay/PathwayBlock/pathwayBlock.module.scss +2 -0
  34. package/src/Components/Shared/ElementHolder/elementHolder.module.scss +1 -0
@@ -0,0 +1,248 @@
1
+ .listingDetail {
2
+ display: flex;
3
+ gap: 48px;
4
+ padding: 32px;
5
+ border-radius: 8px;
6
+ position: relative;
7
+
8
+ &::before {
9
+ content: '';
10
+ position: absolute;
11
+ left: 51%;
12
+ top: 32px;
13
+ bottom: 32px;
14
+ width: 1px;
15
+ background: var(--color-bg);
16
+ transform: translateX(-50%);
17
+ z-index: 1;
18
+ pointer-events: none;
19
+
20
+ @media (max-width: 900px) {
21
+ display: none;
22
+ }
23
+ }
24
+
25
+ @media (max-width: 900px) {
26
+ flex-direction: column-reverse;
27
+ padding: 24px 16px;
28
+ gap: 48px;
29
+ }
30
+ }
31
+
32
+ .mainContent {
33
+ width: 50%;
34
+ padding-right: 20px;
35
+
36
+ @media (max-width: 1200px) {
37
+ padding-left: 80px;
38
+ padding-right: 40px;
39
+ }
40
+
41
+ @media (max-width: 900px) {
42
+ width: 100%;
43
+ padding-left: 0;
44
+ padding-right: 0;
45
+ order: 2;
46
+ }
47
+
48
+ .title {
49
+ font-size: 48px;
50
+ font-weight: 400;
51
+ line-height: 1;
52
+ letter-spacing: -1.92px;
53
+ margin: 0 0 50px 0;
54
+
55
+ @media (max-width: 900px) {
56
+ font-size: 36px;
57
+ margin: 0 0 40px 0;
58
+ }
59
+
60
+ @media (max-width: 480px) {
61
+ font-size: 28px;
62
+ margin: 0 0 32px 0;
63
+ }
64
+ }
65
+
66
+ .description {
67
+ font-size: 24px;
68
+ line-height: 1.3;
69
+ font-weight: 400;
70
+ letter-spacing: -0.48px;
71
+
72
+ @media (max-width: 900px) {
73
+ font-size: 18px;
74
+ margin-bottom: 48px;
75
+ }
76
+
77
+ @media (max-width: 480px) {
78
+ font-size: 16px;
79
+ margin-bottom: 32px;
80
+ }
81
+ }
82
+
83
+ .sectionTitle {
84
+ font-size: 24px;
85
+ font-weight: 600;
86
+ margin: 60px 0 22px 0;
87
+ letter-spacing: -0.48px;
88
+ line-height: 1.3;
89
+
90
+ @media (max-width: 900px) {
91
+ font-size: 20px;
92
+ margin: 48px 0 24px 0;
93
+ }
94
+
95
+ @media (max-width: 480px) {
96
+ font-size: 18px;
97
+ margin: 32px 0 20px 0;
98
+ }
99
+ }
100
+ }
101
+
102
+ .facilitiesList {
103
+ list-style: none;
104
+ padding: 0;
105
+ margin: 0;
106
+ display: grid;
107
+ grid-template-columns: repeat(2, 2fr);
108
+ gap: 9px;
109
+
110
+ @media (max-width: 600px) {
111
+ grid-template-columns: 1fr;
112
+ gap: 2px;
113
+ }
114
+ }
115
+
116
+ .facilityItem {
117
+ display: flex;
118
+ align-items: center;
119
+ font-size: 18px;
120
+ font-weight: 400;
121
+ line-height: 1.4;
122
+ gap: 12px;
123
+
124
+ @media (max-width: 900px) {
125
+ font-size: 16px;
126
+ }
127
+
128
+ svg {
129
+ height: 32px;
130
+ width: 32px;
131
+ color: var(--color-bg);
132
+ flex-shrink: 0;
133
+
134
+ @media (max-width: 900px) {
135
+ height: 24px;
136
+ width: 24px;
137
+ }
138
+ }
139
+ }
140
+
141
+ .sidebar {
142
+ width: 50%;
143
+ display: flex;
144
+ flex-direction: column;
145
+ gap: 60px;
146
+ padding-left: 64px;
147
+
148
+ @media (max-width: 1200px) {
149
+ padding-left: 40px;
150
+ gap: 48px;
151
+ }
152
+
153
+ @media (max-width: 900px) {
154
+ width: 100%;
155
+ padding-left: 0;
156
+ gap: 40px;
157
+ order: 1;
158
+ }
159
+
160
+ @media (max-width: 480px) {
161
+ gap: 32px;
162
+ }
163
+ }
164
+
165
+ .infoItem {
166
+ display: flex;
167
+ gap: 16px;
168
+ align-items: center;
169
+
170
+ @media (max-width: 900px) {
171
+ gap: 12px;
172
+ }
173
+
174
+ svg {
175
+ color: var(--color-text);
176
+ width: 48px;
177
+ height: 48px;
178
+ flex-shrink: 0;
179
+
180
+ @media (max-width: 900px) {
181
+ width: 40px;
182
+ height: 40px;
183
+ }
184
+
185
+ @media (max-width: 480px) {
186
+ width: 32px;
187
+ height: 32px;
188
+ }
189
+ }
190
+ }
191
+
192
+ .sidebarItems {
193
+ flex: 1;
194
+ }
195
+
196
+ .infoLabel {
197
+ font-size: 24px;
198
+ letter-spacing: -0.48px;
199
+ line-height: 1.3;
200
+ font-weight: 700;
201
+
202
+ @media (max-width: 900px) {
203
+ font-size: 18px;
204
+ }
205
+
206
+ @media (max-width: 480px) {
207
+ font-size: 16px;
208
+ }
209
+ }
210
+
211
+ .infoValue {
212
+ font-size: 24px;
213
+ line-height: 1.3;
214
+ font-weight: 400;
215
+ margin-top: 0;
216
+ letter-spacing: -0.48px;
217
+
218
+ @media (max-width: 900px) {
219
+ font-size: 18px;
220
+ }
221
+
222
+ @media (max-width: 480px) {
223
+ font-size: 16px;
224
+ }
225
+ }
226
+
227
+ .infoValueLink {
228
+ color: var(--color-bg);
229
+ font-size: 24px;
230
+ text-decoration: underline;
231
+ line-height: 1.3;
232
+ letter-spacing: -0.48px;
233
+ font-weight: 400;
234
+ margin-top: 0;
235
+
236
+ @media (max-width: 900px) {
237
+ font-size: 18px;
238
+ }
239
+
240
+ @media (max-width: 480px) {
241
+ font-size: 16px;
242
+ }
243
+ }
244
+
245
+ .button {
246
+ margin-top: 5px;
247
+ max-width: 177px !important;
248
+ }
@@ -0,0 +1,42 @@
1
+ // @ts-ignore
2
+ import React from "react"
3
+ import { Meta, StoryObj } from "@storybook/react-vite";
4
+ import Media from "./Media";
5
+ import ElementHolder from "../../Shared/ElementHolder/ElementHolder";
6
+
7
+ const meta: Meta = {
8
+ title: "Layout / Media",
9
+ component: Media,
10
+ parameters: {
11
+ layout: 'fullscreen',
12
+ },
13
+ tags: ["autodocs"]
14
+ }
15
+
16
+ export default meta;
17
+
18
+ type Story = StoryObj<typeof meta>;
19
+
20
+ const PathwayBlockTemplate: Story = {
21
+ render: () => {
22
+
23
+ const mediaProps = {
24
+ imageSrc: "https://images.unsplash.com/photo-1501594907352-04cda38ebc29?w=1200&h=675&fit=crop",
25
+ videoSrc: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
26
+ };
27
+
28
+ return (
29
+ <>
30
+ <ElementHolder pillar="taste">
31
+ <Media {...mediaProps} />
32
+ </ElementHolder>
33
+ </>
34
+ )
35
+ }
36
+ }
37
+
38
+
39
+ export const PathwayBlockComponent = {
40
+ ...PathwayBlockTemplate
41
+ };
42
+
@@ -0,0 +1,57 @@
1
+ import MediaProps from "./MediaProps.tsx";
2
+ import {useEffect, useRef} from "react";
3
+ import videojs from "video.js";
4
+ import 'video.js/dist/video-js.css';
5
+ import './media.scss'
6
+
7
+ const Media = (props : MediaProps) => {
8
+
9
+ const {imageSrc , videoSrc, thumbnail} = props
10
+
11
+ const videoRef = useRef<HTMLVideoElement>(null);
12
+ const playerRef = useRef<any>(null);
13
+
14
+ useEffect(() => {
15
+ if (!playerRef.current && videoRef.current) {
16
+ const videoElement = videoRef.current;
17
+
18
+ playerRef.current = videojs(videoElement, {
19
+ controls: true,
20
+ responsive: true,
21
+ fluid: true,
22
+ preload: 'metadata',
23
+ playbackRates: [0.5, 1, 1.5, 2],
24
+ poster: thumbnail,
25
+ controlBar: {
26
+ volumePanel: {
27
+ inline: true
28
+ }
29
+ }
30
+ });
31
+ }
32
+
33
+ return () => {
34
+ if (playerRef.current) {
35
+ playerRef.current.dispose();
36
+ playerRef.current = null;
37
+ }
38
+ };
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>
54
+
55
+ }
56
+
57
+ export default Media;
@@ -0,0 +1,7 @@
1
+ interface MediaProps {
2
+ imageSrc?: string
3
+ videoSrc?: string
4
+ thumbnail?:string
5
+ }
6
+
7
+ export default MediaProps
@@ -0,0 +1,14 @@
1
+ .video-container{
2
+ .vjs-big-play-button{
3
+ background: var(--color-block-bg) !important;
4
+ height: 114px;
5
+ width: 114px;
6
+ border-radius: 100%;
7
+ border: none;
8
+ }
9
+
10
+ .vjs_video_4320-dimensions.vjs-fluid:not(.vjs-audio-only-mode) {
11
+ padding-top: 56.25%;
12
+ }
13
+
14
+ }
@@ -26,25 +26,35 @@ const PathwayBlockTemplate: Story = {
26
26
  title="Lorem ipsum"
27
27
  cards={[
28
28
  {
29
- title: "Lorem ipsum",
30
- description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
31
- image: "https://images.pexels.com/photos/1854897/pexels-photo-1854897.jpeg"
29
+ title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
30
+ // description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
31
+ image: "https://images.pexels.com/photos/1854897/pexels-photo-1854897.jpeg",
32
+ link: {
33
+ "title": "Learn More",
34
+ "href": "/",
35
+ "target": ""
36
+ },
32
37
  },
33
38
  {
34
- title: "Lorem ipsum",
35
- description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
36
- image: "https://images.pexels.com/photos/1595655/pexels-photo-1595655.jpeg"
39
+ title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
40
+ // description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
41
+ image: "https://images.pexels.com/photos/1595655/pexels-photo-1595655.jpeg",
42
+ link: {
43
+ "title": "Learn More",
44
+ "href": "/",
45
+ "target": ""
46
+ },
37
47
  },
38
48
  {
39
- title: "Lorem ipsum",
40
- description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
41
- image: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg"
49
+ title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
50
+ // description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
51
+ image: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg",
52
+ link: {
53
+ "title": "Learn More",
54
+ "href": "/",
55
+ "target": ""
56
+ },
42
57
  },
43
- {
44
- title: "Lorem ipsum",
45
- description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
46
- image: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg"
47
- }
48
58
  ]}
49
59
  />
50
60
  </ElementHolder>
@@ -0,0 +1,80 @@
1
+ // @ts-ignore
2
+ import React from "react"
3
+ import { Meta, StoryObj } from "@storybook/react-vite";
4
+ import PathwayBlock from "./PathwayBlock";
5
+ import ElementHolder from "../../Shared/ElementHolder/ElementHolder";
6
+
7
+ const meta: Meta = {
8
+ title: "Layout / PathwayBlock",
9
+ component: PathwayBlock,
10
+ parameters: {
11
+ layout: 'fullscreen',
12
+ },
13
+ tags: ["autodocs"]
14
+ }
15
+
16
+ export default meta;
17
+
18
+ type Story = StoryObj<typeof meta>;
19
+
20
+ const PathwayBlockTemplate: Story = {
21
+ render: () => {
22
+ return (
23
+ <>
24
+ <ElementHolder paddingTop="sm" paddingBottom="sm" pillar="participate" level="light">
25
+ <PathwayBlock
26
+ title="Lorem ipsum"
27
+ cards={[
28
+ {
29
+ title: "Lorem ipsum",
30
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
31
+ image: "https://images.pexels.com/photos/1854897/pexels-photo-1854897.jpeg",
32
+ link: {
33
+ "title": "Learn More",
34
+ "href": "/",
35
+ "target": ""
36
+ },
37
+ },
38
+ {
39
+ title: "Lorem ipsum",
40
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
41
+ image: "https://images.pexels.com/photos/1595655/pexels-photo-1595655.jpeg",
42
+ link: {
43
+ "title": "Learn More",
44
+ "href": "/",
45
+ "target": ""
46
+ },
47
+ },
48
+ {
49
+ title: "Lorem ipsum",
50
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
51
+ image: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg",
52
+ link: {
53
+ "title": "Learn More",
54
+ "href": "/",
55
+ "target": ""
56
+ },
57
+ },
58
+ {
59
+ title: "Lorem ipsum",
60
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
61
+ image: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg",
62
+ link: {
63
+ "title": "Learn More",
64
+ "href": "/",
65
+ "target": ""
66
+ },
67
+ }
68
+ ]}
69
+ />
70
+ </ElementHolder>
71
+ </>
72
+ )
73
+ }
74
+ }
75
+
76
+
77
+ export const PathwayBlockComponent = {
78
+ ...PathwayBlockTemplate
79
+ };
80
+
@@ -1,4 +1,6 @@
1
1
  .pathwayBlock {
2
+
3
+
2
4
  .header {
3
5
  font-size: var(--font-size-h3);
4
6
  font-weight: 700;
@@ -2,6 +2,7 @@
2
2
  background-color: var(--color-block-bg);
3
3
  color: var(--color-block-text);
4
4
  position: relative;
5
+ overflow-x: hidden;
5
6
 
6
7
  &Inner {
7
8
  //position: relative;